Building Tab controls in SuperEdit with the tabitha XCmd

Questions regarding the Developer Edition's SuperEdit? This is the place!

Building Tab controls in SuperEdit with the tabitha XCmd

Postby Dan_Kelleher » Mon Feb 28, 2011 5:23 pm

I'm working on building a Tab control for the first time.

To get me headed in the right direction I used:
-Ian's CG Tutorial window that uses a Tab Control
-The tabitha XCmd Info in the SC Xtend project
-The SC Help Project key words-->Style, Orientation, ButtonSize, TabData, and CurrentValue
After using the Resource Manager of the RTE,
I'm using SuperEdit primarily.

---> The attached screenshots just to give an idea of where I'm at...

I changed the currentValue in the ObjectInfo of the Tab Control that is on the bg to select Tabs.

---> Two QUESTIONS
1. What (when) exactly triggers tabitha to capture the (IDs) of the visible objects and to use them to set the values of the userProps ?

2.What is Tab0 and how does that arise ?

-Dan
Some Major Steps_.jpg
Some Major Steps_.jpg (12 KiB) Viewed 2936 times


LayOut, Script, Obj Info_.jpg
LayOut, Script, Obj Info_.jpg (46.95 KiB) Viewed 2936 times


Tabitha ID & some userProp info_.jpg
Tabitha ID & some userProp info_.jpg (27.86 KiB) Viewed 2936 times
Daniel.Kelleher@umassmed.edu
SC4.7.3 OSX 10.7.2 Mac Pro
User avatar
Dan_Kelleher
 
Posts: 438
Joined: Sun Jul 06, 2008 2:45 pm
Location: Worcester (wouster as in would) Massachusetts USA

Re: Building Tab controls in SuperEdit with the tabitha XCm

Postby Scott » Wed Mar 02, 2011 8:49 am

Dan… It is not clear what you want to do here. There are different ways to use a tab control.

One is to have it as a background element and use the currentValue to navigate to different cards of the background that have different elements on the card layer.

Another is to use Tabitha, which changes the visibility of objects that are placed within the bounds of the tab control when another tab of that control is selected. In this case the tab control can be either a card or bg level object. This happens automagically by just placing objects within the bounds of the control for each tab selection.
User avatar
Scott
Site Admin
 
Posts: 1238
Joined: Sat Jul 05, 2008 1:37 pm
Location: Northern Sierra Nevada

Re: Building Tab controls in SuperEdit with the tabitha XCm

Postby Dan_Kelleher » Wed Mar 02, 2011 12:51 pm

Scott wrote:
Another is to use Tabitha, which changes the visibility of objects that are placed within the bounds of the tab control when another tab of that control is selected. In this case the tab control can be either a card or bg level object. This happens automagically by just placing objects within the bounds of the control for each tab selection.


That's exactly what I did.

I gotta run now.
Daniel.Kelleher@umassmed.edu
SC4.7.3 OSX 10.7.2 Mac Pro
User avatar
Dan_Kelleher
 
Posts: 438
Joined: Sun Jul 06, 2008 2:45 pm
Location: Worcester (wouster as in would) Massachusetts USA

Re: Building Tab controls in SuperEdit with the tabitha XCm

Postby Dan_Kelleher » Thu Mar 03, 2011 10:34 am

I originally wrote,
---> Two QUESTIONS
1. What (when) exactly triggers tabitha to capture the (IDs) of the visible objects and to use them to set the values of the userProps ?

2.What is Tab0 and how does that arise ?


I've built a fresh project in SuperEdit 4.7 and, as previously, used running into SC to activate the browse tool and allow tabitha to operate.

I find that, after creating, in SE, one object on the first of three tabs I can 'watch' tabitha create the uProp for that tab and and set it's value correctly, triggered as follows:
Note, that by running into SuperCard and clicking on the NON-selected (NOT-highlighted) "Tab 2 Name" tab control, a new UserProp of the Tab control, "Tab1", was defined by the tabitha XCmd and the value of this userProp was set to "cd graphic ID 100".

and I can get tabitha to create the uProp for a second tab but it sets the value of the second uProp to empty, when it should be "cd graphic ID 101". That's unexpected and not good so I've paused there.

@Mark I think that what is probably happening (in this instance or using tabitha in this way ?) is that when I click on tab 1 tabitha is setting the visible of the second tab object to false BEFORE defining the Tab2 uProp. ?

I tried to upload the project but I get an error message that neither extension, "zip" nor "sc45" is allowed.

*******************************************************************************************************

My step-by-step Notes:
1. Using the Resource Manager in SuperCard, Copy tabitha XCmd from Xtend into your project.

2. In SuperEdit, Add a Tab control button on the bg layer --> a userProp "TabData" is created.

3. Add 3 values to the "TabData" uProp of the Tab control button.
cr-delimited list of TabNames with tab-delimited parameter
and change the "Maximum" value from 1 to 3 then click "OK"
-->The Tab button then shows a new 3-part structure with the 3 Tab Names exactly as you typed them, IF you used the tab key to separate the name parameter from the "true" (boolean) parameter of the value. If you used the space key, you won't get what you want.
--> Note that the first Tab, "Tab1 Name" is selected (highlighted) because the "Current" value = 1

4. Add the Special Script into the Tab control button:
on mouseUp newtab, oldtab
tabitha the target, newtab, oldtab
end mouseUp

5. Return to the card level and create one draw-Text (vector) graphic containing the text, "a Tab1 Object" within the "Tab Pane" area.
Return to the bg layer and note that there is still only one userProp of the Tab control button, "tabData".

6. Now, with Tab 1, "Tab1 Name" selected (highlighted) and the Tab 1 object(s) visible "Run Into SC" (File --> Run or use cmd R) in order to change the tool of your window to the "Browse tool.
In SC note that the cursor is the "Hand" cursor which tells us that the active tool of the window is the "Browse" tool.
Don't click on anything other than the red close button on the topLeft of the window's menubar. You will automatically retured to SE.
Note that nothing has changed, in particular, there is still only one userProp of the Tab control.

7. Repeat step 6 but this time, in SuperCard, before returning to SE, click once -->only on the selected (highlighted) "Tab 1 Name" tab control.
After returning to SE,
Note that nothing has changed, in particular, there is still only one userProp of the Tab control.

8. Repeat step 6 but this time, in SuperCard, before returning to SE, click once --> on the NON-selected (NOT-highlighted) "Tab 2 Name" tab control.
After returning to SE,
Note, that by running into SuperCard and clicking on the NON-selected (NOT-highlighted) "Tab 2 Name" tab control, a new UserProp of the Tab control, "Tab1", was defined by the tabitha XCmd and the value of this userProp was set to "cd graphic ID 100".
Note also that the currentValue property of the Tab control was changed from "1" to "2" when you clicked the second tab while in SuperCard and that you can accomplish this in SuperEdit by changing the value in the objectInfo window of the Tab contol.
Note also that if you now change the value from "2" to "1", the "a Tab 1 Object" is not visible because tabitha also set it's visible property to false. Use Show Invisibles" (cmd H) to see it.

9. Select the tab 1 object and copy it.
Select tab "Tab2Name" by changing currentValue to "2".
Paste and rename the object to "a Tab 2 Object".
Run into SC, click on tab 1.
Return to SE and note that,
Tabitha has created another new userProp of the Tab control, "Tab2",
Tabitha has set the currentValue to "1" and the visible of the tab 1 object to true and the visible of tab 2 object to false

BUT, unexpectedly, tabitha failed to set it's value to "cd graphic ID 101" !!
Instead, the value of the new userProp of the Tab control, "Tab2", is empty.


Save this project as is for now and zip it.

*******************************************************************************************************

The following screenShot is back in SuperCard where currentValue =2 but ShowInvisibles =true so that you can see both objects and that they are located within the bounds of the tab pane.
Tab controls using tabitha XCmd_.jpg
Tab controls using tabitha XCmd_.jpg (15.84 KiB) Viewed 2899 times


Showing the problematic null value for uProp Tab2 (scroll down or click the image to see whole image)
Null Tab2 value !!.jpg
Null Tab2 value !!.jpg (13.71 KiB) Viewed 2899 times
Daniel.Kelleher@umassmed.edu
SC4.7.3 OSX 10.7.2 Mac Pro
User avatar
Dan_Kelleher
 
Posts: 438
Joined: Sun Jul 06, 2008 2:45 pm
Location: Worcester (wouster as in would) Massachusetts USA

Re: Building Tab controls in SuperEdit with the tabitha XCm

Postby codegreen » Sat Mar 05, 2011 5:25 am

Hi Dan,

I've reproduced the bug and have a fix for it.

Thanks for the detailed report!

-Mark
codegreen
 
Posts: 1543
Joined: Mon Jul 14, 2008 11:03 pm

Re: Building Tab controls in SuperEdit with the tabitha XCm

Postby Dan_Kelleher » Sat Mar 05, 2011 6:36 am

I've learned I only learn one way and this is it.
-Dan
User avatar
Dan_Kelleher
 
Posts: 438
Joined: Sun Jul 06, 2008 2:45 pm
Location: Worcester (wouster as in would) Massachusetts USA


Return to SuperEditing

Who is online

Users browsing this forum: No registered users and 1 guest