From 4764b6815e28525fd09dcd2b99ea3facec50b417 Mon Sep 17 00:00:00 2001 From: Luiz Rafael Culik Date: Mon, 6 Aug 2001 23:24:43 +0000 Subject: [PATCH] See changelog 2001-08-06 20:30 GMT -3 --- harbour/ChangeLog | 4 +++ harbour/source/rtl/tbrowse.prg | 50 ++++++++++++++++++---------------- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3e3c29d6f8..5ed8686b89 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,7 @@ +2001-08-06 20:30 GMT -3 Luiz Rafael Culik + *source/rtl/tbrowse.prg + * Fixed support to display pictures in TBrwose. Thanks for Manu Exposito + 2001-08-06 09:15 UTC-0800 Ron Pinkas * source/compiler/genc.c ! Improved sync logic of HB_SETMACRO() level, to only activate once per module with same level used by compiler. diff --git a/harbour/source/rtl/tbrowse.prg b/harbour/source/rtl/tbrowse.prg index 9cf35cadc1..326920b227 100644 --- a/harbour/source/rtl/tbrowse.prg +++ b/harbour/source/rtl/tbrowse.prg @@ -59,6 +59,9 @@ * ::PageUp(), ::PageDown(), ::Down(), ::Up(), ::GoBottom(), ::GoTop(), ::Stabilize() * ::GotoXY() * + * Copyright 2001 Manu Exposito + * Activate data PICTURE DispCell(nColumn, nColor) + * */ @@ -237,10 +240,10 @@ METHOD New(nTop, nLeft, nBottom, nRight) CLASS TBrowse ::nColsVisible := 0 - ::nTop := nTop - ::nLeft := nLeft + ::nTop := nTop + ::nLeft := nLeft ::nBottom := nBottom - ::nRight := nRight + ::nRight := nRight return Self @@ -1026,37 +1029,36 @@ return Self METHOD DispCell( nColumn, nColor ) CLASS TBrowse - LOCAL ftmp := Eval(::aColumns[nColumn]:block) - LOCAL nCol := Col() - - local cColor := iif(::aColumns[nColumn]:ColorBlock != NIL,; - hb_ColorIndex(::ColorSpec, Eval(::aColumns[nColumn]:ColorBlock, ftmp)[nColor] - 1),; - hb_ColorIndex(::ColorSpec, nColor - 1)) + local oCol := ::aColumns[nColumn] + LOCAL ftmp := Eval(oCol:block) + LOCAL nCol := Col() + LOCAL cType := ValType( ftmp ) + local cPict := if( !empty( oCol:Picture ), oCol:Picture, "@" ) + local cDisp := "" + local cColor := iif(oCol:ColorBlock != NIL,; + hb_ColorIndex(::ColorSpec, Eval(oCol:ColorBlock, ftmp)[nColor] - 1),; + hb_ColorIndex(::ColorSpec, nColor - 1)) do case - case valtype( ftmp ) $ "CM" - DispOut( Left( ftmp, ::aColumns[ nColumn ]:Width ), cColor ) + case cType $ "CM" + cDisp := transform( Left( ftmp, ::aColumns[ nColumn ]:Width ), cPict ) - case valtype( ftmp ) == "N" - DispOut( Right( Str( ftmp ), ::aColumns[ nColumn ]:Width ), cColor ) + case cType == "N" + cDisp := Right( transform( ftmp, cPict ), ::aColumns[ nColumn ]:Width ) - case valtype( ftmp ) == "D" - DispOut( Right( DToC( ftmp ), ::aColumns[ nColumn ]:Width ), cColor ) - - case valtype( ftmp ) == "L" - DispOut( Space( ::aColumns[ nColumn ]:Width / 2 ), cColor) - DispOut( iif( ftmp, "T","F" ), cColor ) + case cType == "D" + cPict := if( cPict == "@", "@D", cPict ) + cDisp := Right( transform( ftmp, cPict ), ::aColumns[ nColumn ]:Width ) + case cType == "L" + cDisp := Space( ::aColumns[ nColumn ]:Width / 2 ) + iif( ftmp, "T","F" ) endcase + DispOut( cDisp, cColor ) DispOut( Space( nCol + ::aColumns[ nColumn ]:Width - Col() ), cColor) // Logical fields are centered on column width - if ValType(ftmp) == "L" - SetPos( Row(), nCol + ::aColumns[::ColPos]:Width / 2) - else - SetPos( Row(), nCol ) - endif +// SetPos( Row(), nCol + if( cType == "L", ::aColumns[::ColPos]:Width / 2, 0 ) ) return Self