GUI ScreenIO for Windows

 ScreenIO.com


Defining Menus

The menu definition looks complicated, but it is quite straightforward.  In this case, we'll first create the high-level item File, which is the first item in the main menu of our Windows applications. 

There are Three Types of menus that are defined in the same way using this panel.

  1. Main Menus These appear at the top of the panel in the menu line.  It support the full tree structure layout, with sub-menus (called child menus) that appear when you select the root element.  The root element of a child menu will display an Arrow head (as shown below on the "Relocate" element).  The root element of a child menu does not return any event. 
  2. Blind Menus are simply keys (F-key, Alt-Keys, Ctrl-Keys) that will return events for this panel.  They are never shown on a menu and the user can't see them (hence the name blind) and therefore have no need of a tree structure.
  3. Context menus appear as you right click any control, or the panel itself.  Default context menus are supported for copy/paste operations on controls that accept data.  Context menus support child menus and therefore the tree structure.

To add a new item, right click the (initially empty) Menu Tree Structure, and the context menu will pop up. 

Choose Add New Item.

Since the File item will have branches beneath it, it will not return an event; it's the top item of the branch.  Therefore, just leave 88-name of event blank in the menu properties, enter the Menu Item Text and press the OK button. 

Defining Subordinate Menu Items

Once we've added the top level item, we'll add a couple of subordinate items; Open, Close, and Exit. 

Do this by selecting the menu item below which you want to add items, and right click to get the context menu again and then add the new item. 

You can select Add New Item to create a new (sibling) item at the same level or Add Branch Item to create a child item of the selected menu item.  

Note: You can also Copy/Paste individual items (or entire branches) from one panel to another:  Open both panels at the same time, Copy from one panel's menus then close the menu editor, select the other panel, Open the menu editor, select the target,  right click and indicate if you want to paste a branch or paste below. 

Now, the menu definition panel looks like this:

Here's what your menu will look like when you run your application.

GUI ScreenIO automatically appends the text of the keyboard equivalent that you selected when your menu item is displayed.  

Note: Right clicking any menu item allows you to edit its properties.

Related topics:

If you want to change the text of a menu at run time (via your program) there is an option on the Panel Properties which will break the text elements of the panel into separate labeled strings.  This will provide a data field into which you can move new menu text to change the meaning of a menu item on the fly.  The event id will remain the same.  After changing menu content in this way, you need to tell the runtime to update menu items.


© 2000-2019 Norcom, all rights reserved 

TOC

Send feedback to Norcom