38 const wxBitmap& aDummyBitmap,
const wxPoint& aPos,
39 const wxSize& aSize,
int aStyle ) :
40 wxPanel( aParent, aId, aPos, aSize, aStyle, wxS(
"StdBitmapButton" ) )
42 if( aSize == wxDefaultSize )
44 wxSize
defaultSize = wxButton::GetDefaultSize( aParent );
59 Bind( wxEVT_SYS_COLOUR_CHANGED,
156 wxEvtHandler* pEventHandler = GetEventHandler();
157 wxCHECK( pEventHandler, );
159 pEventHandler->CallAfter(
162 wxCommandEvent evt( wxEVT_BUTTON, GetId() );
163 evt.SetEventObject(
this );
164 GetEventHandler()->ProcessEvent( evt );
182 wxPaintDC dc(
this );
183 wxSize size = GetSize();
186 auto drawBackground =
195 wxColor fg = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNTEXT );
196 wxColor bg = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE );
200 bg = bg.ChangeLightness(
m_bIsEnable ? 130 : 120 );
206 bg = bg.ChangeLightness(
m_bIsEnable ? 200 : 160 );
208 fg = fg.ChangeLightness( 180 );
212 dc.DrawRoundedRectangle( aRect, aRect.height / 4.0 );
219 r1.width = size.GetWidth();
220 r1.height = size.GetHeight();
224 drawBackground( r1 );
231 wxRendererNative::Get().DrawPushButton(
this, dc, r1,
m_stateButton );
237 wxSize bmpSize =
m_bitmap.GetDefaultSize();
239 wxSize bmpSize =
m_bitmap.GetPreferredBitmapSizeFor(
this );
242 r1.x = ( size.GetWidth() - bmpSize.GetWidth() ) / 2;
247 r1.y += ( size.GetHeight() - bmpSize.GetHeight() ) / 2;
249 wxBitmap bm =
m_bitmap.GetBitmapFor(
this );
252 bm.ConvertToDisabled();
254 dc.DrawBitmap( bm, r1.x, r1.y,
true );