27 #include <wx/button.h> 28 #include <wx/dcclient.h> 29 #include <wx/dcmemory.h> 31 #include <wx/renderer.h> 35 const wxPoint& aPos,
const wxSize& aSize ) :
36 wxPanel( aParent, aId, aPos, aSize, wxBORDER_NONE | wxTAB_TRAVERSAL,
"DropDownButton" ),
42 if( aSize == wxDefaultSize )
46 wxSize textSize = GetTextExtent(
m_label );
72 aSize.GetHeight() ) );
136 aEvent.GetPosition( &x, &y );
140 wxEvtHandler* pEventHandler = GetEventHandler();
141 wxASSERT( pEventHandler );
143 pEventHandler->CallAfter(
146 wxCommandEvent evt( wxEVT_BUTTON, GetId() );
147 evt.SetEventObject(
this );
148 GetEventHandler()->ProcessEvent( evt );
164 aEvent.GetPosition( &x, &y );
172 wxSize size = GetSize();
175 position.y = size.GetHeight();
176 PopupMenu(
m_pMenu, position );
194 wxPaintDC dc(
this );
195 wxSize size = GetSize();
202 r1.width = width + 2;
203 r1.height = size.GetHeight();
205 wxRendererNative::Get().DrawPushButton(
this, dc, r1,
m_stateButton );
213 r1.x = ( width -
m_bitmap.GetWidth() ) / 2;
218 r1.y += ( size.GetHeight() -
m_bitmap.GetHeight() ) / 2;
220 dc.Blit( wxPoint( r1.x, r1.y ),
m_bitmap.GetSize(), &mdc, wxPoint( 0, 0 ), wxCOPY, true );
224 r1.y += ( size.GetHeight() - GetCharHeight() ) / 2;
225 dc.DrawLabel(
m_label, r1, wxALIGN_CENTER_HORIZONTAL );
233 r2.height = size.GetHeight();
235 wxRendererNative::Get().DrawPushButton(
this, dc, r2,
m_stateMenu );
236 wxRendererNative::Get().DrawDropArrow(
this, dc, r2,
m_stateMenu );
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
static const wxSize defaultSize(FRAME_T aFrameType)