Page 1 of 1
How to jump among tab menus by pressing tab button
Posted: Sun Nov 30, 2014 7:22 am
by alemrantareq
Hello, I'm trying to make a app with 4 tab menus. Each tab menu has different controls. I can select the controls by pressing tab button from keyboard. but I can't jump to the next tab menu by pressing the tab button. Is there a way to do that? I mean in then first tab, when I press tab button continuously , it will jump among the controls, then it will jump to the next tab menu automatically and will select the controls in it...then next tab menu and so on.
I've seen some examples of menuHistory scripts here; but can't figure it out. I wonder if anyone can help, it'll be appreciated. btw, I use rev ent 4

Re: How to jump among tab menus by pressing tab button
Posted: Sun Nov 30, 2014 9:19 am
by Dixie
Hi...
Have a look at the card script of the attached stack...
Re: How to jump among tab menus by pressing tab button
Posted: Sun Nov 30, 2014 9:26 am
by alemrantareq
thanks for your reply, but as I use rev ent 4, it can't open .livecode file. would you mind to post all of the scripts here?
Re: How to jump among tab menus by pressing tab button
Posted: Sun Nov 30, 2014 9:30 am
by Dixie
Why don't you download the 'community' version of LC ?...
put the following into the card script...
Code: Select all
on tabkey
put the menuhistory of button 1 into whichTab
if whichTab < 4 then
add 1 to whichTab
else
put 1 into whichTab
end if
set the menuhistory of button 1 to whichTab
end tabkey
Re: How to jump among tab menus by pressing tab button
Posted: Sun Nov 30, 2014 9:39 am
by alemrantareq
thanks again for your reply. I tried the same script already. But after applying this, selection jumps on longer among the controls in a card; only among the tab menus
I downloaded LC community version, and gave it a try. But I was demotivated with it because the size of standalone app is over 6 MB when I can make the same app in 1 MB using rev 4 !!
Re: How to jump among tab menus by pressing tab button
Posted: Sun Nov 30, 2014 10:36 am
by alemrantareq
I just figured it out with the help of shiftKey and arrowKey
Code: Select all
on arrowKey tKey
if the shiftKey is down and tKey is "right" then
put the menuhistory of button 1 into tSwitch
if tSwitch < 4 then
add 1 to tSwitch
end if
set the menuhistory of button 1 to tSwitch
else if the shiftKey is down and tKey is "left" then
put the menuhistory of button 1 into tSwitch
if tSwitch > 1 then
subtract 1 from tSwitch
end if
set the menuhistory of button 1 to tSwitch
end if
end arrowKey
now the tab menu can be changed if left and right arrow key is pressed with shift key down, and the controls can be selected using tab key. But I still wonder if it can be done with the tabkey only
