[Modules] ListEx (all OS / DPI)
-
- Enthusiast
- Posts: 542
- Joined: Tue Oct 14, 2014 12:09 pm
Re: [Modules] ListEx (all OS / DPI)
Thank for this addition
It will be good if we can define each lenght for each string zone and if we can have for number or integer the ability to give a range ex 1 to 10 or validate onloy a number < to some value
Have a good day
It will be good if we can define each lenght for each string zone and if we can have for number or integer the ability to give a range ex 1 to 10 or validate onloy a number < to some value
Have a good day
- Thorsten1867
- Addict
- Posts: 1372
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Re: [Modules] ListEx (all OS / DPI)
Update:
- SetCondition() for editable cells
- #MaxChar for SetAttribute() and SetColumnAttribute()
Code: Select all
ListEx::SetCondition(#List, 2, "BETWEEN{0|11}")
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
-
- Enthusiast
- Posts: 542
- Joined: Tue Oct 14, 2014 12:09 pm
Re: [Modules] ListEx (all OS / DPI)
ListEx::SetColumnAttribute(#list,4,ListEx::#MaxChars,14)
The fucntion blocked input only for 13 characters , i wonder fourteen characters Can you see Please ?
The fucntion blocked input only for 13 characters , i wonder fourteen characters Can you see Please ?
- Thorsten1867
- Addict
- Posts: 1372
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Re: [Modules] ListEx (all OS / DPI)
I can't find a problem.loulou2522 wrote:ListEx::SetColumnAttribute(#list,4,ListEx::#MaxChars,14)
The fucntion blocked input only for 13 characters , i wonder fourteen characters Can you see Please ?
Code: Select all
ListEx::SetColumnAttribute(#List, 2, ListEx::#MaxChars, 14)
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Re: [Modules] ListEx (all OS / DPI)
@Thorsten1867,
I've just checked out your latest update of ListEx which, unfortunately, crashes with the error:
1815 ListEx()\Color\Back = BlendColor_(OSX_NSColorToRGB(CocoaMessage(0, 0, "NSColor textBackgroundColor")), $FFFFFF, 80)
[20:43:23] [COMPILER] Line 1815: BlendColor_() is not a function, array, list, map or macro.
I've just checked out your latest update of ListEx which, unfortunately, crashes with the error:
1815 ListEx()\Color\Back = BlendColor_(OSX_NSColorToRGB(CocoaMessage(0, 0, "NSColor textBackgroundColor")), $FFFFFF, 80)
[20:43:23] [COMPILER] Line 1815: BlendColor_() is not a function, array, list, map or macro.
DE AA EB
- Thorsten1867
- Addict
- Posts: 1372
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Re: [Modules] ListEx (all OS / DPI)
Try it again. I hope the problem is solved now.davido wrote:@Thorsten1867,
I've just checked out your latest update of ListEx which, unfortunately, crashes with the error:
1815 ListEx()\Color\Back = BlendColor_(OSX_NSColorToRGB(CocoaMessage(0, 0, "NSColor textBackgroundColor")), $FFFFFF, 80)
[20:43:23] [COMPILER] Line 1815: BlendColor_() is not a function, array, list, map or macro.
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Re: [Modules] ListEx (all OS / DPI)
@Thorsten1867,
As I expected, it works fine now.
Thank you.
As I expected, it works fine now.

Thank you.
DE AA EB
Re: [Modules] ListEx (all OS / DPI)
@Thorsten1867,
I've recently noticed that some of my programs using ListEx hide some of the bottom few rows from view.
Clicking on such a hidden row temporarily reveals it.
I assumed that I was doing something wrong, this usually is the case.
Being unable to solve the problem, I decided to try to amend your demo code to see if I could reproduce the effect.
If you add the following code after your last 'AddItem() ...
... and then extend the depth of the window you should eventually notice the effect to which I referred to above.
I noticed this on my Mac, initially.
However, I use the code mainly on PCs.
All show exactly the same problem.
I've recently noticed that some of my programs using ListEx hide some of the bottom few rows from view.
Clicking on such a hidden row temporarily reveals it.
I assumed that I was doing something wrong, this usually is the case.

Being unable to solve the problem, I decided to try to amend your demo code to see if I could reproduce the effect.
If you add the following code after your last 'AddItem() ...
Code: Select all
For m = 1 To 100
ListEx::AddItem(#List, ListEx::#LastItem, RSet(Str(m),3,"0") + " Harriet" + #LF$ + "Smith" + #LF$ + #LF$ + #LF$ + "Push")
Next
I noticed this on my Mac, initially.
However, I use the code mainly on PCs.
All show exactly the same problem.
DE AA EB
- Thorsten1867
- Addict
- Posts: 1372
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Re: [Modules] ListEx (all OS / DPI)
Quick guide for terms:
Code: Select all
MarkContent()
SetCondition()
Code: Select all
"POSITIVE" => [?] = positive number
"NEGATIVE" => [?] = negative number
"EQUAL{3.95}" or "EQUAL{String}" => [?] = 3.95 or [?] = "String"
"LIKE{*end}" or "LIKE{start*}" or "LIKE{*part*}" => "...end" or "start..." or "...part..."
"COMPARE{<|12}" => [?] < 12
"BETWEEN{10|20}" => 10 < [?] < 20
"BEYOND{3|4}" => 3 > [?] OR [?] > 4
"CHOICE{m|f}[C4]" => if column 4 = "m" -> color 1 / if column 4 = "f" -> color 2
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Re: [Modules] ListEx (all OS / DPI)
Cool
Next thing... After unhide, the ListEx should be drawn. (like ContainerEx).
Line 6149 - 6154

Next thing... After unhide, the ListEx should be drawn. (like ContainerEx).
Line 6149 - 6154
- Thorsten1867
- Addict
- Posts: 1372
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Re: [Modules] ListEx (all OS / DPI)
Fixed
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Re: [Modules] ListEx (all OS / DPI)
@Thorsten1867,
I've created a demo code of the problem I mentioned yesterday regarding the missing rows in ListEx gadgets:
I've created a demo code of the problem I mentioned yesterday regarding the missing rows in ListEx gadgets:
Code: Select all
EnableExplicit
XIncludeFile "ListExModule.pbi"
#Window = 0
Enumeration 1
#List_A
#List_B
#List_C
EndEnumeration
#Image = 0
#Font_Arial9 = 1
#Font_Arial9B = 2
#Font_Arial9U = 3
LoadFont(#Font_Arial9, "Arial", 9)
LoadFont(#Font_Arial9B, "Arial", 9, #PB_Font_Bold)
LoadFont(#Font_Arial9U, "Arial", 9, #PB_Font_Underline)
Global Event.i, i.i
If OpenWindow(#Window, 0, 0, 800, 550, "Window", #PB_Window_SystemMenu|#PB_Window_ScreenCentered|#PB_Window_SizeGadget)
If ListEx::Gadget(#List_A, 5, 5, 260, 450, "", 25, "", ListEx::#GridLines|ListEx::#CheckBoxes|ListEx::#AutoResize|ListEx::#MultiSelect|ListEx::#ResizeColumn, #Window) ; ListEx::#NoRowHeader|ListEx::#ThreeState|ListEx::#NumberedColumn|ListEx::#SingleClickEdit
; --- Add different types of columns ---
ListEx::AddColumn(#List_A, 1, "Edit", 185, "edit", ListEx::#Editable) ; |ListEx::#FitColumn
; --- Add content ---
For i = 0 To 80
ListEx::AddItem(#List_A,ListEx::#LastItem,"List A: " + Str(i))
Next i
EndIf
If ListEx::Gadget(#List_B, 270, 5, 260, 450, "", 25, "", ListEx::#GridLines|ListEx::#CheckBoxes|ListEx::#AutoResize|ListEx::#MultiSelect|ListEx::#ResizeColumn, #Window) ; ListEx::#NoRowHeader|ListEx::#ThreeState|ListEx::#NumberedColumn|ListEx::#SingleClickEdit
; --- Add different types of columns ---
ListEx::AddColumn(#List_B, 1, "Edit", 185, "edit", ListEx::#Editable) ; |ListEx::#FitColumn
; --- Add content ---
For i = 0 To 80
ListEx::AddItem(#List_B,ListEx::#LastItem,"List B: " + Str(i))
Next i
EndIf
If ListEx::Gadget(#List_C, 545, 5, 260, 450, "", 25, "", ListEx::#GridLines|ListEx::#CheckBoxes|ListEx::#AutoResize|ListEx::#MultiSelect|ListEx::#ResizeColumn, #Window) ; ListEx::#NoRowHeader|ListEx::#ThreeState|ListEx::#NumberedColumn|ListEx::#SingleClickEdit
; --- Add different types of columns ---
ListEx::AddColumn(#List_C, 1, "Edit", 185, "edit", ListEx::#Editable) ; |ListEx::#FitColumn
; --- Add content ---
For i = 0 To 80
ListEx::AddItem(#List_C,ListEx::#LastItem,"List C: " + Str(i))
Next i
EndIf
EndIf
Repeat
Event = WaitWindowEvent()
Select Event
Case ListEx::#Event_Gadget ; works with or without EventType()
Select EventType()
Case #PB_EventType_RightClick
Debug "RightClick: " + Str(EventData())
Case ListEx::#EventType_Row
Debug ">>> Row: " + Str(EventData())
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
Case #List_A ;{ only in use with EventType()
Select EventType()
Case ListEx::#EventType_Header
Debug ">>> Header Click: " + Str(EventData()) ; Str(ListEx::EventColumn(#List_A))
Case ListEx::#EventType_Button
Debug ">>> Button pressed (" + Str(ListEx::EventRow(#List_A))+"/"+Str(ListEx::EventColumn(#List_A)) + ")"
Case ListEx::#EventType_Link
Debug ">>> Link pressed (" + Str(ListEx::EventRow(#List_A))+"/"+Str(ListEx::EventColumn(#List_A)) + "): " + ListEx::EventValue(#List_A)
If ListEx::EventID(#List_A) = "PureBasic" : RunProgram("http://www.purebasic.com") : EndIf
Case ListEx::#EventType_String
Debug ">>> Cell edited (" + Str(ListEx::EventRow(#List_A))+"/"+Str(ListEx::EventColumn(#List_A)) + "): " + ListEx::EventValue(#List_A)
Case ListEx::#EventType_Date
Debug ">>> Date changed (" + Str(ListEx::EventRow(#List_A))+"/"+Str(ListEx::EventColumn(#List_A)) + "): " + ListEx::EventValue(#List_A)
Case ListEx::#EventType_CheckBox
Debug ">>> CheckBox state changed (" + Str(ListEx::EventRow(#List_A))+"/"+Str(ListEx::EventColumn(#List_A)) + "):" + Str(ListEx::EventState(#List_A))
Case ListEx::#EventType_ComboBox
Debug ">>> ComboBox state changed (" + Str(ListEx::EventRow(#List_A))+"/"+Str(ListEx::EventColumn(#List_A)) + "): " + ListEx::EventValue(#List_A)
EndSelect ;}
Case #List_B ;{ only in use with EventType()
Select EventType()
Case ListEx::#EventType_Header
Debug ">>> Header Click: " + Str(EventData()) ; Str(ListEx::EventColumn(#List_B))
Case ListEx::#EventType_Button
Debug ">>> Button pressed (" + Str(ListEx::EventRow(#List_B))+"/"+Str(ListEx::EventColumn(#List_B)) + ")"
Case ListEx::#EventType_Link
Debug ">>> Link pressed (" + Str(ListEx::EventRow(#List_B))+"/"+Str(ListEx::EventColumn(#List_B)) + "): " + ListEx::EventValue(#List_B)
If ListEx::EventID(#List_B) = "PureBasic" : RunProgram("http://www.purebasic.com") : EndIf
Case ListEx::#EventType_String
Debug ">>> Cell edited (" + Str(ListEx::EventRow(#List_B))+"/"+Str(ListEx::EventColumn(#List_B)) + "): " + ListEx::EventValue(#List_B)
Case ListEx::#EventType_Date
Debug ">>> Date changed (" + Str(ListEx::EventRow(#List_B))+"/"+Str(ListEx::EventColumn(#List_B)) + "): " + ListEx::EventValue(#List_B)
Case ListEx::#EventType_CheckBox
Debug ">>> CheckBox state changed (" + Str(ListEx::EventRow(#List_B))+"/"+Str(ListEx::EventColumn(#List_B)) + "):" + Str(ListEx::EventState(#List_B))
Case ListEx::#EventType_ComboBox
Debug ">>> ComboBox state changed (" + Str(ListEx::EventRow(#List_B))+"/"+Str(ListEx::EventColumn(#List_B)) + "): " + ListEx::EventValue(#List_B)
EndSelect ;}
Case #List_C ;{ only in use with EventType()
Select EventType()
Case ListEx::#EventType_Header
Debug ">>> Header Click: " + Str(EventData()) ; Str(ListEx::EventColumn(#List_C))
Case ListEx::#EventType_Button
Debug ">>> Button pressed (" + Str(ListEx::EventRow(#List_C))+"/"+Str(ListEx::EventColumn(#List_C)) + ")"
Case ListEx::#EventType_Link
Debug ">>> Link pressed (" + Str(ListEx::EventRow(#List_C))+"/"+Str(ListEx::EventColumn(#List_C)) + "): " + ListEx::EventValue(#List_C)
If ListEx::EventID(#List_C) = "PureBasic" : RunProgram("http://www.purebasic.com") : EndIf
Case ListEx::#EventType_String
Debug ">>> Cell edited (" + Str(ListEx::EventRow(#List_C))+"/"+Str(ListEx::EventColumn(#List_C)) + "): " + ListEx::EventValue(#List_C)
Case ListEx::#EventType_Date
Debug ">>> Date changed (" + Str(ListEx::EventRow(#List_C))+"/"+Str(ListEx::EventColumn(#List_C)) + "): " + ListEx::EventValue(#List_C)
Case ListEx::#EventType_CheckBox
Debug ">>> CheckBox state changed (" + Str(ListEx::EventRow(#List_C))+"/"+Str(ListEx::EventColumn(#List_C)) + "):" + Str(ListEx::EventState(#List_C))
Case ListEx::#EventType_ComboBox
Debug ">>> ComboBox state changed (" + Str(ListEx::EventRow(#List_C))+"/"+Str(ListEx::EventColumn(#List_C)) + "): " + ListEx::EventValue(#List_C)
EndSelect ;}
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow
DE AA EB
- doctorized
- Addict
- Posts: 882
- Joined: Fri Mar 27, 2009 9:41 am
- Location: Athens, Greece
Re: [Modules] ListEx (all OS / DPI)
Tried your last version from today but nothing changed. What exact command should I use?Thorsten1867 wrote:Try version from 10.11.2019.doctorized wrote: ...but auto resizing columns' width is not working.
- Thorsten1867
- Addict
- Posts: 1372
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Re: [Modules] ListEx (all OS / DPI)
Bug fixed
The demo code was very helpful.
The demo code was very helpful.

Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]