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 );
44 m_objectSnappingLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Object Snapping"), wxDefaultPosition, wxDefaultSize, 0 );
48 m_objectSnappingLine =
new wxStaticLine(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
53 wxFlexGridSizer* fgObjectSnapping;
54 fgObjectSnapping =
new wxFlexGridSizer( 0, 2, 5, 5 );
55 fgObjectSnapping->SetFlexibleDirection( wxVERTICAL );
56 fgObjectSnapping->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
58 m_padSnapLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Snap to pads:"), wxDefaultPosition, wxDefaultSize, 0 );
60 fgObjectSnapping->Add(
m_padSnapLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
62 wxArrayString m_padSnapChoiceChoices;
63 m_padSnapChoice =
new wxChoice(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_padSnapChoiceChoices, 0 );
65 m_padSnapChoice->SetToolTip(
_(
"Capture cursor when the mouse enters a pad area") );
67 fgObjectSnapping->Add(
m_padSnapChoice, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT, 5 );
69 m_trackSnapLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Snap to tracks and vias:"), wxDefaultPosition, wxDefaultSize, 0 );
71 fgObjectSnapping->Add(
m_trackSnapLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
73 wxArrayString m_trackSnapChoiceChoices;
74 m_trackSnapChoice =
new wxChoice(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_trackSnapChoiceChoices, 0 );
76 m_trackSnapChoice->SetToolTip(
_(
"Capture cursor when the mouse approaches a track") );
78 fgObjectSnapping->Add(
m_trackSnapChoice, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT, 5 );
80 m_graphicsSnapLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Snap to graphics:"), wxDefaultPosition, wxDefaultSize, 0 );
84 wxArrayString m_graphicsSnapChoiceChoices;
85 m_graphicsSnapChoice =
new wxChoice(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_graphicsSnapChoiceChoices, 0 );
87 m_graphicsSnapChoice->SetToolTip(
_(
"Capture cursor when the mouse approaches graphical control points") );
94 m_snapAllLayers =
new wxCheckBox(
this, wxID_ANY,
_(
"Snap to objects on all layers"), wxDefaultPosition, wxDefaultSize, 0 );
95 m_snapAllLayers->SetToolTip(
_(
"When unchecked, only objects on the active layer are snapped to") );
102 m_snapInferenceLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Snap Inference"), wxDefaultPosition, wxDefaultSize, 0 );
106 m_snapInferenceLine =
new wxStaticLine(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
111 m_snapObjectGeometry =
new wxCheckBox(
this, wxID_ANY,
_(
"Object geometry"), wxDefaultPosition, wxDefaultSize, 0 );
112 m_snapObjectGeometry->SetToolTip(
_(
"Snap to endpoints, midpoints, centres and edges of existing objects") );
121 m_snapTangentNormal =
new wxCheckBox(
this, wxID_ANY,
_(
"Tangent and normal contacts"), wxDefaultPosition, wxDefaultSize, 0 );
122 m_snapTangentNormal->SetToolTip(
_(
"Snap where the dragged geometry meets an arc tangentially or normally") );
135 this->SetSizer( mainSizer );
137 mainSizer->Fit(
this );