From 486d8b4a5682adfda37a726ef7c184666b3c2a39 Mon Sep 17 00:00:00 2001 From: Antonio Linares Date: Wed, 5 Sep 2001 05:05:20 +0000 Subject: [PATCH] Property OnClick added and WM_LBUTTONDOWN msgs properly routed --- harbour/contrib/hgf/win32/tform.prg | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/harbour/contrib/hgf/win32/tform.prg b/harbour/contrib/hgf/win32/tform.prg index f0e8c95837..183399d035 100644 --- a/harbour/contrib/hgf/win32/tform.prg +++ b/harbour/contrib/hgf/win32/tform.prg @@ -54,10 +54,11 @@ #include "common.ch" #include "hbclass.ch" -#define WM_CLOSE 0x0010 -#define WM_COMMAND 0x0111 -#define WM_DESTROY 0x0002 -#define WS_VISIBLE 0x10000000 +#define WM_CLOSE 0x0010 +#define WM_COMMAND 0x0111 +#define WM_DESTROY 0x0002 +#define WM_LBUTTONDOWN 0x0201 +#define WS_VISIBLE 0x10000000 static aForms := {} @@ -67,12 +68,15 @@ CLASS TForm FROM TPersistent DATA oMainMenu DATA cName + DATA OnClick PROPERTY + CLASSDATA lRegistered METHOD New() METHOD Close() INLINE SendMessage( ::hWnd, WM_CLOSE ) METHOD Command( nNotifyCode, nId, hWndCtl ) METHOD HandleEvent( nMsg, nParam1, nParam2 ) + METHOD LButtonDown( nKeyFlags, nXPos, nYPos ) METHOD ShowModal() ACCESS Caption() INLINE WinGetText( ::hWnd ) PROPERTY @@ -130,12 +134,23 @@ METHOD Command( nNotifyCode, nId, hWndCtl ) CLASS TForm return nil +METHOD LButtonDown( nKeyFlags, nXPos, nYPos ) CLASS TForm + + if ::OnClick != nil + return __ObjSendMsg( Self, ::OnClick, Self, nXPos, nYPos ) + endif + +return nil + METHOD HandleEvent( nMsg, nParam1, nParam2 ) CLASS TForm do case case nMsg == WM_COMMAND return ::Command( nHiWord( nParam1 ), nLoWord( nParam1 ), nParam2 ) + case nMsg == WM_LBUTTONDOWN + return ::LButtonDown( nParam1, nLoWord( nParam2 ), nHiWord( nParam2 ) ) + case nMsg == WM_DESTROY PostQuitMessage( 0 ) return 0