[vtkusers] How to capture mouse events in VTK

de Boer Ingo I.deBoer at polytec.de
Mon Oct 18 04:51:15 EDT 2004


Look at the view class:

LRESULT CvtkMDIView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (message)
	{
		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->pvtkWin32RenderWI->GetInitialized())
		{
			return vtkHandleMessage2(this->GetSafeHwnd(), message, wParam, lParam, this->pvtkWin32RenderWI);
		}
		break;
	}

	return CView::WindowProc(message, wParam, lParam);
}

This does it all...
I don't know, what is wrong? This works...
Did you set a breakpoint to check it ?

greets
 Ingo


---
Dr.-Ing. Ingo H. de Boer

Polytec GmbH
Polytec-Platz 1-7, 76337 Waldbronn, Germany
phone: ++49 7243 604 106
fax  : ++49 7243 604 255
 
> 
> Hi Ingo,
> Thanks for your reply.
> I have found an MFC example (vtkMDI).
> but while on lbuttondown, it doesnt go into 'case WM_LBUTTONDOWN:' of
> winproc function.
> do i miss something?
> Thanks in advance.
> shijith



More information about the vtkusers mailing list