Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Select selection : select bold menu
#1
Hi Gintaras, hi all

i use massively the routine to act with firefox tabs. i use one that gives a popupmenu from opened tabs names, and the currently selected tab has it's menu item bold.

I failed trying to autoselect it when menu pops.

Can you help?
Thanks
Function FirefoxUrlFromTabName
Code:
Copy      Help
type NAMEURL str'name str'url
ARRAY(NAMEURL) m
MenuPopup p
NAMEURL& r=m[]

for int'i 0 names.len
,if(empty(urls[i])) continue
,r.name=names[i]
,r.url=urls[i]
,p.AddItems(r.name i+1)
;;
p.SetBold(selectedTab+1)

int ii=p.Show-1; if(ii<0) ret
;int hwnd=win("" "#32768")
s=urls[ii]
#2
What is "autoselect" here?
#3
Well, the menu item in bold (default) should be autoselected so i don't have to navigate with mouse/keyboard to go to it, and I could launch it directly with enter key.
Clearer?
#4
Need a hook or other thread.
Also will need Show(0 0 1) to activate the menu to enable keyboard.
#5
Function FirefoxUrlFromTabName
Code:
Copy      Help
MenuPopup p.AddItems("1a[]2bold[]3c")
p.SetBold(2)

mac "menu_autoselect" "" 2

int ii=p.Show(0 0 1)-1; if(ii<0) ret
;int hwnd=win("" "#32768")
out ii
Function menu_autoselect
Code:
Copy      Help
;\
function n
int hwnd=wait(5 WV win("" "#32768"))
rep n
,PostMessage hwnd WM_KEYDOWN VK_DOWN 0
#6
Was almost ther, except the outside function to make it work.
Tweaked with +1 added to item number to have the right one chosen, and voilà, another solved problem.

TY Gintaras


Forum Jump:


Users browsing this thread: 1 Guest(s)