[Modules] ListEx (all OS / DPI)

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

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

Post by Thorsten1867 »

doctorized wrote:
Thorsten1867 wrote:
doctorized wrote: ...but auto resizing columns' width is not working.
Try version from 10.11.2019.
Tried your last version from today but nothing changed. What exact command should I use?
Can't detect a problem with the latest version. Do you have a demo code?
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

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

Post by davido »

@Thorsten1867,
I have checked out your latest update and as expected it cures the problem. :D
Thank you.

However, I feel I must apologise for not having taken the time to create the demo 'ere posting the first bug report.
You are doing all the hard work here and my demo would have saved you some time. :oops:
DE AA EB
User avatar
doctorized
Addict
Addict
Posts: 882
Joined: Fri Mar 27, 2009 9:41 am
Location: Athens, Greece

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

Post by doctorized »

Thorsten1867 wrote:
doctorized wrote:
Thorsten1867 wrote:
doctorized wrote: ...but auto resizing columns' width is not working.
Try version from 10.11.2019.
Tried your last version from today but nothing changed. What exact command should I use?
Can't detect a problem with the latest version. Do you have a demo code?

Code: Select all

PurifierGranularity(1,1,1,1)
XIncludeFile "ListExModule.pbi"
Global FontName.s = "Arial"
Global FontSize.a = 11

Enumeration
	#Font_Custom
	#Font_Custom_B
	#MainWindow

EndEnumeration

LoadFont(#Font_Custom,  FontName, FontSize)
LoadFont(#Font_Custom_B, FontName, FontSize, #PB_Font_Bold)	

If OpenWindow(#MainWindow, 0, 0, 800, 800, "test", #PB_Window_ScreenCentered|#PB_Window_MinimizeGadget)
	ListEx::Gadget(123,10,40,WindowWidth(#MainWindow)-20,WindowHeight(#MainWindow)-170, "col 1", 30, "", ListEx::#GridLines|ListEx::#AutoResize)
	ListEx::AddColumn(123,1,"col 2",200)
	ListEx::AddColumn(123,2,"col 3",200)
	ListEx::DisableReDraw(123, #True) 
	ListEx::SetHeaderAttribute(123, ListEx::#Align, ListEx::#Center)
	ListEx::SetFont(123, FontID(#Font_Custom))
	ListEx::SetFont(123, FontID(#Font_Custom_B), ListEx::#HeaderFont)
	ListEx::SetRowsHeight(123, 22)
	ListEx::SetAutoResizeFlags(123, ListEx::#Height)
	ListEx::SetAutoResizeFlags(123, ListEx::#Width)
	ListEx::SetColorTheme(123, ListColorTheme)
	;ListEx::SetColor(123, ListEx::#AlternateRowColor, $FBF7F5)
	ListEx::DisableReDraw(123, #False) 
	
	For i=1 To 10
		ListEx::AddItem(123, -1, "a" + Str(i) + #LF$ + "b" + Str(i) + #LF$ + "c" + Str(i))
	Next
	
	Repeat
		Select WaitWindowEvent()
			Case #PB_Event_CloseWindow
				Done = #True
		EndSelect
	Until Done
EndIf
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

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

Post by Thorsten1867 »

Code: Select all

XIncludeFile "ListExModule.pbi"

Enumeration
  #Font_Custom
  #Font_Custom_B
  #MainWindow
  #List
EndEnumeration

LoadFont(#Font_Custom,  "Arial", 11)
LoadFont(#Font_Custom_B, "Arial", 11, #PB_Font_Bold)   

If OpenWindow(#MainWindow, 0, 0, 460, 400, "test", #PB_Window_ScreenCentered|#PB_Window_MinimizeGadget|#PB_Window_SizeGadget) ; #PB_Window_SizeGadget must be used to change the window size. 
   ListEx::Gadget(#List, 10, 40, 440, 350, "col 1", 40, "", ListEx::#GridLines|ListEx::#AutoResize)
   ListEx::AddColumn(#List,1,"col 2",200) ; Columns must be adapted to the list width.
   ListEx::AddColumn(#List,2,"col 3",200) ; Columns must be adapted to the list width.

   ListEx::SetHeaderAttribute(#List, ListEx::#Align, ListEx::#Center)
   ListEx::SetFont(#List, FontID(#Font_Custom))
   ListEx::SetFont(#List, FontID(#Font_Custom_B), ListEx::#HeaderFont)
   
   ListEx::SetRowsHeight(#List, 22)
   ; --- AutoResize ListEx-Gadget ---
   ListEx::SetAutoResizeColumn(#List, 1) ; A column must be defined that is to be adapted.
   ListEx::SetAutoResizeFlags(#List, ListEx::#Height|ListEx::#Width) ; Flags must be linked
   ; --------------------------------
   ListEx::SetColorTheme(#List, ListColorTheme)
   
   For i=1 To 10
      ListEx::AddItem(#List, -1, "a" + Str(i) + #LF$ + "b" + Str(i) + #LF$ + "c" + Str(i))
   Next
   
   Repeat
      Select WaitWindowEvent()
         Case #PB_Event_CloseWindow
            Done = #True
      EndSelect
   Until Done
EndIf
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
camille
User
User
Posts: 71
Joined: Tue Nov 19, 2019 12:52 pm

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

Post by camille »

Three bugs when using the demo code

01. After starting the demo code, right click anywhere in the list view to get the context menu
Choose: Theme '<xxx>' (it doesn't matter which one)
-> All buttons in the right column turn black (their background color)

02. After starting the demo code, none of the three theme buttons on the right do anything when clicked (the column header of the list view doesn't change its color like when you use the context menu)

03. After starting the demo code, click on the "Resize" button. The code will stop on line 7442: The specified #Gadget is not initialised

ListEx is up to date
PureBasic 5.71 LTS x64
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

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

Post by Thorsten1867 »

Demo code fixed
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
doctorized
Addict
Addict
Posts: 882
Joined: Fri Mar 27, 2009 9:41 am
Location: Athens, Greece

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

Post by doctorized »

I want all columns to resize, not just one.
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

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

Post by skywalk »

Hey WOW, this module has become amazing 8)
Prolific amount of work.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

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

Post by Thorsten1867 »

doctorized wrote:I want all columns to resize, not just one.
That's not possible.

Gesendet von meinem Aquaris X2 mit Tapatalk
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

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

Post by davido »

@Thorsten1867,

Would it be possible for me to display a rectangle of thumbnails with ListEx, or have you designed this facility for small symbols only?
DE AA EB
User avatar
doctorized
Addict
Addict
Posts: 882
Joined: Fri Mar 27, 2009 9:41 am
Location: Athens, Greece

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

Post by doctorized »

Thorsten1867 wrote:
doctorized wrote:I want all columns to resize, not just one.
That's not possible.

Gesendet von meinem Aquaris X2 mit Tapatalk
But your version from 4.08.2019 that I used previously could resize all columns including the headers. What happened and lost this option?
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

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

Post by Thorsten1867 »

doctorized wrote:
Thorsten1867 wrote:But your version from 4.08.2019 that I used previously could resize all columns including the headers. What happened and lost this option?
Up to now only one column could be adjusted.
If all columns were adjusted, they would all have to be the same size, otherwise negative column widths could occur.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

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

Post by Thorsten1867 »

davido wrote:Would it be possible for me to display a rectangle of thumbnails with ListEx, or have you designed this facility for small symbols only?
This should only depend on the row height.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
doctorized
Addict
Addict
Posts: 882
Joined: Fri Mar 27, 2009 9:41 am
Location: Athens, Greece

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

Post by doctorized »

Thorsten1867 wrote:
doctorized wrote:
Thorsten1867 wrote:But your version from 4.08.2019 that I used previously could resize all columns including the headers. What happened and lost this option?
Up to now only one column could be adjusted.
If all columns were adjusted, they would all have to be the same size, otherwise negative column widths could occur.
You are wrong, it is accomplished with ListEx::#FitColumn. I had forgotten this option. My bad.
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

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

Post by Thorsten1867 »

#FitColumn adjusts the column width to the maximum text width.

Gesendet von meinem BAH2-W19 mit Tapatalk
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Post Reply