28#include <wx/dcclient.h>
30#include <wx/renderer.h>
31#include <wx/settings.h>
32#include <wx/textctrl.h>
33#include <wx/version.h>
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 );
58 Bind( wxEVT_SYS_COLOUR_CHANGED,
80 wxSize size =
m_bitmap.GetDefaultSize();
82 SetMinSize( wxSize( size.GetWidth() + 8, size.GetHeight() + 8 ) );
84 wxSize size =
m_bitmap.GetPreferredBitmapSizeFor(
this );
94 if( size.GetWidth() >
minSize.GetHeight() )
95 minSize.SetWidth( size.GetWidth() );
146 wxEvtHandler* pEventHandler = GetEventHandler();
147 wxASSERT( pEventHandler );
149 pEventHandler->CallAfter(
152 wxCommandEvent evt( wxEVT_BUTTON, GetId() );
153 evt.SetEventObject(
this );
154 GetEventHandler()->ProcessEvent( evt );
172 wxPaintDC dc(
this );
173 wxSize size = GetSize();
176 auto drawBackground =
185 wxColor fg = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNTEXT );
186 wxColor bg = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE );
193 bg = bg.ChangeLightness(
m_bIsEnable ? 130 : 120 );
199 bg = bg.ChangeLightness(
m_bIsEnable ? 200 : 160 );
201 fg = fg.ChangeLightness( 180 );
205 dc.DrawRoundedRectangle( aRect, aRect.height / 4.0 );
212 r1.width = size.GetWidth();
213 r1.height = size.GetHeight();
217 drawBackground( r1 );
223 wxRendererNative::Get().DrawPushButton(
this, dc, r1,
m_stateButton );
229 wxSize bmpSize =
m_bitmap.GetDefaultSize();
231 wxSize bmpSize =
m_bitmap.GetPreferredBitmapSizeFor(
this );
234 r1.x = ( size.GetWidth() - bmpSize.GetWidth() ) / 2;
239 r1.y += ( size.GetHeight() - bmpSize.GetHeight() ) / 2;
241 wxBitmap bm =
m_bitmap.GetBitmapFor(
this );
244 bm.ConvertToDisabled();
246 dc.DrawBitmap( bm, r1.x, r1.y,
true );
const int minSize
Push and Shove router track width and via size dialog.
static const wxSize defaultSize(FRAME_T aFrameType, wxWindow *aWindow)
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...