[vtkusers] help

Renaud Isabelle renauisa at yahoo.fr
Fri Aug 26 10:42:07 EDT 2005


Hi,
 
I am still locked with problems of handling interaction between MFC interface and vtkRenderWindow. The main problem is that my render window is just a small part of my MFC window (CView). 
 
To resume, I tried 2 possibilities:
 
-1- 
 myRenderWindow->SetParentId(this->m_hWnd);
 myRenderWindow->WindowInitialize();
 CRect rect;
 GetDlgItem(IDC_RECT)->GetWindowRect(rect);
  myRenderWindow->SetPosition(rect.left,rect.top);
  myRenderWindow->SetSize(rect.Width(),rect.Height());
 
But in this case, clicks in the MFC window are fine but clicks in the render window are not always correctly handled. I couldn't figure out why mouse clicks are only handled when  happening outside the render window. 
 
-2- 
 
CWnd* pWnd = GetDlgItem(IDC_RECT);
myRenderWindow ->SetParentId(this->m_hWnd);
myRenderWindow ->SetWindowId(pWnd->GetSafeHwnd());
myRenderWindow ->WindowInitialize();
 pWnd->ShowWindow(SW_SHOW);
 
This seems better but now, I got problems while repainting that I didn't have with the 1st solution: my render window appears only when the CWnd associated to it, is visible with 
ShowWindow(SW_SHOW)). But, by doing this, the MFC window itself is also visible and every paint called, I have to click on the render window that I can't see to make it appear. So strange! what I would like to have is a render window visible but not the rectangle that contains it. 
 
- So, none of these solutions works fine.  I don't know what else to try. I checked out in the code and it seems that, to handle my paint problem, maybe, I could set the Device context to the same than my parent's with SetDisplayId. But I couldn't find examples that implement SetDisplayId(). What is the use of this function? Could it be the solution to my problem. 
 
Isabelle


		
---------------------------------
 Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
 Téléchargez le ici !  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050826/73594085/attachment.htm>


More information about the vtkusers mailing list