Home Index classes Index static functions Index enumerations Index structure types

{Menu|_create}


CLASS {Menu|_create} , UNTESTED:


The helper class to simplify and standartizy some operations while building a string defining a menu. In the AL-IV {Form} class, a popup menu is defined as just a list of string lines separated with #NL characters. Such popup menu can be constructed from the scratch using standard operations under strings (e.g., the concatenation). For example, writing "A:Abc" we create a menu item having the alias A and showing text Abc. Or, we can call the function Item("A", "Abc") and to get the same result. In some cases this can be just more convenient (e.g. in the IDE Designer which uses this {Menu} class to generate menu creation code).


IMPORT : {String_functions} , {System_functions} .


FUNCTION Item|_create ( STR Alias|_item , STR Text|_item ) ==> STR


Creating a menu item with the given Alias and Text. Resulting string is Alias ":" Text, where Alias does not contain ":" (or truncated before it).


FUNCTION Hotkey|_add_after_tabulation (
     
STR Item_created ,
     
STR H|otkey_to_add ) ==> STR


Extending a menu item text adding right to the text shortcut keys after the tabulation character (but not on all platforms: in the Android this call is just ignored). These shortcut keys are just shown (aligned to each others) and this is you who should provide correct handling those key shortcuts.


FUNCTION Disabled|_item (
     
STR Item_created ,
     
BOOL Cond|ition ) ==> STR


Inserting the special text ",disabled" just before the coln character in the menu item passes in case when the condition passed is TRUE. This makes the menu item created grayed and not enabled to click on it.


FUNCTION Checked|_item (
     
STR Item_created ,
     
BOOL Cond|ition ) ==> STR


Inserting the special text ",checked" just before the coln character in the menu item passes in case when the condition passed is TRUE. This adds a checkmark to the menu item (looking checked usually showing that a property controlled by the menu item is turned on).


FUNCTION Hidden|_item ( STR Item_created , BOOL Cond|ition ) ==> STR


Replacing entire text with the empty string if the Condition passed is TRUE. This removes the menu item from a menu.


FUNCTION Separator ==> STR


Creates a special menu item which is looking like a horizontal line between menu items. It is used often to separate groups of menu items concerning a group of connected options.


FUNCTION Begin|_submenu ==> STR


Begins a submenu (a special text line containing the character "(" starting a submenu).


FUNCTION End|_submenu ==> STR


Ends a submenu (a special text line containing the character ")" ending a submenu).


FUNCTION Custom|_submenu ( STR Value|_custom_items ) ==> STR


Returns a string passed.

END