
Scroll Panel

RGerkin
Function ScrollHook(info) Struct WMWinHookStruct &info if(info.eventCode == 22) string controls = ControlNameList(info.winName) variable i for(i=0;i<itemsinlist(controls);i+=1) string control = stringfromlist(i,controls) ModifyControl $control pos+={0,info.wheelDy} endfor endif End
Then activate a given panel with this:
SetWindow my_panel hook(scroll)=ScrollHook

Forum

Support

Gallery
Igor Pro 9
Learn More
Igor XOP Toolkit
Learn More
Igor NIDAQ Tools MX
Learn More
It's not perfect, however: if the mouse is over a control that uses the mouse wheel, that action happens, too, so the control's value changes AND the controls all move.
Better would be to detect whether the mouse if over a control, and only if not, THEN move the controls.
Or perhaps just use a slider or a listbox full of controls.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
February 20, 2013 at 10:25 am - Permalink