X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/338dd992160bf20205743c092b353d96ef7604fb..1dee6b399299241ffef19a61717bcb18d7a855d5:/src/motif/statbmp.cpp?ds=sidebyside diff --git a/src/motif/statbmp.cpp b/src/motif/statbmp.cpp index 32a9835b81..49fe6c600a 100644 --- a/src/motif/statbmp.cpp +++ b/src/motif/statbmp.cpp @@ -13,6 +13,8 @@ #pragma implementation "statbmp.h" #endif +#include "wx/defs.h" + #include "wx/statbmp.h" #ifdef __VMS__ @@ -28,9 +30,7 @@ #include "wx/motif/private.h" -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl) -#endif /* * wxStaticBitmap @@ -76,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 ();