LIGEnhancements - ListIconGadget with Grouping and TileView

Share your advanced PureBasic knowledge/code with the community.
User avatar
Mindphazer
Enthusiast
Enthusiast
Posts: 460
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Post by Mindphazer »

Hi Denis, Jac
I'm facing the same error (PB 6.03 x64, C or ASM backend)
MacBook Pro 16" M4 Pro - 24 Gb - MacOS 15.4.1 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
User avatar
jacdelad
Addict
Addict
Posts: 2010
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Post by jacdelad »

Hi Denis and Mindphazer,
yeah, I just found out, that I already applied the fix provided by Axolotl some time ago, but didn't upload it. Code in first post is corrected now, thanks for reporting and special thanks to Axolotl who was the first one to find the bug!
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Axolotl
Addict
Addict
Posts: 837
Joined: Wed Dec 31, 2008 3:36 pm

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Post by Axolotl »

Hi jacdelad,
you are very welcome. :D

Not a big thing I would like to suggest is to use english names (even as parameters).
The german names are not a thing for me, but maybe a little tricky for others (?)
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
User avatar
jacdelad
Addict
Addict
Posts: 2010
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Post by jacdelad »

I can do that, but then all the magic is gone. :mrgreen:
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Post by boddhi »

Hello,

Nice function :wink:

However, when I click on the first group's arrow, the execution freeze. No debug message, no error reported.
No issue with others arrows.

Win 10 x64 / PB 6.10b6 x64
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
User avatar
jacdelad
Addict
Addict
Posts: 2010
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Post by jacdelad »

That is strange. I never experienced nor doew my code handle clocking the arrows of groups in any way, this is done by Windows itself.
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
User avatar
Caronte3D
Addict
Addict
Posts: 1361
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Post by Caronte3D »

boddhi wrote: Mon Feb 19, 2024 3:47 am However, when I click on the first group's arrow, the execution freeze. No debug message, no error reported.
No issue with others arrows.
Same here.
Also, some text gets glitches (line over):
https://prnt.sc/MG-fhg0tisuB
User avatar
jacdelad
Addict
Addict
Posts: 2010
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Post by jacdelad »

What happens if you comment out the macro?
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Denis
Enthusiast
Enthusiast
Posts: 778
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Post by Denis »

Same here as boddhi and Caronte3D
A+
Denis
User avatar
Caronte3D
Addict
Addict
Posts: 1361
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Post by Caronte3D »

jacdelad wrote: Mon Feb 19, 2024 3:14 pm What happens if you comment out the macro?
The same behavior
User avatar
jacdelad
Addict
Addict
Posts: 2010
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Post by jacdelad »

I suddenly have the same problems...maybe a Windows update or something with the new PureBasic Beta? I never experienced that before.
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Denis
Enthusiast
Enthusiast
Posts: 778
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Post by Denis »

To avoid crash when clicking on the first group's arrow, the ListIcon option "#PB_ListIcon_GridLines" must be removed.
Then all is oK.

Pb manages Gridlines internally (non-standard Gridline), this must be the reason for the crash and poor display of lines.
A+
Denis
User avatar
Caronte3D
Addict
Addict
Posts: 1361
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Post by Caronte3D »

Yes, this way everything works (without grid lines).
User avatar
jacdelad
Addict
Addict
Posts: 2010
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Post by jacdelad »

Yeah, after investigating a bit more: Don't use GridLines with Grouping. Microsoft doesn't want that.
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Denis
Enthusiast
Enthusiast
Posts: 778
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Post by Denis »

The code must be corrected :

Some structures have to be corrected

structure LVITEM corrected x86/64 is here:
https://www.purebasic.fr/english/viewto ... re#p560935

The structure LVCOLUMN supersedes the LV_COLUMN structure (microsoft).

LVCOLUMN is Ok on x86

With the PB structure x64, PB give this
SizeOf(LV_COLUMN) = 52

------- OffsetOf() values -------
OffsetOf(LV_COLUMN\mask) = 0
OffsetOf(LV_COLUMN\fmt) = 4
OffsetOf(LV_COLUMN\cx) = 8
OffsetOf(LV_COLUMN\*pszText) = 16
OffsetOf(LV_COLUMN\cchTextMax) = 24
OffsetOf(LV_COLUMN\iSubItem) = 28
OffsetOf(LV_COLUMN\iImage) = 32
OffsetOf(LV_COLUMN\iOrder) = 36
OffsetOf(LV_COLUMN\cxMin) = 40
OffsetOf(LV_COLUMN\cxDefault) = 44
OffsetOf(LV_COLUMN\cxIdeal) = 48
SizeOf() is not Ok
A padding of 4 bytes have to be added at the very end of structure



C/C++ code using Microsoft Visual Studio Community 2022 (64 bits) - Current Version 17.9.0

Code: Select all


#include <iostream>
#include <windows.h>
#include <commctrl.h>


#define PRINTF_SIZEOF(type) printf("  SizeOf( "  #type  " ) = %zu\n", sizeof(type))
// #define PRINTF_OffsetOf(type,member) printf("  OffsetOf(" #type", "#member ") = %zu\n", offsetof(type,member))
#define PRINTF_OffsetOf(type,member) printf("  OffsetOf( "  #member  " ) = %zu\n", offsetof(type,member))


int main()
{
#ifdef UNICODE


#if defined(_WIN64)
	printf("\n");
	printf("\n");
	printf("  Compilation Window 64 bit - mode unicode\n");
#else
	printf("\n");
	printf("\n");
	printf("  Compilation Window 32 bit - mode unicode\n");
#endif

	/*
		--------------------
			typedef struct tagLVCOLUMNW
			{
				UINT mask;
				int fmt;
				int cx;
				LPWSTR pszText;
				int cchTextMax;
				int iSubItem;
				int iImage;
				int iOrder;
			#if (NTDDI_VERSION >= NTDDI_VISTA)
				int cxMin;       // min snap point
				int cxDefault;   // default snap point
				int cxIdeal;     // read only. ideal may not eqaul current width if auto sized (LVS_EX_AUTOSIZECOLUMNS) to a lesser width.
			#endif
			} LVCOLUMNW, *LPLVCOLUMNW;


				*/

	printf("\n");
	printf("  Structure \n");
	printf("  -----------------\n");

	PRINTF_SIZEOF(LVCOLUMNW);
	printf("\n");
	PRINTF_OffsetOf(LVCOLUMNW, mask);
	PRINTF_OffsetOf(LVCOLUMNW, fmt);
	PRINTF_OffsetOf(LVCOLUMNW, cx);
	PRINTF_OffsetOf(LVCOLUMNW, pszText);
	PRINTF_OffsetOf(LVCOLUMNW, cchTextMax);
	PRINTF_OffsetOf(LVCOLUMNW, iSubItem);
	PRINTF_OffsetOf(LVCOLUMNW, iImage);
	PRINTF_OffsetOf(LVCOLUMNW, iOrder);
	PRINTF_OffsetOf(LVCOLUMNW, cxMin);
	PRINTF_OffsetOf(LVCOLUMNW, cxDefault);
	PRINTF_OffsetOf(LVCOLUMNW, cxIdeal);


#else
	printf("You must compile in unicode mode!\n");
#endif


	return 0;
}
PB code

Code: Select all

CompilerSelect #PB_Compiler_Processor
      CompilerCase #PB_Processor_x86
            
            
      CompilerCase #PB_Processor_x64
            Debug "Compilation Windows 64 bit - mode unicode"
            Structure My_LVCOLUMN
                  mask.l
                  fmt.l
                  cx.l
                  PB_Alignment.b[4]
                  *pszText
                  cchTextMax.l
                  iSubItem.l
                  iImage.l
                  iOrder.l
                  cxMin.l
                  cxDefault.l
                  cxIdeal.l
                  PB_Alignment1.b[4]
            EndStructure
CompilerEndSelect

Debug #CRLF$ + 	"  Structure" + #CRLF$ + 	"  ----------------------"


Debug "SizeOf(My_LVCOLUMN) = " + Str(SizeOf(My_LVCOLUMN))
Debug ""
Debug "-------   OffsetOf()  values   -------"
Debug "OffsetOf(My_LVCOLUMN\mask) = " + Str(OffsetOf(My_LVCOLUMN\mask))
Debug "OffsetOf(My_LVCOLUMN\fmt) = " + Str(OffsetOf(My_LVCOLUMN\fmt))
Debug "OffsetOf(My_LVCOLUMN\cx) = " + Str(OffsetOf(My_LVCOLUMN\cx))
Debug "OffsetOf(My_LVCOLUMN\*pszText) = " + Str(OffsetOf(My_LVCOLUMN\pszText))
Debug "OffsetOf(My_LVCOLUMN\cchTextMax) = " + Str(OffsetOf(My_LVCOLUMN\cchTextMax))
Debug "OffsetOf(My_LVCOLUMN\iSubItem) = " + Str(OffsetOf(My_LVCOLUMN\iSubItem))
Debug "OffsetOf(My_LVCOLUMN\iImage) = " + Str(OffsetOf(My_LVCOLUMN\iImage))
Debug "OffsetOf(My_LVCOLUMN\iOrder) = " + Str(OffsetOf(My_LVCOLUMN\iOrder))
Debug "OffsetOf(My_LVCOLUMN\cxMin) = " + Str(OffsetOf(My_LVCOLUMN\cxMin))
Debug "OffsetOf(My_LVCOLUMN\cxDefault) = " + Str(OffsetOf(My_LVCOLUMN\cxDefault))
Debug "OffsetOf(My_LVCOLUMN\cxIdeal) = " + Str(OffsetOf(My_LVCOLUMN\cxIdeal))
result in x64 mode :
Image
A+
Denis
Post Reply