BRIZ

User menu

The context menu is the menu which user can adjust and configure itself. The menu is caused by click of the right button of a mouse, through a toolbar or by program. Result of a choice of menu item is sending on a server of the given sequence of symbols. The sequence can contain any symbols and contents of the clipboard. For work with a context menu there are following server subroutines:

Sub GP.ContextMenuSub(StrMethod)

Sub GP.ContextMenuFn(StrMethod,Ret)

Context menu methods

DeleteMenu MenuName[,position] Deletes menu item
RenameMenu Name1,Name2 Renames menu
TrackMenu MenuName[,[px],[py][,flags]] Shows menu at the given position
CreatePopupMenu ParentName,[InsertBefore],PopupMenuName,PopupMenuText Creates popup menu item
InsertMenuItem ParentName,[InsertBefore],MenuName,MenuText;MenuOutput Inserts menu item into the given popup menu
InsertSeparator ParentName,[InsertBefore][,SeparatorName] Inserts separator into the given popup menu
SetOutputString MenuName,[position],OutputString

String which it will be transferred on a server at a choice of the specified element of the menu.  See Sequence format description.

SetDescription MenuName,[position],Description Text description of the specified menu item
Load FileName[,InitDir]", Loads context menu from the specified file
LoadMenu MenuName,FileName[,InitDir] Loads given context menu from the specified file
AppendFromFile MenuName,FileName[,InitDir] Appends given context menu from the specified file
Save FileName[,InitDir] Saves context menu
SaveMenu MenuName,FileName[,InitDir] Saves given context menu
Execute MenuName Emulate menu item click (Allows parse clipboard)
DeleteAllItems Deletes all items

For adjustment of the menu is possible to use the dialog of adjustment of context menu or the text editor for editing a file containing the description of a menu. At start of the program the menu described in a file which is specified in dialogue of adjustment of the terminal is loaded. For enable of use the context menu is necessary to sets a flag in the menu "view". With the help the context menu is possible to automate work in a command line of the terminal.

  1. Tests context menu
  2. Loads context menu from the specified file
  3. Saves context menu
  4. Apply changes
  5. Restore current context menu
  6. Inserts menu item
  7. Inserts popup menu item
  8. Inserts separator
  9. Removes menu item
  10. Moves menu item UP
  11. Moves menu item DOWN
  12. Moves menu item LEFT
  13. Moves menu item RIGHT
  14. Context menu explorer
  15. Menu item ID
  16. Sets menu item name (For idetify)
  17. Sets menu item text (For display)
  18. Sets string which it will be transferred on a server at a choice of the specified element of the menu
  19. Sets menu item description
  20. Sets clipboard test value
  21. Shows menu item output

Structure of Context menu file

Menu item

MENUITEM<tab>Menu name<tab>Menu ID<tab>Menu text<tab>Description<tab>Output text

Popup menu

SUBMENU<tab>Menu name<tab>Menu ID<tab><tab>Menu text<tab>Description

End of menu or popup menu

END

Example

MENUITEM<tab>nm1<tab>0<tab>EXIT<tab>Menu for exit<tab>EXIT\r
SUBMENU<tab>Snm1<tab>1<tab>0<tab>Operation with PICK files
MENUITEM<tab>nm2<tab>0<tab>List %CLIP a1 a2 a3 a3 a4 <tab>List %C a1 a2 a3 a3 a4\r
MENUITEM<tab>nm3<tab>0<tab>istat<tab>istat %c (s\r
END
END