LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Let a control located on a special easy tab to respond event message

In the main panel, it is placed some controls , and also insert an easy tab which has 2 tabs , one of tab is placed a button . For the main panel , I use the "install" method for each control to support its message callback. Also , for the button on a tab panel,using the same method to respond the event message , but when click the button on the tab panel , it does not do anything . How to distinguish the click on main panel's control and the tab panel's control ?

David
0 Kudos
Message 1 of 3
(3,015 Views)
As a general rule, callbacks for controls located on a tabbed panel must be installed BEFORE the panel is added to the tab control: the reason is that the tab control adds its own callback to each control chaining it to the exsisting one, if any; installing a callback to a control after the panel is added to the tab control can give unpredictable results and eventually lead to a severe error.

So if you don't want to add the callbacks to controls in the UIR editor, you must add them to the controls before generating the tab control.

Message Edited by Roberto Bozzolo on 05-06-2005 10:08 AM



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?
0 Kudos
Message 2 of 3
(3,014 Views)
It sounds like you're trying to do this programmatically. Roberto has some good advice if you do.
But Easytab has some functions which make it easier (unless for some reason you need to build a tab at runtime).
In the UI Editor, create a new panel and place all the controls you want on your tab on it. Assign callback names for controls in the UI editor. Generate the callback code in the UI editor.
On your main panel, place a Canvas control.
Call EasyTab_ConvertFromCanvas to create a tab control.
Call EasyTab_LoadPanels to load the panel you created in the UI editor into the tab control.
Look at the sample program that comes with CVI
...\CVI\samples\userint\custctrl\easytab\tabdemo.prj
0 Kudos
Message 3 of 3
(3,006 Views)