Xbasic
UI_TOP_MENU Function
Syntax
C UI_TOP_MENU([C menu_format,[C code[,C menu_context]]])
Arguments
- menu_format
Character
- code
Character
- menu_context
Character
Description
Displays menu in main window, provide action code - if no arguments, then switch to 'no' menu.
Example
The following pieces of code are from the MDI Xdialog Framework Xdialog lesson.
dim event_string as C
dim menu_string as C
event_string = <<%code%
if left(a_command,3) = "A5." then
a5.commanda_command,4?
a_command = ""
else if left(a_command,1) = "!" then
evaluate_templatea_command,2?
a_command = ""
else if left(a_command,6) = "addin:" then
evaluate_templatea_command,7?
else if left(a_command,8) = "command:" then
ui_dlg_event(dlg_title,substr(a_command,9))
else if .not. ("|" $ a_command) then
this.command(a_command)
a_command = ""
end if
%code%
menu_string = a5_menu_def_load("MDI_test")
if a_dlg_button = "activate" then 'show the menu
ui_top_menu(ui_expand_branches(menu_string), event_string)
end ifSee Also