Page 20 of 33

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

Posted: Sun Dec 08, 2019 10:13 am
by Thorsten1867
Paul wrote:Just a note...
when resizing Columns, your Columns don't follow the scrollbar so if you move the scrollbar you can no longer select the column to resize it.
Please test if the problem is solved now.

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

Posted: Sun Dec 08, 2019 4:25 pm
by Paul
Still has problem. :(
When you move the bottom slider the column locations become incorrect.

Maybe this shows problem better...
https://youtu.be/nwBpHijXkwc

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

Posted: Sun Dec 08, 2019 5:24 pm
by Thorsten1867
Try it again

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

Posted: Sun Dec 08, 2019 6:44 pm
by Paul
Seems to be a number of problems related to column resizing.
If I click on a checkbox in the checkbox column (first column), sometimes it toggles the checkbox and other times it goes into column resize mode. Also if I start to edit a column and then go to change column size, the edit box randomly appears when the column is resized off the screen.

Image

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

Posted: Mon Dec 09, 2019 8:58 am
by Thorsten1867
Updates:
  • only header resize columns
  • scrollbar closes editable cells

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

Posted: Wed Dec 11, 2019 6:25 pm
by Thorsten1867
Update:

Code: Select all

;{ ___ Format Content (Mask) ___

; Floats:  "0.00" or "0,000"
; Integer: "." or "," or "1.000" or "1,000"
; Date:    "%dd.%mm.%yyyy"
; Time:    "%hh:%ii:%ss"
; Cash:    "0,00 €" or "$ 0.00"

;}

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

Posted: Mon Dec 16, 2019 9:24 pm
by Paul
Finally had a change to come back to this and give it another try.

First thing I'm greeted with when I run the module is...
[14:13:38] [COMPILER] Line 1708: With 'EnableExplicit', variables have to be declared: DSep$.

Curious how you did not get this error when testing the code?

Anyway, when resizing columns the standard Windows behavior is to not stop resizing until the mouse button is released. Currently if you move the mouse pointer outside the header area the resizing stops even if I'm pressing the button. When I do release the button and then move back to the header area, the column will suddenly grab and start resizing again for no reason... since I'm no longer holding the button.
I can post another screen recording of this behavior if you need to see it?

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

Posted: Tue Dec 17, 2019 2:53 am
by Bitblazer
I keep adding lines with ListEx::#LastItem as position.

If i add 10 lines and have 5 visible, how can i keep the last added line always visible?

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

Posted: Tue Dec 17, 2019 1:05 pm
by Thorsten1867
Paul wrote:[14:13:38] [COMPILER] Line 1708: With 'EnableExplicit', variables have to be declared: DSep$.
Bugfixes

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

Posted: Sun Dec 22, 2019 9:56 am
by tatanas
Hi,

You did a wonderfull module Thorsten1867 !

I found a strange behavior in the example.
I don't know if it's a bug, but when you click in the header then move above the left or right vertical line column limit, the resize column event is triggered.
I suppose it shouldn't.

Found another problem :
When resizing column, the cursor flickers during mouse move above the column separator area (+/- offset) because it's reseting to default cursor.
When resizing column with small helping grip separator area (by example : -2 pixels + 2 pixel from cols()\X), there is 2 possibilities : the zone after the first separator "| <- |" and the zone before the second separator "| -> |". In the first case, the column resized should be the previous one.

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

Posted: Sat Dec 28, 2019 10:59 am
by tatanas
Ok, I made some changes to your code. I hope it's not too messy.

I added a procedure to get current column width : GetColumnWidth_(X.i)
modified _LeftButtonDownHandler() and _MouseMoveHandler() to get ride of the small bugs I mentionned in my previous post.

https://drive.google.com/drive/folders/ ... sp=sharing


EDIT : Do you think you could add a drag & drop inside the listview to reorganize rows ?

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

Posted: Sat Dec 28, 2019 12:09 pm
by Thorsten1867
Bugfixes

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

Posted: Sat Dec 28, 2019 2:52 pm
by tatanas
Thanks for the fixes.

The cursor still flickers (changing from default to left/right) when hovering the column separator. You need some changes at line 4868.
I did that :

Code: Select all

							If ListEx()\CanvasCursor <> #Cursor_Sort
								
								If ListEx()\CanvasCursor = #PB_Cursor_LeftRight ; en cours de redimensionnement
									col_Width = GetColumnWidth_(X)								
					
									If ((X >= ListEx()\Cols()\X - dpiX(2)) And (X <= ListEx()\Cols()\X)) Or
									   ((X >= ListEx()\Cols()\X - col_Width) And (X <= ListEx()\Cols()\X - col_Width + dpiX(2)))
										; No change, we keep left-right arrows
									Else
										ListEx()\CanvasCursor = #Cursor_Sort
										SetGadgetAttribute(GNum, #PB_Canvas_Cursor, ListEx()\CanvasCursor)							
									EndIf
								Else
									ListEx()\CanvasCursor = #Cursor_Sort
									SetGadgetAttribute(GNum, #PB_Canvas_Cursor, ListEx()\CanvasCursor)
								EndIf								

							EndIf
							
						Else
							
							If ListEx()\CanvasCursor <> #Cursor_Default
													
								If ListEx()\CanvasCursor = #PB_Cursor_LeftRight ; en cours de redimensionnement
									col_Width = GetColumnWidth_(X)
									
									If ((X >= ListEx()\Cols()\X - dpiX(2)) And (X <= ListEx()\Cols()\X)) Or
									   ((X >= ListEx()\Cols()\X - col_Width) And (X <= ListEx()\Cols()\X - col_Width + dpiX(2)))
										; No change, we keep left-right arrows
									Else
										ListEx()\CanvasCursor = #Cursor_Default
										SetGadgetAttribute(GNum, #PB_Canvas_Cursor, ListEx()\CanvasCursor)								
									EndIf
								Else
									ListEx()\CanvasCursor = #Cursor_Default
									SetGadgetAttribute(GNum, #PB_Canvas_Cursor, ListEx()\CanvasCursor)
								EndIf

							EndIf

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

Posted: Sat Dec 28, 2019 8:09 pm
by Thorsten1867
tatanas wrote:The cursor still flickers (changing from default to left/right) when hovering the column separator.
Try it again! :wink:

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

Posted: Sun Dec 29, 2019 8:08 am
by Bitblazer
Nice module, but is it possible to create lines with different colors?
I try to achieve something like this
Image

but using ListEx::SetColor changes the color of all previous and future lines.

Thanks in advance :)