28#include <wx/dcclient.h>
30#include <wx/renderer.h>
31#include <wx/settings.h>
32#include <wx/version.h>
37 const wxBitmap& aDummyBitmap,
const wxPoint& aPos,
38 const wxSize& aSize,
int aStyle ) :
39 wxPanel( aParent, aId, aPos, aSize, aStyle, wxS(
"StdBitmapButton" ) )
41 if( aSize == wxDefaultSize )
43 #if wxCHECK_VERSION( 3, 1, 3 )
44 wxSize
defaultSize = wxButton::GetDefaultSize( aParent );
59 Bind( wxEVT_SYS_COLOUR_CHANGED,
126 wxEvtHandler* pEventHandler = GetEventHandler();
127 wxASSERT( pEventHandler );
129 pEventHandler->CallAfter(
132 wxCommandEvent evt( wxEVT_BUTTON, GetId() );
133 evt.SetEventObject(
this );
134 GetEventHandler()->ProcessEvent( evt );
152 wxPaintDC dc(
this );
153 wxSize size = GetSize();
156 auto drawBackground =
165 wxColor fg = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNTEXT );
166 wxColor bg = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE );
173 bg = bg.ChangeLightness(
m_bIsEnable ? 130 : 120 );
179 bg = bg.ChangeLightness(
m_bIsEnable ? 200 : 160 );
181 fg = fg.ChangeLightness( 180 );
185 dc.DrawRoundedRectangle( aRect, aRect.height / 4.0 );
192 r1.width = size.GetWidth();
193 r1.height = size.GetHeight();
197 drawBackground( r1 );
203 wxRendererNative::Get().DrawPushButton(
this, dc, r1,
m_stateButton );
208 r1.x = ( size.GetWidth() -
m_bitmap.GetWidth() ) / 2;
213 r1.y += ( size.GetHeight() -
m_bitmap.GetHeight() ) / 2;
static const wxSize defaultSize(FRAME_T aFrameType)
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...