25#include "../eeschema_settings.h"
39 static const wxString verticalChoiceItems[] =
46 _(
"Zoom horizontally"),
50 static constexpr auto ACTION_COUNT =
static_cast<unsigned>( SIM_MOUSE_WHEEL_ACTION::COUNT );
52 static_assert( std::extent<
decltype(verticalChoiceItems)>::value == ACTION_COUNT,
53 "verticalChoiceItems size does not match VERTICAL_SCROLL_ACTION::COUNT" );
60 static const wxString horizontalChoiceItems[] =
64 _(
"Zoom horizontally")
67 m_choiceHScroll->Set( std::extent<
decltype(horizontalChoiceItems)>::value,
68 horizontalChoiceItems );
83 static constexpr auto toAction =
84 [](
const wxChoice* aChoice )
131 case 0:
return SIM_MOUSE_WHEEL_ACTION::NONE;
132 case 1:
return SIM_MOUSE_WHEEL_ACTION::PAN_LEFT_RIGHT;
133 case 2:
return SIM_MOUSE_WHEEL_ACTION::ZOOM_HORIZONTALLY;
137 return SIM_MOUSE_WHEEL_ACTION::NONE;
144 case SIM_MOUSE_WHEEL_ACTION::NONE:
return 0;
145 case SIM_MOUSE_WHEEL_ACTION::PAN_LEFT_RIGHT:
return 1;
146 case SIM_MOUSE_WHEEL_ACTION::ZOOM_HORIZONTALLY:
return 2;
157 static constexpr auto setSelection =
158 []( wxChoice* aChoice,
auto action )
160 aChoice->SetSelection(
static_cast<int>( action ) );
Class PANEL_SIMULATOR_PREFERENCES_BASE.
wxStaticText * m_lblVScrollCtrl
wxChoice * m_choiceVScrollCtrl
wxChoice * m_choiceVScrollUnmodified
wxChoice * m_choiceVScrollShift
wxChoice * m_choiceVScrollAlt
wxStaticText * m_lblVScrollAlt
wxChoice * m_choiceHScroll
~PANEL_SIMULATOR_PREFERENCES()
bool TransferDataFromWindow() override
void onMouseDefaults(wxCommandEvent &) override
bool TransferDataToWindow() override
void applyMouseScrollActionsToPanel(const SIM_MOUSE_WHEEL_ACTION_SET &anActionSet)
PANEL_SIMULATOR_PREFERENCES(wxWindow *aParent)
static int actionToHorizontalScrollSelection(SIM_MOUSE_WHEEL_ACTION anAction)
void ResetPanel() override
Reset the contents of this panel.
static SIM_MOUSE_WHEEL_ACTION horizontalScrollSelectionToAction(int aSelection)
void onTrackpadDefaults(wxCommandEvent &) override
virtual SETTINGS_MANAGER & GetSettingsManager() const
T * GetAppSettings(const wxString &aFilename)
Returns a handle to the a given settings by type If the settings have already been loaded,...
PGM_BASE & Pgm()
The global Program "get" accessor.
SIM_MOUSE_WHEEL_ACTION
Enumerates the possible mouse wheel actions that can be performed on simulator plots.
SIM_PREFERENCES preferences
Contains the set of modified mouse wheel actions that can be performed on a simulator plot.
static SIM_MOUSE_WHEEL_ACTION_SET GetMouseDefaults()
SIM_MOUSE_WHEEL_ACTION vertical_unmodified
SIM_MOUSE_WHEEL_ACTION vertical_with_alt
SIM_MOUSE_WHEEL_ACTION horizontal
SIM_MOUSE_WHEEL_ACTION vertical_with_ctrl
SIM_MOUSE_WHEEL_ACTION vertical_with_shift
static SIM_MOUSE_WHEEL_ACTION_SET GetTrackpadDefaults()
SIM_MOUSE_WHEEL_ACTION_SET mouse_wheel_actions