LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Highlighting current page on Tab control

Hi!,

I am using tab control with 7 pages. The page names are all in the same colour. Is there any way in which the colour for the name of the current page can be made different from the rest?

If your answer involves property nodes (or more advanced techniques) please be descriptive as I am beginner.

Also, which is the best book for inside stuff on property nodes?

I am using LV-PDS 6.1

Best wishes and thanks,
Gurdas
gurdas@qagetech.com
Gurdas Sandhu, Ph.D.
ORISE Research Fellow at US EPA
0 Kudos
Message 1 of 9
(4,540 Views)
Hi Gurdas,
in LV 6.1 many new properties have been added for tab controls.
Indeed you have Allow Multiple Colors property, its name is quite self-explainatory.
Take a look at the example Tab Control Properties.vi in \Examples\General\Controls\Tabctrl.llb; you can see how to deal with the new properties.

There are several LabVIEW books for general concepts see here: http://www.ni.com/devzone/reference/books/labview.htm#gui
I have: LabVIEW Advanced Programming Techniques by Rick Bitter, It's a good book.

Alberto
0 Kudos
Message 2 of 9
(4,540 Views)
Thanks Alberto!

I checked the example. However, it does not answer my query. Nor is 'multiple Color property' what I am looking for.

I do NOT want the page colours to be different. I want the TEXT of tab name (the name of the page) to change colour to show which is the current selection.

Like say, my tab has 6 pages with names "Page1", "Page2" ... "Page6". Initially all are in Black.
Now I want the TEXT "Page2" to become Red when page 2 is the selected page. The background colour of page 2 remains same as other pages. When page 3 is selected, I want "Page3" to become Red and "Page2" reverts to Black.

Hope I've been clear enough in what I want!

- Gurdas
Gurdas Sandhu, Ph.D.
ORISE Research Fellow at US EPA
0 Kudos
Message 3 of 9
(4,540 Views)
Hi again,
sorry, I misunderstood your question!
Actually I could not find a straight way to have multicolors on tab-page labels.
I'll try to find some workaround. If successful I'll let you know.
Alberto
0 Kudos
Message 4 of 9
(4,540 Views)
This is a feature I miss as well, however I would prefer if you could highlight the name of the selected tab with a dotted frame, just like the standard way in Windows and other Windows applications. It's especially useful if you tab navigate to a tab-control...As it is now the user cannot really see that the tab-control is chosen, the only way to discover that is to use the arrow keys to see whether it will select another page.
0 Kudos
Message 5 of 9
(4,540 Views)
I had some time to spend this afternoon, so here's a workaround.
I placed 2 transparent pictures on tabs and I change the text color progammatically.
0 Kudos
Message 6 of 9
(4,540 Views)
That is exactly what I would like to happen.
Thanks!

However, I would not be applying this into my vi because it involves some very comprehensive code changes.

I have a project delivery in another few days and this is not the right time to show my creativity 😉

Have one more query. The user is required to press many buttons on the GUI to get some final data. Each of these buttons have to be pressed in a fixed order. Presently, the user has to click with a mouse. All buttons are booleans to end their respective while loop and move into the next/outer while loop. Some of the while loops are nested.

Is it possible to assign the same keyboard key (to all buttons) such that pressing it will do the job of clicking the curre
nt active button? I would prefer this key to be the 'space bar'.

The application allows only one hand to be free. The other hand will be used to place test component and rotate it manually below the sensor. Thus, such a feature makes the user's task very easy. He just keeps clicking the space bar until the vi ends.

- Gurdas
Gurdas Sandhu, Ph.D.
ORISE Research Fellow at US EPA
0 Kudos
Message 7 of 9
(4,540 Views)
Hi again,
no it's not possible to assign the same key to more controls, and it's not possible to assign a spacebar either.
Two solutions:
- Use event case (Key Down event)to get the key pressed, when it is a spacebar stop the while loop and pass to the outer
- See here: http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3E4D356A4E034080020E74861&p_node=DZ52041&p_submitted=N&p_rank=&p_answer=&p_source=External
You can use these vis to get the key pressed (take a look at the example:Keyboard Scanner.vi in Keyex.llb.
Again, when the key is a spacebar stop the running loop and pass to the outer.

Good luck,
Alberto
0 Kudos
Message 8 of 9
(4,540 Views)
> Is it possible to assign the same keyboard key (to all buttons) such
> that pressing it will do the job of clicking the current active
> button? I would prefer this key to be the 'space bar'.
>
> The application allows only one hand to be free. The other hand will
> be used to place test component and rotate it manually below the
> sensor. Thus, such a feature makes the user's task very easy. He just
> keeps clicking the space bar until the vi ends.
>

It isn't possible to assign a key to more than one control, since then
it would be pretty unclear which control should out-of-the-blue receive
the key. It is possible to catch key events and perform and action
based upon the key press. Another option is to set
the key focus to the
next logical button in your progression. If the focus is set to a
button, then the space bar, enter key, etc all work.

Since you are asking for comments, the UI you describe sounds a bit odd
to me. A sequence of buttons that the user is required to click in a
given order? You might want to compare this to an indicator showing the
stage and current results, and one more button that says Next. Tie the
key navigation shortcut to the single button, and each button press
moves to the next stage. You might want to add a Cancel or Stop button
if there is ever any need to break out of the sequence. Finally, this
is pretty close to a wizard that allows the user to go both directions.
If it makes sense to reverse and redo a step, add that button too and
you have a very standard UI.

To build a wizard, use a tab control with a page for each stage. Hide
the tabs, and modify the pages by adding or subtracting on the value.

Greg McKaskle
0 Kudos
Message 9 of 9
(4,540 Views)