X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e3c55eb333d273693ed2aea23da909b33e9e5484..5875d39c9ba19f518e691792524f2fd03261c825:/src/msw/statbmp.cpp diff --git a/src/msw/statbmp.cpp b/src/msw/statbmp.cpp index e4b2399c4a..fbdba6ccc5 100644 --- a/src/msw/statbmp.cpp +++ b/src/msw/statbmp.cpp @@ -17,10 +17,6 @@ // headers // --------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "statbmp.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -38,6 +34,8 @@ #include "wx/statbmp.h" #endif +#include "wx/sysopt.h" + #include // --------------------------------------------------------------------------- @@ -186,7 +184,9 @@ WXDWORD wxStaticBitmap::MSWGetStyle(long style, WXDWORD *exstyle) const // we use SS_CENTERIMAGE to prevent the control from resizing the bitmap to // fit to its size -- this is unexpected and doesn't happen in other ports - msStyle |= SS_CENTERIMAGE; + // + // and SS_NOTIFY is necessary to receive mouse events + msStyle |= SS_CENTERIMAGE | SS_NOTIFY; return msStyle; } @@ -206,7 +206,11 @@ void wxStaticBitmap::Free() wxSize wxStaticBitmap::DoGetBestSize() const { if ( ImageIsOk() ) - return wxSize(m_image->GetWidth(), m_image->GetHeight()); + { + wxSize best(m_image->GetWidth(), m_image->GetHeight()); + CacheBestSize(best); + return best; + } // this is completely arbitrary return wxSize(16, 16); @@ -263,3 +267,4 @@ void wxStaticBitmap::SetImageNoCopy( wxGDIImage* image) } #endif // wxUSE_STATBMP +