Page 25 of 32

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

Posted: Tue Feb 25, 2020 10:06 pm
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?

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

Posted: Wed Feb 26, 2020 10:48 am
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.

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

Posted: Wed Feb 26, 2020 2:28 pm
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

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

Posted: Wed Feb 26, 2020 5:38 pm
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!

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

Posted: Wed Feb 26, 2020 9:29 pm
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

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

Posted: Fri Feb 28, 2020 6:34 pm
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

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

Posted: Fri Feb 28, 2020 8:34 pm
by Thorsten1867
@davido
I try to intercept the error in the current version.
I suspect that a non-existent image (ImageID = 0!) is passed.

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

Posted: Fri Feb 28, 2020 8:56 pm
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.

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

Posted: Sun Mar 01, 2020 12:48 pm
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

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

Posted: Sun Mar 01, 2020 3:29 pm
by Thorsten1867
Update: Flag #StartSelected for columns added.

@PB_Rainer
Try: ListEx::#Editable|ListEx::#StartSelected

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

Posted: Sun Mar 01, 2020 4:51 pm
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

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

Posted: Sun Mar 01, 2020 6:30 pm
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.

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

Posted: Sun Mar 01, 2020 8:35 pm
by Thorsten1867
Update: Attribute #FirstVisibleRow / #VisibleRows

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

Posted: Wed Mar 04, 2020 12:52 pm
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?

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

Posted: Wed Mar 04, 2020 1:44 pm
by Thorsten1867
I am currently building my own ScrollBar into ListEx, then I could send a corresponding event.