From 827e7a487462cb19677fcc50f3d3eb047651e95e Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Tue, 9 Sep 2003 13:05:50 +0000 Subject: [PATCH] Applied patch for better sizing of bitmap buttons. Applied patch for correct order of activate and mouse down events. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23437 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/app.cpp | 5 ++++- src/mac/bmpbuttn.cpp | 14 ++++++++++---- src/mac/carbon/app.cpp | 5 ++++- src/mac/carbon/bmpbuttn.cpp | 14 ++++++++++---- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/mac/app.cpp b/src/mac/app.cpp index 381dc7fb42..98505dac77 100644 --- a/src/mac/app.cpp +++ b/src/mac/app.cpp @@ -1540,9 +1540,12 @@ void wxApp::MacHandleMouseDownEvent( WXEVENTREF evr ) } else { + // Activate window first + ::SelectWindow( window ) ; + + // Send event later if ( win ) win->MacMouseDown( ev , windowPart ) ; - ::SelectWindow( window ) ; } } else diff --git a/src/mac/bmpbuttn.cpp b/src/mac/bmpbuttn.cpp index f296776652..9c16d3672e 100644 --- a/src/mac/bmpbuttn.cpp +++ b/src/mac/bmpbuttn.cpp @@ -35,11 +35,17 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit m_bmpNormal = bitmap; - m_marginX = 0; - m_marginY = 0; + if (style & wxBU_AUTODRAW) + { + m_marginX = wxDEFAULT_BUTTON_MARGIN; + m_marginY = wxDEFAULT_BUTTON_MARGIN; + } + else + { + m_marginX = 0; + m_marginY = 0; + } - // int x = pos.x; - // int y = pos.y; int width = size.x; int height = size.y; diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index 381dc7fb42..98505dac77 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -1540,9 +1540,12 @@ void wxApp::MacHandleMouseDownEvent( WXEVENTREF evr ) } else { + // Activate window first + ::SelectWindow( window ) ; + + // Send event later if ( win ) win->MacMouseDown( ev , windowPart ) ; - ::SelectWindow( window ) ; } } else diff --git a/src/mac/carbon/bmpbuttn.cpp b/src/mac/carbon/bmpbuttn.cpp index f296776652..9c16d3672e 100644 --- a/src/mac/carbon/bmpbuttn.cpp +++ b/src/mac/carbon/bmpbuttn.cpp @@ -35,11 +35,17 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit m_bmpNormal = bitmap; - m_marginX = 0; - m_marginY = 0; + if (style & wxBU_AUTODRAW) + { + m_marginX = wxDEFAULT_BUTTON_MARGIN; + m_marginY = wxDEFAULT_BUTTON_MARGIN; + } + else + { + m_marginX = 0; + m_marginY = 0; + } - // int x = pos.x; - // int y = pos.y; int width = size.x; int height = size.y; -- 2.45.2