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 - // we are going to build a pulldown menu and we are going to assign it http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
// We are going to build a PullDown menu and we are going to assign it
// to our main Window

// This example is the typical way of start building a FiveWin program

#include "FiveWin.ch"

static oWnd

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

function Main()

   local oIco, oBar

   DEFINE ICON oIco FILE "..\icons\fax.ico"

   DEFINE WINDOW oWnd FROM 1, 1 TO 22, 75 ;
      TITLE "Building the main pulldown menu" ;
      MENU  BuildMenu() ;
      COLOR "W+/RB" ;
      ICON oIco

   DEFINE BUTTONBAR oBar 3D SIZE 33, 33 OF oWnd

   DEFINE BUTTON OF oBar FILENAME "..\bitmaps\exit.bmp" ;
      ACTION MsgInfo( "Hello" )

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

   ACTIVATE WINDOW oWnd

return nil

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

function BuildMenu()

   local oMenu

   MENU oMenu
      MENUITEM "Information"
      MENU
         MENUITEM "&About..." ;
            ACTION ( MsgInfo( "My first Windows app!" + Chr( 13 ) + ;
                            "Msg... functions are quick to use and easy" ),;
                     oWnd:Say( 2, 2, "My first Windows app..." ) )
         SEPARATOR
         MENUITEM "&End..."  ;
            ACTION If( MsgYesNo( "Want to end ?" ), oWnd:End(),)
      ENDMENU

      MENUITEM "&Clients"
      MENU
         MENUITEM "&New..." ;
            ACTION ( MsgStop( "New Clients" ),;
                     oWnd:Say( 5, 5, "New Clients...", "GR+/G" ) )

         MENUITEM "&Modify..."  ACTION MsgInfo( "Modif. Clients" )
         MENUITEM "&Delete..."  ACTION MsgAlert( "Del Clients" )
      ENDMENU

      MENUITEM "&Utilities"
      MENU
         MENUITEM "&Calculator..." ACTION WinExec( "Calc" )
         MENUITEM "C&alendar..."   ACTION WinExec( "Calendar" )
      ENDMENU
   ENDMENU

return oMenu

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

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