In a %gr window, is there some way to respond to mouse scroll wheel movements?
Ian
PS I notice from time to time you supply someone with an intermediate update for salflibc.dll. Can anyone download these from somewhere?
Welcome to our forums
In a %gr window, is there some way to respond to mouse scroll wheel movements?
Ian
PS I notice from time to time you supply someone with an intermediate update for salflibc.dll. Can anyone download these from somewhere?
Ian,
Yes there is, this has been posted previously, a search for 'Mouse wheel events in clearwin' should get you the correct thread which contains code to do this.
regards John
Here is the URL:-
John,
Do you also need full_mouse_input to enable the scrolling response ? such as in:
i = winio@ ('%`^gr[grey, rgb_colours, full_mouse_input]&', &
w_width, w_depth, w_handle, mouse_back_func)
Or would the non-mouse interupt below support the %mg interrupt.
i = winio@ ('%`gr[grey, rgb_colours]&', &
w_width, w_depth, w_handle)
I want to detect the mouse scroll, determine where the mouse is on the screen and then zoom in/out about that point on the screen. It is also an advantage not to have full_mouse_input enabled, as this reduces the number of call-backs to be handled.
My reading of the %mg help may suggest that %mg and full_mouse_input may clash ? If you have a simple example of the capturing of the scroll wheel with %mg, it would be greatly appreciated.
regards John
Hi John,
Do you also need full_mouse_input to enable the scrolling response ?
As always I don't have a simple example, but I did take a look at my code and found the following :-
IF (K_GDI.EQ.1) THEN
C GDI graphics
i=winio@('%`^gr[rgb_colours,black,user_resize,
* full_mouse_input]&',IX_PC,IY_PC,IHNDL,CALLBACK)
ELSE
C OpenGL graphics
i=winio@('%`^og[double,depth16,USER_RESIZE]&'
* ,IX_PC,IY_PC,IHNDL,opengl_proc)
END IF
The scroll wheel routine works the same with either GDI or OpenGL graphics. I removed full_mouse_input from %gr and found that this had no effect on the scroll wheel which I also use to zoom in and out. The conclusion is that %mg is not effected by any particular graphics configuration.
cheers John
John H,
Thanks for your advice. Last night I did experiment with both mouse interrupts and scroll wheel interupts. I soon got them to work and it is resonably straight forward.
Full mouse input is not required, but without it I do first need to select a point for zooming to. Having two seperate interrupt routines for different parts of the mouse appears odd, but works fine. There is no appearence of a clash.
I did find an interesting effect of the scroll wheel, when if I scroll too fast, I sometimes appear to get multiple screen updates overwriting the screen. I may have to test if an update is in progress, especially where the screen paint takes a while.
The experimenting also got me to provide a bit more flexibility with mouse selection, which works better for zooming in, while the scroll wheel provides a convenient way of zooming out.
Your example code has again reminded me of OpenGL, which you find very effective.
I still find it amazing what you can do in fortran with clearwin+ ! ( and no C variety to worry about )
Thanks again for your advice.
regards John C