From d93996a154e3d10fd858f8b4eead6afb99925e9c Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Sat, 11 Oct 2008 11:06:51 +0000 Subject: [PATCH] 2008-10-11 13:06 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/rtl/tget.prg ! fixed cursor positioning when new get item is added. ; added note about possible modification - Viktor, please verify it --- harbour/ChangeLog | 5 +++++ harbour/source/rtl/tget.prg | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 47a6674ba6..2cbe27ab56 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,11 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-10-11 13:06 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/rtl/tget.prg + ! fixed cursor positioning when new get item is added. + ; added note about possible modification - Viktor, please verify it + 2008-10-11 11:21 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/common/expropt2.c * formatting and minor cleanup diff --git a/harbour/source/rtl/tget.prg b/harbour/source/rtl/tget.prg index 8c1f41475e..7fffdf5fee 100644 --- a/harbour/source/rtl/tget.prg +++ b/harbour/source/rtl/tget.prg @@ -255,6 +255,8 @@ METHOD display() CLASS Get LOCAL nOldCursor := SetCursor( SC_NONE ) LOCAL cBuffer LOCAL nDispPos + LOCAL nRowPos + LOCAL nColPos #ifdef HB_COMPAT_C53 LOCAL nPos @@ -310,6 +312,16 @@ METHOD display() CLASS Get IF nPos > 0 hb_dispOutAt( ::nCapRow, ::nCapCol + nPos - 1, SubStr( cCaption, nPos, 1 ), hb_ColorIndex( ::cColorSpec, GET_CLR_ACCEL ) ) ENDIF + + /* should we set fixed cursor position here? + * The above code which can left cursor in the middle of shown screen + * suggests that we shouldn't. If necessary please fix me. + */ + /* + nRowPos := ::nCapRow + nColPos := ::nCapCol + len( cCaption ) + */ + ENDIF #endif @@ -322,6 +334,9 @@ METHOD display() CLASS Get iif( ::lHideInput, PadR( Replicate( SubStr( ::cStyle, 1, 1 ), Len( RTrim( cBuffer ) ) ), ::nDispLen ), SubStr( cBuffer, nDispPos, ::nDispLen ) ),; hb_ColorIndex( ::cColorSpec, iif( ::hasFocus, GET_CLR_ENHANCED, GET_CLR_UNSELECTED ) ) ) + nRowPos := ::nRow + nColPos := ::nCol + ::nDispLen + IF Set( _SET_DELIMITERS ) .AND. !::hasFocus #ifdef HB_COMPAT_C53 hb_dispOutAt( ::nRow, ::nCol - 1, SubStr( Set( _SET_DELIMCHARS ), 1, 1 ), hb_ColorIndex( ::cColorSpec, GET_CLR_UNSELECTED ) ) @@ -331,11 +346,14 @@ METHOD display() CLASS Get hb_dispOutAt( ::nRow, ::nCol - 1, SubStr( Set( _SET_DELIMCHARS ), 1, 1 ) ) hb_dispOutAt( ::nRow, ::nCol + ::nDispLen, SubStr( Set( _SET_DELIMCHARS ), 2, 1 ) ) #endif + ++nColPos ENDIF ENDIF IF ::nPos != 0 SetPos( ::nRow, ::nCol + ::nPos - nDispPos ) + ELSEIF nRowPos != NIL + SetPos( nRowPos, nColPos ) ENDIF ::nOldPos := nDispPos