26#define LIST_BOX_H_PADDING 20
27#define LIST_BOX_V_PADDING 8
29#define LIST_BOX_H_PADDING 40
30#define LIST_BOX_V_PADDING 5
32#define LIST_BOX_H_PADDING 10
33#define LIST_BOX_V_PADDING 5
36#define SHOW_TIME_MS 500
44 Bind( wxEVT_TIMER, [&]( wxTimerEvent& ) {
Show(
false );
m_drawFrame->GetCanvas()->SetFocus(); },
54 [=,
this]( wxKeyEvent& aEvent )
56 aEvent.SetEventType( wxEVT_CHAR );
76 m_listBox->SetSelection( std::min( aSelection,
77 static_cast<int>(
m_listBox->GetCount() ) - 1 ) );
79 int width =
m_stTitle->GetTextExtent( aTitle ).x;
82 for(
const wxString& item : aItems )
84 wxSize extents =
m_listBox->GetTextExtent( item );
85 width = std::max( width, extents.x );
94 GetSizer()->Fit(
this );
118 if( aShow && wxGetEnv( wxT(
"WAYLAND_DISPLAY" ),
nullptr ) )
122 return wxDialog::Show(
true );
137 if( aEvent.GetEventType() == wxEVT_CHAR || aEvent.GetEventType() == wxEVT_CHAR_HOOK )
139 aEvent.SetEventType( wxEVT_CHAR );
145 return EDA_VIEW_SWITCHER_BASE::TryBefore( aEvent );
bool Show(bool show) override
void clampToWorkArea()
Shrink the dialog's minimum and current size down to the work area of the display it occupies,...
The base class for create windows for drawing purpose.
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)
#define LIST_BOX_V_PADDING
#define LIST_BOX_H_PADDING
KICOMMON_API const wxString s_FocusStealableInputName