Add wxGraphicsContext::GetWindow()

This method allows to retrieve the window this context is associated
with, if any.

Add "wxWindow*" argument to wxGraphicsContext ctor and provide the
window pointer to it when available, i.e. when creating the context from
a wxWindow directly or from wxWindowDC, which is also associated with a
window, in platform-specific code.

No real changes yet.
This commit is contained in:
Vadim Zeitlin
2018-11-06 03:17:49 +01:00
parent 81c67c3686
commit 5e53b22bd4
8 changed files with 96 additions and 45 deletions

View File

@@ -565,12 +565,14 @@ void * wxGraphicsBitmap::GetNativeBitmap() const
wxIMPLEMENT_ABSTRACT_CLASS(wxGraphicsContext, wxObject);
wxGraphicsContext::wxGraphicsContext(wxGraphicsRenderer* renderer) :
wxGraphicsObject(renderer),
wxGraphicsContext::wxGraphicsContext(wxGraphicsRenderer* renderer,
wxWindow* window)
: wxGraphicsObject(renderer),
m_antialias(wxANTIALIAS_DEFAULT),
m_composition(wxCOMPOSITION_OVER),
m_interpolation(wxINTERPOLATION_DEFAULT),
m_enableOffset(false)
m_enableOffset(false),
m_window(window)
{
}