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,
73 Unbind( wxEVT_SYS_COLOUR_CHANGED,
89 wxSize size =
m_bitmap.GetDefaultSize();
91 SetMinSize( wxSize( size.GetWidth() + 8, size.GetHeight() + 8 ) );
93 wxSize size =
m_bitmap.GetPreferredBitmapSizeFor(
this );
103 if( size.GetWidth() >
minSize.GetHeight() )
104 minSize.SetWidth( size.GetWidth() );
155 wxEvtHandler* pEventHandler = GetEventHandler();
156 wxASSERT( pEventHandler );
158 pEventHandler->CallAfter(
161 wxCommandEvent evt( wxEVT_BUTTON, GetId() );
162 evt.SetEventObject(
this );
163 GetEventHandler()->ProcessEvent( evt );
181 wxPaintDC dc(
this );
182 wxSize size = GetSize();
185 auto drawBackground =
194 wxColor fg = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNTEXT );
195 wxColor bg = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE );
202 bg = bg.ChangeLightness(
m_bIsEnable ? 130 : 120 );
208 bg = bg.ChangeLightness(
m_bIsEnable ? 200 : 160 );
210 fg = fg.ChangeLightness( 180 );
214 dc.DrawRoundedRectangle( aRect, aRect.height / 4.0 );
221 r1.width = size.GetWidth();
222 r1.height = size.GetHeight();
226 drawBackground( r1 );
232 wxRendererNative::Get().DrawPushButton(
this, dc, r1,
m_stateButton );
238 wxSize bmpSize =
m_bitmap.GetDefaultSize();
240 wxSize bmpSize =
m_bitmap.GetPreferredBitmapSizeFor(
this );
243 r1.x = ( size.GetWidth() - bmpSize.GetWidth() ) / 2;
248 r1.y += ( size.GetHeight() - bmpSize.GetHeight() ) / 2;
250 wxBitmap bm =
m_bitmap.GetBitmapFor(
this );
253 bm.ConvertToDisabled();
255 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...