12PANEL_SNAPPING_BASE::PANEL_SNAPPING_BASE( wxWindow* parent, wxWindowID
id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString&
name ) :
RESETTABLE_PANEL( parent, id, pos, size, style,
name )
14 wxBoxSizer* mainSizer;
15 mainSizer =
new wxBoxSizer( wxVERTICAL );
17 m_gridSnappingLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Grid Snapping"), wxDefaultPosition, wxDefaultSize, 0 );
21 m_gridSnappingLine =
new wxStaticLine(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
24 wxFlexGridSizer* fgGridSnapping;
25 fgGridSnapping =
new wxFlexGridSizer( 0, 2, 5, 5 );
26 fgGridSnapping->SetFlexibleDirection( wxVERTICAL );
27 fgGridSnapping->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
29 m_gridSnapLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Snap to grid:"), wxDefaultPosition, wxDefaultSize, 0 );
31 fgGridSnapping->Add(
m_gridSnapLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
33 wxString m_gridSnapChoiceChoices[] = {
_(
"Always"),
_(
"When grid shown"),
_(
"Never") };
34 int m_gridSnapChoiceNChoices =
sizeof( m_gridSnapChoiceChoices ) /
sizeof( wxString );
35 m_gridSnapChoice =
new wxChoice(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_gridSnapChoiceNChoices, m_gridSnapChoiceChoices, 0 );
39 fgGridSnapping->Add(
m_gridSnapChoice, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT, 5 );
42 mainSizer->Add( fgGridSnapping, 0, wxEXPAND|wxALL, 5 );
45 mainSizer->Add( 0, 10, 0, wxEXPAND, 5 );
47 m_objectSnappingLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Object Snapping"), wxDefaultPosition, wxDefaultSize, 0 );
51 m_objectSnappingLine =
new wxStaticLine(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
56 wxFlexGridSizer* fgObjectSnapping;
57 fgObjectSnapping =
new wxFlexGridSizer( 0, 2, 5, 5 );
58 fgObjectSnapping->SetFlexibleDirection( wxVERTICAL );
59 fgObjectSnapping->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
61 m_padSnapLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Snap to pads:"), wxDefaultPosition, wxDefaultSize, 0 );
63 fgObjectSnapping->Add(
m_padSnapLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
65 wxArrayString m_padSnapChoiceChoices;
66 m_padSnapChoice =
new wxChoice(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_padSnapChoiceChoices, 0 );
68 m_padSnapChoice->SetToolTip(
_(
"Capture cursor when the mouse enters a pad area") );
70 fgObjectSnapping->Add(
m_padSnapChoice, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT, 5 );
72 m_trackSnapLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Snap to tracks and vias:"), wxDefaultPosition, wxDefaultSize, 0 );
74 fgObjectSnapping->Add(
m_trackSnapLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
76 wxArrayString m_trackSnapChoiceChoices;
77 m_trackSnapChoice =
new wxChoice(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_trackSnapChoiceChoices, 0 );
79 m_trackSnapChoice->SetToolTip(
_(
"Capture cursor when the mouse approaches a track") );
81 fgObjectSnapping->Add(
m_trackSnapChoice, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT, 5 );
83 m_graphicsSnapLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Snap to graphics:"), wxDefaultPosition, wxDefaultSize, 0 );
87 wxArrayString m_graphicsSnapChoiceChoices;
88 m_graphicsSnapChoice =
new wxChoice(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_graphicsSnapChoiceChoices, 0 );
90 m_graphicsSnapChoice->SetToolTip(
_(
"Capture cursor when the mouse approaches graphical control points") );
97 m_snapAllLayers =
new wxCheckBox(
this, wxID_ANY,
_(
"Snap to objects on all layers"), wxDefaultPosition, wxDefaultSize, 0 );
98 m_snapAllLayers->SetToolTip(
_(
"When unchecked, only objects on the active layer are snapped to") );
106 mainSizer->Add( 0, 5, 0, wxEXPAND, 5 );
108 m_snapInferenceLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Snap Inference"), wxDefaultPosition, wxDefaultSize, 0 );
112 m_snapInferenceLine =
new wxStaticLine(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
117 m_snapObjectGeometry =
new wxCheckBox(
this, wxID_ANY,
_(
"Object geometry"), wxDefaultPosition, wxDefaultSize, 0 );
118 m_snapObjectGeometry->SetToolTip(
_(
"Snap to endpoints, midpoints, centres and edges of existing objects") );
127 m_snapTangentNormal =
new wxCheckBox(
this, wxID_ANY,
_(
"Tangent and normal contacts"), wxDefaultPosition, wxDefaultSize, 0 );
128 m_snapTangentNormal->SetToolTip(
_(
"Snap where the dragged geometry meets an arc tangentially or normally") );
141 this->SetSizer( mainSizer );
143 mainSizer->Fit(
this );