]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xh_stbmp.cpp
we need our own implementation because in wxmac wxIcon does not inherit from wxBitmap...
[wxWidgets.git] / src / xrc / xh_stbmp.cpp
index 544b43de9f6dda2a2a5c4d0fea2251a4d7681bf2..8bd4bb2094581f93676ab65dfdc8082608307618 100644 (file)
@@ -7,8 +7,8 @@
 // Copyright:   (c) 2000 Vaclav Slavik
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 // Copyright:   (c) 2000 Vaclav Slavik
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "xh_stbmp.h"
 #endif
 
 #pragma implementation "xh_stbmp.h"
 #endif
 
     #pragma hdrstop
 #endif
 
     #pragma hdrstop
 #endif
 
+#if wxUSE_XRC
+
 #include "wx/xrc/xh_stbmp.h"
 #include "wx/statbmp.h"
 
 #include "wx/xrc/xh_stbmp.h"
 #include "wx/statbmp.h"
 
-wxStaticBitmapXmlHandler::wxStaticBitmapXmlHandler() 
-: wxXmlResourceHandler() 
+IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmapXmlHandler, wxXmlResourceHandler)
+
+wxStaticBitmapXmlHandler::wxStaticBitmapXmlHandler()
+: wxXmlResourceHandler()
 {
     AddWindowStyles();
 }
 
 wxObject *wxStaticBitmapXmlHandler::DoCreateResource()
 {
     AddWindowStyles();
 }
 
 wxObject *wxStaticBitmapXmlHandler::DoCreateResource()
-{ 
-    wxStaticBitmap *bmp = wxStaticCast(m_instance, wxStaticBitmap);
-
-    if (!bmp)
-       bmp = new wxStaticBitmap;
+{
+    XRC_MAKE_INSTANCE(bmp, wxStaticBitmap)
 
     bmp->Create(m_parentAsWindow,
                 GetID(),
 
     bmp->Create(m_parentAsWindow,
                 GetID(),
-                GetBitmap(wxT("bitmap"), GetSize()),
+                GetBitmap(wxT("bitmap"), wxART_OTHER, GetSize()),
                 GetPosition(), GetSize(),
                 GetStyle(),
                 GetName());
 
     SetupWindow(bmp);
                 GetPosition(), GetSize(),
                 GetStyle(),
                 GetName());
 
     SetupWindow(bmp);
-    
+
     return bmp;
 }
 
     return bmp;
 }
 
-
-
 bool wxStaticBitmapXmlHandler::CanHandle(wxXmlNode *node)
 {
     return IsOfClass(node, wxT("wxStaticBitmap"));
 }
 
 bool wxStaticBitmapXmlHandler::CanHandle(wxXmlNode *node)
 {
     return IsOfClass(node, wxT("wxStaticBitmap"));
 }
 
-
+#endif // wxUSE_XRC