]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/ogl/basic.cpp
toplevel code transferred to wxTopLevelWindow
[wxWidgets.git] / contrib / src / ogl / basic.cpp
index 2d53683a9421db51ae27292116867c8222be0f60..b7cce422e404d84ae62551678fc733e67e3e4537 100644 (file)
@@ -14,7 +14,7 @@
 #endif
 
 // For compilers that support precompilation, includes "wx.h".
-#include <wx/wxprec.h>
+#include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
 #pragma hdrstop
 
 #include <wx/wxexpr.h>
 
+#ifdef new
+#undef new
+#endif
+
 #if wxUSE_IOSTREAMH
 #include <iostream.h>
 #else
@@ -284,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;
@@ -988,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));
 }
@@ -3272,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;
+}
+