Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PopupMenu: use Label for sel
#1
how to i get the menu text instead of index?

like
sel PopupMenu.Index.Label
case "Andre"

Function rclick
Code:
Copy      Help
str menu=
;Andre
;Anne
;Dirk
;Empfang
;Maya
;Lichtrechner Lenovo
;Server
;-
;Admin Backupstation
;Admin Fritzbox 1
;-
;Exit
out
int i=PopupMenu(menu)
;out i

sel(i)
,case 1 make_rdp("andre-pc" "remote" "starled02")
pi
#2
Macro Macro2120
Code:
Copy      Help
str menu=
;Andre
;Anne
;Dirk
;Empfang
;Maya
;Lichtrechner Lenovo
;Server
;-
;Admin Backupstation
;Admin Fritzbox 1
;-
;Exit
out
MenuPopup m.AddItems(menu 1)
int i=m.Show
out i
if(!i) ret
m.GetItemText(i _s)
out _s
#3
thank you. now i don't have to use index anymore, this way it is easier for me to maintain my small solution.
pi
#4
or

Macro Macro2120
Code:
Copy      Help
str menu=
;1 Andre
;2 Anne
;3 Dirk
;4 Empfang
;5 Maya
;6 Lichtrechner Lenovo
;7 Server
;-
;101 Admin Backupstation
;102 Admin Fritzbox 1
;-
;900 Exit
out
int i=ShowMenu(menu)
out i
#5
or

Macro Macro2120
Code:
Copy      Help
def M_ANDRE 1
def M_ANNE 5
;...

str menu=
F
;{M_ANDRE} Andre
;{M_ANNE} Anne
;...
out
int i=ShowMenu(menu)
out i
sel i
,case M_ANDRE
,case M_ANNE
,;...


Forum Jump:


Users browsing this thread: 1 Guest(s)