Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Building a tagged menu
#1
I have a simple menu built this way:

>Menu 1
Voice 1 ; Tag 1
Voice 2 ; Tag 1
Voice 3
<

when I run this menu and the mouse cursor hovers the line labeled "Menu 1", I see that automatically the three subvoices of the menu appear.
I want to add a second menu that should point to the voices of "Menu 1" containing the text "Tag 1", automatically selecting these voices and showing only these voices when I hover with the mouse cursor on "Menu 2".
How can I tell to Quick macros to do this? The new menu should be organized in a way similar to this:

>Menu 1
Voice 1 ; Tag 1
Voice 2 ; Tag 1
Voice 3
<
>Menu 2
Please, list here automatically for me all and only the "Menu 1" voices containing the word "Tag 1"
<
#2
Macro Macro1209
Code:
Copy      Help
str s=
;>Menu 1
;1 Voice 1 ; Tag 1
;2 Voice 2
;3 Voice 3 ; Tag 1
;<

str tag=" ; Tag 1"
ARRAY(str) a; int j
if findrx(s F"^(.+){tag}$" 0 4|8 a) ;;get all tagged lines
,s.findreplace(tag) ;;remove tags
,s.addline(">Menu 2")
,for(j 0 a.len) s.addline(a[1 j])
,s.addline("<")

int i=ShowMenu(s)
out i
#3
I can't figure out how to set the flag for ShowMenu: I need the popup to always be at the top left of the screen or window. I can't set the "p" as type POINT and make it work: Can anyone help?

MenuPopup x.AddItems(s)
int i=ShowMenu(s p 1)
#4
Macro Macro2022
Code:
Copy      Help
POINT p
int i=ShowMenu("1 A[]2 B" 0 p 1)
#5
Thank you


Forum Jump:


Users browsing this thread: 1 Guest(s)