15DIALOG_FOOTPRINT_PROPERTIES_BASE::DIALOG_FOOTPRINT_PROPERTIES_BASE( wxWindow* parent, wxWindowID
id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
long style ) :
DIALOG_SHIM( parent, id, title, pos, size, style )
17 this->SetSizeHints( wxDefaultSize, wxDefaultSize );
23 wxBoxSizer* m_PanelPropertiesBoxSizer;
24 m_PanelPropertiesBoxSizer =
new wxBoxSizer( wxVERTICAL );
26 wxStaticBoxSizer* sbSizerTexts;
27 sbSizerTexts =
new wxStaticBoxSizer(
new wxStaticBox(
m_PanelGeneral, wxID_ANY,
_(
"Fields") ), wxVERTICAL );
29 m_itemsGrid =
new WX_GRID( sbSizerTexts->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), 0 );
64 m_itemsGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
68 m_itemsGrid->SetRowLabelValue( 0,
_(
"Reference designator") );
71 m_itemsGrid->SetRowLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
76 m_itemsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
79 sbSizerTexts->Add(
m_itemsGrid, 1, wxALL|wxBOTTOM|wxEXPAND, 5 );
81 wxBoxSizer* bButtonSize;
82 bButtonSize =
new wxBoxSizer( wxHORIZONTAL );
84 m_bpAdd =
new STD_BITMAP_BUTTON( sbSizerTexts->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
85 bButtonSize->Add(
m_bpAdd, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 );
88 bButtonSize->Add( 20, 0, 0, wxEXPAND, 5 );
90 m_bpDelete =
new STD_BITMAP_BUTTON( sbSizerTexts->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
91 bButtonSize->Add(
m_bpDelete, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 );
94 sbSizerTexts->Add( bButtonSize, 0, wxEXPAND, 5 );
97 m_PanelPropertiesBoxSizer->Add( sbSizerTexts, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
99 wxBoxSizer* bSizerProperties;
100 bSizerProperties =
new wxBoxSizer( wxHORIZONTAL );
104 wxStaticBoxSizer* sbSizer7;
105 sbSizer7 =
new wxStaticBoxSizer(
new wxStaticBox(
m_PanelGeneral, wxID_ANY,
_(
"Position") ), wxVERTICAL );
107 wxFlexGridSizer* fgSizerPos;
108 fgSizerPos =
new wxFlexGridSizer( 4, 3, 2, 0 );
109 fgSizerPos->AddGrowableCol( 1 );
110 fgSizerPos->AddGrowableRow( 2 );
111 fgSizerPos->SetFlexibleDirection( wxBOTH );
112 fgSizerPos->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
114 m_XPosLabel =
new wxStaticText( sbSizer7->GetStaticBox(), wxID_ANY,
_(
"X:"), wxDefaultPosition, wxDefaultSize, 0 );
116 fgSizerPos->Add(
m_XPosLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
118 m_ModPositionX =
new wxTextCtrl( sbSizer7->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
119 fgSizerPos->Add(
m_ModPositionX, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
121 m_XPosUnit =
new wxStaticText( sbSizer7->GetStaticBox(), wxID_ANY,
_(
"unit"), wxDefaultPosition, wxDefaultSize, 0 );
123 fgSizerPos->Add(
m_XPosUnit, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
125 m_YPosLabel =
new wxStaticText( sbSizer7->GetStaticBox(), wxID_ANY,
_(
"Y:"), wxDefaultPosition, wxDefaultSize, 0 );
127 fgSizerPos->Add(
m_YPosLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
129 m_ModPositionY =
new wxTextCtrl( sbSizer7->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
130 fgSizerPos->Add(
m_ModPositionY, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP, 1 );
132 m_YPosUnit =
new wxStaticText( sbSizer7->GetStaticBox(), wxID_ANY,
_(
"unit"), wxDefaultPosition, wxDefaultSize, 0 );
134 fgSizerPos->Add(
m_YPosUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
136 m_orientationLabel =
new wxStaticText( sbSizer7->GetStaticBox(), wxID_ANY,
_(
"Orientation:"), wxDefaultPosition, wxDefaultSize, 0 );
140 m_orientationCtrl =
new wxComboBox( sbSizer7->GetStaticBox(), wxID_ANY,
_(
"0"), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
145 fgSizerPos->Add(
m_orientationCtrl, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 2 );
148 fgSizerPos->Add( 0, 0, 1, wxEXPAND, 5 );
150 m_BoardSideLabel =
new wxStaticText( sbSizer7->GetStaticBox(), wxID_ANY,
_(
"Side:"), wxDefaultPosition, wxDefaultSize, 0 );
152 fgSizerPos->Add(
m_BoardSideLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
154 wxString m_BoardSideCtrlChoices[] = {
_(
"Front"),
_(
"Back") };
155 int m_BoardSideCtrlNChoices =
sizeof( m_BoardSideCtrlChoices ) /
sizeof( wxString );
156 m_BoardSideCtrl =
new wxChoice( sbSizer7->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_BoardSideCtrlNChoices, m_BoardSideCtrlChoices, 0 );
158 fgSizerPos->Add(
m_BoardSideCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM, 2 );
161 sbSizer7->Add( fgSizerPos, 0, wxEXPAND|wxBOTTOM, 3 );
163 m_cbLocked =
new wxCheckBox( sbSizer7->GetStaticBox(), wxID_ANY,
_(
"Locked"), wxDefaultPosition, wxDefaultSize, 0 );
167 bSizerLeft->Add( sbSizer7, 1, wxEXPAND|wxALL, 5 );
170 bSizerProperties->Add(
bSizerLeft, 1, wxEXPAND, 5 );
173 bSizerProperties->Add( 5, 0, 0, 0, 5 );
175 wxBoxSizer* bSizerMiddle;
176 bSizerMiddle =
new wxBoxSizer( wxVERTICAL );
178 wxStaticBoxSizer* sbAttributesSizer;
179 sbAttributesSizer =
new wxStaticBoxSizer(
new wxStaticBox(
m_PanelGeneral, wxID_ANY,
_(
"Attributes") ), wxVERTICAL );
181 wxBoxSizer* bPartTypeSizer;
182 bPartTypeSizer =
new wxBoxSizer( wxHORIZONTAL );
184 m_componentTypeLabel =
new wxStaticText( sbAttributesSizer->GetStaticBox(), wxID_ANY,
_(
"Footprint type:"), wxDefaultPosition, wxDefaultSize, 0 );
186 bPartTypeSizer->Add(
m_componentTypeLabel, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
188 wxString m_componentTypeChoices[] = {
_(
"Through hole"),
_(
"SMD"),
_(
"Unspecified") };
189 int m_componentTypeNChoices =
sizeof( m_componentTypeChoices ) /
sizeof( wxString );
190 m_componentType =
new wxChoice( sbAttributesSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_componentTypeNChoices, m_componentTypeChoices, 0 );
192 bPartTypeSizer->Add(
m_componentType, 1, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
195 sbAttributesSizer->Add( bPartTypeSizer, 0, wxEXPAND, 5 );
198 sbAttributesSizer->Add( 0, 0, 1, wxEXPAND, 5 );
200 m_boardOnly =
new wxCheckBox( sbAttributesSizer->GetStaticBox(), wxID_ANY,
_(
"Not in schematic"), wxDefaultPosition, wxDefaultSize, 0 );
201 sbAttributesSizer->Add(
m_boardOnly, 0, wxALL, 5 );
203 m_excludeFromPosFiles =
new wxCheckBox( sbAttributesSizer->GetStaticBox(), wxID_ANY,
_(
"Exclude from position files"), wxDefaultPosition, wxDefaultSize, 0 );
206 m_excludeFromBOM =
new wxCheckBox( sbAttributesSizer->GetStaticBox(), wxID_ANY,
_(
"Exclude from bill of materials"), wxDefaultPosition, wxDefaultSize, 0 );
209 m_noCourtyards =
new wxCheckBox( sbAttributesSizer->GetStaticBox(), wxID_ANY,
_(
"Exempt from courtyard requirement"), wxDefaultPosition, wxDefaultSize, 0 );
210 m_noCourtyards->SetToolTip(
_(
"Will not generate \"missing courtyard\" DRC violations") );
212 sbAttributesSizer->Add(
m_noCourtyards, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
214 m_cbDNP =
new wxCheckBox( sbAttributesSizer->GetStaticBox(), wxID_ANY,
_(
"Do not populate"), wxDefaultPosition, wxDefaultSize, 0 );
215 sbAttributesSizer->Add(
m_cbDNP, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 );
218 bSizerMiddle->Add( sbAttributesSizer, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
221 bSizerProperties->Add( bSizerMiddle, 1, wxEXPAND|wxTOP, 5 );
223 wxBoxSizer* bSizerRight;
224 bSizerRight =
new wxBoxSizer( wxVERTICAL );
226 wxBoxSizer* bButtonsSizer;
227 bButtonsSizer =
new wxBoxSizer( wxVERTICAL );
239 bButtonsSizer->Add( 0, 15, 0, wxEXPAND, 5 );
241 m_button5 =
new wxButton(
m_PanelGeneral, wxID_ANY,
_(
"Edit Library Footprint..."), wxDefaultPosition, wxDefaultSize, 0 );
242 bButtonsSizer->Add(
m_button5, 0, wxEXPAND|wxALL, 5 );
245 bSizerRight->Add( bButtonsSizer, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 );
248 bSizerRight->Add( 0, 0, 1, wxEXPAND, 5 );
251 bSizerProperties->Add( bSizerRight, 1, wxEXPAND|wxTOP, 5 );
254 m_PanelPropertiesBoxSizer->Add( bSizerProperties, 0, wxEXPAND, 5 );
262 wxBoxSizer* bSizerPanelClearances;
263 bSizerPanelClearances =
new wxBoxSizer( wxVERTICAL );
265 wxStaticBoxSizer* sbSizerLocalProperties;
266 sbSizerLocalProperties =
new wxStaticBoxSizer(
new wxStaticBox(
m_PanelClearances, wxID_ANY,
_(
"Clearances") ), wxVERTICAL );
268 m_staticTextInfo =
new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY,
_(
"Leave values blank to use Board Setup values."), wxDefaultPosition, wxDefaultSize, 0 );
270 sbSizerLocalProperties->Add(
m_staticTextInfo, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
272 wxGridBagSizer* gbSizer2;
273 gbSizer2 =
new wxGridBagSizer( 4, 0 );
274 gbSizer2->SetFlexibleDirection( wxBOTH );
275 gbSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
276 gbSizer2->SetEmptyCellSize( wxSize( -1,15 ) );
278 m_NetClearanceLabel =
new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY,
_(
"Pad clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
280 m_NetClearanceLabel->SetToolTip(
_(
"This is the local net clearance for all pad of this footprint\nIf 0, the Netclass values are used\nThis value can be superseded by a pad local value.") );
282 gbSizer2->Add(
m_NetClearanceLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
284 m_NetClearanceCtrl =
new wxTextCtrl( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
285 gbSizer2->Add(
m_NetClearanceCtrl, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
287 m_NetClearanceUnits =
new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY,
_(
"unit"), wxDefaultPosition, wxDefaultSize, 0 );
289 gbSizer2->Add(
m_NetClearanceUnits, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
291 m_SolderMaskMarginLabel =
new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY,
_(
"Solder mask expansion:"), wxDefaultPosition, wxDefaultSize, 0 );
293 m_SolderMaskMarginLabel->SetToolTip(
_(
"This is the local clearance between pads and the solder mask for this footprint.\nThis value can be superseded by a pad local value.\nIf 0, the global value is used.") );
295 gbSizer2->Add(
m_SolderMaskMarginLabel, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
297 m_SolderMaskMarginCtrl =
new wxTextCtrl( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
298 gbSizer2->Add(
m_SolderMaskMarginCtrl, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
300 m_SolderMaskMarginUnits =
new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY,
_(
"unit"), wxDefaultPosition, wxDefaultSize, 0 );
302 gbSizer2->Add(
m_SolderMaskMarginUnits, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
304 m_allowSolderMaskBridges =
new wxCheckBox( sbSizerLocalProperties->GetStaticBox(), wxID_ANY,
_(
"Allow bridged solder mask apertures between pads"), wxDefaultPosition, wxDefaultSize, 0 );
307 m_SolderPasteMarginLabel =
new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY,
_(
"Solder paste absolute clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
309 m_SolderPasteMarginLabel->SetToolTip(
_(
"This is the local clearance between pads and the solder paste for this footprint.\nThis value can be superseded by a pad local values.\nThe final clearance value is the sum of this value and the clearance value ratio.\nA negative value means a smaller stencil aperture size than pad size.") );
311 gbSizer2->Add(
m_SolderPasteMarginLabel, wxGBPosition( 5, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
313 m_SolderPasteMarginCtrl =
new wxTextCtrl( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
316 m_SolderPasteMarginUnits =
new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY,
_(
"unit"), wxDefaultPosition, wxDefaultSize, 0 );
318 gbSizer2->Add(
m_SolderPasteMarginUnits, wxGBPosition( 5, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
320 m_PasteMarginRatioLabel =
new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY,
_(
"Solder paste relative clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
322 m_PasteMarginRatioLabel->SetToolTip(
_(
"This is the local clearance ratio applied as a percentage of the pad width and height for this footprint.\nA value of 10 means the horizontal clearance value is 10% of the pad’s width, and the vertical clearance value is 10% of the pad’s height.\nThis value can be superseded by a pad local value.\nThe final clearance value is the sum of this value and the absolute clearance value.\nA negative value means a smaller stencil aperture size than pad size.") );
324 gbSizer2->Add(
m_PasteMarginRatioLabel, wxGBPosition( 6, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
326 m_PasteMarginRatioCtrl =
new wxTextCtrl( sbSizerLocalProperties->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
329 m_PasteMarginRatioUnits =
new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY,
_(
"%"), wxDefaultPosition, wxDefaultSize, 0 );
331 gbSizer2->Add(
m_PasteMarginRatioUnits, wxGBPosition( 6, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
334 sbSizerLocalProperties->Add( gbSizer2, 1, wxEXPAND|wxTOP|wxBOTTOM, 10 );
336 wxFlexGridSizer* fgSizerClearances;
337 fgSizerClearances =
new wxFlexGridSizer( 5, 3, 5, 0 );
338 fgSizerClearances->AddGrowableCol( 1 );
339 fgSizerClearances->SetFlexibleDirection( wxBOTH );
340 fgSizerClearances->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
343 sbSizerLocalProperties->Add( fgSizerClearances, 0, wxTOP|wxBOTTOM, 10 );
345 m_staticTextInfoCopper =
new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY,
_(
"Note: solder mask and paste values are used only for pads on copper layers."), wxDefaultPosition, wxDefaultSize, 0 );
349 m_staticTextInfoPaste =
new wxStaticText( sbSizerLocalProperties->GetStaticBox(), wxID_ANY,
_(
"Note: solder paste clearances (absolute and relative) are added to determine the final clearance."), wxDefaultPosition, wxDefaultSize, 0 );
354 bSizerPanelClearances->Add( sbSizerLocalProperties, 0, wxEXPAND|wxALL, 10 );
356 wxStaticBoxSizer* sbSizerZoneConnection;
357 sbSizerZoneConnection =
new wxStaticBoxSizer(
new wxStaticBox(
m_PanelClearances, wxID_ANY,
_(
"Connection to Copper Zones") ), wxHORIZONTAL );
359 m_staticText16 =
new wxStaticText( sbSizerZoneConnection->GetStaticBox(), wxID_ANY,
_(
"Pad connection to zones:"), wxDefaultPosition, wxDefaultSize, 0 );
361 sbSizerZoneConnection->Add(
m_staticText16, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
363 wxString m_ZoneConnectionChoiceChoices[] = {
_(
"Use zone setting"),
_(
"Solid"),
_(
"Thermal relief"),
_(
"None") };
364 int m_ZoneConnectionChoiceNChoices =
sizeof( m_ZoneConnectionChoiceChoices ) /
sizeof( wxString );
365 m_ZoneConnectionChoice =
new wxChoice( sbSizerZoneConnection->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_ZoneConnectionChoiceNChoices, m_ZoneConnectionChoiceChoices, 0 );
367 sbSizerZoneConnection->Add(
m_ZoneConnectionChoice, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
370 bSizerPanelClearances->Add( sbSizerZoneConnection, 0, wxALL|wxEXPAND, 10 );
380 wxBoxSizer* bottomButtonsSizer;
381 bottomButtonsSizer =
new wxBoxSizer( wxHORIZONTAL );
383 m_libraryIDLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Library link:"), wxDefaultPosition, wxDefaultSize, 0 );
385 bottomButtonsSizer->Add(
m_libraryIDLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 7 );
387 m_tcLibraryID =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxBORDER_NONE );
388 m_tcLibraryID->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DLIGHT ) );
389 m_tcLibraryID->SetToolTip(
_(
"The library ID and footprint ID currently assigned. Use \"Change Footprint...\" to assign a different footprint.") );
391 bottomButtonsSizer->Add(
m_tcLibraryID, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
394 bottomButtonsSizer->Add( 10, 0, 0, 0, 5 );
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
void SetColLabelSize(int aHeight)
Hide wxGrid's SetColLabelSize() method with one which makes sure the size is tall enough for the syst...