[vtkusers] MFC MDI Examples

derong derong at lycos.co.uk
Thu Aug 5 22:53:41 EDT 2004


Hi, 
 
Now, I'm trying to do some projects by using MFC and vtk. It seems the
example for MFC MDI is some old.
Is there any new VTK examples with MFC?
 
I have tried to do event handling with MFC. There are some codes in the
sample codes vtkMDIView.cpp as:
 
LRESULT CVtkMDIView::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_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);
}  
 
if I don't add this kind of codes in my project, the mouse is still working.
But the window can't get any charactor inputing from keyborad. 
Now i added these codes to my projects.
If I just delete the message WM_LBUTTONDOWN,... WM_MOUSEMOVE. leave WM_CHAR,
WM_TIMER.
The window can get keyboard keydown event. Does it mean the mouse event
writing there is redundant?
Can any one explain clearly how vtkWin32RenderWindowInteractor handles the
Windows Messages and events?
 
any hints will be helpful, thanks!
 
Dennis  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040805/9bd1f5d4/attachment.htm>


More information about the vtkusers mailing list