image\GroupHeader

Post Reply
Luisão PITBULL
Posts: 22
Joined: Fri May 04, 2012 3:26 pm

image\GroupHeader

Post 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
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: image\GroupHeader

Post by nageswaragunupudi »

If you want to change the bitmap of the Group Header, then change the nGrpBmpNo of the first column in the Group
Regards

G. N. Rao.
Hyderabad, India
Luisão PITBULL
Posts: 22
Joined: Fri May 04, 2012 3:26 pm

Re: image\GroupHeader

Post 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
Post Reply