Page 29 of 32

Re: [Modules] ListEx (all OS / DPI)

Posted: Tue Mar 31, 2020 4:37 pm
by PB_Rainer
Thorsten1867 wrote:I tested it again and uploaded it.
Hi Thorsten,

WELL DONE, thanks a lot.

Rainer

Re: [Modules] ListEx (all OS / DPI)

Posted: Mon Apr 06, 2020 8:42 pm
by davido
@Thorsten1867,

I have found what appears to be a bug in version 20033101.
I have been able to reproduce the bug in the demo code you supply with the ListEx:

If you change the width of the column from 60 to 80 in line 10292 and then 'run' - two problems appear:

As expected a horizontal scroll-bar is drawn.
1. This scroll-bar partially hides row 10
2. Rows 9 and 10 no longer respond to left-clicks to highlight the clicked row or events.

Re: [Modules] ListEx (all OS / DPI)

Posted: Sun Apr 26, 2020 9:20 am
by mrv2k
Hi Thorsten

Thanks for all the updates. The gadget is almost perfect.

Any chance that you can get the gadget to automaticlly scroll if you are using the keyboard and you reach the bottom row of the screen? The standard gadget does this.

Paul

Re: [Modules] ListEx (all OS / DPI)

Posted: Sun Apr 26, 2020 10:04 am
by Thorsten1867
The cursor keys work for me?!?

Re: [Modules] ListEx (all OS / DPI)

Posted: Sun Apr 26, 2020 4:14 pm
by mrv2k
Strange... Must have had an old version. Downloaded again and it works fine.

Thanks for the answer though.

Keep up the good work!

Re: [Modules] ListEx (all OS / DPI)

Posted: Mon Apr 27, 2020 12:19 am
by tester
Hi Thorsten.
Thanks for the powerful gadget.

SetItemColor for the "test" column number 5 does not work, but it does if you select column number 6.

Re: [Modules] ListEx (all OS / DPI)

Posted: Sat May 16, 2020 4:43 pm
by mrv2k
Hi Thorsten

Any chance of adding an minimum size to the scrollbar slider as i gets really small when showing a long list...

https://imgur.com/eXNPIkU

Thanks

Paul

Re: [Modules] ListEx (all OS / DPI)

Posted: Sun May 17, 2020 2:28 pm
by mrv2k
Fixed it!

Changed...

Code: Select all

If ListEx()\ScrollBar\Item()\Thumb\Size < dpiY(6) : ListEx()\ScrollBar\Item()\Thumb\Size = dpiY(6) : EndIf
to

Code: Select all

If ListEx()\ScrollBar\Item()\Thumb\Size < dpiY(20) : ListEx()\ScrollBar\Item()\Thumb\Size = dpiY(20) : EndIf
in the procedure CalcScrollBarThumb_

Regards

Paul

Re: [Modules] ListEx (all OS / DPI)

Posted: Mon May 18, 2020 12:16 pm
by mrv2k
I'm trying to use the ListEx gadget in a splitter gadget. If I run this code, there seems to be a problem with the auto resize. Am I doing something wrong?

Code: Select all

IncludeFile "ListEx\ListExModule.pbi"
IncludeFile "TreeEx\TreeExModule.pbi"

OpenWindow(0,0,0,1280,720,"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(),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::SetColumnAttribute(2,0,ListEx::#ColumnWidth,600)
ListEx::AddColumn(2,1,"Test 2",260)
ListEx::AddColumn(2,2,"Test 3",82)
ListEx::SetHeaderAttribute(2, ListEx::#Align, ListEx::#Center,2)
ListEx::SetColumnAttribute(2, 2, ListEx::#Align, ListEx::#Center)

ListEx::DisableRedraw(2,#True)

For i=1  To 1000
  ListEx::AddItem(2,ListEx::#LastItem,"Column 1" + #LF$ + "Column 2" + #LF$ + "Column 3")
Next

ListEx::DisableRedraw(2,#False)

Repeat
  
  event=WaitWindowEvent()
        
Until event=#PB_Event_CloseWindow
Regards

Paul

Re: [Modules] ListEx (all OS / DPI)

Posted: Tue May 19, 2020 10:41 am
by Thorsten1867
Update:
  • Attribut '#ParentGadget' for resizing (e.g. ContainerGadget)
  • Attribut '#MinimumSize' for minimum size of scrollbar thumb
@mrv2k
Please try!

Re: [Modules] ListEx (all OS / DPI)

Posted: Tue May 19, 2020 10:44 am
by Thorsten1867
Changed

Re: [Modules] ListEx (all OS / DPI)

Posted: Tue May 19, 2020 3:45 pm
by mrv2k
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: Select all

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: Select all

If ListEx()\ParentNum <> #PB_Default
It should be

Code: Select all

If ListEx()\Parent\Num <> #PB_Default

Re: [Modules] ListEx (all OS / DPI)

Posted: Thu May 21, 2020 9:19 am
by Thorsten1867
Bugfixes (DPI)

Re: [Modules] ListEx (all OS / DPI)

Posted: Thu May 21, 2020 5:04 pm
by mrv2k
Thanks Thorsten!

Works absolutely perfectly now!

Only had to comment out a debug.

Great Work!

Regards

Paul

Re: [Modules] ListEx (all OS / DPI)

Posted: Thu May 21, 2020 6:20 pm
by mrv2k
Sorry Me Again!

Looks like something broke on the scroll bars with the new update. The scrollbar button scrolls at a different speed to the mouse. It does it on the example if you add a few more lines. I checked on different DPI's and it's not related.

Regards

Paul