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 - <b>1.3 the pulldown menu</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 1.3 The PullDown Menu
--------------------------------------------------------------------------------

  The typical structure of a Windows program is to build a Window and to
  assign it a main menu that will be useful as main organizer of the
  application.

  From the menu, the user can select the different tasks of a program.
  Thanks to the pulldown menu structure of Windows we can implement an
  easy and intuitive user interface.

  You should try to use good design techniques for the main menu of your
  application. Don't make it too complicated. The idea is to implement just
  a few main options at the bar menu so the user will easily select what he
  needs, and from there you should presents new submenus that will contain
  all the possible options.

  FiveWin has been designed so you don't need to code DO CASE...ENDCASE
  options to select from the different actions the user may choose.

  When a MenuItem is defined, we will specify the action we want to be
  automatically executed when the user selects that option. It is very
  easy to control all the possible options of the program.

    MENU oMenu

       MENUITEM <cItem> MESSAGE <cMessage> ACTION <uAction>

       MENUITEM <cItem> MESSAGE <cMessage>  // No action here
       MENU                                     // Submenu
          MENUITEM <cItem> MESSAGE <cMessage> ACTION <uAction>
       ENDMENU
       ...
       SEPARATOR
       MENUITEM <cItem> MESSAGE <cMessage> ACTION <uAction>

    ENDMENU

 MESSAGE & ACTION are optional clauses.  If an Action clause is not
 defined, except in the case of a heading for a submenu, then nothing happens
 when you select that menu option.

 You can have as many SubMenus as you need. To create a SubMenu you only have
 to specify a new MENU ... ENDMENU combination under a MenuItem and
 complete it as usual.

       MENUITEM <cItem> MESSAGE <cMessage>
       MENU                               // The new Submenu starts here
          MENUITEM <cItem> MESSAGE <cMessage> ACTION <uAction>
          ...
       ENDMENU

       MENUITEM <cItem> MESSAGE <cMessage> ACTION <uAction> // More Items

 To activate the menu:

 To activate the menu first you have to assign it to a Window. The easiest
 way to do this is when you are building your Window:

       DEFINE WINDOW <oWnd> <otherClauses> ;
          MENU BuildMenu()

       ...

       function BuildMenu()

          local oMenu

          MENU oMenu
             MENUITEM <cItem> MESSAGE <cMessage> ...
             ...
          ENDMENU

       return oMenu

 or you can do it later using the command:

       SET MENU OF <oWnd> TO <oMenu>

See Also: TMenu Commands Menu.ch

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