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 );
59 Bind( wxEVT_SYS_COLOUR_CHANGED,
74 Unbind( wxEVT_SYS_COLOUR_CHANGED,
90 wxSize size =
m_bitmap.GetDefaultSize();
92 SetMinSize( wxSize( size.GetWidth() + 8, size.GetHeight() + 8 ) );
94 wxSize size =
m_bitmap.GetPreferredBitmapSizeFor(
this );
104 if( size.GetWidth() >
minSize.GetHeight() )
105 minSize.SetWidth( size.GetWidth() );
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 );
203 bg = bg.ChangeLightness(
m_bIsEnable ? 130 : 120 );
209 bg = bg.ChangeLightness(
m_bIsEnable ? 200 : 160 );
211 fg = fg.ChangeLightness( 180 );
215 dc.DrawRoundedRectangle( aRect, aRect.height / 4.0 );
222 r1.width = size.GetWidth();
223 r1.height = size.GetHeight();
227 drawBackground( r1 );
234 wxRendererNative::Get().DrawPushButton(
this, dc, r1,
m_stateButton );
240 wxSize bmpSize =
m_bitmap.GetDefaultSize();
242 wxSize bmpSize =
m_bitmap.GetPreferredBitmapSizeFor(
this );
245 r1.x = ( size.GetWidth() - bmpSize.GetWidth() ) / 2;
250 r1.y += ( size.GetHeight() - bmpSize.GetHeight() ) / 2;
252 wxBitmap bm =
m_bitmap.GetBitmapFor(
this );
255 bm.ConvertToDisabled();
257 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...