34 const wxBitmap& aDummyBitmap,
const wxPoint& aPos,
35 const wxSize& aSize,
int aStyle ) :
36 wxPanel( aParent, aId, aPos, aSize, aStyle, wxS(
"StdBitmapButton" ) )
38 if( aSize == wxDefaultSize )
40 wxSize
defaultSize = wxButton::GetDefaultSize( aParent );
55 Bind( wxEVT_SYS_COLOUR_CHANGED,
152 wxEvtHandler* pEventHandler = GetEventHandler();
153 wxCHECK( pEventHandler, );
155 pEventHandler->CallAfter(
158 wxCommandEvent evt( wxEVT_BUTTON, GetId() );
159 evt.SetEventObject(
this );
160 GetEventHandler()->ProcessEvent( evt );
178 wxPaintDC dc(
this );
179 wxSize size = GetSize();
182 auto drawBackground =
191 wxColor fg = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNTEXT );
192 wxColor bg = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE );
196 bg = bg.ChangeLightness(
m_bIsEnable ? 130 : 120 );
202 bg = bg.ChangeLightness(
m_bIsEnable ? 200 : 160 );
204 fg = fg.ChangeLightness( 180 );
208 dc.DrawRoundedRectangle( aRect, aRect.height / 4.0 );
215 r1.width = size.GetWidth();
216 r1.height = size.GetHeight();
220 drawBackground( r1 );
227 wxRendererNative::Get().DrawPushButton(
this, dc, r1,
m_stateButton );
233 wxSize bmpSize =
m_bitmap.GetDefaultSize();
235 wxSize bmpSize =
m_bitmap.GetPreferredBitmapSizeFor(
this );
238 r1.x = ( size.GetWidth() - bmpSize.GetWidth() ) / 2;
243 r1.y += ( size.GetHeight() - bmpSize.GetHeight() ) / 2;
245 wxBitmap bm =
m_bitmap.GetBitmapFor(
this );
248 bm.ConvertToDisabled();
250 dc.DrawBitmap( bm, r1.x, r1.y,
true );