Store a pointer to the wxWindow in the wxWindowDC class
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21795 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
55c5be5e47
commit
fcc9de5478
@ -26,6 +26,8 @@ public:
|
||||
// Create a DC corresponding to a window
|
||||
wxWindowDC(wxWindow *win);
|
||||
~wxWindowDC(void);
|
||||
protected:
|
||||
wxWindow *m_window;
|
||||
};
|
||||
|
||||
class wxClientDC: public wxWindowDC
|
||||
|
@ -21,10 +21,12 @@
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
|
||||
|
||||
wxWindowDC::wxWindowDC(void)
|
||||
: m_window(NULL)
|
||||
{
|
||||
};
|
||||
|
||||
wxWindowDC::wxWindowDC( wxWindow *window )
|
||||
: m_window(window)
|
||||
{
|
||||
wxFAIL_MSG("non-client window DC's are not supported");
|
||||
};
|
||||
@ -43,6 +45,7 @@ wxClientDC::wxClientDC(void)
|
||||
};
|
||||
|
||||
wxClientDC::wxClientDC( wxWindow *window )
|
||||
: wxWindowDC(window)
|
||||
{
|
||||
};
|
||||
|
||||
@ -60,6 +63,7 @@ wxPaintDC::wxPaintDC(void)
|
||||
};
|
||||
|
||||
wxPaintDC::wxPaintDC( wxWindow *window )
|
||||
: wxWindowDC(window)
|
||||
{
|
||||
wxASSERT_MSG([NSView focusView]==window->GetNSView(), "PaintDC's NSView does not have focus. Please use wxPaintDC only as the first DC created in a paint handler");
|
||||
// This transform flips the graphics since wxDC uses top-left origin
|
||||
|
Loading…
Reference in New Issue
Block a user