]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/brush.cpp
wxSpinCtrl
[wxWidgets.git] / src / os2 / brush.cpp
index 4f28e92f53475598e8fb475fd7b1a0d387d7e90d..bf2712be01915560f4a12f6863149822e46845fb 100644 (file)
@@ -81,20 +81,6 @@ wxBrush::wxBrush(const wxBitmap& stipple)
         wxTheBrushList->AddBrush(this);
 }
 
-void wxBrush::Unshare()
-{
-       // Don't change shared data
-       if (!m_refData)
-    {
-               m_refData = new wxBrushRefData();
-       }
-    else
-    {
-               wxBrushRefData* ref = new wxBrushRefData(*(wxBrushRefData*)m_refData);
-               UnRef();
-               m_refData = ref;
-       }
-}
 
 void wxBrush::SetColour(const wxColour& col)
 {
@@ -138,3 +124,39 @@ bool wxBrush::RealizeResource()
     return FALSE;
 }
 
+WXHANDLE wxBrush::GetResourceHandle(void)
+{
+  return (WXHANDLE) M_BRUSHDATA->m_hBrush;
+}
+
+bool wxBrush::FreeResource(bool WXUNUSED(force))
+{
+  if (M_BRUSHDATA && (M_BRUSHDATA->m_hBrush != 0))
+  {
+// TODO    DeleteObject((HBRUSH) M_BRUSHDATA->m_hBrush);
+    M_BRUSHDATA->m_hBrush = 0;
+    return TRUE;
+  }
+  else return FALSE;
+}
+
+bool wxBrush::IsFree() const
+{
+  return (M_BRUSHDATA && (M_BRUSHDATA->m_hBrush == 0));
+}
+
+void wxBrush::Unshare()
+{
+       // Don't change shared data
+       if (!m_refData)
+    {
+               m_refData = new wxBrushRefData();
+       }
+    else
+    {
+               wxBrushRefData* ref = new wxBrushRefData(*(wxBrushRefData*)m_refData);
+               UnRef();
+               m_refData = ref;
+       }
+}
+