Page 1 of 1

image\GroupHeader

Posted: Fri Feb 01, 2013 1:48 pm
by Luisão PITBULL
Guys, someone would have any tips on how to change the image in GroupHeader at runtime

I tried to use this example of samples

Code: Select all

oBrw:aCols[i]:bLClickHeader := { | nMRow, nMCol, nFlags, Self | If( ::nHeadBmpNo == 2, ::nHeadBmpNo := 1, ::nHeadBmpNo := 2 ), ::oBrw:Refresh() }
replacing nHead by n nGrp not the right


Luiz Fernando

Re: image\GroupHeader

Posted: Sat Feb 02, 2013 2:41 pm
by nageswaragunupudi
If you want to change the bitmap of the Group Header, then change the nGrpBmpNo of the first column in the Group

Re: image\GroupHeader

Posted: Mon Feb 04, 2013 11:15 pm
by Luisão PITBULL
nageswaragunupudi wrote:If you want to change the bitmap of the Group Header, then change the nGrpBmpNo of the first column in the Group

Once marked, but does not clear, there is no way to change the image in termpo execution

Image

Code: Select all

    
for i:=2 to (len(aCliente)*2)+1 
      DefineColuna(i,oBrw,nGet,aCliente)
next
     
with OBJECT oBrw
    j:=1
    for i:=1 to len(aCliente) 
         :SetGroupHeader( aCabecalho[i,1],  j+1, j+2, Arial12B )
         oBrw:aCols[j+2]:AddBmpFile( 'delete12' )
         oBrw:aCols[j+2]:AddBmpFile( '' )
         if aCabecalho[i,3]=='S'
             oBrw:aCols[j+2]:nGrpBmpNo  := 1
        else
             oBrw:aCols[j+2]:nGrpBmpNo  := 2
        endif
        j=j+2
   next
 end   
 

Code: Select all

Procedure DefineColuna(i,oBrw,nGet,aCliente)
  if numero_impar(i)
     oBrw:aCols[i]:cHeader       := "Qtd"
     oBrw:aCols[i]:nWidth        := 40
     oBrw:aCols[i]:oDataFont     := Couriern6
     oBrw:aCols[i]:nHeadStrAlign := AL_RIGHT              
     oBrw:aCols[i]:nDataStrAlign := AL_RIGHT
     oBrw:aCols[i]:bstrData      := {|| trans(aVendas[oBrw:nArrayAt,i+1],'@E 999.99')}
     oBrw:aCols[i]:cEditPicture  := "@E 999.99" 
     oBrw:aCols[i]:nEditType     := EDIT_GET        
     oBrw:aCols[i]:bonPostEdit   := { | oCol, uValue, nLastKey | If( nLastKey == 13, aVendas[oBrw:nArrayAt,i+1] := uValue,  nil )  } 
     oBrw:aCols[i]:bEditValid    := { | oGet,oCol | EditCampo(aVendas,oBrw:nArrayAT,oBrw,oGet,"QTD",nGet,aCliente) } 
     oBrw:aCols[i]:bClrStd       := { || iif(aVendas[oBrw:nArrayAt,i+1]>0,{COR_PRETO,COR_BRANCO},{COR_BRANCO,COR_BRANCO}) }
     oBrw:aCols[i]:bLClickHeader := {|r,c,f,o| fecha_cliente(oBrw,nGet,1,o:cGrpHdr,o:nCreationOrder) }
  else
     oBrw:aCols[i]:cHeader       := "Valor"
     oBrw:aCols[i]:nWidth        := 40
     oBrw:aCols[i]:oDataFont     := Couriern6
     oBrw:aCols[i]:nHeadStrAlign := AL_RIGHT              
     oBrw:aCols[i]:nDataStrAlign := AL_RIGHT
     oBrw:aCols[i]:bstrData      := {|| trans(aVendas[oBrw:nArrayAt,i+1],'@E 99,999.99')}
     oBrw:aCols[i]:cEditPicture  := "@E 99,999.99" 
     oBrw:aCols[i]:nEditType     := EDIT_GET        
     oBrw:aCols[i]:bonPostEdit   := { | oCol, uValue, nLastKey | If( nLastKey == 13, aVendas[oBrw:nArrayAt,i+1] := uValue,  nil )  } 
     oBrw:aCols[i]:bEditValid    := { | oGet,oCol | EditCampo(aVendas,oBrw:nArrayAT,oBrw,oGet,"VLR",nGet,aCliente) } 
     oBrw:aCols[i]:bClrStd       := { || iif(aVendas[oBrw:nArrayAt,i+1]>0,{COR_PRETO,COR_BRANCO},{COR_BRANCO,COR_BRANCO}) }
     oBrw:aCols[i]:bLClickHeader := { | r,c,f,o| fecha_cliente(oBrw,nGet,2,o:cGrpHdr,o:nCreationOrder) }
 endif
Return nil




 

Code: Select all

function fecha_cliente(oBrw,nGet,nLocal,cCli,cColuna)
  if numero_impar(cColuna)
     oBrw:aCols[cColuna+1]:nGrpBmpNo := 1
  else
     oBrw:aCols[cColuna]:nGrpBmpNo := 2
  endif
  oBrw:refresh()
return .t.

 











Luiz Fernando