#include <rendwnd.h>
Public Member Functions | |
CRenderWnd (CCamView *pView=NULL) | |
virtual | ~CRenderWnd () |
virtual BOOL | Create (const wxRect &rect, wxWindow *parent, UINT32 id) |
void | SetView (CCamView *pView) |
CCamView * | GetView (void) |
virtual wxClientDC * | GetClientDC () |
Returns a pointer to the appropriate client DC, allocating it if necessary. | |
virtual void | AllocateDC (BOOL KeepIt=TRUE) |
Returns a pointer to the appropriate client DC, allocating it if necessary. | |
virtual void | DoneWithDC () |
Hints that we've done with our DC. | |
Static Public Member Functions | |
static void | SetDoubleBuffer (BOOL DoubleBuffer) |
static BOOL | GetDoubleBuffer () |
Protected Member Functions | |
void | OnPaint (wxPaintEvent &evnt) |
Creates a CPaintDC and sends a private WM_RENDERVIEW message, together with a pointer to the CPaintDC in the LPARAM, to the parent CCamView. Uses a CCPaintDC so we can get to the rectangle list subsequently. | |
void | OnLButtonDown (wxMouseEvent &evnt) |
Passes the mouse message on to the parent CCamView via a call to CRenderWnd::PassMsgToParent(). | |
void | OnLButtonDblClk (wxMouseEvent &evnt) |
Passes the mouse message on to the parent CCamView via a call to CRenderWnd::PassMsgToParent(). | |
void | OnLButtonUp (wxMouseEvent &evnt) |
Passes the mouse message on to the parent CCamView via a call to CRenderWnd::PassMsgToParent(). | |
void | OnMouseMove (wxMouseEvent &evnt) |
Passes the mouse message on to the parent CCamView via a call to CRenderWnd::PassMsgToParent(). | |
void | OnRButtonDown (wxMouseEvent &evnt) |
Passes the mouse message on to the parent CCamView via a call to CRenderWnd::PassMsgToParent(). | |
void | OnRButtonDblClk (wxMouseEvent &evnt) |
Passes the mouse message on to the parent CCamView via a call to CRenderWnd::PassMsgToParent(). | |
void | OnRButtonUp (wxMouseEvent &evnt) |
Passes the mouse message on to the parent CCamView via a call to CRenderWnd::PassMsgToParent(). | |
void | OnMButtonDown (wxMouseEvent &evnt) |
Passes the mouse message on to the parent CCamView via a call to CRenderWnd::PassMsgToParent(). | |
void | OnMButtonDblClk (wxMouseEvent &evnt) |
Passes the mouse message on to the parent CCamView via a call to CRenderWnd::PassMsgToParent(). | |
void | OnMButtonUp (wxMouseEvent &evnt) |
Passes the mouse message on to the parent CCamView via a call to CRenderWnd::PassMsgToParent(). | |
void | OnMouseWheel (wxMouseEvent &evnt) |
Passes the mouse message on to the parent CCamView. | |
void | OnSize (wxSizeEvent &event) |
Does nothing, skipping the event. | |
void | OnErase (wxEraseEvent &event) |
Does nothing. | |
void | OnSetCursor (wxSetCursorEvent &event) |
Eat the cursor update requests to stop anyone else playing with them, this is needed on MSW or the cursor reverts to the normal arrow. | |
void | OnEnter (wxMouseEvent &event) |
void | OnLeave (wxMouseEvent &event) |
void | OnKey (wxKeyEvent &event) |
This DOES NOT ACTUALLY HANDLE EVENTS, it only notes a key has been pressed and stops the mouse motion mangler eating the next mouse move. | |
void | OnChar (wxKeyEvent &event) |
void | OnIdle (wxIdleEvent &event) |
Laze deletion of our client DC on idle. | |
Static Protected Member Functions | |
static void | ReflectDoubleBufferingInChildren (wxWindow *pWindow) |
Protected Attributes | |
CCamView * | m_pView |
INT32 | m_DCUsers |
CCClientDC * | m_pCCClientDC |
Static Protected Attributes | |
static BOOL | m_DoubleBuffer = FALSE |
Definition at line 128 of file rendwnd.h.
|
Definition at line 160 of file rendwnd.cpp. 00160 : 00161 m_pView(pView), m_pCCClientDC(NULL) 00162 { 00163 m_DCUsers=0; 00164 // Nothing else to do for now... 00165 }
|
|
Definition at line 167 of file rendwnd.cpp. 00168 { 00169 TRACEUSER("Gerry", _T("Deleting CRenderWnd at 0x%08x\n"), this); 00170 if (m_DCUsers) 00171 { 00172 ERROR3("CRenderWnd::~CRenderWnd non-zero DC user count - leaking a DC"); 00173 } 00174 else 00175 { 00176 if (m_pCCClientDC) 00177 { 00178 delete(m_pCCClientDC); 00179 m_pCCClientDC = NULL; 00180 } 00181 } 00182 }
|
|
Returns a pointer to the appropriate client DC, allocating it if necessary.
Definition at line 199 of file rendwnd.cpp. 00200 { 00201 ERROR3IF((m_DCUsers && !m_pCCClientDC), "We have users, but no client DC"); 00202 if (!m_pCCClientDC) 00203 m_pCCClientDC = new CCClientDC(this); // OK if it fails 00204 00205 if (KeepIt) 00206 m_DCUsers++; 00207 return; 00208 }
|
|
Definition at line 297 of file rendwnd.cpp. 00299 { 00300 BOOL ok=wxWindow::Create(pParent, id, rect.GetTopLeft(), rect.GetSize(), wxNO_FULL_REPAINT_ON_RESIZE); 00301 SetExtraStyle(wxWS_EX_PROCESS_IDLE); 00302 #if defined(__WXGTK__) 00303 ::SetDoubleBuffer(this, m_DoubleBuffer); 00304 #endif 00305 return ok; 00306 }
|
|
Hints that we've done with our DC.
Definition at line 244 of file rendwnd.cpp. 00245 { 00246 ERROR3IF((m_DCUsers<=0), "We have no users, but I'm being told I'm done with"); 00247 00248 if (m_DCUsers>0) 00249 m_DCUsers--; 00250 00251 // Note we use a lazy-destroy from our idle handler 00252 }
|
|
Returns a pointer to the appropriate client DC, allocating it if necessary.
Definition at line 225 of file rendwnd.cpp. 00226 { 00227 if (!m_pCCClientDC) 00228 AllocateDC(FALSE); 00229 return (wxClientDC*)(m_pCCClientDC?m_pCCClientDC->GetDC():NULL); 00230 }
|
|
Definition at line 145 of file rendwnd.h. 00145 {return m_DoubleBuffer;}
|
|
Definition at line 142 of file rendwnd.h. 00142 { return(m_pView); }
|
|
Definition at line 500 of file rendwnd.cpp. 00501 { 00502 TRACEUSER( "jlh92", _T("CRenderWnd::OnChar \"%c\" \n"), event.GetUnicodeKey() ); 00503 00504 if( !AfxGetApp().HandleKeyPress( event ) ) 00505 event.Skip(); // Pass the key event on to someone who really wants it. 00506 }
|
|
Definition at line 731 of file rendwnd.cpp. 00732 { 00733 TRACEUSER( "Luke", _T("OnEnter %p\n"), event.GetEventObject() ); 00734 00735 // if( event.GetEventObject() != m_pFrame ) 00736 // return; 00737 00738 wxPoint pt( event.GetPosition() ); 00739 wxSetCursorEvent CursorEvent( pt.x, pt.y ); 00740 m_pView->OnSetCursor( CursorEvent ); 00741 if( CursorEvent.HasCursor() ) 00742 { 00743 wxSetCursor( CursorEvent.GetCursor() ); 00744 } 00745 }
|
|
Does nothing.
Definition at line 703 of file rendwnd.cpp.
|
|
Laze deletion of our client DC on idle.
Definition at line 267 of file rendwnd.cpp. 00268 { 00269 if (PrintMonitor::IsPrintingNow()) 00270 return; 00271 00272 if ((m_DCUsers<=0) && m_pCCClientDC) 00273 { 00274 delete m_pCCClientDC; 00275 m_pCCClientDC=NULL; 00276 } 00277 }
|
|
This DOES NOT ACTUALLY HANDLE EVENTS, it only notes a key has been pressed and stops the mouse motion mangler eating the next mouse move.
Definition at line 492 of file rendwnd.cpp. 00493 { 00494 if (m_pView) 00495 m_pView->DontSkipNextMouse(); 00496 00497 event.Skip(); // Pass the key event on to someone who really wants it. 00498 }
|
|
Passes the mouse message on to the parent CCamView via a call to CRenderWnd::PassMsgToParent().
Definition at line 412 of file rendwnd.cpp. 00413 { 00414 if (m_pView) 00415 m_pView->OnLButtonDblClk(evnt); 00416 }
|
|
Passes the mouse message on to the parent CCamView via a call to CRenderWnd::PassMsgToParent().
Definition at line 389 of file rendwnd.cpp. 00390 { 00391 if (m_pView) 00392 m_pView->OnLButtonDown(evnt); 00393 }
|
|
Passes the mouse message on to the parent CCamView via a call to CRenderWnd::PassMsgToParent().
Definition at line 435 of file rendwnd.cpp. 00436 { 00437 if (m_pView) 00438 m_pView->OnLButtonUp(evnt); 00439 }
|
|
Definition at line 747 of file rendwnd.cpp. 00748 { 00749 TRACEUSER( "Luke", _T("OnLeave %p\n"), event.GetEventObject() ); 00750 00751 // if( event.GetEventObject() != m_pFrame ) 00752 // return; 00753 00754 ::wxSetCursor( *wxSTANDARD_CURSOR ); 00755 }
|
|
Passes the mouse message on to the parent CCamView via a call to CRenderWnd::PassMsgToParent().
Definition at line 614 of file rendwnd.cpp. 00615 { 00616 if (m_pView) 00617 m_pView->OnMButtonDblClk(evnt); 00618 }
|
|
Passes the mouse message on to the parent CCamView via a call to CRenderWnd::PassMsgToParent().
Definition at line 591 of file rendwnd.cpp. 00592 { 00593 if (m_pView) 00594 m_pView->OnMButtonDown(evnt); 00595 }
|
|
Passes the mouse message on to the parent CCamView via a call to CRenderWnd::PassMsgToParent().
Definition at line 637 of file rendwnd.cpp. 00638 { 00639 if (m_pView) 00640 m_pView->OnMButtonUp(evnt); 00641 }
|
|
Passes the mouse message on to the parent CCamView via a call to CRenderWnd::PassMsgToParent().
Definition at line 458 of file rendwnd.cpp. 00459 { 00460 if (m_pView) 00461 m_pView->OnMouseMove( event ); 00462 00463 #if defined(__WXGTK__) 00464 wxSetCursorEvent CursorEvent( event.m_x, event.m_y ); 00465 OnSetCursor( CursorEvent ); 00466 if( CursorEvent.HasCursor() ) 00467 { 00468 // The window cursor seems to be ignored, but is needed for 00469 // CaptureMouse to work 00470 wxSetCursor( CursorEvent.GetCursor() ); 00471 SetCursor( CursorEvent.GetCursor() ); 00472 } 00473 #endif 00474 }
|
|
Passes the mouse message on to the parent CCamView.
Definition at line 659 of file rendwnd.cpp. 00660 { 00661 if (m_pView) 00662 m_pView->OnMouseWheel(evnt); 00663 }
|
|
Creates a CPaintDC and sends a private WM_RENDERVIEW message, together with a pointer to the CPaintDC in the LPARAM, to the parent CCamView. Uses a CCPaintDC so we can get to the rectangle list subsequently.
Definition at line 329 of file rendwnd.cpp. 00330 { 00331 if ((!CCamApp::IsDisabled()) && (!PrintMonitor::IsPrintingNow())) 00332 { 00333 CCPaintDC dc(this); 00334 // wxPalette* OldPal = PaletteManager::StartPaintPalette(&dc); 00335 00336 if (m_pView) 00337 m_pView->OnDraw(dc.GetDC()); 00338 00339 // PaletteManager::StopPaintPalette(&dc, OldPal); 00340 } 00341 else 00342 { 00343 // if we were printing, we have to draw something - white will do 00344 if (PrintMonitor::IsPrintingNow()) 00345 { 00346 // Draw a white rectangle here 00347 wxPaintDC MyPaint(this); 00348 00349 // Lets have a white brush... 00350 MyPaint.SetBrush(wxBrush(wxColour(*wxWHITE))); 00351 MyPaint.SetPen(*wxTRANSPARENT_PEN); 00352 00353 wxRegionIterator upd(GetUpdateRegion()); // get the update rect list 00354 00355 while (upd) 00356 { 00357 wxRect rect(upd.GetRect()); 00358 MyPaint.DrawRectangle(rect); 00359 upd++; 00360 } 00361 00362 // ask for a full redraw at the end 00363 PrintMonitor::WantFullRedraw(TRUE); 00364 } 00365 else 00366 { 00367 wxPaintDC dc( this ); // Clear paint condition 00368 } 00369 } 00370 }
|
|
Passes the mouse message on to the parent CCamView via a call to CRenderWnd::PassMsgToParent().
Definition at line 546 of file rendwnd.cpp. 00547 { 00548 if (m_pView) 00549 m_pView->OnRButtonDblClk(evnt); 00550 }
|
|
Passes the mouse message on to the parent CCamView via a call to CRenderWnd::PassMsgToParent().
Definition at line 523 of file rendwnd.cpp. 00524 { 00525 if (m_pView) 00526 m_pView->OnRButtonDown(evnt); 00527 }
|
|
Passes the mouse message on to the parent CCamView via a call to CRenderWnd::PassMsgToParent().
Definition at line 569 of file rendwnd.cpp. 00570 { 00571 if (m_pView) 00572 m_pView->OnRButtonUp(evnt); 00573 }
|
|
Eat the cursor update requests to stop anyone else playing with them, this is needed on MSW or the cursor reverts to the normal arrow.
Definition at line 724 of file rendwnd.cpp. 00725 { 00726 if( NULL != m_pView ) 00727 m_pView->OnSetCursor( event ); 00728 }
|
|
Does nothing, skipping the event.
Definition at line 681 of file rendwnd.cpp. 00682 { 00683 TRACEUSER("Gerry", _T("CRenderWnd::OnSize(%d, %d)\n"), evnt.m_size.x, evnt.m_size.y); 00684 evnt.Skip(); 00685 }
|
|
Definition at line 766 of file rendwnd.cpp. 00767 { 00768 #if defined(__WXGTK__) 00769 // Process this one 00770 if (pWindow->IsKindOf(CLASSINFO(CRenderWnd))) 00771 ::SetDoubleBuffer(pWindow, m_DoubleBuffer); 00772 #endif 00773 00774 // Now process children if any 00775 wxWindowList::Node * pNode = pWindow->GetChildren().GetFirst(); 00776 while (pNode) 00777 { 00778 ReflectDoubleBufferingInChildren(pNode->GetData()); 00779 pNode = pNode->GetNext(); 00780 } 00781 return; 00782 }
|
|
Definition at line 758 of file rendwnd.cpp. 00759 { 00760 m_DoubleBuffer = DoubleBuffer; 00761 // Now go through and set or clear double buffering on each window 00762 wxWindow * pWindow = CCamFrame::GetMainFrame(); 00763 if (pWindow) ReflectDoubleBufferingInChildren(pWindow); 00764 }
|
|
Definition at line 141 of file rendwnd.h. 00141 { m_pView = pView; }
|
|
|
|
|
|
|
|
|