Index | Parent | Menu classes |
Menustrip, Menu and Menuitem are used to create menus for applications and windows and context-menus for any object.
A Menu can only be added to a Menustrip.
A Menuitem named MI can only be added to:
Once a Menustrip was used as strip for an application or a window it can't be removed or disposed.
Once a Menustrip was used as context-menu for an object it can't be removed or
disposed.
To remove/dispose it you must set another Menustrip as context-menu for that object and
then remove or dispose it.
Of course all the above is handled by RxMUI: if something is not possible, RxMUI just returns an error code.
See MakeObj() Menuitem()
Menuitem attributes | |||
---|---|---|---|
Name | Type | Class | Note |
Checked | B | ISGN | |
CheckIt | B | ISG | |
CommandString | B | ISG | Set to 1 if the ShortCut (supplied directly or within the Title) is to be considered a description string. Note that if so, the string is not checked: this is left to you. |
Enabled | B | ISGN | |
Exclude | N | ISG | |
MenuTrigger | B | GN | Set to 1 and notified when a Menuitem is selected |
ShortCut | S | ISG | If CmdString is set to 1, this is just a description string, which is not checked by MUI, otherwise this is a real-one-char-short-cut. |
Title | S | ISG | It is the Menuitem title. If in the form S\Title, S is used as short cut for the Menuitem. Note that if ShortCut is supplied it is used, if \\ is found, the short cut is ignored. This is very helpy in localizing strings. |
Toggle | B | ISG |
Menuitem methods | ||
---|---|---|
Name | Parameters | Note |
None defined |
Menu attributes | |||
---|---|---|---|
Name | Type | Class | Note |
Enabled | B | ISGN | |
Title | S | ISG |
Menu methods | ||
---|---|---|
Name | Parameters | Note |
None defined |
Menustrip attributes | |||
---|---|---|---|
Name | Type | Class | Note |
Enabled | B | ISGN |
Menustrip methods | ||
---|---|---|
Name | Parameters | Note |
None defined |
The following lines all create the same Menustrip object:
app.Menustrip="mstrip" mstrip.0="mproject" mstrip.Class="Menustrip" mproject.Class="Menu" mproject.Title="Project" mproject.0="mabout" mabout.Class="Menuitem" mabout.title="About..." mabout.shortcut="?" mproject.1="maboutrxmui" maboutrxmui.Class="Menuitem" maboutrxmui.title="About RxMUI..." mproject.2="maboutmui" maboutmui.Class="Menuitem" maboutmui.title="About MUI..." mproject.3="md1" md1.Class="Menuitem" md1.title="BAR" mproject.4="mhide" mhide.Class="Menuitem" mhide.title="Hide" mhide.shortcut="H" mproject.5="md2" md2.Class="Menuitem" md2.title="BAR" mproject.6="mquit" mquit.Class="Menuitem" mquit.title="Quit" mquit.shortcut="Q" mstrip.1="meditor" meditor.Class="Menu" meditor.Title="Editor" meditor.0="mdefault" mdefault.Class="Menuitem" mdefault.title="Reset to defaults" mdefault.shortcut="R" meditor.1="mlast" mlast.Class="Menuitem" mlast.title="Last saveds" mlast.shortcut="L" meditor.2="mrestore" mrestore.Class="Menuitem" mrestore.title="Restore" mrestore.shortcut="R" meditor.3="md3" md3.Class="Menuitem" md3.title="BAR" meditor.4="mmui" mmui.Class="Menuitem" mmui.title="MUI..."
mstrip.0="mproject" mproject.Class="Menu" mproject.Title="Project" mproject.0=Menuitem("mabout","About...","?") mproject.1=Menuitem("maboutrxmui","About RxMUI...") mproject.2=Menuitem("maboutmui","About MUI...") mproject.3=Menuitem(,"BAR") mproject.4=Menuitem("mhide","Hide","H") mproject.5=Menuitem(,"BAR") mproject.6=Menuitem("mquit","Quit","Q") mstrip.1="meditor" meditor.Class="Menu" meditor.Title="Editor" meditor.0=Menuitem("mdefault","Reset to defaults","D") meditor.1=Menuitem("mlast","Last saveds","L") meditor.2=Menuitem("mrestore","Restore","R") meditor.3=Menuitem(,"BAR") meditor.4=Menuitem("mmui","MUI...") if NewObj("Menustrip","mstrip")>0 then exit ... app.Menustrip="mstrip"
app.Menustrip="mstrip" mstrip.0="mproject" mstrip.Class="Menustrip" mproject.Class="Menu" mproject.Title="Project" mproject.0=Menuitem("mabout","About...","?") mproject.1=Menuitem("maboutrxmui","About RxMUI...") mproject.2=Menuitem("maboutmui","About MUI...") mproject.3=Menuitem(,"BAR") mproject.4=Menuitem("mhide","Hide","H") mproject.5=Menuitem(,"BAR") mproject.6=Menuitem("mquit","Quit","Q") mstrip.1="meditor" meditor.Class="Menu" meditor.Title="Editor" meditor.0=Menuitem("mdefault","Reset to defaults","D") meditor.1=Menuitem("mlast","Last saveds","L") meditor.2=Menuitem("mrestore","Restore","R") meditor.3=Menuitem(,"BAR") meditor.4=Menuitem("mmui","MUI...")
app.Menustrip=MakeObj(,"Menustrip",, MakeObj(,"Menu","Project",, Menuitem("mabout","About...","?"),, Menuitem("maboutrxmui","About RxMUI..."),, Menuitem("maboutmui","About MUI..."),, Menuitem(,"BAR"),, Menuitem("mhide","Hide","H"),, Menuitem(,"BAR"),, Menuitem("mquit","Quit","Q")),, MakeObj("medit","Menu","Editor",, Menuitem("mdefault","Reset to defaults","D"),, Menuitem("mlast","Last saveds","L"),, Menuitem("mrestore","Restore","R"),, Menuitem(,"BAR"),, Menuitem("mmui","MUI...")))