Page 1 of 1

virtual GRID with Checkbox ?

Posted: Tue Jan 10, 2023 5:23 pm
by AUGE_OHR
hi,

using CheckBoxEnabled i can use Checkbox in a GRID

Question : is it possible to use Checkbox with "virtual" GRID :?:
if Yes, how :?:

Re: virtual GRID with Checkbox ?

Posted: Thu Jan 12, 2023 7:26 am
by AUGE_OHR
hi,

have found out that HMG use GETGRIDDISPINFOINDEX(), SetGridQueryData() and SetGridQueryImage() but not INDEXTOSTATEIMAGEMASK() for GRID ( but TREE )

here my HB_FUNC() wfich i made for Fivewin

Code: Select all

HB_FUNC( LV_SETCHECKITEM )
{
   #ifndef _WIN64
      LPARAM lParam = ( LPARAM ) hb_parnl( 1 );
   #else
      LPARAM lParam = ( LPARAM ) hb_parnll( 1 );
   #endif
   LV_DISPINFO * pDispInfo = ( LV_DISPINFO * ) lParam;

   //Create a pointer to the item
   LV_ITEM* pItem= &(pDispInfo)->item;

   //To enable check box, we have to enable state mask...
   pItem->mask |= LVIF_STATE;
   pItem->stateMask = LVIS_STATEIMAGEMASK;

   pItem->state = INDEXTOSTATEIMAGEMASK( hb_parni( 2 ) );
}
---

for "marked" File you have LVIS_SELECTED but in "virtual" Mode you need also

Code: Select all

#define LVIS_UNCHECKED 0x1000
#define LVIS_CHECKED   0x2000
as i found out

Code: Select all

   iMax := LV_GETSELECTEDCOUNT( ::hLv )
does only give me LVIS_SELECTED but not LVIS_CHECKED, in virtual GRID, which "can" be different

so i have to find out how to implement that Stuff into HMG

Re: virtual GRID with Checkbox ?

Posted: Thu Jan 12, 2023 9:47 am
by SALINETAS24
Hola Auge, yo utilizo esta solución. No es gráfica pero me ha sacado de algún aprieto.
Sl2 y cervecita fresquita

Re: virtual GRID with Checkbox ?

Posted: Fri Jan 13, 2023 1:03 am
by AUGE_OHR
hi,

thx for Answer.

hm ... add a "Extra" Column for "mark" :idea:

i got Array from Directory()
how to add "Extra" Column to Array ... hm :?:

Re: virtual GRID with Checkbox ?

Posted: Fri Jan 13, 2023 8:37 am
by SALINETAS24
Hola Jimmy, creo que no te entiendo, pero si lo que buscas es esto, espero que te sirva.

Code: Select all

	aMatriz:=DIRECTORY("*.*")
	MSGDEbug(aMatriz)
	FOR nFor=1 TO LEN(aMatriz)
		hb_aIns(aMatriz[nFor],1,.F.,.T.)
	NEXT
	MSGDEbug(aMatriz)
Saludos cordiales.

Re: virtual GRID with Checkbox ?

Posted: Fri Jan 13, 2023 10:27 pm
by AUGE_OHR
hi,
SALINETAS24 wrote: Fri Jan 13, 2023 8:37 am

Code: Select all

		hb_aIns(aMatriz[nFor],1,.F.,.T.)
ah, use AINS() that Way to add Element for new Column.
thx for Tip