From 9279f182f68037f26bcc6a1ab7dcfec0659621be Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Tue, 25 Nov 2008 17:20:49 +0000 Subject: [PATCH] 2008-11-25 09:15 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/gtwvg/wvggui.c * harbour/contrib/gtwvg/wvgdlg.prg * harbour/contrib/gtwvg/wvgtoolb.prg + Hot Tracking of toolbar buttons. ;TODO: Buttons from resources. System defined buttons. Buttons with dropdown menues. Buttons with disabled/hot images. --- harbour/ChangeLog | 11 +++++++++++ harbour/contrib/gtwvg/wvgdlg.prg | 4 ++++ harbour/contrib/gtwvg/wvggui.c | 21 ++++++++++++--------- harbour/contrib/gtwvg/wvgtoolb.prg | 12 +++++++++--- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ed3eb57210..bfc33ba00b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,17 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-11-25 09:15 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * harbour/contrib/gtwvg/wvggui.c + * harbour/contrib/gtwvg/wvgdlg.prg + * harbour/contrib/gtwvg/wvgtoolb.prg + + Hot Tracking of toolbar buttons. + + ;TODO: Buttons from resources. + System defined buttons. + Buttons with dropdown menues. + Buttons with disabled/hot images. + 2008-11-25 02:14 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/gtwvg/hbgtwvg.ch * harbour/contrib/gtwvg/wvtwin.ch diff --git a/harbour/contrib/gtwvg/wvgdlg.prg b/harbour/contrib/gtwvg/wvgdlg.prg index a588998e4d..5102d94e47 100644 --- a/harbour/contrib/gtwvg/wvgdlg.prg +++ b/harbour/contrib/gtwvg/wvgdlg.prg @@ -162,6 +162,10 @@ METHOD destroy() CLASS WvgDialog ::oMenu:destroy() ENDIF + IF Len( ::aChildren ) > 0 + aeval( ::aChildren, {|o| o:destroy() } ) + ENDIF + ::pGT := NIL ::pGTp := NIL diff --git a/harbour/contrib/gtwvg/wvggui.c b/harbour/contrib/gtwvg/wvggui.c index c7ccf84abb..6ffb5931c7 100644 --- a/harbour/contrib/gtwvg/wvggui.c +++ b/harbour/contrib/gtwvg/wvggui.c @@ -1098,17 +1098,20 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara LPNMMOUSE nmm = ( LPNMMOUSE ) lParam; NMHDR nmh = nmm->hdr; - hb_arrayNew( pEvParams, 5 ); - hb_arraySetNI( pEvParams, 1, ( int ) wParam ); - hb_arraySetNInt( pEvParams, 2, ( HB_PTRDIFF ) nmh.hwndFrom ); - hb_arraySetNI( pEvParams, 3, nmh.idFrom ); - hb_arraySetNI( pEvParams, 4, nmh.code ); - hb_arraySetNL( pEvParams, 5, nmm->dwItemSpec ); + if( nmh.code == NM_CLICK ) + { + hb_arrayNew( pEvParams, 5 ); + hb_arraySetNI( pEvParams, 1, ( int ) wParam ); + hb_arraySetNInt( pEvParams, 2, ( HB_PTRDIFF ) nmh.hwndFrom ); + hb_arraySetNI( pEvParams, 3, nmh.idFrom ); + hb_arraySetNI( pEvParams, 4, nmh.code ); + hb_arraySetNL( pEvParams, 5, nmm->dwItemSpec ); - hb_gt_wvt_FireEvent( pWVT, HB_GTE_NOTIFY, pEvParams ); + hb_gt_wvt_FireEvent( pWVT, HB_GTE_NOTIFY, pEvParams ); - hb_itemRelease( pEvParams ); - return TRUE; + hb_itemRelease( pEvParams ); + return TRUE; + } } case WM_CREATE: { diff --git a/harbour/contrib/gtwvg/wvgtoolb.prg b/harbour/contrib/gtwvg/wvgtoolb.prg index fdd0122c35..3967708e4f 100644 --- a/harbour/contrib/gtwvg/wvgtoolb.prg +++ b/harbour/contrib/gtwvg/wvgtoolb.prg @@ -226,10 +226,16 @@ METHOD configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) CLASS Wv METHOD destroy() CLASS WvgToolBar LOCAL i, nItems - IF ( nItems := ::numItems() ) > 0 + IF ( nItems := Len( ::aItems ) ) > 0 FOR i := 1 TO nItems - IF ::aItems[ i ]:image <> NIL - Win_DeleteObject( ::aItems[ i ]:image ) + IF ::aItems[ i,2 ]:image <> NIL + Win_DeleteObject( ::aItems[ i,2 ]:image ) + ENDIF + IF ::aItems[ i,2 ]:disabledImage <> NIL + Win_DeleteObject( ::aItems[ i,2 ]:disabledImage ) + ENDIF + IF ::aItems[ i,2 ]:hotImage <> NIL + Win_DeleteObject( ::aItems[ i,2 ]:hotImage ) ENDIF NEXT ENDIF