28#define LIST_BOX_H_PADDING 20
29#define LIST_BOX_V_PADDING 8
31#define LIST_BOX_H_PADDING 10
32#define LIST_BOX_V_PADDING 5
37 wxKeyCode aCtrlKey ) :
40 m_receivingEvents( false ),
49 for(
const wxString& item : aItems )
51 wxSize extents =
m_listBox->GetTextExtent( item );
52 width = std::max( width, extents.x );
62 GetSizer()->Fit(
this );
100 return DIALOG_SHIM::TryBefore( aEvent );
110 if( wxGetKeyState( WXK_SHIFT ) &&
m_ctrlKey != WXK_SHIFT )
119 if( ++idx >= (
int)
m_listBox->GetCount() )
137 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
139 else if( wxGetKeyState( WXK_ESCAPE ) )
141 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL ) );
144 return DIALOG_SHIM::TryBefore( aEvent );
bool Show(bool show) override
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
Class EDA_VIEW_SWITCHER_BASE.
EDA_VIEW_SWITCHER(wxWindow *aParent, const wxArrayString &aItems, wxKeyCode aCtrlKey)
bool Show(bool show) override
bool TryBefore(wxEvent &aEvent) override
#define LIST_BOX_V_PADDING
#define LIST_BOX_H_PADDING