Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FiveWin 1.9.2 - January 97 - // this is the same exercise we have done at tutor04, but now http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
// This is the same exercise we have done at Tutor04, but now
// we are going to add it messages to Menu options and we are going
// to start program execution with the Window maximized.

#include "FiveWin.ch"

static oWnd

//----------------------------------------------------------------------------//

function Main()

   DEFINE WINDOW oWnd FROM 1, 1 TO 22, 75 ;
      TITLE "Building the main menu of your app" ;
      MENU  BuildMenu()

   SET MESSAGE OF oWnd ;
      TO FWVERSION + " " + FWCOPYRIGHT ;
      CENTERED DATE CLOCK KEYBOARD

   ACTIVATE WINDOW oWnd MAXIMIZED     // Now the app will start maximized

return nil

//----------------------------------------------------------------------------//

function BuildMenu()

   local oMenu

   MENU oMenu
      MENUITEM "Information"
      MENU
         MENUITEM  "&About..." ;
            ACTION  MsgAbout( "My first windows app!", "Your name here!" ) ;
            MESSAGE "About this app"
         SEPARATOR
         MENUITEM "&End..."  ;
            ACTION If( MsgYesNo( "Want to end ?", "Please, tell me" ),;
                       oWnd:End(),) ;
            MESSAGE "End this app"
      ENDMENU

      MENUITEM "&Clients"
      MENU
         MENUITEM   "&New Client..." ;
            ACTION  MsgStop( "New Client" ) ;
            MESSAGE "Add a new Client"

         MENUITEM "&Modifications..."  ;
            ACTION MsgInfo( "Modif. Client" ) ;
            MESSAGE "Edit and modify a Client information"

         MENUITEM "&Delete" ;
            ACTION MsgAlert( "Del Client" ) ;
            MESSAGE "Delete a Client record"
      ENDMENU

      MENUITEM "&Utilities"
      MENU
         MENUITEM "&Calculator..." ;
            ACTION WinExec( "Calc" ) ;
            MESSAGE "Using the Windows calculator"

         MENUITEM "C&alendar..." ;
            ACTION WinExec( "Calendar" ) ;
            MESSAGE "Using Windows calendar"

         MENUITEM "Write..." ;
            ACTION WinExec( "Write" ) ;
            MESSAGE "Using Windows write"
      ENDMENU
   ENDMENU

return oMenu

//----------------------------------------------------------------------------//

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson