diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 16a71e7f48..aa85d556a6 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,10 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-08-07 18:50 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * source/rtl/achoice.prg + * Minor changes to mouse support. TOFIX/TODO added. + 2008-08-07 17:48 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/debug/debugger.prg ! added missing semicolon for -DHB_NO_READDBG compilation diff --git a/harbour/source/rtl/achoice.prg b/harbour/source/rtl/achoice.prg index 87b6b660be..86d8e24a85 100644 --- a/harbour/source/rtl/achoice.prg +++ b/harbour/source/rtl/achoice.prg @@ -159,16 +159,18 @@ FUNCTION AChoice( nTop, nLeft, nBottom, nRight, acItems, xSelect, xUserFunc, nPo nPos := 0 lFinished := .T. - CASE nKey == K_MWFORWARD - Keyboard( Chr( K_UP ) ) - - CASE nKey == K_MWBACKWARD - Keyboard( Chr( K_DOWN ) ) + CASE nKey == K_LBUTTONDOWN + /* TOFIX: Position to line under mouse cursor. */ CASE nKey == K_LDBLCLK + /* TOFIX: Position to line under mouse cursor and select it. */ Keyboard( Chr( K_ENTER ) ) +#ifdef HB_C52_STRICT CASE nKey == K_UP +#else + CASE nKey == K_UP .OR. nKey == K_MWFORWARD +#endif IF nPos == nFrstItem nMode := AC_HITTOP @@ -179,7 +181,7 @@ FUNCTION AChoice( nTop, nLeft, nBottom, nRight, acItems, xSelect, xUserFunc, nPo ELSE nNewPos := nPos - 1 DO WHILE !Eval( bSelect, alSelect[ nNewPos ] ) - nNewPos -- + nNewPos-- ENDDO IF INRANGE( nAtTop, nNewPos, nAtTop + nNumRows - 1 ) DispLine( acItems[ nPos ], nTop + ( nPos - nAtTop ), nLeft, Eval( bSelect, alSelect[ nPos ] ), .F., nNumCols ) @@ -193,14 +195,18 @@ FUNCTION AChoice( nTop, nLeft, nBottom, nRight, acItems, xSelect, xUserFunc, nPo nPos := Max( nPos, nAtTop + nNumRows - 1 ) DO WHILE nPos > nNewPos DispLine( acItems[ nPos ], nTop + ( nPos - nAtTop ), nLeft, Eval( bSelect, alSelect[ nPos ] ), .F., nNumCols ) - nPos -- + nPos-- ENDDO DispLine( acItems[ nPos ], nTop + ( nPos - nAtTop ), nLeft, Eval( bSelect, alSelect[ nPos ] ), .T., nNumCols ) DispEnd() ENDIF ENDIF +#ifdef HB_C52_STRICT CASE nKey == K_DOWN +#else + CASE nKey == K_DOWN .OR. nKey == K_MWBACKWARD +#endif // Find the next selectable item to display IF nPos == nLastItem @@ -214,7 +220,7 @@ FUNCTION AChoice( nTop, nLeft, nBottom, nRight, acItems, xSelect, xUserFunc, nPo nNewPos := nPos + 1 DO WHILE !Eval( bSelect, alSelect[ nNewPos ] ) - nNewPos ++ + nNewPos++ ENDDO IF INRANGE( nAtTop, nNewPos, nAtTop + nNumRows - 1 ) @@ -229,7 +235,7 @@ FUNCTION AChoice( nTop, nLeft, nBottom, nRight, acItems, xSelect, xUserFunc, nPo nPos := Max( nPos, nAtTop ) DO WHILE nPos < nNewPos DispLine( acItems[ nPos ], nTop + ( nPos - nAtTop ), nLeft, Eval( bSelect, alSelect[ nPos ] ), .F., nNumCols ) - nPos ++ + nPos++ ENDDO DispLine( acItems[ nPos ], nTop + ( nPos - nAtTop ), nLeft, Eval( bSelect, alSelect[ nPos ] ), .T., nNumCols ) DispEnd() @@ -513,6 +519,17 @@ FUNCTION AChoice( nTop, nLeft, nBottom, nRight, acItems, xSelect, xUserFunc, nPo RETURN nPos +STATIC FUNCTION HitTest( nTop, nLeft, nBottom, nRight, mRow, mCol ) + + IF mCol >= nLeft .AND. ; + mCol <= nRight .AND. ; + mRow >= nTop .AND. ; + mRow <= nBottom + RETURN mRow - nTop + 1 + ENDIF + + RETURN 0 + STATIC PROCEDURE DispPage( acItems, alSelect, nTop, nLeft, nRight, nNumRows, nPos, nAtTop, nArrLen, bSelect, nRowsClr ) LOCAL nCntr