[vtkusers] vtk SDI is no response for mouseclicking?

shijith shijith at ddd.co.jp
Mon Nov 8 04:32:30 EST 2004


Hi,
add the code segment given below in OnCreate() Of your view class.
	this->renWin->SetWindowId(this->GetSafeHwnd());
Now, if you want capture the WM_LBUTTONDOWN event, then go to windowproc()
function in your view class and comment 'case :wm_LBUTTONDOWN' as given
below

	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;

  }
----------------------
shijith

Message: 3
Date: Mon, 8 Nov 2004 11:04:32 +0800 (CST)
From: " zfjgo " <zfjgo at 126.com>
Subject: [vtkusers] vtk SDI is no response for mouseclicking?
To: vtkusers at vtk.org
Message-ID: <418EE240.00019E.08048 at m64.126.com>
Content-Type: text/plain; charset="gb2312"

I am writing a windows application using VC++6 and MFC . I wrote the program
base on the vtk window sample program "vtkSDI", and when I need to catch the
mouse click event using classwizard like WM_LBUTTONDOWN, WM_RBUTTONDOWN or
WM_MOUSEMOVE. could there be some suggestion to solve this problem?? I
really need to work this program!

Thanks for your help.
The following is my code,but it does not work.

LRESULT CVtkSDIView::CallInteractor(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    if (this->iren->GetInitialized())
    {
		return vtkHandleMessage2(this->m_hWnd,uMsg,wParam,lParam,this->iren);
    }

    return 0;
}


void CVtkSDIView::OnLButtonDown(UINT nFlags, CPoint point)
{
	// TODO: Add your message handler code here and/or call default
	CString msg;
	msg="asdsadsadasdsad";
	AfxMessageBox(msg);
	this->CallInteractor(WM_LBUTTONDOWN,(WPARAM)(UINT)(nFlags),MAKELPARAM((poin
t.x), (point.y)));

}




------------------------------







More information about the vtkusers mailing list