KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PANEL_SNAPPING Class Reference

The snapping preferences page. More...

#include <panel_snapping.h>

Inheritance diagram for PANEL_SNAPPING:
PANEL_SNAPPING_BASE RESETTABLE_PANEL

Classes

struct  VALUES
 One editor's snapping settings by value, so the page can also be filled from a settings object that isn't the live one. More...
 

Public Member Functions

 PANEL_SNAPPING (wxWindow *aParent, FRAME_T aFrameType, int *aGridSnap, SNAP_INFERENCE_SETTINGS *aInference, MAGNETIC_SETTINGS *aMagnetics, std::function< VALUES()> aDefaults)
 
bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 
void ResetPanel () override
 Reset the contents of this panel.
 
virtual wxString GetResetTooltip () const
 Get the tooltip the reset button should display when showing this panel.
 
wxString GetHelpTextAtPoint (const wxPoint &aPt, wxHelpEvent::Origin aOrigin) const override
 Overridden to supply the reset button tooltip when queried with { -INT_MAX, INT_MAX }.
 

Protected Attributes

wxStaticText * m_gridSnappingLabel
 
wxStaticLine * m_gridSnappingLine
 
wxStaticText * m_gridSnapLabel
 
wxChoice * m_gridSnapChoice
 
wxStaticText * m_objectSnappingLabel
 
wxStaticLine * m_objectSnappingLine
 
wxBoxSizer * m_sizerObjectSnapping
 
wxStaticText * m_padSnapLabel
 
wxChoice * m_padSnapChoice
 
wxStaticText * m_trackSnapLabel
 
wxChoice * m_trackSnapChoice
 
wxStaticText * m_graphicsSnapLabel
 
wxChoice * m_graphicsSnapChoice
 
wxCheckBox * m_snapAllLayers
 
wxStaticText * m_snapInferenceLabel
 
wxStaticLine * m_snapInferenceLine
 
wxBoxSizer * m_sizerSnapInference
 
wxCheckBox * m_snapObjectGeometry
 
wxCheckBox * m_snapConstructionExtensions
 
wxCheckBox * m_snapTangentNormal
 
wxCheckBox * m_snapAlignmentDistribution
 

Private Member Functions

void load (const VALUES &aValues)
 

Private Attributes

bool m_routing
 
int * m_gridSnap
 
SNAP_INFERENCE_SETTINGSm_inference
 
MAGNETIC_SETTINGSm_magnetics
 
std::function< VALUES()> m_defaults
 
std::vector< MAGNETIC_OPTIONSm_padOptions
 
std::vector< MAGNETIC_OPTIONSm_trackOptions
 
std::vector< MAGNETIC_OPTIONSm_graphicsOptions
 

Detailed Description

The snapping preferences page.

Every editor gets the same page, showing the groups its own settings support: grid snapping everywhere, object snapping in the board editors, and snap inference wherever the geometry tools run. Use CreateSnappingPanel() rather than constructing this directly.

Definition at line 37 of file panel_snapping.h.

Constructor & Destructor Documentation

◆ PANEL_SNAPPING()

PANEL_SNAPPING::PANEL_SNAPPING ( wxWindow * aParent,
FRAME_T aFrameType,
int * aGridSnap,
SNAP_INFERENCE_SETTINGS * aInference,
MAGNETIC_SETTINGS * aMagnetics,
std::function< VALUES()> aDefaults )
Parameters
aFrameTypeis the editor the page belongs to, which decides the modes offered.
aGridSnappoints at the live grid snapping mode.
aInferencepoints at the live inference settings, or null if the editor has none.
aMagneticspoints at the live object snapping settings, or null if the editor has none.
aDefaultsyields the values the reset button restores.

Definition at line 77 of file panel_snapping.cpp.

References fillMagneticChoice(), FRAME_PCB_EDITOR, m_defaults, m_graphicsOptions, PANEL_SNAPPING_BASE::m_graphicsSnapChoice, m_gridSnap, m_inference, m_magnetics, PANEL_SNAPPING_BASE::m_objectSnappingLabel, PANEL_SNAPPING_BASE::m_objectSnappingLine, m_padOptions, PANEL_SNAPPING_BASE::m_padSnapChoice, m_routing, PANEL_SNAPPING_BASE::m_sizerObjectSnapping, PANEL_SNAPPING_BASE::m_sizerSnapInference, PANEL_SNAPPING_BASE::m_snapInferenceLabel, PANEL_SNAPPING_BASE::m_snapInferenceLine, m_trackOptions, PANEL_SNAPPING_BASE::m_trackSnapChoice, PANEL_SNAPPING_BASE::m_trackSnapLabel, MagneticSnapOptions(), move, and PANEL_SNAPPING_BASE::PANEL_SNAPPING_BASE().

Member Function Documentation

◆ GetHelpTextAtPoint()

wxString RESETTABLE_PANEL::GetHelpTextAtPoint ( const wxPoint & aPt,
wxHelpEvent::Origin aOrigin ) const
inlineoverrideinherited

Overridden to supply the reset button tooltip when queried with { -INT_MAX, INT_MAX }.

Definition at line 72 of file resettable_panel.h.

References GetResetTooltip().

◆ GetResetTooltip()

virtual wxString RESETTABLE_PANEL::GetResetTooltip ( ) const
inlinevirtualinherited

Get the tooltip the reset button should display when showing this panel.

Returns
the tooltip

Reimplemented in PANEL_COLOR_SETTINGS, and PANEL_HOTKEYS_EDITOR.

Definition at line 64 of file resettable_panel.h.

References _.

Referenced by GetHelpTextAtPoint().

◆ load()

◆ ResetPanel()

void PANEL_SNAPPING::ResetPanel ( )
overridevirtual

Reset the contents of this panel.

Implements RESETTABLE_PANEL.

Definition at line 189 of file panel_snapping.cpp.

References load(), and m_defaults.

◆ TransferDataFromWindow()

◆ TransferDataToWindow()

bool PANEL_SNAPPING::TransferDataToWindow ( )
override

Member Data Documentation

◆ m_defaults

std::function<VALUES()> PANEL_SNAPPING::m_defaults
private

Definition at line 73 of file panel_snapping.h.

Referenced by PANEL_SNAPPING(), and ResetPanel().

◆ m_graphicsOptions

std::vector<MAGNETIC_OPTIONS> PANEL_SNAPPING::m_graphicsOptions
private

Definition at line 77 of file panel_snapping.h.

Referenced by load(), PANEL_SNAPPING(), and TransferDataFromWindow().

◆ m_graphicsSnapChoice

wxChoice* PANEL_SNAPPING_BASE::m_graphicsSnapChoice
protectedinherited

◆ m_graphicsSnapLabel

wxStaticText* PANEL_SNAPPING_BASE::m_graphicsSnapLabel
protectedinherited

Definition at line 47 of file panel_snapping_base.h.

Referenced by PANEL_SNAPPING_BASE().

◆ m_gridSnap

int* PANEL_SNAPPING::m_gridSnap
private

Definition at line 70 of file panel_snapping.h.

Referenced by PANEL_SNAPPING(), TransferDataFromWindow(), and TransferDataToWindow().

◆ m_gridSnapChoice

wxChoice* PANEL_SNAPPING_BASE::m_gridSnapChoice
protectedinherited

◆ m_gridSnapLabel

wxStaticText* PANEL_SNAPPING_BASE::m_gridSnapLabel
protectedinherited

Definition at line 38 of file panel_snapping_base.h.

Referenced by PANEL_SNAPPING_BASE().

◆ m_gridSnappingLabel

wxStaticText* PANEL_SNAPPING_BASE::m_gridSnappingLabel
protectedinherited

Definition at line 36 of file panel_snapping_base.h.

Referenced by PANEL_SNAPPING_BASE().

◆ m_gridSnappingLine

wxStaticLine* PANEL_SNAPPING_BASE::m_gridSnappingLine
protectedinherited

Definition at line 37 of file panel_snapping_base.h.

Referenced by PANEL_SNAPPING_BASE().

◆ m_inference

SNAP_INFERENCE_SETTINGS* PANEL_SNAPPING::m_inference
private

◆ m_magnetics

MAGNETIC_SETTINGS* PANEL_SNAPPING::m_magnetics
private

◆ m_objectSnappingLabel

wxStaticText* PANEL_SNAPPING_BASE::m_objectSnappingLabel
protectedinherited

Definition at line 40 of file panel_snapping_base.h.

Referenced by PANEL_SNAPPING::PANEL_SNAPPING(), and PANEL_SNAPPING_BASE().

◆ m_objectSnappingLine

wxStaticLine* PANEL_SNAPPING_BASE::m_objectSnappingLine
protectedinherited

Definition at line 41 of file panel_snapping_base.h.

Referenced by PANEL_SNAPPING::PANEL_SNAPPING(), and PANEL_SNAPPING_BASE().

◆ m_padOptions

std::vector<MAGNETIC_OPTIONS> PANEL_SNAPPING::m_padOptions
private

Definition at line 75 of file panel_snapping.h.

Referenced by load(), PANEL_SNAPPING(), and TransferDataFromWindow().

◆ m_padSnapChoice

wxChoice* PANEL_SNAPPING_BASE::m_padSnapChoice
protectedinherited

◆ m_padSnapLabel

wxStaticText* PANEL_SNAPPING_BASE::m_padSnapLabel
protectedinherited

Definition at line 43 of file panel_snapping_base.h.

Referenced by PANEL_SNAPPING_BASE().

◆ m_routing

bool PANEL_SNAPPING::m_routing
private

Definition at line 68 of file panel_snapping.h.

Referenced by load(), PANEL_SNAPPING(), and TransferDataFromWindow().

◆ m_sizerObjectSnapping

wxBoxSizer* PANEL_SNAPPING_BASE::m_sizerObjectSnapping
protectedinherited

Definition at line 42 of file panel_snapping_base.h.

Referenced by PANEL_SNAPPING::PANEL_SNAPPING(), and PANEL_SNAPPING_BASE().

◆ m_sizerSnapInference

wxBoxSizer* PANEL_SNAPPING_BASE::m_sizerSnapInference
protectedinherited

Definition at line 52 of file panel_snapping_base.h.

Referenced by PANEL_SNAPPING::PANEL_SNAPPING(), and PANEL_SNAPPING_BASE().

◆ m_snapAlignmentDistribution

wxCheckBox* PANEL_SNAPPING_BASE::m_snapAlignmentDistribution
protectedinherited

◆ m_snapAllLayers

wxCheckBox* PANEL_SNAPPING_BASE::m_snapAllLayers
protectedinherited

◆ m_snapConstructionExtensions

wxCheckBox* PANEL_SNAPPING_BASE::m_snapConstructionExtensions
protectedinherited

◆ m_snapInferenceLabel

wxStaticText* PANEL_SNAPPING_BASE::m_snapInferenceLabel
protectedinherited

Definition at line 50 of file panel_snapping_base.h.

Referenced by PANEL_SNAPPING::PANEL_SNAPPING(), and PANEL_SNAPPING_BASE().

◆ m_snapInferenceLine

wxStaticLine* PANEL_SNAPPING_BASE::m_snapInferenceLine
protectedinherited

Definition at line 51 of file panel_snapping_base.h.

Referenced by PANEL_SNAPPING::PANEL_SNAPPING(), and PANEL_SNAPPING_BASE().

◆ m_snapObjectGeometry

wxCheckBox* PANEL_SNAPPING_BASE::m_snapObjectGeometry
protectedinherited

◆ m_snapTangentNormal

wxCheckBox* PANEL_SNAPPING_BASE::m_snapTangentNormal
protectedinherited

◆ m_trackOptions

std::vector<MAGNETIC_OPTIONS> PANEL_SNAPPING::m_trackOptions
private

Definition at line 76 of file panel_snapping.h.

Referenced by load(), PANEL_SNAPPING(), and TransferDataFromWindow().

◆ m_trackSnapChoice

wxChoice* PANEL_SNAPPING_BASE::m_trackSnapChoice
protectedinherited

◆ m_trackSnapLabel

wxStaticText* PANEL_SNAPPING_BASE::m_trackSnapLabel
protectedinherited

Definition at line 45 of file panel_snapping_base.h.

Referenced by PANEL_SNAPPING::PANEL_SNAPPING(), and PANEL_SNAPPING_BASE().


The documentation for this class was generated from the following files: