ANSI Standard PL/B Language and Visual PL/B
MENU OBJECTS
NOTE TO OUR READERS
This web resource is written for our own use. But we feel strongly that the PL/B language should be shared with the software community. So feel free to use this at will!
BUT PLEASE...
if you find errors or omissions or have a better way to do something. TELL US! Dialog helps us all. Send e-mail to:
support@mmcctech.com
Here are a few quick notes on MENU objects.
- Menus can be created on the main window or on a window created by the form designer.
MY_MENU MENU
MY_MENU_DATA INIT ")MYSTUFF":
";)Scream":
";Sho)ut"
CREATE MY_MENU,MY_MENU_DATA
ACTIVATE MY_MENU,MY_MENU_ROUTINE,MENU_RESULT
CREATE Form_Window;MY_MENU,MY_MENU_DATA
ACTIVATE MY_MENU,MY_MENU_ROUTINE,MENU_RESULT
- A number of special characters can be used in the menu definition. Such as function keys, etc.
WATCH OUT FOR: the < symbol which is a special SUFFIX. This causes the runtime to use the built in fuctions for the numbered functions rather than passing the event to your own routine.
The benefit of this is so that the standard RIGHT CLICK offers CUT, COPY, PASTE, etc. You might want to have these also show up on your EDIT menu... but you don't want to process them yourself. By including the <n suffix to your menu item, the standard CUT/COPY processing will be done by the runtime. If you DO NOT use the <n suffix, and the menu item is clicked, control passes to you and you must handle it.
The < codes from the plb manual are:
<1 Undo
<2 Cut
<3 Copy
<4 Paste
<5 Delete
<6 Select All
-
The examples in the on-line help from Sunbelt show things like the illustration below. That's a very good example. What's not spelled out is that the hex 09 (0x09) tab character in the string is exactly that... a tab character. It's only used to line things up in the menu item on the screen.
MENUDATA INIT ")Demo;":
"/T&Test",0x09,"CTRL+T;":
"<F5&Next Item",0x09,"F5;":
"&Previous Item",0x09,"SHIFT+F5<sF5"
.
CREATE XMENU,MENUDATA
v1.10
Write to MMCC Technical Support at:
Send
e-mail to MMCC.
MMCC - Technical Support
600 W. Midland
Bay City, MI 48708
(989) 686-8860
© 1997 - 2024 MMCC - All Rights Reserved