08-23-2011 08:58 AM
Hi,
I am trying to change the page order of a tab control programmatically based on certains conditions but I can't find a property node for this. It is posible to do this in any way?
08-23-2011 09:17 AM
via kludge yes.
Set-up an off-screen control associated with tab key and use an event structure to trigger when tab is pressed then use set key focus to the controls in the order you want.
Ben
08-23-2011 09:38 AM
I think Ben is talking about the tab order of controls. The OP is wanting to change the order of tabs in a tab control, I think.
Try using an invoke node (method) "rearrange pages"
08-23-2011 09:39 AM
Ben,
Thank for the response and sorry about my ignorance, but I don't understand what you mean. Key focus is to receive key pressed on the keyboard and what I want to do is change the order of the pages in the tab control. Let say I have a tab control with 3 pages (tabs). Tab 0, 1 and 2, then based on any condition in my code, I want to make tab 2 became 0 and tab 0 became 2.
08-23-2011 09:56 AM
vt92,
I don't have a "method" invoke node in my right click option.
08-23-2011 10:10 AM
please forgive that shot to left field.
If the method mentioned by VT92 is not a script node, you may have to upgrade to get it.
Not sure off-hand what else to offer as an idea beside yet another hack.
Just diabling some of the tabs probably will not meet your req's.
I'll post if I think of something.
Ben
08-23-2011 10:38 AM
Ben is correct, it is a script node. I should have noticed that.
You could probably using scripting and a subpanel to get it to work.
08-23-2011 10:39 AM
"Silly bear!" (Christopher Robins, Winnie the Pooh)
Hide the tab lables and show the tab captions so you can change the label.
For all tab pages that can cahnge implment those as sub-panels, so...
Start-up sets config #1 that set the tab labels and loade the sub-panels and hide un-used tabs.
When the mode changes, relable the tabs and move the sub-panels to the proper page and show the active tabs.
Ben
08-23-2011 12:21 PM
Thanks a lot for your help guys.
Let me explain a little bit more my problem, maybe you guys get a good way to do this.
Ok, I have a tab control with 4 tabs (Auto Mode, Manual Mode, Troubleshooting and Configuration) in that order. In the "Auto Mode and Manual Mode tabs I have a selector switch to select the operation mode (auto or manual). Now, when I have the switch in auto mode, the manual mode tab page is hidden, when I change the selector switch to manual mode the manual mode tab page is unhide, the auto mode tab page is hide and the manual mode tab page is automatically selected. This happens because my manual mode page is the second one and when the page before is hidden the next one get active. The problem came up when I change the switch back to manual mode. I want that the auto mode page unhide, the manual mode page hide and the auto mode page get active, but instead the page that came active is the troubleshooting page since this is the one after the manual mode page.
So, what I was planning to do was to rearrange the pages order when auto or manual mode are selected so that the second page be always the hidden one.
Maybe I confuse you guys more, but that'sthe idea. If something came out of your mind, I really appreciate the help.
08-23-2011 12:22 PM
I like to use invisible Tabs in GUIs (ie. body of the Tab control, but a different selector (listbox usually). I also like to use the page selector without the body, kind of like a nice UI (especially with images on the Tabs) for an enum. It is not often that I actually use the selector and the body together (ie. the way nature intended). Just doesn't feel right sometimes.
I do not know how many different arrangements you have (please not too many I personally dislike moving targets on my UI, screws up my muscle memory). You could decouple the selector(s) from the working Tab. Make a few different Selector only Tab controls, choose the visible one depending on your wishes, use these selectors to drive the Tab Control which has the actual controls. Here is an example for two different Tab arrangements. I align the two Selector Tabs on the FP and float the working one over the top of them both (with a transparent frame). You float an object over the tabs my moving with the arrow keys.
Easier than subpanels? I do not know, probably depends on what you are used to.