|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
IanLambley
Joined: 17 Dec 2006 Posts: 490 Location: Sunderland
|
Posted: Wed Aug 22, 2007 12:40 pm Post subject: Mouse scroll wheel |
|
|
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? |
|
Back to top |
|
|
JohnHorspool
Joined: 26 Sep 2005 Posts: 270 Location: Gloucestershire UK
|
Posted: Thu Aug 23, 2007 1:27 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
JohnHorspool
Joined: 26 Sep 2005 Posts: 270 Location: Gloucestershire UK
|
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Fri Aug 24, 2007 2:51 am Post subject: |
|
|
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 |
|
Back to top |
|
|
JohnHorspool
Joined: 26 Sep 2005 Posts: 270 Location: Gloucestershire UK
|
Posted: Fri Aug 24, 2007 8:14 am Post subject: |
|
|
Hi John,
Quote: | Do you also need full_mouse_input to enable the scrolling response ? |
- No you don't, the non-mouse interrupt works fine with %mg.
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 |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Sat Aug 25, 2007 5:36 am Post subject: |
|
|
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 |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|