Page 2 of 3

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Posted: Thu Feb 15, 2024 1:19 pm
by Mindphazer
Hi Denis, Jac
I'm facing the same error (PB 6.03 x64, C or ASM backend)

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Posted: Thu Feb 15, 2024 4:30 pm
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!

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Posted: Thu Feb 15, 2024 6:18 pm
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 (?)

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Posted: Thu Feb 15, 2024 9:40 pm
by jacdelad
I can do that, but then all the magic is gone. :mrgreen:

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Posted: Mon Feb 19, 2024 3:47 am
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

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Posted: Mon Feb 19, 2024 8:44 am
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.

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Posted: Mon Feb 19, 2024 9:58 am
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

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Posted: Mon Feb 19, 2024 3:14 pm
by jacdelad
What happens if you comment out the macro?

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Posted: Mon Feb 19, 2024 6:50 pm
by Denis
Same here as boddhi and Caronte3D

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Posted: Mon Feb 19, 2024 7:50 pm
by Caronte3D
jacdelad wrote: Mon Feb 19, 2024 3:14 pm What happens if you comment out the macro?
The same behavior

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Posted: Mon Feb 19, 2024 8:28 pm
by jacdelad
I suddenly have the same problems...maybe a Windows update or something with the new PureBasic Beta? I never experienced that before.

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Posted: Tue Feb 20, 2024 8:01 am
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.

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Posted: Tue Feb 20, 2024 1:57 pm
by Caronte3D
Yes, this way everything works (without grid lines).

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Posted: Tue Feb 20, 2024 3:13 pm
by jacdelad
Yeah, after investigating a bit more: Don't use GridLines with Grouping. Microsoft doesn't want that.

Re: LIGEnhancements - ListIconGadget with Grouping and TileView

Posted: Thu Feb 22, 2024 11:59 am
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