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
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
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: 1725
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
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: 1725
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: 42068
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 29 guests