Hi All
I'm trying to show a calendar type browse where within each cell, I have 3 lines of text. I want to show the second line in a larger font with the first and third line smaller.
Any suggestions?
TIA David
function MultiLineCells
local oDlg, oBrw, aFont[ 3 ]
local aData := Array( 4, 12 )
local n,i,j
n := 1
for i := 1 to 4
for j := 1 to 10 step 3
aData[ i, j ] := NToCDOW( ( n - 1 ) % 7 + 1 )
aData[ i, j + 1 ] := n
aData[ i, j + 2 ] := "Some details that may take more than one line"
n++
next
next
DEFINE FONT aFont[ 1 ] NAME "TAHOMA" SIZE 0,-16 BOLD
DEFINE FONT aFont[ 2 ] NAME "IMPACT" SIZE 0,-34
DEFINE FONT aFont[ 3 ] NAME "TIMES ROMAN" SIZE 0,-12 ITALIC
DEFINE DIALOG oDlg SIZE 700,500 PIXEL
@ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg DATASOURCE aData AUTOCOLS ;
LINES NOBORDER
WITH OBJECT oBrw
:nWidths := 150
:nRowHeight := 100
for i := 1 to 10 STEP 3
WITH OBJECT :aCols[ i ]
:oDataFont := aFont[ 1 ]
:nDataStrAlign := AL_CENTER
END
WITH OBJECT :aCols[ i + 1 ]
:oDataFont := aFont[ 2 ]
:nDataStrAlign := AL_CENTER
:bClrStd := { || { CLR_HRED, CLR_WHITE } }
END
WITH OBJECT :aCols[ i + 2 ]
:oDataFont := aFont[ 3 ]
:nDataLines := 2
END
:aCols[ i ]:SetColsAsRows( i, i + 1, i + 2 )
next
//
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED
AEval( aFont, { |o| o:End() } )
return nil
XBROWSER aData
// :aCols[ i ]:SetColsAsRows( i, i + 1, i + 2 )
:aCols[ i ]:SetColsAsRows( i, i + 1, i + 2 )
Otto wrote:Dear Mr. Rao,
I want to try this program but get following error msg:
Application
===========
Path and name: C:\fwh\samples\testbrw.exe (32 bits)
Size: 2,104,832 bytes
Compiler version: xHarbour build 1.2.1 Intl. (SimpLex) (Rev. 6715)
FiveWin Version: FWHX 12.03
Windows version: 6.1, Build 7601 Service Pack 1
Time from start: 0 hours 0 mins 1 secs
Error occurred at: 09/03/13, 20:50:12
Error description: Error BASE/1081 Argument error: +
Args:
[ 1] = N 20
[ 2] = U
Stack Calls
===========
Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:PAINTCELL( 9690 )
Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:PAINTDATA( 9561 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:PAINT( 1434 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:DISPLAY( 1253 )
Thanks in advance
Otto
METHOD PaintData( nRow, nCol, nHeight, lHighLite, lSelected, nOrder, nPaintRow ) CLASS TXBrwColumn
.../...
if Empty( ::nDataHeight )
::nDataHeight := ::DataHeight()
endif
nDataHeight := If( Empty( ::aRows ), nHeight, ::nDataHeight )
::PaintCell( nRow, nCol, nDataHeight, lHighLite, lSelected, nOrder, nPaintRow )
if ! Empty( ::aRows )
for n := 2 to Len( ::aRows )
.../...
nDataHeight := If( n == Len( ::aRows ), nHeight, oCol:nDataHeight )
if Empty( nDataHeight )
if Empty( oCol:nDataHeight )
oCol:nDataHeight := oCol:DataHeight()
endif
nDataHeight := oCol:nDataHeight
endif
oCol:PaintCell( nRow, nCol, nDataHeight, lHighLite, lSelected, nOrder, nPaintRow )
next n
endif
return nil
cText := oLbx:SelectedCol():Value
:bLDblClick := { | nRow, nCol, nFlag | MsgInfo( oBrw:aCols[ oBrw:MouseColPos( nCol ) ]:Value ) }
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 92 guests