From e77ab95e6184c2c83d4488cf9e78029048d686ff Mon Sep 17 00:00:00 2001 From: Luiz Rafael Culik Date: Sat, 11 Aug 2001 11:24:06 +0000 Subject: [PATCH] See changelog 2001-08-11 08:30 GMT -3 --- harbour/ChangeLog | 4 ++++ harbour/tests/testbrw.prg | 32 +++++++++++++++++++------------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b37110b73d..45fcc32381 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,7 @@ +2001-08-11 08:40 GMT -3 Luiz Rafael Culik + *tests/testbrw.prg + * updated to show the use of pictures with tbrowse + 2001-08-10 13:30 UTC-0400 David G. Holm * source/rtl/dbdelim.prg diff --git a/harbour/tests/testbrw.prg b/harbour/tests/testbrw.prg index a99b01a938..d311383857 100644 --- a/harbour/tests/testbrw.prg +++ b/harbour/tests/testbrw.prg @@ -9,7 +9,10 @@ function Main() local oBrowse := TBrowseNew( 5, 5, 16, 30 ) - local aTest := { "This", "is", "a", "browse", "on", "an", "array", "test", "with", "a", "long", "data" } + local aTest0 := { "This", "is", "a", "browse", "on", "an", "array", "test", "with", "a", "long", "data" } + local aTest1 := { 1, 2, 3, 4, 5, 6, 7, 8, 10000, -1000, 54, 456342 } + local aTest2 := { date(), date()+4, date()+56, date()+14, date()+5, date()+6, date()+7, date()+8, date()+10000, date()-1000, date()-54, date()+456342 } + local aTest3 := { .t., .f., .t., .t., .f., .f., .t., .f., .t., .t., .f., .f. } local n := 1 local nKey local lEnd := .f. @@ -23,21 +26,25 @@ function Main() oBrowse:HeadSep = "ΡΝ" oBrowse:FootSep = "ΟΝ" oBrowse:GoTopBlock = { || n := 1 } - oBrowse:GoBottomBlock = { || n := Len( aTest ) } + oBrowse:GoBottomBlock = { || n := Len( aTest0 ) } oBrowse:SkipBlock = { | nSkip, nPos | nPos := n,; - n := If( nSkip > 0, Min( Len( aTest ), n + nSkip ),; + n := If( nSkip > 0, Min( Len( aTest0 ), n + nSkip ),; Max( 1, n + nSkip )), n - nPos } oBrowse:AddColumn( TBColumnNew( "First", { || n } ) ) - oBrowse:AddColumn( TBColumnNew( "Second", { || aTest[ n ] } ) ) - oBrowse:AddColumn( TBColumnNew( "Third", { || aTest[ n ] } ) ) - oBrowse:AddColumn( TBColumnNew( "Forth", { || aTest[ n ] } ) ) - oBrowse:AddColumn( TBColumnNew( "Fifth", { || n } ) ) - oBrowse:GetColumn(1):Footing = 'First' - oBrowse:GetColumn(2):Footing = 'Second' - oBrowse:GetColumn(3):Footing = 'Third' - oBrowse:GetColumn(4):Footing = 'Forth' - oBrowse:GetColumn(5):Footing = 'Fifth' + oBrowse:AddColumn( TBColumnNew( "Second", { || aTest0[ n ] } ) ) + oBrowse:AddColumn( TBColumnNew( "Third", { || aTest1[ n ] } ) ) + oBrowse:AddColumn( TBColumnNew( "Forth", { || aTest2[ n ] } ) ) + oBrowse:AddColumn( TBColumnNew( "Fifth", { || aTest3[ n ] } ) ) + oBrowse:GetColumn(1):Footing = 'Number' + oBrowse:GetColumn(2):Footing = 'Strins' + + oBrowse:GetColumn(2):Picture := '@!' + + oBrowse:GetColumn(3):Footing = 'Number' + oBrowse:GetColumn(3):Picture := '999,999.99' + oBrowse:GetColumn(4):Footing = 'Dates' + oBrowse:GetColumn(5):Footing = 'Logical' // needed since I've changed some columns _after_ I've added them to TBrowse object oBrowse:Configure() @@ -62,7 +69,6 @@ enddo While !lEnd oBrowse:ForceStable() - nKey = InKey( 0 ) do case