Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GetLastSelectedMenuItem parent item (submenu name)
#1
Is it possible to get the full path and/or submenu menu when clicked on?
It is like the function GetLastSelectedMenuItem , but I need it to return the fullpath or at least the submenu item clicked on.

For example the below code, shows the menu "Menu 1"

it has a menu path
.root item
.root item
.root item
[dialog_clips] (submenu)
> [windows] (submenu)
> sub item
> sub item
> etc...


If I click on 'dialog_clips', the menu expands to submenu 'windows', in stead I would like to output "dialog_clips".
The same goes for the other sub menu's, for example if I would click on "windows" it would output
"windows"
or
"dialog_clips\windows" (this is the full path).


I almost have a macro complete that creates a code snippet (in a new macro) from selected text and puts it into a menu.
The problem is that I can't "point" to the desired location within the submenu.

The menu itself already exists, and below is a part of it.
Menu code:
Menu Menu1
Code:
Copy      Help
Var output :mac "qmpop_output_var"
Open :mac "qmpop_OpenFileFolderQMeditor"
Replace :mac "qmpop_replace_inQM_editor"
-
>array
,for loop from selected var :mac "qmpop_for_loop"
,create from selected :mac "qmpop_create_array"
,<
>dialog_clips
,>Window
,,gettxt :mac "qmpop_window_gettxt"            
,,hide/disable :mac "qmpop_window_hide"            
,<
,>Checkbox
,,Get :mac "qmpop_checkbox_getval"    
,,Set :mac "qmpop_checkbox_setval"    
,<
,>DDLB
,,declare :mac "qmpop_ddlb_declare"
,,get selected ID :mac "qmpop_ddlb_get_selected_id"
,,get selected string :mac "qmpop_ddlb_get_selected_string"
,,add string item :mac "qmpop_ddlb_add_string_item"
,,set selected ID :mac "qmpop_ddlb_set_selected_id"
,,set selected string :mac "set_selected_string"
,<


Maybe possible with "MenuGetString", but I do not how to produce the correct syntax
#2
Cannot get submenu-item text.
To get normal item path, can parse menu text.
This code displays the selected menu line and all lines before. You can create path from it.
Macro Macro2215
Code:
Copy      Help
out
int i=mac("Menu1")-1
if(i<0) ret
ARRAY(str) a=_s.getmacro("Menu1")
for i i -1 -1
,out a[i]
#3
thank you!!!!


Forum Jump:


Users browsing this thread: 1 Guest(s)