Hi - is there a way to script a tab selection on a tab panel control? I've tried mouseUp and menuItem "tab 1" but those didn't work. I want to select a specific tab to open depending on a user's keyboard shortcut. Couldn't find anything else in the docs or forum yet to try. Thanks!
on rawKeyDown theKeyNumber
switch (theKeyNumber)
case 50 -- 2
if the ctrlKey is down then
send mouseUp ("Tab 2") to btn "tabpanel"
end if
break
case 51 -- 3
if the ctrlKey is down then
send mouseUp ("Tab 3") to btn "tabpanel"
end if
break
end switch
pass rawKeyDown
end rawKeyDown
scripting a click on a tab panel
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: scripting a click on a tab panel
Hi rjd,
you can "set the menuhistory of btn xxx to y", where y is the number of the TAB you want to hilite/select.
Example: Tabbed button "el tabbo" with 3 tabs: tab1, tab2, tab3
Will hilite/select the second tab "tab2" as if clicked, you get the picture.
Best
Klaus
you can "set the menuhistory of btn xxx to y", where y is the number of the TAB you want to hilite/select.
Example: Tabbed button "el tabbo" with 3 tabs: tab1, tab2, tab3
Code: Select all
on mouseup
set the menuhistory of btn "el tabbo" to 2
end mouseup
Best
Klaus
Re: scripting a click on a tab panel
Thanks for the quick response, Klaus! I don't know how I didn't come across that in my searches but I'm so glad you knew it =)
-
- VIP Livecode Opensource Backer
- Posts: 9578
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: scripting a click on a tab panel
Hi.
What Klaus knew.
You should know that all similar buttons will respond in this way. So if you have an option menu and want to "preset" its displayed selection, you can do the same thing.
Craig Newman
What Klaus knew.
You should know that all similar buttons will respond in this way. So if you have an option menu and want to "preset" its displayed selection, you can do the same thing.
Craig Newman