How do I auto-update a procedure call ONLY at slider tick marks?
jjweimer
I have a graph with an attached panel. The panel has a slider. The slider has ticks, and the action is set to update with each tick. The call to the slider procedure updates a set of waves AND updates DrawActions on the graph. The issue is likely with how I have implemented the latter. I have this ...
DoWindow/F GraphX
DrawAction/W=GraphX getgroup=Teq, delete, begininsert
SetDrawEnv/W=GraphX gstart, gname=Teq
SetDrawEnv/W=GraphX xcoord=MT_iTK, dash=2
DrawLine/W=GraphX 1/(Tequal+TK), 0.1, 1/(Tequal+TK), 0.45
SetDrawEnv/W=GraphX gstop
DrawAction endinsert
The
DoWindow/F
pulls the focus away from the panel. In my slider control, I have this ... if( sa.eventCode & 1 ) // value set
UpdateCurves()
FindTSatValues()
DoWindow/F Inputs
endif
UpdateCurves()
FindTSatValues()
DoWindow/F Inputs
endif
This should return focus back to the panel. But, it seems that it does not. Or at least not the way that I expect.
I want to return to the panel AND the slider that was the focus. I want to be able to slide through the increments of settings and have the procedure update ONLY at the tick settings.
I imagine one approach is to remove the DrawActions in favor of waves to create vertical lines. That would put them in the UpdateCurves() function and protect them by an implicit PauseUpdate.
Am I missing a cleaner approach?
FWIW, the procedure that I am revising is the Semiconductor Plots Demo.
http://www.igorexchange.com/project/semiconductorconductivity
Sliding through any of the sliders causes the graph to update at each tick mark. But then, you have to re-click on the slider to "unstick" it for the next incremental move.
UpdateCurves()
elseif (sa.eventCode & 4 ) // mouse up
FindTSatValues()
endif
This does however suggest an slider option ... "Autoupdate only at tick marks"
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
March 7, 2018 at 01:27 pm - Permalink
And you might want to use Slider limits={low, high, inc} with inc set to your tick increment.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
March 7, 2018 at 02:20 pm - Permalink
OK. I will try with the DoWindow/F command removed.
--> IT WORKS! Thank you.
The slider has limits set during its design, and I am running through a general purpose SliderProc command. My thought on the other option for updating mode is in a different direction, and I probably need to rethink whether it really is useful.
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
March 7, 2018 at 04:10 pm - Permalink