[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 »

Update:
  • Added: SetCellFlags() / RemoveCellFlag()
  • Flags: #LockCell / #Strings / #ComboBoxes / #Dates

Code: Select all

ListEx::SetCellFlags(#List, 2, 3, ListEx::#Strings|ListEx::#LockCell)
ListEx::RemoveCellFlag(#List, 2, 3, ListEx::#LockCell)
@kinglestat
=> Q2 / Q3
Last edited by Thorsten1867 on Sun Nov 17, 2019 1:29 pm, edited 1 time in total.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
kinglestat
Enthusiast
Enthusiast
Posts: 746
Joined: Fri Jul 14, 2006 8:53 pm
Location: Malta
Contact:

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

Post by kinglestat »

thank you...that was fast!
I may not help with your coding
Just ask about mental issues!

http://www.lulu.com/spotlight/kingwolf
http://www.sen3.net
kinglestat
Enthusiast
Enthusiast
Posts: 746
Joined: Fri Jul 14, 2006 8:53 pm
Location: Malta
Contact:

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

Post by kinglestat »

Is it possible to change the type for a cell? For example if a cell is already a button can it be made into a string? etc
I may not help with your coding
Just ask about mental issues!

http://www.lulu.com/spotlight/kingwolf
http://www.sen3.net
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 »

When it comes to single cells, you can use RemoveCellFlag() and SetCellFlags().
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
kinglestat
Enthusiast
Enthusiast
Posts: 746
Joined: Fri Jul 14, 2006 8:53 pm
Location: Malta
Contact:

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

Post by kinglestat »

Excuse my ignorance
This is your example edited

Code: Select all

    ListEx::AddItem(#List, ListEx::#LastItem, "Thomas"   + #LF$ + "Roberts"  + #LF$ + #LF$ + #LF$ + "Push")
    ListEx::AddItem(#List, ListEx::#LastItem, "Harriet"  + #LF$ + "Smith"    + #LF$ + #LF$ + #LF$ + "Push")

   ListEx::RemoveCellFlag(#List, 4, 5, ListEx::#Buttons )
   ListEx::SetCellFlags(#List, 4, 5, ListEx::#Strings )

    ListEx::SetItemState(#List, 3, ListEx::#Inbetween)


there is no change. What am I doing wrong?
I may not help with your coding
Just ask about mental issues!

http://www.lulu.com/spotlight/kingwolf
http://www.sen3.net
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 »

Bugfix

@kinglestat
The cell type was changed, but the button was drawn anyway.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
kinglestat
Enthusiast
Enthusiast
Posts: 746
Joined: Fri Jul 14, 2006 8:53 pm
Location: Malta
Contact:

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

Post by kinglestat »

Thank you!
I may not help with your coding
Just ask about mental issues!

http://www.lulu.com/spotlight/kingwolf
http://www.sen3.net
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 »

Update: Change column width with the mouse (#ResizeColumn)
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,
A very nice touch. Thank you. :D
DE AA EB
Cyllceaux
Enthusiast
Enthusiast
Posts: 510
Joined: Mon Jun 23, 2014 1:18 pm

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

Post by Cyllceaux »

Hey there,

Since I use ListEx with Dialogs, I changed the _ResizeHandler a little bit.

Code: Select all

      If ListEx()\ReDraw
        If ListEx()\FitCols : FitColumns_() : EndIf
      	UpdateColumnX_()
      	UpdateRowY_()
      
      	Draw_()
      EndIf
At the moment I habe 13 ListEx in my application and only one is always shown. So it's no need to draw every ListEx, if it's not shown. I disable the drawing, when I hide the ListEx and enable the drawing, when its shown.
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 »

Cyllceaux wrote:Hey there,

Since I use ListEx with Dialogs, I changed the _ResizeHandler a little bit.

Code: Select all

      If ListEx()\ReDraw
        If ListEx()\FitCols : FitColumns_() : EndIf
      	UpdateColumnX_()
      	UpdateRowY_()
      
      	Draw_()
      EndIf
At the moment I habe 13 ListEx in my application and only one is always shown. So it's no need to draw every ListEx, if it's not shown. I disable the drawing, when I hide the ListEx and enable the drawing, when its shown.
Just use ListEx::Hide(). :wink:
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Cyllceaux
Enthusiast
Enthusiast
Posts: 510
Joined: Mon Jun 23, 2014 1:18 pm

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

Post by Cyllceaux »

I didn't know :oops:
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 »

Cyllceaux wrote:I didn't know :oops:
I just added it, too. :lol:
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 »

@Cyllceaux,
I note you use ListEx with Dialogs.
I tried, but failed miserably. :oops:

Would you mind explaining how it works for you?
DE AA EB
Cyllceaux
Enthusiast
Enthusiast
Posts: 510
Joined: Mon Jun 23, 2014 1:18 pm

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

Post by Cyllceaux »

Easy...
This is one of my Examples:

Important:
OpenGadgetList()
and
#UseExistingCanvas
#AutoResize

in the XML

Code: Select all

     <canvas name="lstProjektAufgaben" flags="#PB_Canvas_Container"/> 
in the Code

Code: Select all

Protected lstProjektAufgaben=DialogGadget(dialog,"lstProjektAufgaben")
Protected windowMain=DialogWindow(dialog)
UseModule ListEx
		OpenGadgetList(lstProjektAufgaben)
		Gadget(lstProjektAufgaben,0,0,0,0,"",20,"",#UseExistingCanvas|#GridLines|#AutoResize|#CheckBoxes,windowMain)
		SetAutoResizeFlags(lstProjektAufgaben, #Height)
		AddColumn(lstProjektAufgaben,1,"",20,"",#Image|#FitColumn)
		AddColumn(lstProjektAufgaben,2,"Titel",100)
		AddColumn(lstProjektAufgaben,3,"Status",100,"",#FitColumn)
		AddColumn(lstProjektAufgaben,4,"Prozent",100,"",#FitColumn|#ProgressBar)
		AddColumn(lstProjektAufgaben,5,"Start",100,"",#FitColumn)
		AddColumn(lstProjektAufgaben,6,"Fällig",100,"",#FitColumn)
		AddColumn(lstProjektAufgaben,7,"Projekt",100,"",#FitColumn)
		
		SetAutoResizeColumn(lstProjektAufgaben, 2)
		SetDateMask(lstProjektAufgaben,"%dd.%mm.%yyyy",3)
		SetDateMask(lstProjektAufgaben,"%dd.%mm.%yyyy",4)
		
		SetProgressBarAttribute(lstProjektAufgaben,#Minimum,0)
		SetProgressBarAttribute(lstProjektAufgaben,#Maximum,100)
		SetProgressBarFlags(lstProjektAufgaben, #ShowPercent)
		
		SetHeaderSort(lstProjektAufgaben, 2, #Ascending, #Deutsch)
		SetHeaderSort(lstProjektAufgaben, 3, #Ascending, #Deutsch)
		SetHeaderSort(lstProjektAufgaben, 7, #Ascending, #Deutsch)
		SetHeaderSort(lstProjektAufgaben, 4, #Ascending, #SortNumber|#HeaderSort|#SortArrows|#SwitchDirection)
		SetHeaderSort(lstProjektAufgaben, 5, #Ascending, #SortDate|#HeaderSort|#SortArrows|#SwitchDirection)
		SetHeaderSort(lstProjektAufgaben, 6, #Ascending, #SortDate|#HeaderSort|#SortArrows|#SwitchDirection)
		BindGadgetEvent(lstProjektAufgaben,@evtProjektAufgabenChange(),#EventType_Row)
		BindGadgetEvent(lstProjektAufgaben,@evtProjektAufgabenChangeCheckbox(),#EventType_CheckBox)
	UnuseModule ListEx
evtProjektAufgabenChange() and evtProjektAufgabenChangeCheckbox() are my Method for row-changes and pushing the Checkboxes.


I want to use more controls in Dialogs, but not all have the#UseExistingCanvas Flag.
Post Reply