From 54cd7ccb937718718b1c141b5826fc5c11374481 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 15 Feb 2004 15:33:34 +0000 Subject: [PATCH] 2004-02-15 16:35 UTC+0100 Viktor Szakats * src/rtl/tbrowse.prg ! Fixed to not display headsep/footsep when there's no header/footer. ! Fixed to display headsep/footsep with the width of colsep. * makefile.bc ! Added DEBUG_LIB for Harbour exes to make them compile in debug mode. * souce/rtl/gtapi.c ! hb_gtSetColorStr() previous change reverted. The mistake was on my side most probably. --- harbour/ChangeLog | 16 +++++++++ harbour/makefile.bc | 4 +++ harbour/source/rtl/gtapi.c | 10 ------ harbour/source/rtl/tbrowse.prg | 63 +++++++++++++++++++--------------- 4 files changed, 56 insertions(+), 37 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 0d229f6de7..a18db1072f 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,22 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ +2004-02-15 16:35 UTC+0100 Viktor Szakats + + * src/rtl/tbrowse.prg + ! Fixed to not display headsep/footsep when there's no + header/footer. + ! Fixed to display headsep/footsep with the width of + colsep. + + * makefile.bc + ! Added DEBUG_LIB for Harbour exes to make them compile + in debug mode. + + * souce/rtl/gtapi.c + ! hb_gtSetColorStr() previous change reverted. The mistake + was on my side most probably. + 2004-02-15 05:25 UTC+0100 Viktor Szakats * source/rtl/tbrowse.prg diff --git a/harbour/makefile.bc b/harbour/makefile.bc index 836d4102bd..d7ec35d75a 100644 --- a/harbour/makefile.bc +++ b/harbour/makefile.bc @@ -2631,6 +2631,7 @@ $(HBRUN_EXE) : $(HBRUN_EXE_OBJS) $(ECHO) $(CODEPAGE_LIB) >> make.tmp $(ECHO) $(RDD_LIB) >> make.tmp $(ECHO) $(MACRO_LIB) >> make.tmp + $(ECHO) $(DEBUG_LIB) >> make.tmp $(ECHO) $(DBFNTX_LIB) >> make.tmp $(ECHO) $(DBFCDX_LIB) >> make.tmp $(ECHO) $(DBFDBT_LIB) >> make.tmp @@ -2676,6 +2677,7 @@ $(HBTEST_EXE) : $(HBTEST_EXE_OBJS) $(ECHO) $(LANG_LIB) >> make.tmp $(ECHO) $(RDD_LIB) >> make.tmp $(ECHO) $(MACRO_LIB) >> make.tmp + $(ECHO) $(DEBUG_LIB) >> make.tmp $(ECHO) $(DBFNTX_LIB) >> make.tmp $(ECHO) $(DBFCDX_LIB) >> make.tmp $(ECHO) $(DBFDBT_LIB) >> make.tmp @@ -2781,6 +2783,7 @@ $(HBDOC_EXE) : $(HBDOC_EXE_OBJS) $(ECHO) $(LANG_LIB) >> make.tmp $(ECHO) $(RDD_LIB) >> make.tmp $(ECHO) $(MACRO_LIB) >> make.tmp + $(ECHO) $(DEBUG_LIB) >> make.tmp $(ECHO) $(DBFNTX_LIB) >> make.tmp $(ECHO) $(DBFCDX_LIB) >> make.tmp $(ECHO) $(DBFDBT_LIB) >> make.tmp @@ -2929,6 +2932,7 @@ $(HBMAKE_EXE) : $(HBMAKE_EXE_OBJS) $(ECHO) $(LANG_LIB) >> make.tmp $(ECHO) $(RDD_LIB) >> make.tmp $(ECHO) $(MACRO_LIB) >> make.tmp + $(ECHO) $(DEBUG_LIB) >> make.tmp $(ECHO) $(DBFNTX_LIB) >> make.tmp $(ECHO) $(DBFCDX_LIB) >> make.tmp $(ECHO) $(DBFDBT_LIB) >> make.tmp diff --git a/harbour/source/rtl/gtapi.c b/harbour/source/rtl/gtapi.c index 0f384cb079..670192c807 100644 --- a/harbour/source/rtl/gtapi.c +++ b/harbour/source/rtl/gtapi.c @@ -649,18 +649,8 @@ USHORT hb_gtSetColorStr( char * szColorString ) } while( c ); - /* NOTE: Commented out because no test could reveal that - CA-Clipper is actually doing such assignment. - Moreover this feature sometimes caused - incompatibilies in color usage (discovered when - using incompletely specified color strings with - GETs. [vszakats] - Originally added by ptucker at version 1.31 */ - - /* if( nPos >= 1 && nPos <= 3 ) s_pColor[ HB_CLR_UNSELECTED ] = s_pColor[ HB_CLR_ENHANCED ]; - */ s_uiColorIndex = HB_CLR_STANDARD; /* hb_gtColorSelect( HB_CLR_STANDARD ); */ diff --git a/harbour/source/rtl/tbrowse.prg b/harbour/source/rtl/tbrowse.prg index 671b333963..d23a81c414 100644 --- a/harbour/source/rtl/tbrowse.prg +++ b/harbour/source/rtl/tbrowse.prg @@ -355,7 +355,7 @@ METHOD Configure(nMode) CLASS TBrowse next - IF( nMode == NIL ) + IF nMode == NIL for n := 1 to ::nColumns ::aColsWidth[n] := ::SetColumnWidth( ::aColumns[n] ) next @@ -365,8 +365,8 @@ METHOD Configure(nMode) CLASS TBrowse // If I add (or remove) header or footer (separator) I have to change number // of available rows ::RowCount := ::nBottom - ::nTop + 1 - iif( ::lHeaders, ::nHeaderHeight, 0 ) - ; - iif( ::lFooters, ::nFooterHeight, 0 ) - iif( Empty( ::HeadSep ), 0, 1 ) - ; - iif( Empty( ::FootSep ), 0, 1 ) + iif( ::lFooters, ::nFooterHeight, 0 ) - iif( Empty( ::HeadSep ) .OR. !::lHeaders, 0, 1 ) - ; + iif( Empty( ::FootSep ) .OR. !::lFooters, 0, 1 ) if Len(::aRedraw) <> ::RowCount ::aRedraw := Array(::RowCount) @@ -378,14 +378,18 @@ METHOD Configure(nMode) CLASS TBrowse if ::freeze > 0 ::SetFrozenCols(::freeze) endif + #ifdef HB_COMPAT_C53 - nleft:=::nLeft - nRight:=::nRight - ::rect:={::ntop+::nHeaderHeight,::nleft,::nbottom-::nHeaderHeight,::nright} - for n:= nleft to nright - aadd(::aVisibleCols,n) - next + + nleft := ::nLeft + nRight := ::nRight + ::rect := { ::ntop + ::nHeaderHeight, ::nleft, ::nbottom - ::nHeaderHeight, ::nright } + FOR n := nleft TO nright + AAdd( ::aVisibleCols, n ) + NEXT + #endif + return Self @@ -579,7 +583,6 @@ METHOD GoBottom() CLASS TBrowse local nToTop - ::Moved() Eval(::goBottomBlock) @@ -779,7 +782,7 @@ return Self METHOD DeHilite() CLASS TBrowse - local nRow := ::nTop + ::RowPos + iif(::lHeaders, ::nHeaderHeight, 0 ) + iif(Empty(::HeadSep), 0, 1) - 1 + local nRow := ::nTop + ::RowPos + iif(::lHeaders, ::nHeaderHeight, 0 ) + iif(Empty( ::HeadSep ) .OR. !::lHeaders, 0, 1) - 1 local cType SetPos( nRow, ::aColumns[ ::ColPos ]:ColPos ) @@ -804,7 +807,7 @@ METHOD Hilite() CLASS TBrowse local nRow, nCol local cType - nRow := ::nTop + ::RowPos + iif(::lHeaders, ::nHeaderHeight, 0) + iif(Empty(::HeadSep), 0, 1) - 1 + nRow := ::nTop + ::RowPos + iif(::lHeaders, ::nHeaderHeight, 0) + iif(Empty( ::HeadSep ) .OR. !::lHeaders, 0, 1) - 1 nCol := ::aColumns[ ::ColPos ]:ColPos // Start of cell @@ -826,7 +829,7 @@ return Self METHOD PosCursor() CLASS TBrowse - local nRow := ::nTop + ::RowPos + iif(::lHeaders, ::nHeaderHeight, 0) + iif(Empty(::HeadSep), 0, 1) - 1 + local nRow := ::nTop + ::RowPos + iif(::lHeaders, ::nHeaderHeight, 0) + iif(Empty( ::HeadSep ) .OR. !::lHeaders, 0, 1) - 1 local nCol local cType := ValType( Eval( ::aColumns[ ::ColPos ]:block ) ) @@ -914,7 +917,8 @@ METHOD RedrawHeaders(nWidth) CLASS TBrowse local n, nTPos, nBPos local cBlankBox := Space(9) - local nScreenRowT, nScreenRowB + local nScreenRowT + local nScreenRowB local nLCS // Len(ColSep) if ::lHeaders // Drawing headers @@ -939,14 +943,18 @@ METHOD RedrawHeaders(nWidth) CLASS TBrowse next endif - if ! Empty( ::HeadSep ) //Draw horizontal heading separator line - DispOutAt((nScreenRowT := ::nTop + iif(::lHeaders, ::nHeaderHeight , 0 )), ::nLeft,; + if ! Empty( ::HeadSep ) .AND. ::lHeaders //Draw horizontal heading separator line + DispOutAt((nScreenRowT := ::nTop + ::nHeaderHeight ), ::nLeft,; Replicate( Right( ::HeadSep, 1 ), nWidth), ::ColorSpec) + else + nScreenRowT := NIL endif - if ! Empty( ::FootSep ) //Draw horizontal footing separator line - DispOutAt((nScreenRowB := ::nBottom - iif(::lFooters, ::nFooterHeight, 0)), ::nLeft,; + if ! Empty( ::FootSep ) .AND. ::lFooters //Draw horizontal footing separator line + DispOutAt((nScreenRowB := ::nBottom - ::nFooterHeight ), ::nLeft,; Replicate(Right(::FootSep, 1), nWidth), ::ColorSpec) + else + nScreenRowB := NIL endif nTPos := nBPos := ::nLeft + (( nWidth - ::nColsWidth ) / 2 ) @@ -958,16 +966,17 @@ METHOD RedrawHeaders(nWidth) CLASS TBrowse endif if n < ::rightVisible + nLCS := iif(::aColumns[n + 1]:ColSep != NIL, Len(::aColumns[n + 1]:ColSep), Len(::ColSep)) - if ! Empty( ::HeadSep ) - DispOutAT(nScreenRowT, (nTPos += ::aColsWidth[ n ]), ::HeadSep, ::ColorSpec ) - nTPos += Len(::HeadSep) + (nLCS - Len(::HeadSep)) + if nScreenRowT != NIL + DispOutAt(nScreenRowT, (nTPos += ::aColsWidth[ n ]), Left(::HeadSep, nLCS), ::ColorSpec ) + nTPos += nLCS endif - if ! Empty( ::FootSep ) - DispOutAT(nScreenRowB, (nBPos += ::aColsWidth[ n ]), ::FootSep, ::ColorSpec ) - nBPos += Len(::FootSep) + (nLCS - Len(::FootSep)) + if nScreenRowB != NIL + DispOutAt(nScreenRowB, (nBPos += ::aColsWidth[ n ]), Left(::FootSep, nLCS), ::ColorSpec ) + nBPos += nLCS endif endif @@ -1106,7 +1115,7 @@ METHOD Stabilize() CLASS TBrowse else // K_DN or K_UP // Where does really start first TBrowse row? - nFirstRow := ::nTop + iif( ::lHeaders, ::nHeaderHeight, 0 ) + iif( Empty( ::HeadSep ), 0, 1 ) + nFirstRow := ::nTop + iif( ::lHeaders, ::nHeaderHeight, 0 ) + iif( Empty( ::HeadSep ) .OR. !::lHeaders, 0, 1 ) // I'm at top or bottom of TBrowse so I can scroll if ::nNewRowPos == ::RowCount @@ -1170,7 +1179,7 @@ METHOD Stabilize() CLASS TBrowse // if there is a row to repaint if ::aRedraw[nRow] - DispOutAt(::nTop + nRow + iif(::lHeaders, ::nHeaderHeight, 0) + iif(Empty(::HeadSep), 0, 1) - 1, ::nLeft,; + DispOutAt(::nTop + nRow + iif(::lHeaders, ::nHeaderHeight, 0) + iif(Empty( ::HeadSep ) .OR. !::lHeaders, 0, 1) - 1, ::nLeft,; Space( ( nWidth - ::nColsWidth ) / 2 ), ::ColorSpec ) for n := iif( ::nFrozenCols > 0, 1, ::leftVisible ) to ::rightVisible @@ -1427,7 +1436,7 @@ METHOD MGotoYX(nRow, nCol) CLASS TBrowse endif // Set new row position - nNewRow := nRow - ::nTop + iif(::lHeaders, ::nHeaderHeight, 0) + iif(Empty(::HeadSep), 0, 1) - 1 + nNewRow := nRow - ::nTop + iif(::lHeaders, ::nHeaderHeight, 0) + iif(Empty( ::HeadSep ) .OR. !::lHeaders, 0, 1) - 1 ::nRecsToSkip := nNewRow - ::nNewRowPos // move data source accordingly