Usando ADD TOP e STATUS PANEL(em baixo) do dialog, e o head do browse.
#include "hwgui.ch"
Function Test()
Local oDlg, oTopPanel, oBtn1, oBtn2, oBtn3, oBrw
Local oStyleNormal, oStylePressed, oStyleOver
Local aSample := { {"Alex",17,1200}, {"Victor",42,1600}, {"John",31,1000} }
oStyleNormal := HStyle():New( {16759929,16772062}, 1 )
oStylePressed := HStyle():New( {16759929}, 1,, 3, 0 )
oStyleOver := HStyle():New( {16759929}, 1,, 2, 12164479 )
INIT DIALOG oDlg TITLE "Styled controls" ;
AT 0, 0 SIZE 380, 260 COLOR 16772062 ;
FONT HFont():Add( "MS Sans Serif",0,-15 )
// A TOP PANEL is the same PANEL control, which we used in "Panel and Ownerbuttons"
// module, but it has predefined ON SIZE codeblock to be at the top of a window
ADD TOP PANEL oTopPanel TO oDlg HEIGHT 48 BACKCOLOR 16770002
@ 0,0 OWNERBUTTON oBtn1 OF oTopPanel SIZE 64,48 ;
TEXT "Date" ;
ON CLICK {||hwg_WriteStatus(oDlg,1,Dtoc(Date()),.T.)}
oBtn1:aStyle := { oStyleNormal, oStylePressed, oStyleOver }
@ 64,0 OWNERBUTTON oBtn2 OF oTopPanel SIZE 64,48 ;
TEXT "Time" ;
ON CLICK {||hwg_WriteStatus(oDlg,2,Time(),.T.)}
oBtn2:aStyle := { oStyleNormal, oStylePressed, oStyleOver }
@ 128,0 OWNERBUTTON oBtn3 OF oTopPanel SIZE 64,48 ;
TEXT "Version" ;
ON CLICK {||hwg_WriteStatus(oDlg,3,hwg_Version(),.T.)}
oBtn3:aStyle := { oStyleNormal, oStylePressed, oStyleOver }
@ 50,72 BROWSE oBrw ARRAY SIZE 280,140 STYLE WS_BORDER + WS_VSCROLL ;
ON SIZE ANCHOR_TOPABS + ANCHOR_LEFTABS + ANCHOR_RIGHTABS + ANCHOR_BOTTOMABS
oBrw:oStyleHead := HStyle():New( { 0xffffff, 0xbbbbbb }, 1 )
oBrw:aArray := aSample
oBrw:AddColumn( HColumn():New( "Name",{|v,o|o:aArray[o:nCurrent,1]},"C",12,0 ) )
oBrw:AddColumn( HColumn():New( "Age",{|v,o|o:aArray[o:nCurrent,2]},"N",4,0 ) )
oBrw:AddColumn( HColumn():New( "Number",{|v,o|o:aArray[o:nCurrent,3]},"N",8,0 ) )
// A STATUS PANEL is a subclass of a PANEL control, which may be used instead of
// a standard STATUS control
ADD STATUS PANEL TO oDlg HEIGHT 30 FONT oDlg:oFont ;
HSTYLE HStyle():New( {16770002,16772062}, 1,, 0.4, 16759929 ) PARTS 120,120,0
ACTIVATE DIALOG oDlg
Return Nil
Saudações,
Itamar M. Lins Jr.