X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c8bc33d5b5c97e0b4d794b776f9831af2d15b7af..0d1dff0172e94487c4aa2d830c714f93be73c7ec:/contrib/src/ogl/basic.cpp diff --git a/contrib/src/ogl/basic.cpp b/contrib/src/ogl/basic.cpp index 0a85bbb517..b7cce422e4 100644 --- a/contrib/src/ogl/basic.cpp +++ b/contrib/src/ogl/basic.cpp @@ -14,7 +14,7 @@ #endif // For compilers that support precompilation, includes "wx.h". -#include +#include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop @@ -288,7 +288,6 @@ wxShape::wxShape(wxShapeCanvas *can) m_textColour = wxBLACK; m_textColourName = "BLACK"; m_visible = FALSE; - m_clientData = NULL; m_selected = FALSE; m_attachmentMode = ATTACHMENT_MODE_NONE; m_spaceAttachments = TRUE; @@ -338,11 +337,6 @@ wxShape::~wxShape() if (m_canvas) m_canvas->RemoveShape(this); - if (m_clientData) { - delete m_clientData; - m_clientData = NULL; - } - GetEventHandler()->OnDelete(); } @@ -997,8 +991,9 @@ void wxShape::OnEraseContents(wxDC& dc) if (m_pen) penWidth = m_pen->GetWidth(); - dc.SetPen(* g_oglWhiteBackgroundPen); - dc.SetBrush(* g_oglWhiteBackgroundBrush); + dc.SetPen(GetBackgroundPen()); + dc.SetBrush(GetBackgroundBrush()); + dc.DrawRectangle(WXROUND(topLeftX - penWidth), WXROUND(topLeftY - penWidth), WXROUND(maxX + penWidth*2.0 + 4.0), WXROUND(maxY + penWidth*2.0 + 4.0)); } @@ -3281,3 +3276,25 @@ void wxShape::Rotate(double WXUNUSED(x), double WXUNUSED(y), double theta) } } + +wxPen wxShape::GetBackgroundPen() +{ + if (GetCanvas()) + { + wxColour c = GetCanvas()->GetBackgroundColour(); + return wxPen(c, 1, wxSOLID); + } + return * g_oglWhiteBackgroundPen; +} + + +wxBrush wxShape::GetBackgroundBrush() +{ + if (GetCanvas()) + { + wxColour c = GetCanvas()->GetBackgroundColour(); + return wxBrush(c, wxSOLID); + } + return * g_oglWhiteBackgroundBrush; +} +