virtual GRID with Checkbox ?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

virtual GRID with Checkbox ?

Post 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 :?:
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: virtual GRID with Checkbox ?

Post 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
have fun
Jimmy
User avatar
SALINETAS24
Posts: 667
Joined: Tue Feb 27, 2018 3:06 am
DBs Used: DBF
Contact:

Re: virtual GRID with Checkbox ?

Post 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
Attachments
GRID_08.rar
(1.21 MiB) Downloaded 127 times
Como dijo el gran pensador Hommer Simpson..., - En este mundo solo hay 3 tipos de personas, los que saben contar y los que no. :shock:
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: virtual GRID with Checkbox ?

Post 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 :?:
have fun
Jimmy
User avatar
SALINETAS24
Posts: 667
Joined: Tue Feb 27, 2018 3:06 am
DBs Used: DBF
Contact:

Re: virtual GRID with Checkbox ?

Post 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.
Como dijo el gran pensador Hommer Simpson..., - En este mundo solo hay 3 tipos de personas, los que saben contar y los que no. :shock:
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: virtual GRID with Checkbox ?

Post 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
have fun
Jimmy
Post Reply