ENTER for TGrid From TControl

ENTER for TGrid From TControl

Postby Jimmy » Wed Oct 19, 2022 5:40 am

hi,

i can use Method Notify() to get NM_CLICK but how when press ENTER of Listview :?:

Code: Select all  Expand view  RUN
METHOD Notify( nIdCtrl, nPtrNMHDR ) CLASS TGrid
LOCAL nCode   := GetNMHDRCode( nPtrNMHDR )
LOCAL nWParam := GetWParam(    nPtrNMHDR )
LOCAL nLParam := GetLParam(    nPtrNMHDR )

   CASE nCode == LVN_KEYDOWN
      if GETGRIDVKEY(nLParam) = 13

but it crash here :(
Code: Select all  Expand view  RUN
HB_FUNC ( GETGRIDVKEY )
{
   #ifndef _WIN64
      LPARAM lParam = (LPARAM) hb_parnl (1);
   #else
      LPARAM lParam = (LPARAM) hb_parnll (1);
   #endif
   LV_KEYDOWN * LVK = (LV_KEYDOWN *) lParam;
   hb_retni ( LVK->wVKey );
}

i "think" i got wrong nLParam from GetLParam(nPtrNMHDR) ..

so how to ENTER my CLASS TGrid :idea:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: ENTER for TGrid From TControl

Postby Jimmy » Thu Oct 20, 2022 3:57 am

hi,

got it :D
Code: Select all  Expand view  RUN
CASE nCode == LVN_KEYDOWN
   // nOption = Get_NMListViewItem( nPtrNMHDR ) + 1
   nKey := GETGRIDVKEY(nPtrNMHDR)
   onDummy( TIME(), "LVN_KEYDOWN",nKey, ::nOption )
   IF nKey = 13
      IF ::bClick != nil
         // ::nOption := nOption
         //  use last from LVN_ITEMCHANGED
         EVAL( ::bClick, ::nOption, Self )
      ENDIF
   ENDIF

instead of nLParam i have to use nPtrNMHDR
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: ENTER for TGrid From TControl

Postby Antonio Linares » Thu Oct 20, 2022 6:58 am

You are improving everyday my friend :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 39 guests