Serendipity Editors is a two-card stack, and I am using a tab panel to navigate between the Image Editor and the Icon Editor. Each tab contains the name of one of the cards, so
on menuPick theCardName
go to card theCardName
end menuPick
does just fine....until I close the stack from the second card. The next time the stack is opened the tab is set as it was on the card that was visible when the stack was closed. I've tried the same technique with a grouped tab panel on a simple three-card stack with cards named "Tab 1", "Tab 2", & "Tab 3" with the same result.
I realize the tab panel is designed for a dialog box, not for navigation; but I like the effect on a stack with a small number of cards. So I'm looking for a solution or a workaround. I tried putting a closeStackRequest handler in the script of the second card that clicks at the appropriate tab, but no go.
When I follow the process in the Message Watcher I see:
focusIn
mouseDown
cREVGetsUpdate
menuPick
cREVGetsUpdate
cREVTable
cREVGeneral
mouseUp
mouseLeave
I'm guessing the tab switch is handled in one of the cREV messages. Sending a menuPick message does not change the tab, and while I can see the tabs in the text of the panel. I can't identify a property that determines which tab is hilited.
Any thoughts/suggestions would be appreciated.
How can one reset a tab panel?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
How can one reset a tab panel?
Rob Cozens dba Serendipity Software Company
Manchester, CA USA
Each new generation gives more attention to the man-made world...
and less attention to the world that made man.
Manchester, CA USA
Each new generation gives more attention to the man-made world...
and less attention to the world that made man.
Re: How can one reset a tab panel?
Hi Rob,
you can use the "menuhistory" property:
Hope that helps!
Best
Klaus
you can use the "menuhistory" property:
Code: Select all
...
## if you don't want to execute the TAB buttons script
lock messages
set the menuhistory of btn "your tab panel here..." to 1
...
Best
Klaus
Re: How can one reset a tab panel?
Hi Rob,
if i understood correctly you want to basically synchronise the selected tab with the selected card?
In that case it's easiest to simply set the menuHistory property of the tab panel button. For example, put a script in the preOpenCard handler to set the selected tab panel:
That way when you open the stack the tab panel will always indicate the card you're on.
I attach a simple example, hope that helps
Stam
---- EDIT ----
As usual Klaus got there just before me... out-Klaussed again!
if i understood correctly you want to basically synchronise the selected tab with the selected card?
In that case it's easiest to simply set the menuHistory property of the tab panel button. For example, put a script in the preOpenCard handler to set the selected tab panel:
Code: Select all
on preOpenCard
set the menuHistory of button "tab menu" to <the number of the card>
end preOpenCard
I attach a simple example, hope that helps
Stam
---- EDIT ----
As usual Klaus got there just before me... out-Klaussed again!
- Attachments
-
- tab test.livecode.zip
- (1.39 KiB) Downloaded 114 times
Re: How can one reset a tab panel?
Problem solved: mea ignorant.
The first thing I did after downloading v9.6.2 was read the User Guide to see how LiveCode had evolved in the last 15 years. But I probably just skimmed menus because my app and Serendipity Editors use point-&-click interfaces. Once I set the mernuHistory when opening the stack the problem was eliminated.
Thanks for helping me.
The first thing I did after downloading v9.6.2 was read the User Guide to see how LiveCode had evolved in the last 15 years. But I probably just skimmed menus because my app and Serendipity Editors use point-&-click interfaces. Once I set the mernuHistory when opening the stack the problem was eliminated.
Thanks for helping me.
Rob Cozens dba Serendipity Software Company
Manchester, CA USA
Each new generation gives more attention to the man-made world...
and less attention to the world that made man.
Manchester, CA USA
Each new generation gives more attention to the man-made world...
and less attention to the world that made man.
Re: How can one reset a tab panel?
An update to this thread for persons planning to distribute LiveCode stacks/apps across multiple platforms:
The visual representation of tab controls is so different between MacOS and Win32 that I would not recommend using tab controls except in the manner for which they were originally designed: in dialog boxes. They could hardly be more different on the two platforms. Here are the visuals:
The difference in titles was scripted by me; the rest of the differences (tab placement, background color, and coloration of the selected tab) are all via LiveCode.
I still like visuals and utility of navigating stacks with just a few cards in Windows, and I will add a kludge so I can duplicate Serendipity Editor's utility on MacOS; but I would not recommend using tab controls for any purpose beside the use they were designed for without careful consideration of the visual differences.
Cheers!
The visual representation of tab controls is so different between MacOS and Win32 that I would not recommend using tab controls except in the manner for which they were originally designed: in dialog boxes. They could hardly be more different on the two platforms. Here are the visuals:
The difference in titles was scripted by me; the rest of the differences (tab placement, background color, and coloration of the selected tab) are all via LiveCode.
I still like visuals and utility of navigating stacks with just a few cards in Windows, and I will add a kludge so I can duplicate Serendipity Editor's utility on MacOS; but I would not recommend using tab controls for any purpose beside the use they were designed for without careful consideration of the visual differences.
Cheers!
Rob Cozens dba Serendipity Software Company
Manchester, CA USA
Each new generation gives more attention to the man-made world...
and less attention to the world that made man.
Manchester, CA USA
Each new generation gives more attention to the man-made world...
and less attention to the world that made man.