39 auto it = std::find( aOptions.begin(), aOptions.end(), aValue );
41 if( it == aOptions.end() )
44 return it == aOptions.end() ? 0 :
static_cast<int>( std::distance( aOptions.begin(), it ) );
50 if( aIndex < 0 || aIndex >=
static_cast<int>( aOptions.size() ) )
53 return aOptions[aIndex];
70static void fillMagneticChoice( wxChoice* aChoice,
const std::vector<MAGNETIC_OPTIONS>& aOptions )
79 std::function<
VALUES()> aDefaults ) :
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)
wxStaticText * m_objectSnappingLabel
wxBoxSizer * m_sizerSnapInference
wxCheckBox * m_snapAlignmentDistribution
wxChoice * m_gridSnapChoice
wxBoxSizer * m_sizerObjectSnapping
wxCheckBox * m_snapConstructionExtensions
wxStaticText * m_trackSnapLabel
wxStaticText * m_snapInferenceLabel
wxChoice * m_trackSnapChoice
wxStaticLine * m_objectSnappingLine
wxChoice * m_graphicsSnapChoice
wxCheckBox * m_snapTangentNormal
wxStaticLine * m_snapInferenceLine
wxCheckBox * m_snapObjectGeometry
wxChoice * m_padSnapChoice
wxCheckBox * m_snapAllLayers
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...
static wxString magneticOptionLabel(MAGNETIC_OPTIONS aOption)
std::vector< MAGNETIC_OPTIONS > MagneticSnapOptions(bool aRouting)
The object snapping modes an editor offers.
static void fillMagneticChoice(wxChoice *aChoice, const std::vector< MAGNETIC_OPTIONS > &aOptions)
MAGNETIC_OPTIONS MagneticSnapValue(const std::vector< MAGNETIC_OPTIONS > &aOptions, int aIndex)
The mode at aIndex, or "never" if the index is out of range.
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...
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.
@ CAPTURE_CURSOR_IN_TRACK_TOOL
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
bool constructionExtensions
bool alignmentDistribution