Ing. Stephan ask another problem
> have a problem with the MultiHeaders.
>I have 5 columns and I want 2 MultiHeaders beginning at the second column, every Multiheader over 2 columns.
>The first Multiheader over Last and Street and the second over Counry and State. The first column has a normal header.
>So I set :
>nHeaderType of Column 1 to 0 - no Multiheader
>nHeaderType of Column 2 to 2 - Start of the first Multiheader
>nHeaderType of Column 3 to 3 - End of the first Multiheader
>nHeaderType of Column 4 to 2- Start of the second Multiheader
>nHeaderType of Column 5 to 3- End of the second Multiheader
> What am I doing wrong ?
Solution :
0
2
1
4
1
the code :
- Code: Select all Expand view
#include "FiveWin.ch"
#include "XBrowse.ch"
Stati oMain
function main()
local oBar
local oBrush
local oPopup
DEFINE BRUSH oBrush COLOR nRGB( 12, 129, 87 )
DEFINE WINDOW oMain MDI FROM 1, 10 TO 20, 60 ;
TITLE "Testing Header xBrowse" ;
BRUSH oBrush
DEFINE BUTTONBAR oBar OF oMain _3D
DEFINE BUTTON OF oBar FILE "..\bitmaps\16x16\exit.bmp" ACTION ( oMain:End() )
DEFINE BUTTON OF oBar FILE "..\bitmaps\16x16\New.bmp" ACTION ( TestHeader() )
ACTIVATE WINDOW oMain
Retu Nil
func TestHeader
local oWnd, oBrw
Local oCol, xColBrw:=Array(10,11), K:=0, cCustomer
USE CUSTOMER ALIAS cCustomer NEW
DEFINE WINDOW oWnd MDICHILD OF oMain
oBrw := TXBrowse():New( oWnd )
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLCELL
oBrw:nColDividerStyle := LINESTYLE_LIGHTGRAY // LINESTYLE_BLACK
oBrw:nRowDividerStyle := LINESTYLE_LIGHTGRAY // LINESTYLE_NOLINES
oBrw:nHeader := 1
oBrw:aHeaderTop := {"D A T A G E N E R A L ","Country"}
oBrw:nHeaderHeight := 38
oBrw:bClrHeader := { || { nRGB( 0, 0, 0 ), nRGB( 203, 225, 252 ), nRGB( 255, 255, 220 ) } }
oBrw:cAlias := cCustomer
oBrw:lAllowColSwapping := .f.
oBrw:lColDividerComplete := .t.
oBrw:lHScroll := .f.
oBrw:lFastEdit := .t.
oBrw:nFreeze := 3
xColBrw[01] := { "First", AL_CENTER, .T., 50, AL_LEFT, "@30", 0, { |o| (oBrw:cAlias)->FIRST }, { || (oBrw:cAlias)->FIRST }, 0, AL_LEFT }
xColBrw[02] := { "Last", AL_CENTER, .T., 60, AL_LEFT, "@30", 1, { |o| (oBrw:cAlias)->LAST }, { || (oBrw:cAlias)->LAST }, 2, AL_RIGHT }
xColBrw[03] := { "Street",AL_CENTER, .T., 70, AL_LEFT, "@30", 1, { |o| (oBrw:cAlias)->STREET },{ || (oBrw:cAlias)->STREET },1, AL_RIGHT }
xColBrw[04] := { "City", AL_CENTER, .T., 70, AL_LEFT, "@30", 1, { |o| (oBrw:cAlias)->CITY }, { || (oBrw:cAlias)->CITY }, 4, AL_RIGHT }
xColBrw[05] := { "State", AL_CENTER, .T., 70, AL_LEFT, "@30", 1, { |o| (oBrw:cAlias)->STATE },{ || (oBrw:cAlias)->STATE }, 1, AL_RIGHT }
For K:=1 To 5
oCol := oBrw:AddCol()
oCol:AddBmpfile( "CLIP.bmp" )
oCol:cHeader := xColBrw[K,01]
oCol:nHeaderType := xColBrw[K,10]
oCol:nHeadStrAlign := xColBrw[K,02]
oCol:nFootStrAlign := xColBrw[K,11]
oCol:lAllowSizing := xColBrw[K,03]
oCol:nWidth := xColBrw[K,04]
oCol:nDataStrAlign := xColBrw[K,05]
oCol:cEditPicture := xColBrw[K,06]
oCol:nEditType := xColBrw[K,07]
oCol:bStrData := xColBrw[K,08]
oCol:bEditValue := xColBrw[K,09]
oCol:nHeadBmpNo := 1
Next K
oBrw:nColSel := 2
oBrw:SetRDD()
oBrw:CreateFromCode()
oWnd:SetControl( oBrw )
ACTIVATE WINDOW oWnd maximized
Retu ( Nil )