FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ENTER for TGrid From TControl
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
ENTER for TGrid From TControl
Posted: Wed Oct 19, 2022 05:40 AM
hi,

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

Code (fw): Select all Collapse
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 (fw): Select all Collapse
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 :-)
greeting,

Jimmy
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: ENTER for TGrid From TControl
Posted: Thu Oct 20, 2022 03:57 AM
hi,

got it :-)
Code (fw): Select all Collapse
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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: ENTER for TGrid From TControl
Posted: Thu Oct 20, 2022 06:58 AM

You are improving everyday my friend :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion