LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Why when I use tab control in a child panel it don't remind active when I click on the tiltebar

Hi everybody,
 
I display two child panels, one ids on the top and the over on the back
 
When I clik on the tittle bar of the back panel, it reminds active. It's on my point of view a good think !
 
BUT when I used tab control on this child panel, and I do the same action IT DOESN'T REMIND ACTIVE !!! WHY ?
 
Jean-Noel Pomies
0 Kudos
Message 1 of 6
(3,518 Views)
Can you just attach a simple example of what you are talking about.... (we can talk in french if you prefer...)
Regards,
 
David D.
Application Engineer
NI France
0 Kudos
Message 2 of 6
(3,499 Views)
Bonjour,
 
Dans l'exemple joint, il y a trois fenetres filles se chevauchant qui s'ouvrent au demarrage.
Lorsque je clique sur la fenetre Child1, elle passe au 1er plan (active).
Lorsque je clique sur la fenetre Child2, elle passe au 1er plan (active).
Mais lorsque je clique sur la fenetre Child3 (qui contient un controle Tab), elle reste au second plan (non active), Pourquoi ?
0 Kudos
Message 3 of 6
(3,487 Views)
Hi,
 
The behavior you are seeing with EasyTabs and their parent panels is expected behavior. If you look at the code for the Easy Tab Instrument (Right Click on the Intrument in your library tree >> Edit Instrument >> Attach and Edit Source), then navigate to the ActivationHookPanelCallback function, there it mentions:
 
Clicking on an easy tab panel (or parent) shouldn't activate it unless you click on a control because the panels are supposed to behave as a single panel. Therefore, in order to activate a panel with an EasyTab on it, you first have to click on one of the tab panels on the EasyTab controls vs. on the parent panel, itself.
 
Regards
 
David D.
Applications Engineer
NI France
0 Kudos
Message 4 of 6
(3,429 Views)
Hello again,
 
So to clarify and somewhat retract what I said in my previous post:
The behavior you are seeing is happening because the focus events are being deliberately swallowed in the easytab code. This is intentional behavior and is intended to be consistent with the different rules used for activating tab panels, as opposed to conventional child panels (refer to the source code comments in the ActivationHookPanelCallback and InstallActivationHooks functions).

If you do not desire this behavior, you can easily change it. To change it, remove the EVENT_LOST_FOCUS and EVENT_GOT_FOCUS cases from the Sheet_PanelCallback function in easytab.c.

I'm also attaching a version of easytab.c that is modified accordingly, that will work with CVI 7.0, 7.1 or CVI 8.0. Simply copy the attached file toolslib\custctrl\easytab.c. (All of these versions of CVI install identical versions of easytab.c. This is why this single file can patch any of these versions).

Hope this helps.

David D. - Application Engineer - NI France

0 Kudos
Message 5 of 6
(3,408 Views)
Bonjour,
 
Le fichier easytab.c que vous avez joint ne resoud en rien le probleme, je ne peux avoir ma fenetre fille active que lorsque je clic sur un controle ou un tab !
 
Meme en retirant les cases EVENT_LOST_FOCUS et EVENT_GOT_FOCUS,  je ne parviens pas a activer la fenetre fille lorsque je clic dessus.
 
Cordialement,
 
Jean-Noel Pomies
0 Kudos
Message 6 of 6
(3,367 Views)