20#ifndef PANEL_SNAPPING_H
21#define PANEL_SNAPPING_H
58 std::function<
VALUES()> aDefaults );
108template <
typename SETTINGS_T>
114 [aInference, aMagnetics](
const SETTINGS_T& aSettings )
117 values.
gridSnap = aSettings.m_Window.grid.snap;
120 values.
inference = aSettings.*aInference;
123 values.
magnetics = aSettings.*aMagnetics;
128 return new PANEL_SNAPPING( aParent, aFrameType, &aCfg->m_Window.grid.snap,
129 aInference ? &( aCfg->*aInference ) :
nullptr,
130 aMagnetics ? &( aCfg->*aMagnetics ) :
nullptr,
135 return valuesOf( defaults );
PANEL_SNAPPING_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
The snapping preferences page.
std::function< VALUES()> m_defaults
void ResetPanel() override
Reset the contents of this panel.
bool TransferDataToWindow() override
bool TransferDataFromWindow() override
std::vector< MAGNETIC_OPTIONS > m_padOptions
SNAP_INFERENCE_SETTINGS * m_inference
MAGNETIC_SETTINGS * m_magnetics
void load(const VALUES &aValues)
std::vector< MAGNETIC_OPTIONS > m_trackOptions
std::vector< MAGNETIC_OPTIONS > m_graphicsOptions
PANEL_SNAPPING(wxWindow *aParent, FRAME_T aFrameType, int *aGridSnap, SNAP_INFERENCE_SETTINGS *aInference, MAGNETIC_SETTINGS *aMagnetics, std::function< VALUES()> aDefaults)
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
int MagneticSnapIndex(const std::vector< MAGNETIC_OPTIONS > &aOptions, MAGNETIC_OPTIONS aValue)
The position of aValue in aOptions, falling back to the "never" entry for a value the editor does not...
PANEL_SNAPPING * CreateSnappingPanel(wxWindow *aParent, SETTINGS_T *aCfg, FRAME_T aFrameType, SNAP_INFERENCE_SETTINGS SETTINGS_T::*aInference=nullptr, MAGNETIC_SETTINGS SETTINGS_T::*aMagnetics=nullptr)
Build the snapping page for an editor.
std::vector< MAGNETIC_OPTIONS > MagneticSnapOptions(bool aRouting)
The object snapping modes an editor offers.
MAGNETIC_OPTIONS MagneticSnapValue(const std::vector< MAGNETIC_OPTIONS > &aOptions, int aIndex)
The mode at aIndex, or "never" if the index is out of range.
One editor's snapping settings by value, so the page can also be filled from a settings object that i...
SNAP_INFERENCE_SETTINGS inference
MAGNETIC_SETTINGS magnetics