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

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.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1282
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

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

Post 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
Image Image
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 »

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

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1282
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

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

Post 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
Image Image
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 »

Updates:
  • only header resize columns
  • scrollbar closes editable cells
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: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

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

Post 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"

;}
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1282
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

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

Post 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?
Image Image
Bitblazer
Enthusiast
Enthusiast
Posts: 761
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

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

Post 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?
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 »

Paul wrote:[14:13:38] [COMPILER] Line 1708: With 'EnableExplicit', variables have to be declared: DSep$.
Bugfixes
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
tatanas
Enthusiast
Enthusiast
Posts: 260
Joined: Wed Nov 06, 2019 10:28 am
Location: France

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

Post 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.
Windows 10 Pro x64
PureBasic 6.20 x64
tatanas
Enthusiast
Enthusiast
Posts: 260
Joined: Wed Nov 06, 2019 10:28 am
Location: France

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

Post 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 ?
Windows 10 Pro x64
PureBasic 6.20 x64
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 »

Bugfixes
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
tatanas
Enthusiast
Enthusiast
Posts: 260
Joined: Wed Nov 06, 2019 10:28 am
Location: France

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

Post 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
Windows 10 Pro x64
PureBasic 6.20 x64
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 »

tatanas wrote:The cursor still flickers (changing from default to left/right) when hovering the column separator.
Try it again! :wink:
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Bitblazer
Enthusiast
Enthusiast
Posts: 761
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

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

Post 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 :)
Post Reply