]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/statbmp.cpp
create lib\...\setup.h from setup.h, not setup0.h which is not meant to be edited
[wxWidgets.git] / src / motif / statbmp.cpp
index 9d8c27fd0030838097ea83740b8a6a27b589967c..49fe6c600a0382751105c0c7f31b732b4510214b 100644 (file)
@@ -13,6 +13,8 @@
 #pragma implementation "statbmp.h"
 #endif
 
+#include "wx/defs.h"
+
 #include "wx/statbmp.h"
 
 #ifdef __VMS__
@@ -74,7 +76,13 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id,
     ChangeFont(FALSE);
 
     SetCanAddEventHandler(TRUE);
-    AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
+
+    wxSize actualSize(size);
+    if (actualSize.x == -1)
+      actualSize.x = bitmap.GetWidth();
+    if (actualSize.y == -1)
+      actualSize.y = bitmap.GetHeight();
+    AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, actualSize.x, actualSize.y);
 
     ChangeBackgroundColour ();