X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/289532452089421ddadbd4726a8469511a19ab76..96c9640205933ad0673d5af2c96af0816c50160c:/src/msw/statbmp.cpp diff --git a/src/msw/statbmp.cpp b/src/msw/statbmp.cpp index 0b2a52706e..a41b7e17aa 100644 --- a/src/msw/statbmp.cpp +++ b/src/msw/statbmp.cpp @@ -153,7 +153,7 @@ WXDWORD wxStaticBitmap::MSWGetStyle(long style, WXDWORD *exstyle) const bool wxStaticBitmap::ImageIsOk() const { - return m_image && m_image->Ok(); + return m_image && m_image->IsOk(); } wxIcon wxStaticBitmap::GetIcon() const @@ -189,17 +189,21 @@ void wxStaticBitmap::Free() wxDELETE(m_image); } -wxSize wxStaticBitmap::DoGetBestSize() const +wxSize wxStaticBitmap::DoGetBestClientSize() const { + wxSize size; if ( ImageIsOk() ) { - wxSize best(m_image->GetWidth(), m_image->GetHeight()); - CacheBestSize(best); - return best; + size = m_image->GetSize(); + } + else // No image yet + { + // this is completely arbitrary + size.x = + size.y = 16; } - // this is completely arbitrary - return wxSize(16, 16); + return size; } #ifndef __WXWINCE__ @@ -232,12 +236,12 @@ void wxStaticBitmap::SetImage( const wxGDIImage* image ) { wxGDIImage* convertedImage = ConvertImage( *image ); SetImageNoCopy( convertedImage ); - InvalidateBestSize(); } void wxStaticBitmap::SetImageNoCopy( wxGDIImage* image) { Free(); + InvalidateBestSize(); m_isIcon = image->IsKindOf( CLASSINFO(wxIcon) ); // the image has already been copied