Pue eso amigos
saben como
Mil gracias
#include "fivewin.ch"
#include "xbrowse.ch"
function main
local oWnd
local oBrw
local aArray
local oFont
aArray := { { "one", "two", "three", "four" },;
{ "one", "two", "three", "four" },;
{ "one", "two", "three", "four" },;
{ "one", "two", "three", "four" },;
{ "one", "two", "three", "four" } }
define font oFont name "courier new"
define window oWnd title "Test xBrowse Verticar Header" from 0,0 to 400,800 pixel
@ 0,0 xbrowse oBrw array aArray of oWnd font oFont ;
head { fVerticalTxt( "Vertical Text in xBrowse Header TOP ALIGN", 2,0 ),;
fVerticalTxt( "Vertical Text in xBrowse Header BOTTOM ALIGN", 2,1 ),;
fVerticalTxt( "Vertical Text in xBrowse Header CENTER ALIGN", 2,2 ),;
fVerticalTxt( "OneLine" ) } ;
sizes {180,180,180,180} ;
cols { 1,2,3,4 }
oBrw:aCols[ 1 ]:nHeadstrAlign := 0
oBrw:aCols[ 2 ]:nHeadstrAlign := 1
oBrw:aCols[ 3 ]:nHeadstrAlign := 2
oBrw:aCols[ 4 ]:nHeadstrAlign := 2
oBrw:nHeaderLines := 8
oBrw:createfromcode()
oWnd:oClient := oBrw
activate window oWnd
return nil
function fVerticalTxt( cText, nSpa, nAlign )
local aOutPut
local aWord := {}
local cWord
local cOut := ""
local nTotalWord := 0
local nRow, nCol, n, i, j
local nCount, nHalf
local nOffSet:= 0
local nMaxWord := 0
default nAlign := 1,;
nSpa := 1
while nOffSet < len( cText )
cWord = cStrWord( cText, @nOffset, " " )
if cWord == " "
loop
else
nMaxWord := max( nMaxWord, len( cWord ) )
aadd( aWord, cWord )
nTotalWord++
endif
end
aOutPut := array( nTotalWord, nMaxWord )
nRow := 1
nCol := 0
for n = 1 to nTotalWord
if nCol + len( aWord[ n ] ) > nMaxWord
nCol := 1
nRow++
else
nCol++
endif
for i = 1 to len( aWord[ n ] )
aOutPut[ nRow, nCol ] = substr( aWord[ n ], i, 1 )
nCol++
next
next
nCount := 0
for n = 1 to nRow
i = nMaxWord
while aOutPut[ n,i-- ] == nil
nCount++
end
if nCount > 0
do case
case nAlign = 1
for j = nMaxWord to nCount + 1 step - 1
aOutPut[ n,j ] := aOutPut[ n,j-nCount ]
next
for j = 1 to nCount
aOutPut[ n,j ] := NIL
next
case nAlign = 2
nHalf := (int( nMaxWord / 2 ) - round( ( nMaxWord - nCount )/2, 0 ) )
if nCount > 0
for j = nMaxWord - nHalf to 1 step - 1
aOutPut[ n,j ] := if( j - nHalf < 1, NIL, aOutPut[ n,j - nHalf ] )
next
endif
endcase
endif
nCount := 0
next
for n = 1 to nMaxWord
for i = 1 to nRow
cOut += if ( aOutPut[ i,n ] == NIL, " ", aOutPut[ i,n ] ) + if ( i != nRow, space( nSpa ), "" )
next
cOut += CRLF
next
return cOut
nHalf := (int( nMaxWord / 2 ) - round( ( nMaxWord - nCount )/2, 0 ) )
nHalf := (round( ( nMaxWord )/2, 0 ) - round( ( nMaxWord - nCount )/2, 0 ) )
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: Google [Bot] and 42 guests