up and down button event codes

I may have mentioned this before by e-mail, but it would be really nice if the event code in a WMSetVariableAction record would report whether the up or down button was clicked for a numeric SetVariable. I like to use these buttons for controlling gains or stepping through a list of waves. Gains have variable step values (e.g. 100 goes up to 200, but down to 50), and lists of waves may be missing entries. Therefore, knowing which direction the user wants to go is relevant, rather than the ending value. I have come up with various kluges (storing the old value and doing the comparison, using separate plus and minus buttons), but an event code would be much nicer. I noticed that the direction of a mousewheel turn is available, but only if the built-in arrows are disabled (by having increment of 0). That isn't as nice from a user-interface point of view. Thanks for considering this!

-Matthew
I have entered an enhancement request ticket. It does seem like a useful thing. As usual, this is not a promise, just an indication that we are paying attention :)

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
As a workaround for now, you can store the old value as userdata in the control and then derive the direction.
Seems like for this to be useful, you also need a mode in which your code controls the SetVariable value. At present, trying to respond to a click by setting the value tends to work badly because you are fighting with the action of the control itself.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
I have occasionally wondered whether set variables could have their own functions to define the up/down step increments. I often think logarithmically in doing experiment designs (e.g. 0.1, 0.3, 1, 3, 10, ...). Or I will have controls that should step in decade sizes. I can do the latter by a set variable that is a log function to start (e.g. log(A) rather than A). I have yet to figure out a way to achieve the former without two controls.

I'd vote for a f(x) call to a set variable that would allow users in some way to "roll their own" increments. Add this also to sliders too.

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
You're getting into Custom Control territory...

Unfortunately, Igor controls were designed to simply report to you what has happened, without a good way for an action procedure to affect the the control responds to a given event. This is especially apparent if you have ever wanted to block a control from using certain key strokes. My idea was to have a flag that tells a SetVariable that it should never set its own value, because your code is going to do that. Then a mouse down on the up- or down-arrow buttons could be used by your action procedure. I suppose it will have to have a "mouse held" event as well that would be delivered periodically. Of course, as soon as I do that, someone will want to do a lengthy curve fit on every repeat of the event :)

Will have to wait at least for Igor 9.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Perhaps custom SetVariable and Slider are in order.

CustomControl --> CustomButton
CustomSetVariable
CustomSlider


(breaking convention of retaining backwards compatibility)

This avoids also burdening the well-established setvariable and slider controls with yet more flags, actions, and "widgets".

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH