]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/statbmp.cpp
fixed problems with sometimes processing the events twice introduced in rev 1.170...
[wxWidgets.git] / src / msw / statbmp.cpp
index e4b2399c4a27e21aeb9c6b0cb7025d4139f190be..fbdba6ccc56cb263ac907cc5ec178aed90b7dcd1 100644 (file)
 // 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 <stdio.h>
 
 // ---------------------------------------------------------------------------
@@ -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
+