LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a Callback on tab

Hi,
I have a tab control and need to add a Callback so that certain function is called when the tab is clicked.
This Callback however should be limited to just the top tab rectangle, so that clicking on any other part of the tab screen does not call the function.
How can I acheive this?
 
Thanks in advance.
 
0 Kudos
Message 1 of 3
(3,275 Views)
This functionality should be obtainable by a callback installed on the tab control. The callback receives EVENT_TAB_CHANGED event every time the user clicks a tab to make a panel active; it is not fired if the tab is clicked for a panel already active nor is a EVENT_LEFT_CLICK event fired in this case.
 
To setup the callback you can operate two ways:
- In case you start from a canvas on a panel, add the callback to the canvas control in the UIR editor or in the code BEFORE calling EasyTab_ConvertFromCanvas ()
- In case you create the tab from scratch, simply indicate the callback in  CallbackFunction parameter in EasyTab_Create () function. The callback has the usual prototype of standard control callbacks.
 
I modified the standard simpdemo project to illustrate this.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 3
(3,263 Views)

Hello!

Great advice from the CVI community!  Be sure to check out CVI 8.0 where Tab Controls are native!! http://www.ni.com/lwcvi/whats_new.htm.

Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 3 of 3
(3,241 Views)