]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/fl/newbmpbtn.cpp
Applied David's fix for not autoconf-ing on RHL8
[wxWidgets.git] / contrib / src / fl / newbmpbtn.cpp
index b811e40c124e5e6e4f8b49fb63c7b9c137c5c8d8..cec54de1b11408cd427ab21b5fdbb138254a9248 100644 (file)
 #include "wx/fl/newbmpbtn.h"
 #include "wx/utils.h"     // import wxMin,wxMax macros
 
+#ifdef __WXMSW__
+#include "wx/msw/private.h"
+#endif
+
 ///////////// button-label rendering helpers //////////////////
 
 static int* create_array( int width, int height, int fill = 0 )
@@ -206,7 +210,8 @@ BEGIN_EVENT_TABLE( wxNewBitmapButton, wxPanel )
 
     EVT_LEFT_DOWN   ( wxNewBitmapButton::OnLButtonDown   )
     EVT_LEFT_UP     ( wxNewBitmapButton::OnLButtonUp     )
-    EVT_LEFT_DCLICK ( wxNewBitmapButton::OnLButtonDClick )
+//    EVT_LEFT_DCLICK ( wxNewBitmapButton::OnLButtonDClick )
+    EVT_LEFT_DCLICK ( wxNewBitmapButton::OnLButtonDown )
     EVT_ENTER_WINDOW( wxNewBitmapButton::OnMouseEnter    )
     EVT_LEAVE_WINDOW( wxNewBitmapButton::OnMouseLeave    )
 
@@ -516,7 +521,14 @@ void wxNewBitmapButton::RenderLabelImage( wxBitmap*& destBmp, wxBitmap* srcBmp,
                  destBmp->GetHeight() + mMarginY*2, 0 
             );
     }
+    destDc.SelectObject( wxNullBitmap );
+    
+#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
+    // Map to system colours
+    (void) wxToolBar::MapBitmap(destBmp->GetHBITMAP(), destBmp->GetWidth(), destBmp->GetHeight());
+#endif    
 }
+
 void wxNewBitmapButton::RenderAllLabelImages()
 {
     if ( !mIsCreated )
@@ -665,21 +677,6 @@ void wxNewBitmapButton::OnLButtonUp( wxMouseEvent& event )
     }
 }
 
-void wxNewBitmapButton::OnLButtonDClick( wxMouseEvent& event )
-{
-    if ( IsInWindow( event.m_x, event.m_y ) ) 
-    {
-        // fire event, if mouse was released
-        // within the bounds of button
-        wxCommandEvent cmd( mFiredEventType, GetId() );
-        GetParent()->ProcessEvent( cmd );
-
-        mDragStarted = FALSE;
-        mIsPressed   = FALSE;
-        Refresh();
-    }
-}
-
 bool wxNewBitmapButton::IsInWindow( int x, int y )
 {
     int width, height;