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,
154 wxEvtHandler* pEventHandler = GetEventHandler();
155 wxCHECK( pEventHandler, );
157 pEventHandler->CallAfter(
160 wxCommandEvent evt( wxEVT_BUTTON, GetId() );
161 evt.SetEventObject(
this );
162 GetEventHandler()->ProcessEvent( evt );
180 wxPaintDC dc(
this );
181 wxSize size = GetSize();
184 auto drawBackground =
193 wxColor fg = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNTEXT );
194 wxColor bg = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE );
198 bg = bg.ChangeLightness(
m_bIsEnable ? 130 : 120 );
204 bg = bg.ChangeLightness(
m_bIsEnable ? 200 : 160 );
206 fg = fg.ChangeLightness( 180 );
210 dc.DrawRoundedRectangle( aRect, aRect.height / 4.0 );
217 r1.width = size.GetWidth();
218 r1.height = size.GetHeight();
222 drawBackground( r1 );
229 wxRendererNative::Get().DrawPushButton(
this, dc, r1,
m_stateButton );
235 wxSize bmpSize =
m_bitmap.GetDefaultSize();
237 wxSize bmpSize =
m_bitmap.GetPreferredBitmapSizeFor(
this );
240 r1.x = ( size.GetWidth() - bmpSize.GetWidth() ) / 2;
245 r1.y += ( size.GetHeight() - bmpSize.GetHeight() ) / 2;
247 wxBitmap bm =
m_bitmap.GetBitmapFor(
this );
250 bm.ConvertToDisabled();
252 dc.DrawBitmap( bm, r1.x, r1.y,
true );