Just wondering.
Hans.
As far as I know, mousewheel is handled by the OS, and it generates
the appropriate events. All of the applications that I have developed
in Borland C++ Builder (before mousewheels even existed) do handle
these events.
Carlos
--
> Are there mousewheel events in wxWindows?
At least under wxMSW, this works just fine.
Installing Mousewheel support under X11 doesn't
work well at all, though, although it is possible
that I made a mistake somewhere when trying to
configure X11 in such a way,
Roert
--
Robert Roebling, MD <rob...@roebling.de>
Yes and no to that. A number of native controls do react
automatically to the mousewheel - I don't think this is so
much OS or contols behaviour as the extended mouse drivers
looking for scrollbars to fiddle with. However, there are
also mouse wheel messages that can be intercepted (at least
in windows). This is useful when alternative wheel behaviour
is needed (I can imagine using it as a speed control in a
game), or when for some reason the correct scrollbar isn't
found (e.g. the scrollbar is separate from the control it
scrolls).
wxMSW probably just works for normal scrollbar-based stuff
(the examples I've tried seem to) but there is a good chance
that wxUNIVERSAL will need special handling.
It works fine in the native controls that support it, but there is no
support for it in any wx class. There are no mouse wheel or even scroll
events sent to the wxWindow in response to rolling the wheel so, for
example, a wxScrolledWindow or wxGrid does absolutely nothing when you roll
the wheel, and you can't catch the event in an event handler...
I guess I can take a stab at implementing this for MSW, (it's about time
that I learned to do things at that level.) My question is should it
generate a new type of wxMouseEvent or a wxScrollEvent, or both (send a
scroll event if the mouse event isn't processed)?
> Installing Mousewheel support under X11 doesn't
> work well at all, though, although it is possible
> that I made a mistake somewhere when trying to
> configure X11 in such a way,
>
Did you use imwheel or some other way? I havn't gotten it to work either
but I havn't tried too hard yet.
--
Robin Dunn
Software Craftsman
ro...@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!
I just found out that I have to have
Section "Pointer"
Protocol "NetScrollPS/2"
Device "/dev/mouse"
ZAxisMapping 4 5
.
.
.
in my /etc/X11/XF86Config although i have genius mouse.
Pavel
On Wednesday 02 May 2001 03:48, Pavel Jurus wrote:
> I have my mousewheel working under X on linux and
> for example wxTextCtrl can be scrolled by wheel.
>
> I just found out that I have to have
>
> Section "Pointer"
> Protocol "NetScrollPS/2"
> Device "/dev/mouse"
> ZAxisMapping 4 5
> ..
> ..
> ..
>
> in my /etc/X11/XF86Config although i have genius mouse.
>
> Pavel
>
>
> _______________________________________________
> wx-users mailing list
> wx-u...@lists.wxwindows.org
> http://lists.wxwindows.org/mailman/listinfo/wx-users
--
David D. Marshall
ARTLab System Administrator/GRA
Georgia Institute of Technology, Atlanta Georgia, 30332
http://www.ae.gatech.edu/research/artlab/artl/artlab.html
mailto:gte...@prism.gatech.edu
The legitimate object of government is to do for a community
of people whatever they need to have done, but cannot do at all,
or cannot so well do, for themselves in their separate and
individual capacities. -- Abraham Lincoln
>>> Are there mousewheel events in wxWindows?
>>
>> At least under wxMSW, this works just fine.
>
> It works fine in the native controls that support it, but there is no
> support for it in any wx class.
I use my MouseWheel in wxDesigner's editor every day under Windows,
using plain wxMSW 2.2.6 from CVS - and the editor is surely a
generic control, not a native one,
Robert
Your mouse driver is probably turning the wheel messages into scroll
messages or something, not all of them do that. My mouse wheel does nothing
in wxDesigner's editor window. I think we need to handle the WM_MOUSEWHEEL
message ourselves.
RD> Your mouse driver is probably turning the wheel messages into scroll
RD> messages or something, not all of them do that. My mouse wheel does nothing
RD> in wxDesigner's editor window. I think we need to handle the WM_MOUSEWHEEL
RD> message ourselves.
If anybody sends me a wheel mouse by mail I can do it, but otherwise I can't
even try as I'm not used to writing code without being able to test it (BTW,
I can send it back after finishing the testing - I'm perfectly well with my
10 year old Logitech mouse).
Alternatively, and maybe simpler :-), I can write the code but let someone
else to test and fix it.
Regards,
VZ
This emulation feature can be turned off (older M$ mouse drivers did
not emulate scroll events, so the the wheel didn't work in old
programs, I don't know about newer ones).
M$-Office programs use the WM_MOUSEWHEEL directly (and do the job
right in the above example).
Regards
Markus Greither
I think sending will cost more than the mouse itself (about 10 USD).
> Alternatively, and maybe simpler :-), I can write the code but let someone
> else to test and fix it.
I can test it in Mahogany or some sample...
Regards
Markus Greither
long MyEdit::EvMousewheel(WXWPARAM wparam,WXLPARAM /*lparam*/)
{ // Mousewheel turned
static int AkDelta = 0;
short zDelta = (short)HIWORD(wparam);
int LinesPer;
if (!SystemParametersInfo(SPI_GETWHEELSCROLLLINES,0,&LinesPer,0)) //
Get the steps per WM_MOUSEWHEEL
LinesPer = 1;
AkDelta += zDelta;
int lines = AkDelta / WHEEL_DELTA; // required math for the new
wheel position
AkDelta -= lines * WHEEL_DELTA;
if (lines != 0)
{
lines = FirstVisZeile-lines*LinesPer; // FirstVisZeile is the
first visible line in a text control
if (lines > MAXLINES) lines = MAXLINES; // limit to existing lines
if (lines < 1) lines = 1;
EvVScroll(wxEVT_SCROLLWIN_THUMBRELEASE,lines-1); // set the new
first line
}
return 1;
}
long MyEdit::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM
lParam)
{
if (nMsg == WM_MOUSEWHEEL)
return EvMousewheel(wParam,lParam);
else
return wxWindow::MSWWindowProc(nMsg,wParam,lParam);
}
----- Original Message -----
From: "Vadim Zeitlin" <Vadim....@dptmaths.ens-cachan.fr>
To: <wx-u...@lists.wxwindows.org>
I was planning on giving it a shot. I'll try to do it this evening and if
I'm successful will put a patch on SF you can review before I check it in.