TabProc to hide graphs?
fltcoils
Is there a more detailed guide to the ControlNameList and how one uses it with panel Control procs?
---------
Function TabProc(ctrlName,tabNum) : TabControl
String ctrlName
Variable tabNum
String curTabMatch= "*_tab"+num2istr(tabNum)
String controls= ControlNameList("")
Variable i, n= ItemsInList(controls)
for(i=0; i String control= StringFromList(i, controls)
Variable isInATab= stringmatch(control,"*_tab*")
if( isInATab )
Variable show= stringmatch(control,curTabMatch)
ControlInfo $control // gets V_disable
if( show )
V_disable= V_disable & ~0x1 // clear the hide bit
else
V_disable= V_disable | 0x1 // set the hide bit
endif
ModifyControl $control disable=V_disable
endif
endfor
return 0
End
SetWindow subwindowname hide=1
where you need to replace "subwindowname" with a complete subwindow path and name.
I recommend using the structure-based control action procedures. They are getting the attention in future development, they are faster and more reliable, and the structure passed to your action procedure includes the name of the window containing the control.
I also recommend using the window name in places like the call to ControlNameList(). Odd and hard-to-find bugs result from action procedures that due to unforeseen circumstances wind up running with the top window not being the window that originally triggered the call.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
January 22, 2014 at 04:47 pm - Permalink
January 23, 2014 at 05:39 am - Permalink
That seems to fix it.
Thanks
January 23, 2014 at 11:55 am - Permalink