From 9113680b5a592eb4cc327b2bb18b0222734d01b3 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Sat, 11 Oct 2008 01:24:26 +0000 Subject: [PATCH] 2008-10-11 03:24 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/rtl/scrollbr.prg * harbour/source/rtl/getsys.prg * harbour/source/rtl/tpopup.prg * harbour/source/rtl/tgetlist.prg * harbour/source/rtl/radiogrp.prg * harbour/source/rtl/listbox.prg * harbour/source/rtl/checkbox.prg * harbour/source/rtl/browse.prg * harbour/source/rtl/tget.prg * harbour/source/rtl/ttopbar.prg * harbour/source/rtl/pushbtn.prg * harbour/source/rtl/tmenusys.prg * harbour/source/rtl/achoice.prg * harbour/source/rtl/teditor.prg * harbour/source/rtl/radiobtn.prg * harbour/source/rtl/tbrowse.prg * replaced DispOut() with hb_dispOut() * replaced DispBox() with hb_dispBox() % removed saving and restoring of cursor position in places where it's not longer necessary due to hb_dispOut()/hb_dispBox() usage % removed saving and restoring of SetColor() value in places where it's not longer necessary due to hb_dispOut()/hb_dispBox() usage % removed saving and restoring of MSetCursor(). If it's necessary low GT driver should hide and redraw mouse cursor before and after screen update. We do not have to make it manually The above modification gives faster code and allow to access screen from different threads simultaneously because functions like hb_dispOut() and hb_dispBox() are stateless and atomic in screen access. Not all .prg code has been updated yet. If someone is familiar with this code then please help. I'll add yet HB_SCROLL() function which will support additionally colors. Viktor if possible please verify this modifications. --- harbour/ChangeLog | 38 ++++++++++++++++++- harbour/source/rtl/achoice.prg | 28 ++++++-------- harbour/source/rtl/browse.prg | 24 ++++++------ harbour/source/rtl/checkbox.prg | 27 +++++--------- harbour/source/rtl/getsys.prg | 13 ++----- harbour/source/rtl/listbox.prg | 29 ++++++++------- harbour/source/rtl/pushbtn.prg | 26 +++++-------- harbour/source/rtl/radiobtn.prg | 23 ++++-------- harbour/source/rtl/radiogrp.prg | 19 ++-------- harbour/source/rtl/scrollbr.prg | 66 +++++++++++---------------------- harbour/source/rtl/tbrowse.prg | 38 +++++++++---------- harbour/source/rtl/teditor.prg | 25 +++++-------- harbour/source/rtl/tget.prg | 18 ++++----- harbour/source/rtl/tgetlist.prg | 28 ++------------ harbour/source/rtl/tmenusys.prg | 5 +-- harbour/source/rtl/tpopup.prg | 41 ++++++++------------ harbour/source/rtl/ttopbar.prg | 13 ++----- 17 files changed, 191 insertions(+), 270 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 9a9214f43f..a1e8b6f105 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,41 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-10-11 03:24 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/rtl/scrollbr.prg + * harbour/source/rtl/getsys.prg + * harbour/source/rtl/tpopup.prg + * harbour/source/rtl/tgetlist.prg + * harbour/source/rtl/radiogrp.prg + * harbour/source/rtl/listbox.prg + * harbour/source/rtl/checkbox.prg + * harbour/source/rtl/browse.prg + * harbour/source/rtl/tget.prg + * harbour/source/rtl/ttopbar.prg + * harbour/source/rtl/pushbtn.prg + * harbour/source/rtl/tmenusys.prg + * harbour/source/rtl/achoice.prg + * harbour/source/rtl/teditor.prg + * harbour/source/rtl/radiobtn.prg + * harbour/source/rtl/tbrowse.prg + * replaced DispOut() with hb_dispOut() + * replaced DispBox() with hb_dispBox() + % removed saving and restoring of cursor position in places where + it's not longer necessary due to hb_dispOut()/hb_dispBox() usage + % removed saving and restoring of SetColor() value in places where + it's not longer necessary due to hb_dispOut()/hb_dispBox() usage + % removed saving and restoring of MSetCursor(). If it's necessary + low GT driver should hide and redraw mouse cursor before and after + screen update. We do not have to make it manually + + The above modification gives faster code and allow to access screen + from different threads simultaneously because functions like + hb_dispOut() and hb_dispBox() are stateless and atomic in screen + access. Not all .prg code has been updated yet. If someone is + familiar with this code then please help. I'll add yet HB_SCROLL() + function which will support additionally colors. + Viktor if possible please verify this modifications. + 2008-10-11 03:06 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbapigt.h * harbour/source/rtl/gtapi.c @@ -24,7 +59,6 @@ + added HB_DISPBOX() function - works like DISPBOX() bit does not change cursor position and is atomic for other threads - * harbour/include/hbapigt.h * harbour/include/hbgtcore.h * harbour/source/rtl/hbgtcore.c @@ -127,7 +161,7 @@ For VC, see above. - Removed HB_BUILD_ST undocumented option. % Other minor cleanups. - + * contrib/xhb/hbcompat.ch * contrib/xhb/xhb.ch ! Moved __COPYFILE() translation to xhb.ch. diff --git a/harbour/source/rtl/achoice.prg b/harbour/source/rtl/achoice.prg index e0a0489450..b8561a3f7f 100644 --- a/harbour/source/rtl/achoice.prg +++ b/harbour/source/rtl/achoice.prg @@ -467,7 +467,7 @@ FUNCTION AChoice( nTop, nLeft, nBottom, nRight, acItems, xSelect, xUserFunc, nPo nUserFunc := Do( xUserFunc, nMode, nPos, nPos - nAtTop ) IF ISNUMBER( nUserFunc ) - + DO CASE CASE nUserFunc == AC_ABORT .OR. nMode == AC_NOITEM lFinished := .T. @@ -482,12 +482,12 @@ FUNCTION AChoice( nTop, nLeft, nBottom, nRight, acItems, xSelect, xUserFunc, nPo // this keystroke will be processed as a goto. nMode := AC_GOTO ENDCASE - + IF nPos > 0 .AND. nMode != AC_GOTO - + nRowsClr := Min( nNumRows, nItems ) nMode := Ach_Limits( @nFrstItem, @nLastItem, @nItems, bSelect, alSelect, acItems ) - + IF nMode == AC_NOITEM nPos := 0 nAtTop := Max( 1, nPos - nNumRows + 1 ) @@ -495,23 +495,23 @@ FUNCTION AChoice( nTop, nLeft, nBottom, nRight, acItems, xSelect, xUserFunc, nPo DO WHILE nPos < nLastItem .AND. !Eval( bSelect, alSelect[ nPos ] ) nPos++ ENDDO - + IF nPos > nLastItem nPos := BETWEEN( nFrstItem, nPos, nLastItem ) ENDIF - + nAtTop := Min( nAtTop, nPos ) - + IF nAtTop + nNumRows - 1 > nItems nAtTop := BETWEEN( 1, nPos - nNumRows + 1, nItems - nNumRows + 1 ) ENDIF - + IF nAtTop < 1 nAtTop := 1 ENDIF - + ENDIF - + DispPage( acItems, alSelect, nTop, nLeft, nRight, nNumRows, nPos, nAtTop, nItems, bSelect, nRowsClr ) ENDIF ELSE @@ -542,8 +542,6 @@ STATIC PROCEDURE DispPage( acItems, alSelect, nTop, nLeft, nRight, nNumRows, nPo LOCAL nCntr LOCAL nRow // Screen row LOCAL nIndex // Array index - LOCAL nSaveRow := Row() // Position at start of routine - LOCAL nSaveCol := Col() // Position at start of routine DEFAULT nRowsClr TO nNumRows @@ -558,14 +556,12 @@ STATIC PROCEDURE DispPage( acItems, alSelect, nTop, nLeft, nRight, nNumRows, nPo DispLine( acItems[ nIndex ], nRow, nLeft, Eval( bSelect, alSelect[ nIndex ] ), nIndex == nPos, nRight - nLeft + 1 ) ELSE ColorSelect( CLR_STANDARD ) - DispOutAt( nRow, nLeft, Space( nRight - nLeft + 1 ) ) + hb_dispOutAt( nRow, nLeft, Space( nRight - nLeft + 1 ) ) ENDIF NEXT DispEnd() - SetPos( nSaveRow, nSaveCol ) - RETURN STATIC PROCEDURE DispLine( cLine, nRow, nCol, lSelect, lHiLite, nNumCols ) @@ -573,7 +569,7 @@ STATIC PROCEDURE DispLine( cLine, nRow, nCol, lSelect, lHiLite, nNumCols ) ColorSelect( iif( lSelect .AND. ISCHARACTER( cLine ), ; iif( lHiLite, CLR_ENHANCED, CLR_STANDARD ), CLR_UNSELECTED ) ) - DispOutAt( nRow, nCol, iif( ISCHARACTER( cLine ), PadR( cLine, nNumCols ), Space( nNumCols ) ) ) + hb_dispOutAt( nRow, nCol, iif( ISCHARACTER( cLine ), PadR( cLine, nNumCols ), Space( nNumCols ) ) ) ColorSelect( CLR_STANDARD ) diff --git a/harbour/source/rtl/browse.prg b/harbour/source/rtl/browse.prg index 64c8a5d67b..33453d3e1b 100644 --- a/harbour/source/rtl/browse.prg +++ b/harbour/source/rtl/browse.prg @@ -80,10 +80,10 @@ FUNCTION Browse( nTop, nLeft, nBottom, nRight ) nOldCursor := SetCursor( SC_NONE ) cOldScreen := SaveScreen( nTop, nLeft, nBottom, nRight ) - DispBox( nTop, nLeft, nBottom, nRight, B_DOUBLE_SINGLE ) - DispBox( nTop + 3, nLeft, nTop + 3, nLeft, chr( 198 ) ) - DispBox( nTop + 3, nRight, nTop + 3, nRight, chr( 181 ) ) - DispOutAt( nTop + 1, nLeft + 1, Space( nRight - nLeft - 1 ) ) + hb_dispBox( nTop, nLeft, nBottom, nRight, B_DOUBLE_SINGLE ) + hb_dispBox( nTop + 3, nLeft, nTop + 3, nLeft, chr( 198 ) ) + hb_dispBox( nTop + 3, nRight, nTop + 3, nRight, chr( 181 ) ) + hb_dispOutAt( nTop + 1, nLeft + 1, Space( nRight - nLeft - 1 ) ) oBrw := TBrowseDB( nTop + 2, nLeft + 1, nBottom - 1, nRight - 1 ) oBrw:HeadSep := " " + Chr( 205 ) @@ -293,18 +293,18 @@ STATIC PROCEDURE StatLine( oBrw, lAppend ) LOCAL nTop := oBrw:nTop - 1 LOCAL nRight := oBrw:nRight - DispOutAt( nTop, nRight - 27, "Record " ) + hb_dispOutAt( nTop, nRight - 27, "Record " ) IF LastRec() == 0 .AND. ! lAppend - DispOutAt( nTop, nRight - 20, " " ) + hb_dispOutAt( nTop, nRight - 20, " " ) ELSEIF RecNo() == LastRec() + 1 - DispOutAt( nTop, nRight - 40, " " ) - DispOutAt( nTop, nRight - 20, " " ) + hb_dispOutAt( nTop, nRight - 40, " " ) + hb_dispOutAt( nTop, nRight - 20, " " ) ELSE - DispOutAt( nTop, nRight - 40, iif( Deleted(), "", " " ) ) - DispOutAt( nTop, nRight - 20, PadR( LTrim( Str( RecNo() ) ) + "/" + ; - LTrim( Str( LastRec() ) ), 16 ) + ; - iif( oBrw:HitTop(), "", " " ) ) + hb_dispOutAt( nTop, nRight - 40, iif( Deleted(), "", " " ) ) + hb_dispOutAt( nTop, nRight - 20, PadR( LTrim( Str( RecNo() ) ) + "/" + ; + LTrim( Str( LastRec() ) ), 16 ) + ; + iif( oBrw:HitTop(), "", " " ) ) ENDIF RETURN diff --git a/harbour/source/rtl/checkbox.prg b/harbour/source/rtl/checkbox.prg index 1657b6c853..8ea76db5cc 100644 --- a/harbour/source/rtl/checkbox.prg +++ b/harbour/source/rtl/checkbox.prg @@ -189,23 +189,19 @@ METHOD hitTest( nMRow, nMCol ) CLASS CHECKBOX METHOD display() CLASS CHECKBOX - LOCAL cOldColor := SetColor() - LOCAL nOldRow := Row() - LOCAL nOldCol := Col() - LOCAL lOldMCur := MSetCursor( .F. ) - + LOCAL cColor LOCAL cStyle := ::cStyle LOCAL cCaption LOCAL nPos DispBegin() - DispOutAt( ::nRow, ::nCol + 1, iif( ::lBuffer, SubStr( cStyle, 2, 1 ), SubStr( cStyle, 3, 1 ) ),; - hb_ColorIndex( ::cColorSpec, iif( ::lHasFocus, 1, 0 ) ) ) + hb_dispOutAt( ::nRow, ::nCol + 1, iif( ::lBuffer, SubStr( cStyle, 2, 1 ), SubStr( cStyle, 3, 1 ) ),; + hb_ColorIndex( ::cColorSpec, iif( ::lHasFocus, 1, 0 ) ) ) - SetColor( hb_ColorIndex( ::cColorSpec, 2 ) ) - DispOutAt( ::nRow, ::nCol, Left( cStyle, 1 ) ) - DispOutAt( ::nRow, ::nCol + 2, Right( cStyle, 1 ) ) + cColor := hb_ColorIndex( ::cColorSpec, 2 ) + hb_dispOutAt( ::nRow, ::nCol, Left( cStyle, 1 ), cColor ) + hb_dispOutAt( ::nRow, ::nCol + 2, Right( cStyle, 1 ), cColor ) IF !Empty( cCaption := ::cCaption ) @@ -217,23 +213,20 @@ METHOD display() CLASS CHECKBOX ENDIF IF ::lHasFocus - SetColor( hb_ColorIndex( ::cColorSpec, 3 ) ) + cColor := hb_ColorIndex( ::cColorSpec, 3 ) ENDIF - DispOutAt( ::nCapRow, ::nCapCol, cCaption ) + hb_dispOutAt( ::nCapRow, ::nCapCol, cCaption, cColor ) IF !::lHasFocus .AND. nPos != 0 - DispOutAt( ::nCapRow, ::nCapCol + nPos - 1, SubStr( cCaption, nPos, 1 ), hb_ColorIndex( ::cColorSpec, 3 ) ) + hb_dispOutAt( ::nCapRow, ::nCapCol + nPos - 1, SubStr( cCaption, nPos, 1 ), ; + hb_ColorIndex( ::cColorSpec, 3 ) ) ENDIF ENDIF DispEnd() - MSetCursor( lOldMCur ) - SetColor( cOldColor ) - SetPos( nOldRow, nOldCol ) - RETURN Self METHOD bitmaps( aBitmaps ) CLASS CHECKBOX diff --git a/harbour/source/rtl/getsys.prg b/harbour/source/rtl/getsys.prg index e981d91347..f316f00328 100644 --- a/harbour/source/rtl/getsys.prg +++ b/harbour/source/rtl/getsys.prg @@ -284,8 +284,6 @@ PROCEDURE __SetFormat( bFormat ) FUNCTION RangeCheck( oGet, xDummy, xLow, xHigh ) LOCAL xValue LOCAL cMessage - LOCAL nOldRow - LOCAL nOldCol HB_SYMBOL_UNUSED( xDummy ) @@ -300,21 +298,16 @@ FUNCTION RangeCheck( oGet, xDummy, xLow, xHigh ) ENDIF IF Set( _SET_SCOREBOARD ) - + cMessage := Left( __NatMsg( _GET_RANGE_FROM ) + LTrim( Transform( xLow, "" ) ) + ; __NatMsg( _GET_RANGE_TO ) + LTrim( Transform( xHigh, "" ) ), MaxCol() ) - nOldRow := Row() - nOldCol := Col() - - DispOutAt( SCORE_ROW, Min( 60, MaxCol() - Len( cMessage ) ), cMessage ) - SetPos( nOldRow, nOldCol ) + hb_dispOutAt( SCORE_ROW, Min( 60, MaxCol() - Len( cMessage ) ), cMessage ) DO WHILE NextKey() == 0 ENDDO - DispOutAt( SCORE_ROW, Min( 60, MaxCol() - Len( cMessage ) ), Space( Len( cMessage ) ) ) - SetPos( nOldRow, nOldCol ) + hb_dispOutAt( SCORE_ROW, Min( 60, MaxCol() - Len( cMessage ) ), Space( Len( cMessage ) ) ) ENDIF diff --git a/harbour/source/rtl/listbox.prg b/harbour/source/rtl/listbox.prg index b3a95c9ad3..f9954513cf 100644 --- a/harbour/source/rtl/listbox.prg +++ b/harbour/source/rtl/listbox.prg @@ -227,10 +227,9 @@ METHOD delItem( nPos ) METHOD display() CLASS LISTBOX - LOCAL cOldColor := SetColor() - LOCAL nOldRow := Row() - LOCAL nOldCol := Col() - LOCAL lOldMCur := MSetCursor( .F. ) + LOCAL nOldRow + LOCAL nOldCol + LOCAL cOldColor LOCAL nItem LOCAL nEnd @@ -243,7 +242,7 @@ METHOD display() CLASS LISTBOX LOCAL cHotBox LOCAL cCaption LOCAL nPos - + IF ::lHasFocus cHotBox := ::cHotBox cColor3 := hb_ColorIndex( ::cColorSpec, 2 ) @@ -262,11 +261,11 @@ METHOD display() CLASS LISTBOX IF ::lDropDown - DispOutAt( nTop++, nLeft,; + hb_dispOutAt( nTop, nLeft,; iif( ::nValue == 0, Space( nSize - 1 ), PadR( ::aItems[ ::nValue ][ _ITEM_cTEXT ], nSize - 1 ) ),; cColorAny ) - DispOut( ::cStyle, hb_ColorIndex( ::cColorSpec, 7 ) ) + hb_dispOutAt( nTop++, nLeft + nSize - 1, ::cStyle, hb_ColorIndex( ::cColorSpec, 7 ) ) nEnd-- ENDIF @@ -274,6 +273,10 @@ METHOD display() CLASS LISTBOX IF ::lIsOpen IF !Empty( cHotBox ) + nOldRow := Row() + nOldCol := Col() + cOldColor := SetColor() + SetColor( hb_ColorIndex( ::cColorSpec, 4 ) ) Scroll( nTop, nLeft, ::nBottom, ::nRight ) DispBox( nTop, nLeft, ::nBottom, ::nRight, cHotBox ) @@ -282,6 +285,9 @@ METHOD display() CLASS LISTBOX ::oVScroll:display() ENDIF + SetColor( cOldColor ) + SetPos( nOldRow, nOldCol ) + nTop++ nLeft++ nSize -= 2 @@ -294,7 +300,7 @@ METHOD display() CLASS LISTBOX ENDIF FOR nItem := ::nTopItem TO nEnd - DispOutAt( nTop++, nLeft, PadR( ::aItems[ nItem ][ _ITEM_cTEXT ], nSize ), iif( nItem == ::nValue, cColor4, cColor3 ) ) + hb_dispOutAt( nTop++, nLeft, PadR( ::aItems[ nItem ][ _ITEM_cTEXT ], nSize ), iif( nItem == ::nValue, cColor4, cColor3 ) ) NEXT ENDIF @@ -307,19 +313,16 @@ METHOD display() CLASS LISTBOX cCaption := Stuff( cCaption, nPos, 1, "" ) ENDIF - DispOutAt( ::nCapRow, ::nCapCol - 1, cCaption, hb_ColorIndex( ::cColorSpec, 5 ) ) + hb_dispOutAt( ::nCapRow, ::nCapCol - 1, cCaption, hb_ColorIndex( ::cColorSpec, 5 ) ) IF nPos != 0 - DispOutAt( ::nCapRow, ::nCapCol + nPos - 2, SubStr( cCaption, nPos, 1 ), hb_ColorIndex( ::cColorSpec, 6 ) ) + hb_dispOutAt( ::nCapRow, ::nCapCol + nPos - 2, SubStr( cCaption, nPos, 1 ), hb_ColorIndex( ::cColorSpec, 6 ) ) ENDIF ENDIF DispEnd() - MSetCursor( lOldMCur ) - SetColor( cOldColor ) - SetPos( nOldRow, nOldCol ) RETURN Self diff --git a/harbour/source/rtl/pushbtn.prg b/harbour/source/rtl/pushbtn.prg index a1d48c817c..989d0541e0 100644 --- a/harbour/source/rtl/pushbtn.prg +++ b/harbour/source/rtl/pushbtn.prg @@ -205,11 +205,7 @@ METHOD hitTest( nMRow, nMCol ) CLASS PUSHBUTTON METHOD display() CLASS PUSHBUTTON - LOCAL cOldColor := SetColor() - LOCAL nOldRow := Row() - LOCAL nOldCol := Col() - LOCAL lOldMCur := MSetCursor( .F. ) - + LOCAL cColor LOCAL cStyle := ::cStyle LOCAL cCaption := ::cCaption LOCAL nRow := ::nRow @@ -219,11 +215,11 @@ METHOD display() CLASS PUSHBUTTON DispBegin() IF ::lBuffer - SetColor( hb_ColorIndex( ::cColorSpec, 2 ) ) + cColor := hb_ColorIndex( ::cColorSpec, 2 ) ELSEIF ::lHasFocus - SetColor( hb_ColorIndex( ::cColorSpec, 1 ) ) + cColor := hb_ColorIndex( ::cColorSpec, 1 ) ELSE - SetColor( hb_ColorIndex( ::cColorSpec, 0 ) ) + cColor := hb_ColorIndex( ::cColorSpec, 0 ) ENDIF IF ( nPos := At( "&", cCaption ) ) == 0 @@ -238,30 +234,26 @@ METHOD display() CLASS PUSHBUTTON nCol++ IF Len( cStyle ) == 2 - DispOutAt( ::nRow, ::nCol, SubStr( cStyle, 1, 1 ) ) - DispOutAt( ::nRow, ::nCol + Len( cCaption ) + 1, SubStr( cStyle, 2, 1 ) ) + hb_dispOutAt( ::nRow, ::nCol, SubStr( cStyle, 1, 1 ), cColor ) + hb_dispOutAt( ::nRow, ::nCol + Len( cCaption ) + 1, SubStr( cStyle, 2, 1 ), cColor ) ELSE nRow++ - DispBox( ::nRow, ::nCol, ::nRow + 2, ::nCol + Len( cCaption ) + 1, cStyle ) + hb_dispBox( ::nRow, ::nCol, ::nRow + 2, ::nCol + Len( cCaption ) + 1, cStyle, cColor ) ENDIF ENDIF IF !Empty( cCaption ) - DispOutAt( nRow, nCol, cCaption ) + hb_dispOutAt( nRow, nCol, cCaption, cColor ) IF nPos != 0 - DispOutAt( nRow, nCol + nPos - 1, SubStr( cCaption, nPos, 1 ), hb_ColorIndex( ::cColorSpec, 3 ) ) + hb_dispOutAt( nRow, nCol + nPos - 1, SubStr( cCaption, nPos, 1 ), hb_ColorIndex( ::cColorSpec, 3 ) ) ENDIF ENDIF DispEnd() - MSetCursor( lOldMCur ) - SetColor( cOldColor ) - SetPos( nOldRow, nOldCol ) - RETURN Self METHOD bitmap( cBitmap ) CLASS PUSHBUTTON diff --git a/harbour/source/rtl/radiobtn.prg b/harbour/source/rtl/radiobtn.prg index cedf5f2579..ade6318c83 100644 --- a/harbour/source/rtl/radiobtn.prg +++ b/harbour/source/rtl/radiobtn.prg @@ -154,23 +154,18 @@ METHOD killFocus() CLASS RADIOBUTTN RETURN Self METHOD display() CLASS RADIOBUTTN - - LOCAL cOldColor := SetColor() - LOCAL nOldRow := Row() - LOCAL nOldCol := Col() - LOCAL lOldMCur := MSetCursor( .F. ) + LOCAL cColor LOCAL cStyle := ::cStyle LOCAL nPos LOCAL cOldCaption DispBegin() - SetColor( iif( ::lBuffer, hb_ColorIndex( ::cColorSpec, 3 ), hb_ColorIndex( ::cColorSpec, 1 ) ) ) - SetPos( ::nRow, ::nCol ) - DispOut( Left( cStyle, 1 ) ) - DispOut( iif( ::lBuffer, SubStr( cStyle, 2, 1 ), SubStr( cStyle, 3, 1 ) ) ) - DispOut( Right( cStyle, 1 ) ) + cColor := iif( ::lBuffer, hb_ColorIndex( ::cColorSpec, 3 ), hb_ColorIndex( ::cColorSpec, 1 ) ) + hb_dispOutAt( ::nRow, ::nCol, Left( cStyle, 1 ), cColor ) + hb_dispOutAt( ::nRow, ::nCol + 1, iif( ::lBuffer, SubStr( cStyle, 2, 1 ), SubStr( cStyle, 3, 1 ) ), cColor ) + hb_dispOutAt( ::nRow, ::nCol + 3, Right( cStyle, 1 ), cColor ) IF !Empty( cOldCaption := ::cCaption ) @@ -181,19 +176,15 @@ METHOD display() CLASS RADIOBUTTN cOldCaption := Stuff( cOldCaption, nPos, 1, "" ) ENDIF - DispOutAt( ::nCapRow, ::nCapCol, cOldCaption, hb_ColorIndex( ::cColorSpec, 4 ) ) + hb_dispOutAt( ::nCapRow, ::nCapCol, cOldCaption, hb_ColorIndex( ::cColorSpec, 4 ) ) IF nPos != 0 - DispOutAt( ::nCapRow, ::nCapCol + nPos - 1, SubStr( cOldCaption, nPos, 1 ), iif( ::lHasfocus, hb_ColorIndex( ::cColorSpec, 6 ), hb_ColorIndex( ::cColorSpec, 5 ) ) ) + hb_dispOutAt( ::nCapRow, ::nCapCol + nPos - 1, SubStr( cOldCaption, nPos, 1 ), iif( ::lHasfocus, hb_ColorIndex( ::cColorSpec, 6 ), hb_ColorIndex( ::cColorSpec, 5 ) ) ) ENDIF ENDIF DispEnd() - MSetCursor( lOldMCur ) - SetColor( cOldColor ) - SetPos( nOldRow, nOldCol ) - RETURN Self METHOD isAccel( xKey ) CLASS RADIOBUTTN diff --git a/harbour/source/rtl/radiogrp.prg b/harbour/source/rtl/radiogrp.prg index c4d2fca13e..2937b1c502 100644 --- a/harbour/source/rtl/radiogrp.prg +++ b/harbour/source/rtl/radiogrp.prg @@ -161,11 +161,6 @@ METHOD delItem( nPos ) CLASS RADIOGROUP METHOD display() CLASS RADIOGROUP - LOCAL cOldColor := SetColor() - LOCAL nOldRow := Row() - LOCAL nOldCol := Col() - LOCAL lOldMCur := MSetCursor( .F. ) - LOCAL cSelBox LOCAL cUnSelBox LOCAL cCaption @@ -181,12 +176,10 @@ METHOD display() CLASS RADIOGROUP cUnSelBox := ::cHotBox ENDIF - SetColor( hb_ColorIndex( ::cColorSpec, 0 ) ) - IF !Empty( cSelBox ) - DispBox( ::nTop, ::nLeft, ::nBottom, ::nRight, cSelBox ) + hb_dispBox( ::nTop, ::nLeft, ::nBottom, ::nRight, cSelBox, hb_ColorIndex( ::cColorSpec, 0 ) ) ELSEIF !Empty( cUnSelBox ) - DispBox( ::nTop, ::nLeft, ::nBottom, ::nRight, cUnSelBox ) + hb_dispBox( ::nTop, ::nLeft, ::nBottom, ::nRight, cUnSelBox, hb_ColorIndex( ::cColorSpec, 0 ) ) ENDIF IF !Empty( cCaption := ::cCaption ) @@ -199,10 +192,10 @@ METHOD display() CLASS RADIOGROUP ENDIF ENDIF - DispOutAt( ::nCapRow, ::nCapCol, cCaption, hb_ColorIndex( ::cColorSpec, 1 ) ) + hb_dispOutAt( ::nCapRow, ::nCapCol, cCaption, hb_ColorIndex( ::cColorSpec, 1 ) ) IF nPos != 0 - DispOutAt( ::nCapRow, ::nCapCol + nPos - 1, SubStr( cCaption, nPos, 1 ), hb_ColorIndex( ::cColorSpec, 2 ) ) + hb_dispOutAt( ::nCapRow, ::nCapCol + nPos - 1, SubStr( cCaption, nPos, 1 ), hb_ColorIndex( ::cColorSpec, 2 ) ) ENDIF ENDIF @@ -211,10 +204,6 @@ METHOD display() CLASS RADIOGROUP DispEnd() - MSetCursor( lOldMCur ) - SetColor( cOldColor ) - SetPos( nOldRow, nOldCol ) - RETURN Self METHOD getAccel( xValue ) CLASS RADIOGROUP diff --git a/harbour/source/rtl/scrollbr.prg b/harbour/source/rtl/scrollbr.prg index 74082782d7..cd0139e2aa 100644 --- a/harbour/source/rtl/scrollbr.prg +++ b/harbour/source/rtl/scrollbr.prg @@ -113,11 +113,7 @@ ENDCLASS METHOD display() CLASS SCROLLBAR - LOCAL cOldColor - LOCAL nOldRow - LOCAL nOldCol - LOCAL lOldMCur - + LOCAL cColor LOCAL cStyle LOCAL nOffset LOCAL nStart @@ -126,46 +122,37 @@ METHOD display() CLASS SCROLLBAR IF ::CalcThumbPos() - cOldColor := SetColor() - nOldRow := Row() - nOldCol := Col() - lOldMCur := MSetCursor( .F. ) - cStyle := ::cStyle nOffset := ::nOffset nStart := ::nStart nEnd := ::nEnd - 1 - + DispBegin() - - SetColor( hb_ColorIndex( ::cColorSpec, 0 ) ) - + + cColor := hb_ColorIndex( ::cColorSpec, 0 ) + IF ::nOrient == SCROLL_VERTICAL FOR nPos := nStart + 1 TO nEnd - DispOutAt( nPos, nOffset, SubStr( cStyle, 2, 1 ) ) + hb_dispOutAt( nPos, nOffset, SubStr( cStyle, 2, 1 ), cColor ) NEXT - SetColor( hb_ColorIndex( ::cColorSpec, 1 ) ) - DispOutAt( nStart, nOffset, SubStr( cStyle, 1, 1 ) ) - DispOutAt( nStart + ::nThumbPos, nOffset, SubStr( cStyle, 3, 1 ) ) - DispOutAt( nEnd + 1, nOffset, SubStr( cStyle, 4, 1 ) ) + cColor := hb_ColorIndex( ::cColorSpec, 1 ) + hb_dispOutAt( nStart, nOffset, SubStr( cStyle, 1, 1 ), cColor ) + hb_dispOutAt( nStart + ::nThumbPos, nOffset, SubStr( cStyle, 3, 1 ), cColor ) + hb_dispOutAt( nEnd + 1, nOffset, SubStr( cStyle, 4, 1 ), cColor ) ELSE - DispOutAt( nOffset, nStart + 1, Replicate( SubStr( cStyle, 2, 1 ), nEnd - nStart ) ) - - SetColor( hb_ColorIndex( ::cColorSpec, 1 ) ) - DispOutAt( nOffset, nStart, SubStr( cStyle, 1, 1 ) ) - DispOutAt( nOffset, nStart + ::nThumbPos, SubStr( cStyle, 3, 1 ) ) - DispOutAt( nOffset, nEnd + 1, SubStr( cStyle, 4, 1 ) ) + hb_dispOutAt( nOffset, nStart + 1, Replicate( SubStr( cStyle, 2, 1 ), nEnd - nStart ), cColor ) + + cColor := hb_ColorIndex( ::cColorSpec, 1 ) + hb_dispOutAt( nOffset, nStart, SubStr( cStyle, 1, 1 ), cColor ) + hb_dispOutAt( nOffset, nStart + ::nThumbPos, SubStr( cStyle, 3, 1 ), cColor ) + hb_dispOutAt( nOffset, nEnd + 1, SubStr( cStyle, 4, 1 ), cColor ) ENDIF - + DispEnd() - - MSetCursor( lOldMCur ) - SetColor( cOldColor ) - SetPos( nOldRow, nOldCol ) RETURN .T. ENDIF @@ -174,10 +161,6 @@ METHOD display() CLASS SCROLLBAR METHOD update() CLASS SCROLLBAR - LOCAL nOldRow - LOCAL nOldCol - LOCAL lOldMCur - LOCAL nOldThumbPos := ::nThumbPos IF ISBLOCK( ::bSBlock ) @@ -186,25 +169,18 @@ METHOD update() CLASS SCROLLBAR IF ::CalcThumbPos() .AND. nOldThumbPos != ::nThumbPos - nOldRow := Row() - nOldCol := Col() - lOldMCur := MSetCursor( .F. ) - DispBegin() IF ::nOrient == SCROLL_VERTICAL - DispOutAt( ::nStart + nOldThumbPos, ::nOffSet, SubStr( ::cStyle, 2, 1), hb_ColorIndex( ::cColorSpec, 0 ) ) - DispOutAt( ::nStart + ::nThumbPos, ::nOffset, SubStr( ::cStyle, 3, 1 ), hb_ColorIndex( ::cColorSpec, 1 ) ) + hb_dispOutAt( ::nStart + nOldThumbPos, ::nOffSet, SubStr( ::cStyle, 2, 1), hb_ColorIndex( ::cColorSpec, 0 ) ) + hb_dispOutAt( ::nStart + ::nThumbPos, ::nOffset, SubStr( ::cStyle, 3, 1 ), hb_ColorIndex( ::cColorSpec, 1 ) ) ELSE - DispOutAt( ::nOffset, ::nStart + nOldThumbPos, SubStr( ::cStyle, 2, 1 ), hb_ColorIndex( ::cColorSpec, 0 ) ) - DispOutAt( ::nOffset, ::nStart + ::nThumbPos, SubStr( ::cStyle, 3, 1 ), hb_ColorIndex( ::cColorSpec, 1 ) ) + hb_dispOutAt( ::nOffset, ::nStart + nOldThumbPos, SubStr( ::cStyle, 2, 1 ), hb_ColorIndex( ::cColorSpec, 0 ) ) + hb_dispOutAt( ::nOffset, ::nStart + ::nThumbPos, SubStr( ::cStyle, 3, 1 ), hb_ColorIndex( ::cColorSpec, 1 ) ) ENDIF DispEnd() - MSetCursor( lOldMCur ) - SetPos( nOldRow, nOldCol ) - RETURN .T. ENDIF diff --git a/harbour/source/rtl/tbrowse.prg b/harbour/source/rtl/tbrowse.prg index 1e71734664..89bc6c4a84 100644 --- a/harbour/source/rtl/tbrowse.prg +++ b/harbour/source/rtl/tbrowse.prg @@ -398,8 +398,8 @@ STATIC PROCEDURE _DISP_FHSEP( nRow, nType, cColor, aColData ) ELSEIF aCol[ _TBCI_LASTSPACE ] < 0 cSep := Left( cSep, Len( cSep ) + aCol[ _TBCI_LASTSPACE ] ) ENDIF - DispOutAt( nRow, aCol[ _TBCI_COLPOS ] - aCol[ _TBCI_FROZENSPACE ], ; - cSep, cColor ) + hb_dispOutAt( nRow, aCol[ _TBCI_COLPOS ] - aCol[ _TBCI_FROZENSPACE ], ; + cSep, cColor ) ELSEIF aCol[ _TBCI_CELLWIDTH ] > 0 lFirst := .F. ENDIF @@ -417,8 +417,8 @@ STATIC PROCEDURE _DISP_FHNAME( nRow, nHeight, nLeft, nRight, nType, nColor, aCol LOCAL nWidth LOCAL lFirst := .T. - DispBox( nRow, nLeft, nRow + nHeight - 1, nRight, ; - Space( 9 ), aColors[ _TBC_CLR_STANDARD ] ) + hb_dispBox( nRow, nLeft, nRow + nHeight - 1, nRight, ; + Space( 9 ), aColors[ _TBC_CLR_STANDARD ] ) FOR EACH aCol IN aColData IF aCol[ _TBCI_COLPOS ] != NIL @@ -434,10 +434,10 @@ STATIC PROCEDURE _DISP_FHNAME( nRow, nHeight, nLeft, nRight, nType, nColor, aCol nWidth += aCol[ _TBCI_LASTSPACE ] ENDIF FOR nPos := 1 TO nHeight - DispOutAt( nRow + nPos - 1, nCol, ; - PadR( hb_tokenGet( cName, nPos, _TBR_CHR_LINEDELIMITER ), nWidth ), ; - iif( aCol[ _TBCI_DEFCOLOR ][ nColor ] == 0, "N/N", ; - aColors[ aCol[ _TBCI_DEFCOLOR ][ nColor ] ] ) ) + hb_dispOutAt( nRow + nPos - 1, nCol, ; + PadR( hb_tokenGet( cName, nPos, _TBR_CHR_LINEDELIMITER ), nWidth ), ; + iif( aCol[ _TBCI_DEFCOLOR ][ nColor ] == 0, "N/N", ; + aColors[ aCol[ _TBCI_DEFCOLOR ][ nColor ] ] ) ) NEXT ENDIF NEXT @@ -454,7 +454,7 @@ METHOD dispFrames() CLASS TBROWSE DispBegin() IF ::lInvalid .AND. !Empty( ::cBorder ) - DispBox( ::nTop, ::nLeft, ::nBottom, ::nRight, ::cBorder, ::colorValue( _TBC_CLR_STANDARD ) ) + hb_dispBox( ::nTop, ::nLeft, ::nBottom, ::nRight, ::cBorder, ::colorValue( _TBC_CLR_STANDARD ) ) ENDIF IF ::nHeadHeight > 0 @@ -498,7 +498,7 @@ METHOD dispRow( nRow ) CLASS TBROWSE nRowPos := ::n_Top + ::nHeadHeight + iif( ::lHeadSep, 1, 0 ) + nRow - 1 cStdColor := ::colorValue( _TBC_CLR_STANDARD ) - DispBox( nRowPos, ::n_Left, nRowPos, ::n_Right, Space( 9 ), cStdColor ) + hb_dispBox( nRowPos, ::n_Left, nRowPos, ::n_Right, Space( 9 ), cStdColor ) lFirst := .T. FOR EACH aCol, cValue, aColors IN ::aColData, ::aCellValues[ nRow ], ::aCellColors[ nRow ] @@ -507,21 +507,21 @@ METHOD dispRow( nRow ) CLASS TBROWSE IF lFirst lFirst := .F. ELSEIF aCol[ _TBCI_SEPWIDTH ] > 0 - DispOutAt( nRowPos, aCol[ _TBCI_COLPOS ] - aCol[ _TBCI_FROZENSPACE ], ; - aCol[ _TBCI_COLSEP ], cStdColor ) + hb_dispOutAt( nRowPos, aCol[ _TBCI_COLPOS ] - aCol[ _TBCI_FROZENSPACE ], ; + aCol[ _TBCI_COLSEP ], cStdColor ) nColPos += aCol[ _TBCI_SEPWIDTH ] ENDIF nColPos += aCol[ _TBCI_CELLPOS ] cColor := ::colorValue( aColors[ _TBC_CLR_STANDARD ] ) IF aCol[ _TBCI_LASTSPACE ] < 0 - DispOutAt( nRowPos, nColPos, ; - Left( cValue, ::n_Right - nColPos + 1 ), cColor ) + hb_dispOutAt( nRowPos, nColPos, ; + Left( cValue, ::n_Right - nColPos + 1 ), cColor ) ELSE #ifdef HB_C52_STRICT - DispOutAt( nRowPos, nColPos, ; - Left( cValue, aCol[ _TBCI_COLWIDTH ] - aCol[ _TBCI_CELLPOS ] ), cColor ) + hb_dispOutAt( nRowPos, nColPos, ; + Left( cValue, aCol[ _TBCI_COLWIDTH ] - aCol[ _TBCI_CELLPOS ] ), cColor ) #else - DispOutAt( nRowPos, nColPos, cValue, cColor ) + hb_dispOutAt( nRowPos, nColPos, cValue, cColor ) #endif ENDIF ENDIF @@ -1839,7 +1839,7 @@ METHOD hiLite() CLASS TBROWSE IF ::n_Col + Len( cValue ) > _TBR_COORD( ::n_Right ) cValue := Left( cValue, _TBR_COORD( ::n_Right ) - ::n_Col + 1 ) ENDIF - DispOut( cValue, cColor ) + hb_dispOutAt( ::n_Row, ::n_Col, cValue, cColor ) SetPos( ::n_Row, ::n_Col ) ::lHiLited := .T. ENDIF @@ -1866,7 +1866,7 @@ METHOD deHilite() CLASS TBROWSE IF ::n_Col + Len( cValue ) > _TBR_COORD( ::n_Right ) cValue := Left( cValue, _TBR_COORD( ::n_Right ) - ::n_Col + 1 ) ENDIF - DispOut( cValue, cColor ) + hb_dispOutAt( ::n_Row, ::n_Col, cValue, cColor ) SetPos( ::n_Row, ::n_Col ) ENDIF ENDIF diff --git a/harbour/source/rtl/teditor.prg b/harbour/source/rtl/teditor.prg index c070399cef..598bb13f2f 100644 --- a/harbour/source/rtl/teditor.prg +++ b/harbour/source/rtl/teditor.prg @@ -405,11 +405,12 @@ METHOD display() CLASS HBEditor LOCAL i LOCAL nOCol := ::Col() LOCAL nORow := ::Row() - LOCAL nOCur := SetCursor( SC_NONE ) LOCAL cOldColor + DispBegin() + FOR i := 0 TO Min( ::nNumRows - 1, ::naTextLen - 1 ) - DispOutAt( ::nTop + i, ::nLeft, PadR( SubStr( ::GetLine( ::nFirstRow + i ), ::nFirstCol, ::nNumCols ), ::nNumCols, " " ), ::LineColor( ::nFirstRow + i ) ) + hb_dispOutAt( ::nTop + i, ::nLeft, PadR( SubStr( ::GetLine( ::nFirstRow + i ), ::nFirstCol, ::nNumCols ), ::nNumCols, " " ), ::LineColor( ::nFirstRow + i ) ) NEXT // Clear rest of editor window (needed when deleting lines of text) @@ -419,20 +420,16 @@ METHOD display() CLASS HBEditor SetColor( cOldColor ) ENDIF - SetCursor( nOCur ) ::SetPos( nORow, nOCol ) + DispEnd() + RETURN Self // Redraws current screen line METHOD RefreshLine() CLASS HBEditor - LOCAL nOCol := ::Col() - LOCAL nORow := ::Row() - - DispOutAt( ::Row(), ::nLeft, PadR( SubStr( ::GetLine( ::nRow ), ::nFirstCol, ::nNumCols ), ::nNumCols, " " ), ::LineColor( ::nRow ) ) - - ::SetPos( nORow, nOCol ) + hb_dispOutAt( ::Row(), ::nLeft, PadR( SubStr( ::GetLine( ::nRow ), ::nFirstCol, ::nNumCols ), ::nNumCols, " " ), ::LineColor( ::nRow ) ) RETURN Self @@ -440,16 +437,14 @@ METHOD RefreshLine() CLASS HBEditor METHOD RefreshColumn() CLASS HBEditor LOCAL i - LOCAL nOCol := ::Col() - LOCAL nORow := ::Row() - LOCAL nOCur := SetCursor( SC_NONE ) + + DispBegin() FOR i := 0 TO Min( ::nNumRows - 1, ::naTextLen - 1 ) - DispOutAt( ::nTop + i, nOCol, SubStr( ::GetLine( ::nFirstRow + i ), ::nCol, 1 ), ::LineColor( ::nFirstRow + i ) ) + hb_dispOutAt( ::nTop + i, ::Col(), SubStr( ::GetLine( ::nFirstRow + i ), ::nCol, 1 ), ::LineColor( ::nFirstRow + i ) ) NEXT - SetCursor( nOCur ) - ::SetPos( nORow, nOCol ) + DispEnd() RETURN Self diff --git a/harbour/source/rtl/tget.prg b/harbour/source/rtl/tget.prg index 7102d79c1f..8c1f41475e 100644 --- a/harbour/source/rtl/tget.prg +++ b/harbour/source/rtl/tget.prg @@ -306,9 +306,9 @@ METHOD display() CLASS Get ENDIF ENDIF - DispOutAt( ::nCapRow, ::nCapCol, cCaption, hb_ColorIndex( ::cColorSpec, GET_CLR_CAPTION ) ) + hb_dispOutAt( ::nCapRow, ::nCapCol, cCaption, hb_ColorIndex( ::cColorSpec, GET_CLR_CAPTION ) ) IF nPos > 0 - DispOutAt( ::nCapRow, ::nCapCol + nPos - 1, SubStr( cCaption, nPos, 1 ), hb_ColorIndex( ::cColorSpec, GET_CLR_ACCEL ) ) + hb_dispOutAt( ::nCapRow, ::nCapCol + nPos - 1, SubStr( cCaption, nPos, 1 ), hb_ColorIndex( ::cColorSpec, GET_CLR_ACCEL ) ) ENDIF ENDIF @@ -318,18 +318,18 @@ METHOD display() CLASS Get IF !::lSuppDisplay .OR. nDispPos != ::nOldPos - DispOutAt( ::nRow, ::nCol,; - 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 ) ) ) + hb_dispOutAt( ::nRow, ::nCol,; + 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 ) ) ) IF Set( _SET_DELIMITERS ) .AND. !::hasFocus #ifdef HB_COMPAT_C53 - DispOutAt( ::nRow, ::nCol - 1, SubStr( Set( _SET_DELIMCHARS ), 1, 1 ), hb_ColorIndex( ::cColorSpec, GET_CLR_UNSELECTED ) ) - DispOutAt( ::nRow, ::nCol + ::nDispLen, SubStr( Set( _SET_DELIMCHARS ), 2, 1 ), hb_ColorIndex( ::cColorSpec, GET_CLR_UNSELECTED ) ) + hb_dispOutAt( ::nRow, ::nCol - 1, SubStr( Set( _SET_DELIMCHARS ), 1, 1 ), hb_ColorIndex( ::cColorSpec, GET_CLR_UNSELECTED ) ) + hb_dispOutAt( ::nRow, ::nCol + ::nDispLen, SubStr( Set( _SET_DELIMCHARS ), 2, 1 ), hb_ColorIndex( ::cColorSpec, GET_CLR_UNSELECTED ) ) #else /* NOTE: C5.2 will use the default color. We're replicating this here. [vszakats] */ - DispOutAt( ::nRow, ::nCol - 1, SubStr( Set( _SET_DELIMCHARS ), 1, 1 ) ) - DispOutAt( ::nRow, ::nCol + ::nDispLen, SubStr( Set( _SET_DELIMCHARS ), 2, 1 ) ) + hb_dispOutAt( ::nRow, ::nCol - 1, SubStr( Set( _SET_DELIMCHARS ), 1, 1 ) ) + hb_dispOutAt( ::nRow, ::nCol + ::nDispLen, SubStr( Set( _SET_DELIMCHARS ), 2, 1 ) ) #endif ENDIF ENDIF diff --git a/harbour/source/rtl/tgetlist.prg b/harbour/source/rtl/tgetlist.prg index 2df71c8021..5f96121136 100644 --- a/harbour/source/rtl/tgetlist.prg +++ b/harbour/source/rtl/tgetlist.prg @@ -792,21 +792,9 @@ METHOD GetActive( oGet ) CLASS HBGetList METHOD ShowScoreboard() CLASS HBGetList - LOCAL nRow - LOCAL nCol - LOCAL nOldCursor - IF Set( _SET_SCOREBOARD ) - nRow := Row() - nCol := Col() - - nOldCursor := SetCursor( SC_NONE ) - - DispOutAt( SCORE_ROW, SCORE_COL, iif( Set( _SET_INSERT ), __NatMsg( _GET_INSERT_ON ), __NatMsg( _GET_INSERT_OFF ) ) ) - SetPos( nRow, nCol ) - - SetCursor( nOldCursor ) + hb_dispOutAt( SCORE_ROW, SCORE_COL, iif( Set( _SET_INSERT ), __NatMsg( _GET_INSERT_ON ), __NatMsg( _GET_INSERT_OFF ) ) ) ENDIF @@ -814,22 +802,14 @@ METHOD ShowScoreboard() CLASS HBGetList METHOD DateMsg() CLASS HBGetList - LOCAL nRow - LOCAL nCol - IF Set( _SET_SCOREBOARD ) - nRow := Row() - nCol := Col() - - DispOutAt( SCORE_ROW, SCORE_COL, __NatMsg( _GET_INVD_DATE ) ) - SetPos( nRow, nCol ) + hb_dispOutAt( SCORE_ROW, SCORE_COL, __NatMsg( _GET_INVD_DATE ) ) DO WHILE NextKey() == 0 ENDDO - DispOutAt( SCORE_ROW, SCORE_COL, Space( Len( __NatMsg( _GET_INVD_DATE ) ) ) ) - SetPos( nRow, nCol ) + hb_dispOutAt( SCORE_ROW, SCORE_COL, Space( Len( __NatMsg( _GET_INVD_DATE ) ) ) ) ENDIF @@ -1613,7 +1593,7 @@ METHOD ShowGetMsg( oGet, aMsg ) CLASS HBGetList IF !Empty( cMsg ) lMOldState := MSetCursor( .F. ) - DispOutAt( aMsg[ MSGROW ], aMsg[ MSGLEFT ], PadC( cMsg, aMsg[ MSGRIGHT ] - aMsg[ MSGLEFT ] + 1 ), aMsg[ MSGCOLOR ] ) + hb_dispOutAt( aMsg[ MSGROW ], aMsg[ MSGLEFT ], PadC( cMsg, aMsg[ MSGRIGHT ] - aMsg[ MSGLEFT ] + 1 ), aMsg[ MSGCOLOR ] ) MSetCursor( lMOldState ) ENDIF ENDIF diff --git a/harbour/source/rtl/tmenusys.prg b/harbour/source/rtl/tmenusys.prg index ca39ccb4cd..00e384d78e 100644 --- a/harbour/source/rtl/tmenusys.prg +++ b/harbour/source/rtl/tmenusys.prg @@ -620,7 +620,6 @@ METHOD MHitTest( oNewMenu, nNewLevel, nNewItem ) CLASS HBMenuSys METHOD ShowMsg( lMode ) CLASS HBMenuSys LOCAL nCurrent LOCAL cMsg - LOCAL lMOldState := MSetCursor( .F. ) IF ISLOGICAL( ::lOldMsgFlag ) .AND. ::lOldMsgFlag RestScreen( ::nMsgRow, ::nMsgLeft, ::nMsgRow, ::nMsgRight, ::cMsgSaveS ) @@ -635,7 +634,7 @@ METHOD ShowMsg( lMode ) CLASS HBMenuSys ( nCurrent := ::oMenu:current ) != 0 .AND. ; !Empty( cMsg := ::oMenu:getItem( nCurrent ):message ) - DispOutAt( ::nMsgRow, ::nMsgLeft, PadC( cMsg, ::nMsgRight - ::nMsgLeft + 1 ), ::cMsgColor ) + hb_dispOutAt( ::nMsgRow, ::nMsgLeft, PadC( cMsg, ::nMsgRight - ::nMsgLeft + 1 ), ::cMsgColor ) ENDIF ::cOldMessage := cMsg @@ -643,8 +642,6 @@ METHOD ShowMsg( lMode ) CLASS HBMenuSys ENDIF - MSetCursor( lMOldState ) - RETURN .T. /* NOTE: Generates the somewhat internal, yet widely used message line format of CA-Cl*pper 5.3 diff --git a/harbour/source/rtl/tpopup.prg b/harbour/source/rtl/tpopup.prg index 8bb1381447..3b49bc3cf6 100644 --- a/harbour/source/rtl/tpopup.prg +++ b/harbour/source/rtl/tpopup.prg @@ -136,7 +136,7 @@ METHOD addItem( oItem ) CLASS POPUPMENU AAdd( ::aItems, oItem ) ::nItemCount++ - + ::nWidth := Max( __CapMetrics( oItem ), ::nWidth ) ENDIF @@ -193,17 +193,13 @@ METHOD delItem( nPos ) CLASS POPUPMENU METHOD display() CLASS POPUPMENU - LOCAL nOldRow - LOCAL nOldCol - LOCAL lOldMCur - - LOCAL nTop - LOCAL nLeft - LOCAL aItems + LOCAL nTop + LOCAL nLeft + LOCAL aItems LOCAL nCurrent - LOCAL nLen + LOCAL nLen LOCAL nPos - LOCAL nWidth + LOCAL nWidth LOCAL oPopup LOCAL nHotKeyPos LOCAL cCaption @@ -211,10 +207,6 @@ METHOD display() CLASS POPUPMENU IF ::isOpen() - nOldRow := Row() - nOldCol := Col() - lOldMCur := MSetCursor( .F. ) - ::setMetrics() nTop := ::nTop @@ -225,11 +217,11 @@ METHOD display() CLASS POPUPMENU nWidth := ::nWidth DispBegin() - - DispBox( nTop, nLeft, ::nBottom, ::nRight, ; - SubStr( ::cBorder, 1, 8 ) + " ", ; - hb_ColorIndex( ::cColorSpec, 5 ) ) - + + hb_dispBox( nTop, nLeft, ::nBottom, ::nRight, ; + SubStr( ::cBorder, 1, 8 ) + " ", ; + hb_ColorIndex( ::cColorSpec, 5 ) ) + #ifdef HB_EXTENSION IF ::shadowed hb_Shadow( nTop + 1, nLeft + 1, ::nBottom + 1, ::nRight + 1 ) @@ -243,7 +235,7 @@ METHOD display() CLASS POPUPMENU IF aItems[ nPos ]:caption == MENU_SEPARATOR - DispOutAt( nTop, nLeft - 1, SubStr( ::cBorder, 9, 1 ) + Replicate( SubStr( ::cBorder, 10, 1 ), nWidth ) + SubStr( ::cBorder, 11, 1 ), hb_ColorIndex( ::cColorSpec, 5 ) ) + hb_dispOutAt( nTop, nLeft - 1, SubStr( ::cBorder, 9, 1 ) + Replicate( SubStr( ::cBorder, 10, 1 ), nWidth ) + SubStr( ::cBorder, 11, 1 ), hb_ColorIndex( ::cColorSpec, 5 ) ) ELSE cCaption := PadR( aItems[ nPos ]:caption, nWidth - 1 ) @@ -283,18 +275,15 @@ METHOD display() CLASS POPUPMENU cCaption := Stuff( cCaption, nHotKeyPos, 1, "" ) ENDIF - DispOutAt( nTop, nLeft, cCaption, hb_ColorIndex( ::cColorSpec, iif( nPos == nCurrent, 1, iif( aItems[ nPos ]:enabled, 0, 4 ) ) ) ) + hb_dispOutAt( nTop, nLeft, cCaption, hb_ColorIndex( ::cColorSpec, iif( nPos == nCurrent, 1, iif( aItems[ nPos ]:enabled, 0, 4 ) ) ) ) IF aItems[ nPos ]:enabled .AND. nHotKeyPos != 0 - DispOutAt( nTop, nLeft + nHotKeyPos - 1, SubStr( cCaption, nHotKeyPos, 1 ), hb_ColorIndex( ::cColorSpec, iif( nPos == nCurrent, 3, 2 ) ) ) + hb_dispOutAt( nTop, nLeft + nHotKeyPos - 1, SubStr( cCaption, nHotKeyPos, 1 ), hb_ColorIndex( ::cColorSpec, iif( nPos == nCurrent, 3, 2 ) ) ) ENDIF ENDIF NEXT - - DispEnd() - MSetCursor( lOldMCur ) - SetPos( nOldRow, nOldCol ) + DispEnd() ENDIF diff --git a/harbour/source/rtl/ttopbar.prg b/harbour/source/rtl/ttopbar.prg index 3b08346961..718a2bfc60 100644 --- a/harbour/source/rtl/ttopbar.prg +++ b/harbour/source/rtl/ttopbar.prg @@ -143,10 +143,6 @@ METHOD delItem( nPos ) CLASS TOPBARMENU METHOD display() CLASS TOPBARMENU - LOCAL nOldRow := Row() - LOCAL nOldCol := Col() - LOCAL lOldMCur := MSetCursor( .F. ) - LOCAL nRow := ::nRow LOCAL nLeft := ::nLeft LOCAL nRight := ::nRight @@ -165,7 +161,7 @@ METHOD display() CLASS TOPBARMENU DispBegin() - DispOutAt( nRow, nLeft, Space( nRight - nLeft + 1 ), cColor1 ) + hb_dispOutAt( nRow, nLeft, Space( nRight - nLeft + 1 ), cColor1 ) FOR nItem := 1 TO nItemCount @@ -200,12 +196,12 @@ METHOD display() CLASS TOPBARMENU ENDIF ENDIF - DispOutAt( nRow, nLeft, cCaption,; + hb_dispOutAt( nRow, nLeft, cCaption,; iif( nItem == nCurrent, cColor2,; iif( aItems[ nItem ]:enabled, cColor1, hb_ColorIndex( ::cColorSpec, 4 ) ) ) ) IF aItems[ nItem ]:enabled .AND. nPos > 0 - DispOutAt( nRow, nLeft + nPos - 1, SubStr( cCaption, nPos, 1 ),; + hb_dispOutAt( nRow, nLeft + nPos - 1, SubStr( cCaption, nPos, 1 ),; iif( nItem == nCurrent, hb_ColorIndex( ::cColorSpec, 3 ), hb_ColorIndex( ::cColorSpec, 2 ) ) ) ENDIF @@ -221,9 +217,6 @@ METHOD display() CLASS TOPBARMENU DispEnd() - SetPos( nOldRow, nOldCol ) - MSetCursor( lOldMCur ) - RETURN Self METHOD getFirst() CLASS TOPBARMENU