24#define LIST_BOX_H_PADDING 20
25#define LIST_BOX_V_PADDING 8
27#define LIST_BOX_H_PADDING 10
28#define LIST_BOX_V_PADDING 5
33 wxKeyCode aCtrlKey ) :
46 for(
const wxString& item : aItems )
48 wxSize extents = m_listBox->GetTextExtent( item );
49 width = std::max( width, extents.x );
50 height += extents.y + LIST_BOX_V_PADDING;
59 GetSizer()->Fit(
this );
97 return DIALOG_SHIM::TryBefore( aEvent );
107 if( wxGetKeyState( WXK_SHIFT ) &&
m_ctrlKey != WXK_SHIFT )
116 if( ++idx >= (
int)
m_listBox->GetCount() )
134 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
136 else if( wxGetKeyState( WXK_ESCAPE ) )
138 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL ) );
141 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.
EDA_VIEW_SWITCHER_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("View Preset Switcher"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxSTAY_ON_TOP)
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