#include "FiveWin.ch"
static oWnd, cPath, oBar, oBrush, oCursorHand
FUNCTION Main()
LOCAL hDCo, oButt1, oButt2, oButt3, oButt4, oButt5, oButt6
LOCAL oButtFont1, oButtFont2, oButtFont3
c_path := GETCURDIR()
oButtFont1 := TFont():New("Arial",,-18,.F.,.F.,,,,.F.)
oButtFont2 := TFont():New("Arial",,-18,.F.,.T.,,,,.F.)
oButtFont3 := TFont():New("Arial",,-18,.F.,.T.,,,,.T.)
DEFINE CURSOR oCursorHand HAND
SetBalloon( .T. )
// Color
// -------
DEFINE BRUSH oBrush COLOR 14853684
DEFINE WINDOW oWnd TITLE "Testing Buttonbar" ;
MENU TMenu():New() BRUSH oBrush
DEFINE BUTTONBAR oBar OF oWnd SIZE 100,80 3DLOOK 2007 TOP
// 1) In the Main( ) window, a button bar is created, called oReBar. Buttons are added to it.
// 2) When a dialog is ACTIVATEd, ON INIT includes oReBar:Hide( ).
// 3) When a dialog is closed, oReBar:Show( ) is issued.
// 4) In past versions, the bar was displayed and the label font never changed
// 5) With 12.04, when the Show( ) is issued, the bar returns, but with a larger font.
// 6) This is consistent with ALL dialog calls.
oBar:SetColor( 0)
oBar:bClrGrad = { | lInvert | If( ! lInvert, ;
{ { 0.90,14853684,16314573 }, ;
{ 0.90,16314573,14853684 } }, ;
{ { 0.90,14853684,14853684 }, ;
{ 0.90,14853684,14853684 } } ) }
DEFINE BUTTON oButt1 OF oBar FILE c_path + "\project\EXPLORER.BMP" ;
MESSAGE "Button 1" ;
ACTION D_START() ;
PROMPT "Button 1"
oButt1:cToolTip := { " " + CRLF + "Button 1", "1. Button", 1, 0, 128 }
oButt1:SetColor( 128 )
oButt1:SetFont( oButtFont1 )
DEFINE BUTTON oButt2 OF oBar FILE c_path + "\project\TRASH.BMP" ;
MESSAGE "Button 2" ;
ACTION MsgAlert( "Button 1","Attention" ) ;
PROMPT "Button 2"
oButt2:cToolTip := { " " + CRLF + "Button 2", "2. Button", 1, 0, 128 }
oButt2:SetFont( oButtFont2 )
DEFINE BUTTON oButt3 OF oBar FILE c_path + "\project\VISA.BMP" ;
MESSAGE "Button 3" ;
ACTION MsgAlert( "Button 3","Attention" ) ;
PROMPT "Button 3"
oButt3:cToolTip := { " " + CRLF + "Button 3", "3. Button", 1, 0, 128 }
oButt3:SetFont( oButtFont3 )
DEFINE BUTTON oButt4 OF oBar FILE c_path + "\project\ICHAT.BMP" ;
MESSAGE "Button 4" ;
ACTION MsgAlert( "Button 4","Attention" ) ;
PROMPT "Button 4"
oButt4:cToolTip := { " " + CRLF + "Button 4", "4. Button", 1, 0, 128 }
DEFINE BUTTON oButt5 OF oBar FILE c_path + "\project\PENDRIVE.BMP" ;
MESSAGE "Button 5" ;
ACTION MsgAlert( "Button 5","Attention" ) ;
PROMPT "Button 5"
oButt5:cToolTip := { " " + CRLF + "Button 5", "5. Button", 1, 0, 128 }
DEFINE BUTTON oButt6 OF oBar FILE c_path + "\project\Stop.bmp" MESSAGE "Close" ;
ACTION ( oWnd:End() ) ;
PROMPT "Close"
oButt6:cToolTip := { " " + CRLF + "Close Bartest", "Close", 1, 0, 128 }
AEval( oWnd:aControls, { | o | o:oCursor := oCursorHand } )
SET MESSAGE OF oWnd TO "Bar-Test" ;
CENTERED CLOCK KEYBOARD 2007
ACTIVATE WINDOW oWnd MAXIMIZED ;
oBrush:End()
oButtFont1:End()
oButtFont2:End()
oButtFont3:End()
RETURN NIL
// -------------------------
FUNCTION D_START()
LOCAL oDlg1
LOCAL oDlgFont := TFont():New("Arial",,-12,.F.,.F.,,,,.F.)
DEFINE DIALOG oDlg1 SIZE 200, 300 TITLE "Dialog-test" FONT oDlgFont OF oWnd ;
PIXEL TRANSPARENT
ACTIVATE DIALOG oDlg1 CENTERED ;
ON INIT ( oBar:Hide(), oDlg1:Move( 200, 300, 500, 400, .f. ) )
oDlgFont:End()
oBar:Show()
RETURN NIL