KiCad PCB EDA Suite
dialog_pns_settings_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version Oct 17 2018)
3 // http://www.wxformbuilder.org/
4 //
5 // PLEASE DO *NOT* EDIT THIS FILE!
7 
9 
11 
12 DIALOG_PNS_SETTINGS_BASE::DIALOG_PNS_SETTINGS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
13 {
14  this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
15 
16  wxBoxSizer* bMainSizer;
17  bMainSizer = new wxBoxSizer( wxVERTICAL );
18 
19  wxString m_modeChoices[] = { _("Highlight collisions"), _("Shove"), _("Walk around") };
20  int m_modeNChoices = sizeof( m_modeChoices ) / sizeof( wxString );
21  m_mode = new wxRadioBox( this, wxID_ANY, _("Mode:"), wxDefaultPosition, wxDefaultSize, m_modeNChoices, m_modeChoices, 1, wxRA_SPECIFY_COLS );
22  m_mode->SetSelection( 0 );
23  bMainSizer->Add( m_mode, 0, wxALL|wxEXPAND, 5 );
24 
25  wxStaticBoxSizer* bOptions;
26  bOptions = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options:") ), wxVERTICAL );
27 
28  wxFlexGridSizer* fgSizer1;
29  fgSizer1 = new wxFlexGridSizer( 0, 2, 0, 0 );
30  fgSizer1->AddGrowableCol( 1 );
31  fgSizer1->SetFlexibleDirection( wxBOTH );
32  fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
33 
34  m_staticText4 = new wxStaticText( bOptions->GetStaticBox(), wxID_ANY, _("Mouse drag behavior:"), wxDefaultPosition, wxDefaultSize, 0 );
35  m_staticText4->Wrap( -1 );
36  fgSizer1->Add( m_staticText4, 0, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
37 
38  wxString m_dragToolModeChoices[] = { _("Move item"), _("Interactive drag") };
39  int m_dragToolModeNChoices = sizeof( m_dragToolModeChoices ) / sizeof( wxString );
40  m_dragToolMode = new wxChoice( bOptions->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_dragToolModeNChoices, m_dragToolModeChoices, 0 );
41  m_dragToolMode->SetSelection( 0 );
42  fgSizer1->Add( m_dragToolMode, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 );
43 
44 
45  bOptions->Add( fgSizer1, 1, wxEXPAND, 5 );
46 
47  m_freeAngleMode = new wxCheckBox( bOptions->GetStaticBox(), wxID_ANY, _("Free angle mode (no shove/walkaround)"), wxDefaultPosition, wxDefaultSize, 0 );
48  bOptions->Add( m_freeAngleMode, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
49 
50  m_shoveVias = new wxCheckBox( bOptions->GetStaticBox(), wxID_ANY, _("Shove vias"), wxDefaultPosition, wxDefaultSize, 0 );
51  m_shoveVias->Enable( false );
52  m_shoveVias->SetToolTip( _("When disabled, vias are treated as un-movable objects and hugged instead of shoved.") );
53 
54  bOptions->Add( m_shoveVias, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
55 
56  m_backPressure = new wxCheckBox( bOptions->GetStaticBox(), wxID_ANY, _("Jump over obstacles"), wxDefaultPosition, wxDefaultSize, 0 );
57  m_backPressure->SetToolTip( _("When enabled, the router tries to move colliding traces behind solid obstacles (e.g. pads) instead of \"reflecting\" back the collision") );
58 
59  bOptions->Add( m_backPressure, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
60 
61  m_removeLoops = new wxCheckBox( bOptions->GetStaticBox(), wxID_ANY, _("Remove redundant tracks"), wxDefaultPosition, wxDefaultSize, 0 );
62  m_removeLoops->SetToolTip( _("Removes loops while routing (e.g. if the new track ensures same connectivity as an already existing one, the old track is removed).\nLoop removal works locally (only between the start and end of the currently routed trace).") );
63 
64  bOptions->Add( m_removeLoops, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
65 
66  m_smartPads = new wxCheckBox( bOptions->GetStaticBox(), wxID_ANY, _("Optimize pad connections"), wxDefaultPosition, wxDefaultSize, 0 );
67  m_smartPads->SetToolTip( _("When enabled, the router tries to break out pads/vias in a clean way, avoiding acute angles and jagged breakout traces.") );
68 
69  bOptions->Add( m_smartPads, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
70 
71  m_smoothDragged = new wxCheckBox( bOptions->GetStaticBox(), wxID_ANY, _("Smooth dragged segments"), wxDefaultPosition, wxDefaultSize, 0 );
72  m_smoothDragged->SetToolTip( _("When enabled, the router attempts to merge several jagged segments into a single straight one (dragging mode).") );
73 
74  bOptions->Add( m_smoothDragged, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
75 
76  m_violateDrc = new wxCheckBox( bOptions->GetStaticBox(), wxID_ANY, _("Allow DRC violations"), wxDefaultPosition, wxDefaultSize, 0 );
77  m_violateDrc->SetToolTip( _("(Highlight collisions mode only) - allows one to establish a track even if is violating the DRC rules.") );
78 
79  bOptions->Add( m_violateDrc, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
80 
81  m_suggestEnding = new wxCheckBox( bOptions->GetStaticBox(), wxID_ANY, _("Suggest track finish"), wxDefaultPosition, wxDefaultSize, 0 );
82  m_suggestEnding->Enable( false );
83 
84  bOptions->Add( m_suggestEnding, 0, wxALL, 5 );
85 
86  m_optimizeDraggedTrack = new wxCheckBox( bOptions->GetStaticBox(), wxID_ANY, _("Optimize track being dragged"), wxDefaultPosition, wxDefaultSize, 0 );
87  bOptions->Add( m_optimizeDraggedTrack, 0, wxALL, 5 );
88 
89  m_staticline1 = new wxStaticLine( bOptions->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
90  bOptions->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
91 
92  wxBoxSizer* bEffort;
93  bEffort = new wxBoxSizer( wxHORIZONTAL );
94 
95  m_effortLabel = new wxStaticText( bOptions->GetStaticBox(), wxID_ANY, _("Optimizer effort:"), wxDefaultPosition, wxDefaultSize, 0 );
96  m_effortLabel->Wrap( -1 );
97  m_effortLabel->SetToolTip( _("Defines how much time the router shall spend optimizing the routed/shoved traces.\nMore effort means cleaner routing (but slower), less effort means faster routing but somewhat jagged traces.") );
98 
99  bEffort->Add( m_effortLabel, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
100 
101 
102  bEffort->Add( 0, 0, 0, wxEXPAND, 5 );
103 
104  wxBoxSizer* bSlider;
105  bSlider = new wxBoxSizer( wxVERTICAL );
106 
107  m_effort = new wxSlider( bOptions->GetStaticBox(), wxID_ANY, 1, 0, 2, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS|wxSL_BOTTOM|wxSL_HORIZONTAL|wxSL_TOP );
108  bSlider->Add( m_effort, 1, wxEXPAND, 5 );
109 
110  wxBoxSizer* bSliderLabels;
111  bSliderLabels = new wxBoxSizer( wxHORIZONTAL );
112 
113  m_lowLabel = new wxStaticText( bOptions->GetStaticBox(), wxID_ANY, _("low"), wxDefaultPosition, wxDefaultSize, 0 );
114  m_lowLabel->Wrap( -1 );
115  m_lowLabel->SetFont( wxFont( 8, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
116 
117  bSliderLabels->Add( m_lowLabel, 0, 0, 5 );
118 
119 
120  bSliderLabels->Add( 0, 0, 1, wxEXPAND, 5 );
121 
122  m_highLabel = new wxStaticText( bOptions->GetStaticBox(), wxID_ANY, _("high"), wxDefaultPosition, wxDefaultSize, 0 );
123  m_highLabel->Wrap( -1 );
124  m_highLabel->SetFont( wxFont( 8, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
125 
126  bSliderLabels->Add( m_highLabel, 0, 0, 5 );
127 
128 
129  bSlider->Add( bSliderLabels, 1, wxEXPAND, 5 );
130 
131 
132  bEffort->Add( bSlider, 1, wxEXPAND, 5 );
133 
134 
135  bOptions->Add( bEffort, 0, wxEXPAND, 5 );
136 
137 
138  bMainSizer->Add( bOptions, 1, wxEXPAND|wxALL, 5 );
139 
140  m_stdButtons = new wxStdDialogButtonSizer();
141  m_stdButtonsOK = new wxButton( this, wxID_OK );
142  m_stdButtons->AddButton( m_stdButtonsOK );
143  m_stdButtonsCancel = new wxButton( this, wxID_CANCEL );
144  m_stdButtons->AddButton( m_stdButtonsCancel );
145  m_stdButtons->Realize();
146 
147  bMainSizer->Add( m_stdButtons, 0, wxALL|wxEXPAND, 5 );
148 
149 
150  this->SetSizer( bMainSizer );
151  this->Layout();
152  bMainSizer->Fit( this );
153 
154  // Connect Events
155  m_mode->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PNS_SETTINGS_BASE::onModeChange ), NULL, this );
156  m_freeAngleMode->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PNS_SETTINGS_BASE::onFreeAngleModeChange ), NULL, this );
157  m_stdButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PNS_SETTINGS_BASE::OnOkClick ), NULL, this );
158 }
159 
161 {
162  // Disconnect Events
163  m_mode->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PNS_SETTINGS_BASE::onModeChange ), NULL, this );
164  m_freeAngleMode->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PNS_SETTINGS_BASE::onFreeAngleModeChange ), NULL, this );
165  m_stdButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PNS_SETTINGS_BASE::OnOkClick ), NULL, this );
166 
167 }
virtual void onFreeAngleModeChange(wxCommandEvent &event)
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:83
#define NULL
virtual void OnOkClick(wxCommandEvent &event)
wxStdDialogButtonSizer * m_stdButtons
virtual void onModeChange(wxCommandEvent &event)
#define _(s)
Definition: 3d_actions.cpp:33
DIALOG_PNS_SETTINGS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Interactive Router Settings"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)