How to jump among tab menus by pressing tab button

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
alemrantareq
Posts: 203
Joined: Wed Jul 23, 2008 8:46 am

How to jump among tab menus by pressing tab button

Post by alemrantareq » Sun Nov 30, 2014 7:22 am

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 :)

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: How to jump among tab menus by pressing tab button

Post by Dixie » Sun Nov 30, 2014 9:19 am

Hi...

Have a look at the card script of the attached stack...
Attachments
tabstuff.livecode.zip
(1.05 KiB) Downloaded 194 times

alemrantareq
Posts: 203
Joined: Wed Jul 23, 2008 8:46 am

Re: How to jump among tab menus by pressing tab button

Post by alemrantareq » Sun Nov 30, 2014 9:26 am

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?

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: How to jump among tab menus by pressing tab button

Post by Dixie » Sun Nov 30, 2014 9:30 am

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

alemrantareq
Posts: 203
Joined: Wed Jul 23, 2008 8:46 am

Re: How to jump among tab menus by pressing tab button

Post by alemrantareq » Sun Nov 30, 2014 9:39 am

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 !!

alemrantareq
Posts: 203
Joined: Wed Jul 23, 2008 8:46 am

Re: How to jump among tab menus by pressing tab button

Post by alemrantareq » Sun Nov 30, 2014 10:36 am

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 :)

Post Reply