26#define LIST_BOX_H_PADDING 20
27#define LIST_BOX_V_PADDING 8
29#define LIST_BOX_H_PADDING 10
30#define LIST_BOX_V_PADDING 5
35 wxKeyCode aCtrlKey ) :
48 for(
const wxString& item : aItems )
50 wxSize extents = m_listBox->GetTextExtent( item );
51 width = std::max( width, extents.x );
52 height += extents.y + LIST_BOX_V_PADDING;
61 GetSizer()->Fit(
this );
78 if( aShow && wxGetEnv( wxT(
"WAYLAND_DISPLAY" ),
nullptr ) )
83 return wxDialog::Show(
true );
112 return DIALOG_SHIM::TryBefore( aEvent );
122 if( wxGetKeyState( WXK_SHIFT ) &&
m_ctrlKey != WXK_SHIFT )
131 if( ++idx >= (
int)
m_listBox->GetCount() )
149 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
151 else if( wxGetKeyState( WXK_ESCAPE ) )
153 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL ) );
156 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.
void clampToWorkArea()
Shrink the dialog's minimum and current size down to the work area of the display it occupies,...
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