[Modules] ListEx (all OS / DPI)

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
ruslanx
User
User
Posts: 46
Joined: Mon Jun 06, 2011 8:28 am

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

Post by ruslanx »

Thorsten1867 wrote:Update: Use DateEx, if available.

@ruslanx
Tested it. Scrolling works for me.

hmmm ... downloaded now and now working .. wtf.

https://prnt.sc/r7mf1q


try to move window when combo is opened .. or focusing on others

Thorsten1867, can I somehow change scrollbar color .. or not?
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:
  • Added: Color for ComboBox items with AddComboBoxItem()
  • Bugfix: Move window
@ruslanx
The ScrollbarGadget of PB does not allow changing the color.
But as a consolation you can now change the color of the items of ComboBoxes.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
loulou2522
Enthusiast
Enthusiast
Posts: 501
Joined: Tue Oct 14, 2014 12:09 pm

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

Post by loulou2522 »

loulou2522 wrote:Hi thorsten,
The new version dated from 13;57 works now on PB 5.72


ListEx::SetState(#List, 4, 1)
The focus is not putting on this column
seems not working maybe i don't use it correctly
Thanks for your dsponibility
Can you see THorsten because i don't arrive to make focus
User avatar
PB_Rainer
User
User
Posts: 80
Joined: Fri Jun 07, 2019 1:56 pm

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

Post by PB_Rainer »

Hello Thorsten

using ListEx in a dialog for changing colors in a bitmap. First colum shows the color in real. If I set the cursor to any row, this row will be hightlighted (ok thats normal!) But highlighting the complete row kills the color in the first colum.

Is there any chance to:

disable highlighting the complete row?
disable hightlighting first (any) colum in the row?

Thanks in advance for your help.

Tried to insert a picture, but that does not work??!!


**********************************
Problem solved

I use Images 1*1 point with the color!
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,

Thank you for the latest version of ListEX (#Version = 20022503)

First the good news! -- I notice that the (ListEx) ComboBox now works perfectly in OSX. :D

Second my program crashes when the code below is executed:
ListEx::AddItem(#WML_A_List,-1,"")

With the following error:

[20:12:51] Executable started.
[20:12:58] [ERROR] ListExModule.pbi (Line: 3626)
[20:12:58] [ERROR] DrawImage(): The specified 'ImageID' is null.
[20:13:04] The Program was killed.

I have attempted to make a small snippet of code that gives this error but have not yet succeeded, sorry.
What I can say is that if I use an earlier version of ListEx with my program it works ok.
My program also works if I comment out the following code in (#Version = 20022503):

Code: Select all

 3590             If Flags & #Image
                
                imgFlags = ListEx()\Rows()\Column(Key$)\Image\Flags
                
                If imgFlags & #Center
                  imgX  = (dpiX(ListEx()\Cols()\Width) - dpiX(ListEx()\Rows()\Column(Key$)\Image\Width)) / 2
                ElseIf imgFlags & #Right
                  imgX  = dpiX(ListEx()\Cols()\Width)  - dpiX(ListEx()\Rows()\Column(Key$)\Image\Width) - dpiX(4)
                Else 
                  imgX = dpiX(4)
                EndIf
                
                imgWidth  = dpiX(ListEx()\Rows()\Column(Key$)\Image\Width) ;+ dpiX(4)
                imgHeight = dpiY(ListEx()\Rows()\Column(Key$)\Image\Height)
                imgY      = (dpiY(ListEx()\Rows()\Height) - dpiY(ListEx()\Rows()\Column(Key$)\Image\Height)) / 2 + dpiY(1)
                
                DrawingMode(#PB_2DDrawing_AlphaBlend)
                DrawImage(ListEx()\Rows()\Column(Key$)\Image\ID, colX + imgX, rowY + imgY, imgWidth, imgHeight) 

              ElseIf ListEx()\Cols()\Flags & #Image
                
                imgFlags = ListEx()\Cols()\Image\Flags
                
                If imgFlags & #Center
                  imgX  = (dpiX(ListEx()\Cols()\Width) - dpiX(ListEx()\Cols()\Image\Width)) / 2
                ElseIf imgFlags & #Right
                  imgX  = dpiX(ListEx()\Cols()\Width)  - dpiX(ListEx()\Cols()\Image\Width) - dpiX(4)
                Else 
                  imgX = dpiX(4)
                EndIf
                
                imgWidth  = dpiX(ListEx()\Cols()\Image\Width) ; + dpiX(4)
                imgHeight = dpiY(ListEx()\Cols()\Image\Height)
                imgY      = (dpiY(ListEx()\Rows()\Height) - dpiY(ListEx()\Cols()\Image\Height)) / 2 + dpiY(1)
                
                DrawingMode(#PB_2DDrawing_AlphaBlend)
                DrawImage(ListEx()\Cols()\Image\ID, colX + imgX, rowY + imgY, imgWidth, imgHeight) 

              EndIf
DE AA EB
User avatar
PB_Rainer
User
User
Posts: 80
Joined: Fri Jun 07, 2019 1:56 pm

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

Post by PB_Rainer »

Hi Thorsten,

ListEx is great piece of code! Thanks for that!

What I'm missing is a flag for editable fields = FirstCharacterClear

That would be nice, because when you want to edit a field which already has a value/text, you have to clear it with backspace.

Regards
Rainer
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 »

@davido
I try to intercept the error in the current version.
I suspect that a non-existent image (ImageID = 0!) is passed.
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,
Thank you taking time to check this.

I had assumed that this was not my problem.
This is because the only change made was in the name of the Included ListEx version!

I'll go away and check much more carefully.
If this does turn out to be my problem, please accept my apologies.
DE AA EB
User avatar
PB_Rainer
User
User
Posts: 80
Joined: Fri Jun 07, 2019 1:56 pm

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

Post by PB_Rainer »

PB_Rainer wrote:Hi Thorsten,

ListEx is great piece of code! Thanks for that!

What I'm missing is a flag for editable fields = FirstCharacterClear

That would be nice, because when you want to edit a field which already has a value/text, you have to clear it with backspace.

Regards
Rainer
Hi Thorsten,

@all

I tried the following:

init the column = OK:

Code: Select all

ListEx::AddColumn(Palette_ListEx, 6, "Change to color#", 95, "ChangeToColor", ListEx::#Integer | ListEx::#Editable)
ListEx::SetColumnAttribute(Palette_ListEx, 6, ListEx::#Align, ListEx::#Center)
Getting cell-infos after doubleclick = OK:

Code: Select all

Case #PB_Event_Gadget
	Select EventGadget()
		Case Palette_ListEx
			If EventType() = 2
				Palette_ClearEditCell(ListEx::EventRow(Palette_ListEx), ListEx::EventColumn(Palette_ListEx))

Trial to clear the cell = NOT OK:

Code: Select all

Procedure Palette_ClearEditCell(Row.i, Cell.i)
	Protected.s ColumnLabel, ItemText
	
	ColumnLabel = ListEx::GetColumnLabel(Palette_ListEx, Cell)
	ItemText = ListEx::GetItemText(Palette_ListEx, Row, Cell)
	Debug "Row / Cell / ColumnLabel / ItemText " + Row + " / " + Cell + " / " + ColumnLabel + " / " + ItemText
	ListEx::SetCellState(Palette_ListEx, Row, ColumnLabel, ListEx::#Edit)
	ListEx::SetItemText(Palette_ListEx, Row, "", Cell)
EndProcedure
But this trial does not work, tried a lot setitemstate, celldata and so on.
Nothing clears the cell after doubleclick.

Does anyone knows a solution,
can anyone help?

Thanks to all in advance

regards
Rainer
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: Flag #StartSelected for columns added.

@PB_Rainer
Try: ListEx::#Editable|ListEx::#StartSelected
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
PB_Rainer
User
User
Posts: 80
Joined: Fri Jun 07, 2019 1:56 pm

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

Post by PB_Rainer »

Thorsten1867 wrote:Update: Flag #StartSelected for columns added.

@PB_Rainer
Try: ListEx::#Editable|ListEx::#StartSelected
Hi Thorsten,

thanks a lot.

Perfect add, works as wanted and it's better than a real "FirstCharacreClear". Very good that is only marked, so you can still use it if you want. Great!

regards
Rainer
User avatar
mrv2k
User
User
Posts: 51
Joined: Fri Jan 20, 2012 3:40 pm
Location: SE England
Contact:

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

Post by mrv2k »

Hi Thorsten

Is there a way to find out the number of the number of the first row that is visible and how many rows are visible in the gadget?

Thanks.
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: Attribute #FirstVisibleRow / #VisibleRows
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
mrv2k
User
User
Posts: 51
Joined: Fri Jan 20, 2012 3:40 pm
Location: SE England
Contact:

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

Post by mrv2k »

Thorsten1867 wrote:Update: Attribute #FirstVisibleRow / #VisibleRows
Thanks. This is super useful!

Is there any way to detect events from the scrollbar? I can see that it pings an event when the mouse button is release but how can I capture this?
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 am currently building my own ScrollBar into ListEx, then I could send a corresponding event.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

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