I think its a DPI issue. My display is normally set to 125% scaling. If I turn scaling to 100%, the header and column problems go away.
If I run this code at 100% scaling, the gadgets are perfect.
Code:
IncludeFile "ListEx\ListExModule.pbi"
IncludeFile "TreeEx\TreeExModule.pbi"
OpenWindow(0,0,0,1280,920,"Test",#PB_Window_ScreenCentered!#PB_Window_MaximizeGadget|#PB_Window_MinimizeGadget)
TreeEx::Gadget(1,0,0,0,0,"Tree",TreeEx::#AutoResize, 0)
ListEx::Gadget(2,0,0,0,0,"Test 1",1,"",ListEx::#GridLines|ListEx::#AutoResize, 0)
SplitterGadget(3,0,0,WindowWidth(0),WindowHeight(0)-MenuHeight()-200,1,2,#PB_Splitter_Vertical|#PB_Splitter_Separator)
SetGadgetAttribute(3,#PB_Splitter_FirstMinimumSize,250)
SetGadgetState(3,250)
ListEx::SetAutoResizeFlags(2, ListEx::#Height|ListEx::#Width)
ListEx::SetAttribute(2,ListEx::#ParentGadget, 3)
ListEx::SetAttribute(2,ListEx::#MinimumSize, 20)
ListEx::SetAutoResizeColumn(2,1)
ListEx::SetColumnAttribute(2,0,ListEx::#ColumnWidth,GadgetWidth(3)-257-342) ; 257 =250+7 For Splitter | 342 = 260+82 For Columns
ListEx::AddColumn(2,1,"Test 2",260)
ListEx::AddColumn(2,2,"Test 3",82)
ListEx::Gadget(4,0,WindowHeight(0)-205,WindowWidth(0),180,"Test 1",WindowWidth(0)-342,"",ListEx::#GridLines|ListEx::#AutoResize, 0)
ListEx::SetAutoResizeFlags(4, ListEx::#Height|ListEx::#Width)
ListEx::SetAutoResizeColumn(4,1)
ListEx::SetAttribute(4,ListEx::#MinimumSize, 20)
ListEx::AddColumn(4,1,"Test 2",260)
ListEx::AddColumn(4,2,"Test 3",82)
ListEx::DisableRedraw(2,#True)
ListEx::DisableRedraw(4,#True)
For i=1 To 10000
ListEx::AddItem(2,ListEx::#LastItem,"Column 1" + #LF$ + "Column 2" + #LF$ + "Column 3")
ListEx::AddItem(4,ListEx::#LastItem,"Column 1" + #LF$ + "Column 2" + #LF$ + "Column 3")
Next
ListEx::DisableRedraw(2,#False)
ListEx::DisableRedraw(4,#False)
Repeat
event=WaitWindowEvent()
Until event=#PB_Event_CloseWindow
If I set it to anything over 100%, the header bar becomes extended and the columns sizes break. It also breaks SetAutoResizeColumn.
I can probably get around the splittergadget problem by intercepting the resize event and doing a bit of math to calculate the first column width. The #ParentGadget is great, but splitter gadgets are dynamic and you would need to know the dimensions of which ever side the ListEx is in. This might be possible by getting the ListEx GadgetWidth() after the splitter is drawn as it automatically resizes each gadget.
#MinimumSize - Works Great!
Thanks for all you help!
Paul
P.S. Theres a typo on line 7491. It reads...
Code:
If ListEx()\ParentNum <> #PB_Default
It should be
Code:
If ListEx()\Parent\Num <> #PB_Default