[vtkusers] Mouse wheel events not working under Win32?

Mathieu Malaterre mathieu.malaterre at kitware.com
Thu Sep 16 20:09:35 EDT 2004


Charles,

   This has been fixed in CVS, the bug was entered here:

http://vtk.org/Bug/bug.php?op=show&bugid=1177

Thanks for patch
Mathieu

> 
> From: "Charles Boivin" <Charles.Boivin at rwdiwest.com>
> Date: 2004/09/16 Thu PM 06:18:25 EDT
> To: <mathieu.malaterre at kitware.com>
> CC: <vtkusers at vtk.org>
> Subject: Re: [vtkusers] Mouse wheel events not working under Win32?
> 
> Mathieu,
> 
> It's working now. You pointed me in the right direction with your
> comment regarding passing all the mouse messages... It turns out that in
> there is a function in the SDI example that needs to be modified:
> 
> LRESULT CVtkSDIView::WindowProc(UINT message, WPARAM wParam, LPARAM
> lParam) 
> {
>   switch (message)
>   {
>     //case WM_PAINT: 
>     case WM_LBUTTONDOWN: 
>     case WM_LBUTTONUP: 
>     case WM_MBUTTONDOWN: 
>     case WM_MBUTTONUP: 
>     case WM_RBUTTONDOWN: 
>     case WM_RBUTTONUP: 
>     case WM_MOUSEMOVE:
> 	case WM_MOUSEWHEEL:
>     case WM_CHAR:
>     case WM_TIMER:
>       if (this->iren->GetInitialized())
>       {
>         return vtkHandleMessage2(this->m_hWnd, message, wParam, lParam,
> this->iren);
>       }
>       break;
>   }
>   
>   return CView::WindowProc(message, wParam, lParam);
> }
> 
> 
> I added the "case WM_MOUSEWHEEL:" there. And then, of course,
> vtkHandleMessage2() was able to receive the mouse wheel messages. 
> 
> I just checked, and the examples from CVS do NOT have that in there, so
> that should probably be modified to avoid further problems with Windows
> users... 
> 
> Thanks for your help,
> 
> Charles
> 
> >>> Mathieu Malaterre <mathieu.malaterre at kitware.com> 09/16/04 03:55pm
> >>>
> Charles,
> 
> 	On Win32, I used to play with wxWindow/wxWidgets, so I don't
> know about 
> MFC. Did you try a google search, I found:
> 
> http://awc.al-williams.com/tips/tip26.htm 
> 
> 	I bet this is something really simple to be done in the example
> for the 
> event to get passed.
> 
> I'll look into it tonite,
> Mathieu
> 
> Charles Boivin wrote:
> > Hi Mathieu, thanks for your reply.
> > 
> > In response to your questions:
> > 
> > a) Yes, the mouse wheel works fine in other windows apps. In fact,
> it
> > even works in the vtk debug window
> > 
> > b) There are no WM_MOUSEWHEEL messages being passed to
> > vtkWin32RenderWindowInteractor::vtkHandleMessage2()
> > 
> > c) This is from a MFC app. In fact, it is from the VTK MFC SDI
> sample
> > application that I have modified a bit. Mind you, this is the SDI
> > application from version 4.4. Would the one from the CVS version
> pass
> > all the mouse events? I am definitely NOT a MFC guru, so I am not
> sure
> > how I should go about this.
> > 
> > Thank you for your reply.
> > 
> > Charles
> > 
> > 
> >>>>Mathieu Malaterre <mathieu.malaterre at kitware.com> 09/16/04 02:49pm
> >>>>
> > 
> > Charles,
> > 
> > 	- Does your mouse wheel works in any other Windoze apps ?
> > 
> > 	- What happen in vtkHandleMessage2 
> > (vtkWin32RenderWindowInteractor.cxx), if you put a breakpoint /
> printf
> > 
> > stuff ?
> > 
> > 	- Are you using a simple vtkRWI window ? Or is it within your
> > MFC app ? 
> > If so make sure you are passing all mouse events.
> > 
> > HTH
> > Mathieu
> > 
> > Charles Boivin wrote:
> > 
> >>Hello all,
> >>
> >>I have been trying to capture MouseWheel events in my own
> >>InteractorStyle object without any success. I am using Visual Studio
> >>.NET 2003 and the CVS version of VTK (CVS updated yesterday) on
> > 
> > Windows
> > 
> >>XP.
> >>
> >>I have been tracking down the events using the debugger and there
> > 
> > does
> > 
> >>not seem to be *any* calls made to
> > 
> > vtkInteractorStyle::ProcessEvents()
> > 
> >>that contain either MouseWheelForwardEvents or
> > 
> > MouseWheelBackwardEvents.
> > 
> >>This is *regardless* of the interactor style object that ends up
> > 
> > being
> > 
> >>used (my own, or the default one).
> >>
> >>I looked at the mailing list archives and it looked like this had
> > 
> > been
> > 
> >>implemented and was functional... am I missing something? Do I need
> > 
> > to
> > 
> >>set some macro to make sure that mouse wheel events are generated?
> >>
> >>Thank you,
> >>
> >>Charles Boivin
> >>
> >>_______________________________________________
> >>This is the private VTK discussion list. 
> >>Please keep messages on-topic. Check the FAQ at:
> > 
> > <http://public.kitware.com/cgi-bin/vtkfaq>
> > 
> >>Follow this link to subscribe/unsubscribe:
> >>http://www.vtk.org/mailman/listinfo/vtkusers 
> >>
> > 
> > 
> > 
> > 
> > _______________________________________________
> > This is the private VTK discussion list. 
> > Please keep messages on-topic. Check the FAQ at:
> > <http://public.kitware.com/cgi-bin/vtkfaq>
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers 
> > 
> > 
> 
> 
> 
> 
> 





More information about the vtkusers mailing list