[Modules] ListEx (all OS / DPI)

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

Re: [Modules] Editable and sortable ListGadget (all OS / DPI

Post by Thorsten1867 »

Bug fixed

Please try it again.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
zikitrake
Addict
Addict
Posts: 834
Joined: Thu Mar 25, 2004 2:15 pm
Location: Spain

Re: [Modules] Editable and sortable ListGadget (all OS / DPI

Post by zikitrake »

Thorsten1867 wrote:Bug fixed

Please try it again.
It works fine now! No more rows()\number :lol:

Thank you again.
zikitrake
Addict
Addict
Posts: 834
Joined: Thu Mar 25, 2004 2:15 pm
Location: Spain

Re: [Modules] Editable and sortable ListGadget (all OS / DPI

Post by zikitrake »

:oops: Another request if is possible

In the following example, I activate the 4th row of the list, make a ClearItems() and call GetState(), which follows with the value 4.

Is possible reset Getstate() value to 0 after a call to ClearItems() ?

Code: Select all

   If OpenWindow(0, 0, 0, 500, 200, "Window", #PB_Window_SystemMenu|#PB_Window_ScreenCentered|#PB_Window_SizeGadget)    
    ListEx::Gadget(1, 10, 10, 400, 70, "header1", 125, "", ListEx::#GridLines)    
    For c  = 1 To 10
      ListEx::AddItem(1, ListEx::#LastItem, "Randy Rhoads")
    Next
    
    ListEx::SetState(1, 4)
    ListEx::ClearItems(1)
    Debug ListEx::getState(1)
    
    Repeat: Until WaitWindowEvent()  = #PB_Event_CloseWindow     
  EndIf  
CompilerEndIf
For now I added ListEx()\Row\Focus = -1 in Procedure ClearItems(gNum.i) and it seem works fine

PS: I owe you a dozen beers!
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Modules] Editable and sortable ListGadget (all OS / DPI

Post by Thorsten1867 »

Bug fixed
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
RobertRioja
User
User
Posts: 71
Joined: Thu May 02, 2019 3:57 am
Location: USA
Contact:

Re: [Modules] Editable and sortable ListGadget (all OS / DPI

Post by RobertRioja »

Thank you for ListEx.

Is it possible to resize a column based on the content's width? If so, can you offer sample code?

Thank you,
Robert
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Modules] Editable and sortable ListGadget (all OS / DPI

Post by Thorsten1867 »

Update:
  • Align & font for individual columns of header row
  • SetHeaderHeight() added
  • SetFont() & SetColor() for individual columns
  • SetFont() extended by type parameters (#HeaderFont/#StringFont/#GadgetFont)
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: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Modules] Editable and sortable ListGadget (all OS / DPI

Post by Thorsten1867 »

RobertRioja wrote:Is it possible to resize a column based on the content's width? If so, can you offer sample code?
Update: Added: new flag #FitColumn for AddColumn()
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: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Modules] Editable and sortable ListGadget (all OS / DPI

Post by Thorsten1867 »

Update: CloseEdit() - closes all cells that are open for editing (StringGadget / ComboBox / DateGadget) and saves the changes.
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: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

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

Post by Thorsten1867 »

Update: individual colors for the columns of the header line
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: 856
Joined: Fri Mar 27, 2009 9:41 am
Location: Athens, Greece

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

Post by doctorized »

Your code is a hell of a job! Congratulations!
I would like one thing, if it can be done. Is there a way to add a shortcut for keyboard Enter key and when the user double clicks an editable cell, enters a value and presses Enter key, to be able to go to the next cell in the column without having double clicking that cell?
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

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

Post by Thorsten1867 »

doctorized wrote: .... when the user double clicks an editable cell, enters a value and presses Enter key, to be able to go to the next cell in the column without having double clicking that cell?
Have you ever tried the tab key? :wink:
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: 856
Joined: Fri Mar 27, 2009 9:41 am
Location: Athens, Greece

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

Post by doctorized »

Thorsten1867 wrote:Have you ever tried the tab key? :wink:
I tried it now and the cell just lost editing focus. Nothing more.
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

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

Post by Thorsten1867 »

I just re-tested it.
I double click in the column "Edit", change the name and press the tab key.
Then the ComboBox will be opened automatically for editing.
(Windows 10 / PB 5.71)
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: 856
Joined: Fri Mar 27, 2009 9:41 am
Location: Athens, Greece

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

Post by doctorized »

Thorsten1867 wrote:I just re-tested it.
I double click in the column "Edit", change the name and press the tab key.
Then the ComboBox will be opened automatically for editing.
(Windows 10 / PB 5.71)
Oh, now I see. If you have two or more editable columns, with Tab key you go through them horizontally. In my case, only one editable column exists and I want to move vertically.

Also, a small addition useful to me:

Code: Select all

Declare.i CountColumns(GNum.i)

   Procedure.i CountColumns(GNum.i)
    
    If FindMapElement(ListEx(), Str(GNum))
      
      ProcedureReturn ListEx()\Col\Number
      
    EndIf  
 
 EndProcedure
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

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

Post by Thorsten1867 »

Try:

Code: Select all

ListEx::GetAttribute(#List, ListEx::#ColumnCount)
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

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