#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
//----- main menu -------//
xMESSAGE := "User "+xLOGIN+" Rights "+cRIGHTS+ ;
" Default= "+cDEFA+" Rdd= "+cRDD+ ;
" Revision "+DTOC(dEXE)+;
" -r"+str(nSCR1,4)+" x "+STR(nSCR2,4)
DEFINE ICON oICO RESOURCE "PMO"
DEFINE WINDOW oWindMain ;
FROM 0,2 to 28,78 ;
TITLE "PMO Strategic Projects Vital Signs" ;
MENU BuildMenu(cOLDDEFA,dEXE,cRDD,nSCR1,nSCR2,lFROMLINK,xPROJECTEID,oWindMain);
ICON oICO ;
MDI
DEFINE BITMAP oBMAP FILENAME (cOLDDEFA+"\PMO.BMP") of oWindMain
// 56, 64
DEFINE BUTTONBAR oBar OF oWindMain SIZE 56,58 2010
* oBar:SetColor( 0)
oBar:bClrGrad = { || { { 0.10,15724527,7303023 }, ;
{ 0.10,7303023,15724527 } } }
DEFINE BUTTON oButt1 of oBar ACTION ( _ProjBrow(oWindMain, lFROMLINK, xPROJECTEID, oBar )) ;
RESOURCE "compas",;
"DCompas",;
"DCompas";
PROMPT "Projects" ;
TOOLTIP "Project Management Information"
//-------- group --
MENU oPopRpt1 POPUP
MENUITEM "PMO Project Status Report" FileName (cDefa+"\Icons\FOLDEROPEN.bmp") ;
ACTION ( _ProjList() )
MENUITEM "PMO Delinquent Reminder Reporting" FileName (cDefa+"\Icons\FOLDERCLOSED.bmp");
ACTION ( _ProjDelq() )
MENUITEM "PMO Delinquent Reporting Generation" FileName (cDefa+"\Icons\FOLDERDETAIL.bmp");
ACTION ( Msginfo( "Under Construction" ))
MENUITEM "PMO Delinquent Reporting Generation" FileName (cDefa+"\Icons\FOLDERCLOSED.bmp");
ACTION (_Delinq() )
ENDMENU
DEFINE BUTTON oButt2 of oBar ;
RESOURCE "reports",;
"DReports",;
"DReports";
PROMPT "Reports" ;
ACTION oButt2:ShowPopup()GROUP;
MENU oPopRpt1 ;
TOOLTIP "Reports"
//-------- group --
MENU oPopUtl POPUP
MENUITEM "System Parameters" FileName (cDefa+"\Icons\FOLDEROPEN.bmp") ;
ACTION ( _OwnView( "E", oWindMain ) )
MENUITEM "User and Project Mgr Information" FileName (cDefa+"\Icons\FOLDERCLOSED.bmp");
ACTION ( _userbrow( oWindMain ) )
MENUITEM "Sponsor and Customer Information" FileName (cDefa+"\Icons\FOLDERDETAIL.bmp");
ACTION ( _Spbrow( oWindMain ) )
MENUITEM "Frequency Indicator Information" FileName (cDefa+"\Icons\FOLDERCLOSED.bmp");
ACTION ( _FreqBrow( oWindMain ) )
MENUITEM "Role Information" FileName (cDefa+"\Icons\FOLDERDETAIL.bmp");
ACTION ( _Rolebrow( oWindMain ) )
MENUITEM "Master Strategic Goals" FileName (cDefa+"\Icons\FOLDERDETAIL.bmp");
ACTION ( _Mg_brow( oWindMain ) )
ENDMENU
DEFINE BUTTON oButt3 of oBar ;
RESOURCE "utility",;
"DUtility",;
"DUtility";
PROMPT "Utilities" ;
ACTION oButt3:ShowPopup()GROUP;
MENU oPopUtl ;
TOOLTIP "Utilities and Setup Parameters"
DEFINE BUTTON oButt4 of oBar ACTION ( oWindMain:End()) ;
RESOURCE "quit";
PROMPT "Quit" ;
TOOLTIP "Quit and Close this Program"
SET MESSAGE OF oWindMain ;
to xMESSAGE CLOCK 2010
ACTIVATE WINDOW oWindMain ;
MAXIMIZED ;
ON PAINT ( IF( xTEXT = "/NL", ,PalBmpDraw( hDC, 0,0, oBMAP:hBitmap, oBMAP:hPalette, nSCR1, nSCR2 )));
ON INIT ( IF( xTEXT = "/NL", , MSGLOGO( cDEFA+"\SPLASH.BMP",2 )), ;
IF( nSCR1 < 1024, _ResMessage(nSCR1, nSCR2), ),;
IF( lFIRST = .T., _OwnView( "A", oWindMain), ),;
IF( lFROMLINK = .T., _ProjBrow( oWINDMain, lFROMLINK, xPROJECTEID ), ),;
IF( lSENDMAIL = .T., SendMail(), ), oWINDMain:Select(), oWINDMain:Refresh() ) ;
VALID ( IIF( !lExitPgm, ExitPgm( .T.,@lExitPgm ) , .F. ))
RETURN( NIL )
// Now open the window and apply settings
DEFINE WINDOW oWnd TITLE mlsTitle FROM 0,0 TO 800, 1150 PIXEL MENU BuildMenu( )
oWnd:SetIcon( oWIcon )
oWnd:oFont := oMfont
oWnd:nHelpID := 19
WNDCENTER( oWnd:hWnd ) // Center the window on the screen
DEFINE BUTTONBAR oReBar OF oWnd SIZE 50,60 2007
DEFINE BUTTON OF oReBar RESOURCE "ORDER" PROMPT "Order" ACTION PRO100M( ) ;
TOOLTIP "Workorders" FONT oBfont
DEFINE BUTTON OF oReBar RESOURCE "HRHIST" PROMPT "History" ACTION PRO7500( );
TOOLTIP "Service History" FONT oBfont
DEFINE BUTTON OF oReBar RESOURCE "INVENT" PROMPT "Parts" ACTION PRO2100( );
TOOLTIP "Inventory Editor" FONT oBfont GROUP
DEFINE BUTTON OF oReBar RESOURCE "LOSTSALE" PROMPT "Lost" ACTION PRO2810( );
TOOLTIP "Lost Sales" FONT oBfont
DEFINE BUTTON OF oReBar RESOURCE "CLIENT" PROMPT "Client" ACTION PRO3100( ) ;
TOOLTIP "Client Editor" FONT oBfont GROUP
DEFINE BUTTON OF oReBar RESOURCE sBmp[1] PROMPT sLbl[1] ACTION PRO3200( ) ;
TOOLTIP sLbl[1] + " Editor" FONT oBfont
.... Additional coded buttons continue here
// Activate the window
ACTIVATE WINDOW oWnd ON PAINT MainWinBckgrnd( hDC, oWnd ) VALID MsgYesNo( "Do you want to quit ? ", "Exiting ")
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 120 guests