X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c8b751aa27764b6deb21e56f09c5403f230b0ce3..bd996abe63a8ed6aa07b26856a0d7935002e3e81:/src/mac/statbmp.cpp?ds=sidebyside diff --git a/src/mac/statbmp.cpp b/src/mac/statbmp.cpp index b66b32f072..d04e549b0e 100644 --- a/src/mac/statbmp.cpp +++ b/src/mac/statbmp.cpp @@ -39,6 +39,13 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id, { SetName(name); wxSize size = s ; + if ( bitmap.Ok() ) + { + if ( size.x == -1 ) + size.x = bitmap.GetWidth() ; + if ( size.y == -1 ) + size.y = bitmap.GetHeight() ; + } m_backgroundColour = parent->GetBackgroundColour() ; m_foregroundColour = parent->GetForegroundColour() ; @@ -60,8 +67,8 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id, void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; + SetSize(wxSize(bitmap.GetWidth(), bitmap.GetHeight())); Refresh() ; - SetBestSize(wxSize(bitmap.GetWidth(), bitmap.GetHeight())); } void wxStaticBitmap::OnPaint( wxPaintEvent &event ) @@ -74,9 +81,6 @@ void wxStaticBitmap::OnPaint( wxPaintEvent &event ) wxSize wxStaticBitmap::DoGetBestSize() const { - if ( m_bitmap.Ok() ) - return wxSize(m_bitmap.GetWidth(), m_bitmap.GetHeight()); - else - return wxSize(16, 16); // completely arbitrary + return wxWindow::DoGetBestSize() ; }