From 86bba9ea9862b7ebe6a89289085a0b62a82d5ee6 Mon Sep 17 00:00:00 2001 From: Antonio Linares Date: Sun, 6 Feb 2000 09:14:29 +0000 Subject: [PATCH] 20000206-10:12 GMT+1 Antonio Linares --- harbour/ChangeLog | 5 ++- harbour/source/debug/debugger.prg | 61 ++++++++++++++++++++++++------- 2 files changed, 51 insertions(+), 15 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 4cdfc39055..2af3a2fb95 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,7 @@ +20000206-10:12 GMT+1 Antonio Linares + * source/debug/debugger.prg + * Mouse support to select pulldown top items (just that for now) + 20000205-17:00 GMT+1 Victor Szakats * source/compiler/hbusage.c + The command line help screen uses the platform dependent switch @@ -177,7 +181,6 @@ * doc/whatsnew.txt % Synchronized with updates that were made to the build31 branch - * source/pp/pragma.c * contrib/dot/pp_harb.ch * tests/inline_c.prg diff --git a/harbour/source/debug/debugger.prg b/harbour/source/debug/debugger.prg index 65721a9167..357d5f418c 100644 --- a/harbour/source/debug/debugger.prg +++ b/harbour/source/debug/debugger.prg @@ -356,18 +356,22 @@ METHOD HandleEvent() CLASS TDebugger nKey = InKey( 0 ) do case - case nKey == K_LBUTTONDOWN - Alert( Str( MRow() ) + ", " + Str( MCol() ) ) - - case nKey == K_RBUTTONDOWN - Alert( "K_RBUTTONDOWN" ) - case ::oPullDown:IsOpen() ::oPullDown:ProcessKey( nKey ) if ::oPullDown:nOpenPopup == 0 // Closed ::aWindows[ ::nCurrentWindow ]:SetFocus( .t. ) endif + case nKey == K_LBUTTONDOWN + if MRow() == 0 + if ( nPopup := ::oPullDown:GetItemOrdByCoors( 0, MCol() ) ) != 0 + SetCursor( SC_NONE ) + ::oPullDown:ShowPopup( nPopup ) + endif + endif + + case nKey == K_RBUTTONDOWN + case nKey == K_ESC ::RestoreAppStatus() s_oDebugger := nil @@ -404,8 +408,10 @@ METHOD HandleEvent() CLASS TDebugger otherwise if ( nPopup := ::oPullDown:GetHotKeyPos( AltToKey( nKey ) ) ) != 0 - SetCursor( SC_NONE ) - ::oPullDown:ShowPopup( nPopup ) + if ::oPullDown:nOpenPopup != nPopup + SetCursor( SC_NONE ) + ::oPullDown:ShowPopup( nPopup ) + endif endif endcase end @@ -1076,6 +1082,7 @@ CLASS TDbMenu /* debugger menu */ METHOD Display() METHOD EvalAction() METHOD GetHotKeyPos( nKey ) + METHOD GetItemOrdByCoors( nRow, nCol ) METHOD GoBottom() METHOD GoDown() INLINE ::aItems[ ::nOpenPopup ]:bAction:GoRight() METHOD GoLeft() @@ -1175,9 +1182,11 @@ METHOD ClosePopup( nPopup ) CLASS TDbMenu if nPopup != 0 oPopup = ::aItems[ nPopup ]:bAction - RestScreen( oPopup:nTop, oPopup:nLeft, oPopup:nBottom + 1, oPopup:nRight + 2,; - oPopup:cBackImage ) - oPopup:cBackImage = nil + if oPopup:ClassName() == "TDBMENU" + RestScreen( oPopup:nTop, oPopup:nLeft, oPopup:nBottom + 1, oPopup:nRight + 2,; + oPopup:cBackImage ) + oPopup:cBackImage = nil + endif ::aItems[ nPopup ]:Display( ::cClrPopup, ::cClrHotKey ) endif @@ -1244,6 +1253,19 @@ METHOD GetHotKeyPos( cKey ) CLASS TDbMenu return 0 +METHOD GetItemOrdByCoors( nRow, nCol ) CLASS TDbMenu + + local n + + for n = 1 to Len( ::aItems ) + if ::aItems[ n ]:nRow == nRow .and. nCol >= ::aItems[ n ]:nCol .and. ; + nCol <= ::aItems[ n ]:nCol + Len( ::aItems[ n ]:cPrompt ) - 2 + return n + endif + next + +return 0 + METHOD GoBottom() CLASS TDbMenu local oPopup @@ -1301,7 +1323,6 @@ METHOD GoRight() CLASS TDbMenu ::ShowPopup( ::nOpenPopup := 1 ) endif endif - // DispEnd() return nil @@ -1334,6 +1355,16 @@ METHOD ProcessKey( nKey ) CLASS TDbMenu local nPopup do case + case nKey == K_LBUTTONDOWN + if MRow() == 0 + if ( nPopup := ::GetItemOrdByCoors( 0, MCol() ) ) != 0 + if nPopup != ::nOpenPopup + ::ClosePopup( ::nOpenPopup ) + ::ShowPopup( nPopup ) + endif + endif + endif + case nKey == K_ESC ::Close() @@ -1360,8 +1391,10 @@ METHOD ProcessKey( nKey ) CLASS TDbMenu otherwise if ( nPopup := ::GetHotKeyPos( AltToKey( nKey ) ) ) != 0 - ::Close() - ::ShowPopup( nPopup ) + if nPopup != ::nOpenPopup + ::Close() + ::ShowPopup( nPopup ) + endif endif endcase