* Agregar una clase container en una Biblioteca Vcx
* Nombre de Clase: "CntHeader"
* BaseClass="Container"
* ------------------------------------------
* Agregar a la clase Container CntHeader creada:
* una propiedad nombre: "ObjGrid"
* un Método - Nombre: "gControl"
* ------------------------------------------
* Evento Init de la Clase Container CntHeader
* -------------------------------------------
this.objgrid=null
this.BackStyle= 0
this.BorderWidth=0
* Método gControl de la Clase Container CntHeader
* -----------------------------------------------
LOCAL nleft,ncol,nwidth,objNew,;
lnAlig,lnLabel,lcName
IF ISNULL(this.objgrid)
RETURN
ENDIF
nCol=this.objgrid.columncount
this.Height=This.objGRid.Headerheight
nLeft=1
FOR i=1 TO nCol
lcName="Cnt"+TRANSFORM(i)
this.NewObject(lcName,"Container")
objNew=this.&lcName
nWidth=this.objgrid.columns[i].width
lnAlig=this.objgrid.Columns[i].Header1.alignment
lnLabel=2
DO case
CASE INLIST(LnAlig,0,4,7)
lnLabel=0
CASE INLIST(lnAlig,1,5,8)
lnLabel=1
CASE INLIST(lnAlig,2,3,6,9)
lnLabel=2
ENDCASE
WITH objNew
.Height=this.Height-1
.Top=1
.left=nLeft
.Width=nWidth
.SpecialEffect=0
.BackColor=this.objgrid.columns[i].Header1.backcolor
.visible=.t.
ENDWITH
nLeft=nLeft+nWidth+1
objNew.Newobject("Label1","Label")
WITH objNew.Label1
.top=1
.left=1
.Height=objNew.Height
.Width=objNew.Width
.BAckstyle=0
.ForeColor=this.objgrid.Columns[i].Header1.foreColor
.FontBold=this.objgrid.Columns[i].Header1.FontBold
.FontName=this.objgrid.Columns[i].Header1.FontName
.FontSize=this.objgrid.Columns[i].Header1.FontSize
.Alignment=lnLabel
.WordWrap=.t.
.Caption=this.objgrid.Columns[i].Header1.Caption
.visible=.t.
ENDWITH
NEXT
WITH this
.Width=nleft+1
.top=.objgrid.top-.Height-1
.objgrid.Headerheight=0
.left=IIF(.objgrid.deleteMark,15,10)+.objgrid.left
ENDWITH
*------------------------------------------------------
* Guardar la clase Container CntHeader
* -----------------------------------------------------
* En el formulario de que se trate, crear el control grid normalmente
* Agregar al formulario el objeto container CntHeader (que se llamará CntHeader1)
* Luego, suponiendo que el control grid se llama "Grid1"
thisform.cntheader1.objgrid=thisform.grid1
thisform.cntheader1.gcontrol()