From 7fd24c7f0388e0be287fde71b56c54d1c4d2a5b9 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 3 Aug 2012 17:43:15 +0200 Subject: [PATCH] Very minor fixes. --- pcbnew/autorouter/automove.cpp | 2 +- ...board_items_to_polygon_shape_transform.cpp | 4 +- pcbnew/class_board_connected_item.cpp | 2 +- pcbnew/class_pad.cpp | 2 +- pcbnew/class_pad_draw_functions.cpp | 6 +- pcbnew/class_zone.cpp | 6 +- pcbnew/class_zone.h | 18 - pcbnew/dialogs/dialog_design_rules_base.cpp | 30 +- pcbnew/dialogs/dialog_design_rules_base.fbp | 4068 ++++++++--------- pcbnew/dialogs/dialog_design_rules_base.h | 7 +- pcbnew/dialogs/dialog_drc.cpp | 3 +- pcbnew/dialogs/dialog_drc.h | 303 +- pcbnew/dialogs/dialog_drc_base.cpp | 21 +- pcbnew/dialogs/dialog_drc_base.fbp | 2680 +++++++---- pcbnew/dialogs/dialog_drc_base.h | 41 +- pcbnew/dialogs/dialog_drclistbox.h | 311 ++ pcbnew/dialogs/dialog_find.cpp | 3 +- pcbnew/dialogs/dialog_find_base.fbp | 4 +- .../dialog_global_modules_fields_edition.cpp | 4 +- pcbnew/editrack.cpp | 8 +- .../gen_holes_and_tools_lists_for_drill.cpp | 2 +- pcbnew/hotkeys_board_editor.cpp | 2 +- pcbnew/magnetic_tracks_functions.cpp | 4 +- pcbnew/pcb_parser.cpp | 1 + pcbnew/print_board_functions.cpp | 6 +- pcbnew/ratsnest.cpp | 2 +- pcbnew/zone_filling_algorithm.cpp | 5 +- ...nvert_brd_items_to_polygons_with_Boost.cpp | 8 +- ...ones_convert_to_polygons_aux_functions.cpp | 8 +- pcbnew/zones_functions_for_undo_redo.cpp | 9 +- polygon/PolyLine.h | 21 - 31 files changed, 4178 insertions(+), 3413 deletions(-) create mode 100644 pcbnew/dialogs/dialog_drclistbox.h diff --git a/pcbnew/autorouter/automove.cpp b/pcbnew/autorouter/automove.cpp index 154fdcc831..f7db5f5b7f 100644 --- a/pcbnew/autorouter/automove.cpp +++ b/pcbnew/autorouter/automove.cpp @@ -279,7 +279,7 @@ void PCB_EDIT_FRAME::AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb ) GetScreen()->SetCrossHairPosition( current + Module->m_Pos - Module->m_BoundaryBox.GetPosition() ); - Ymax_size = max( Ymax_size, Module->m_BoundaryBox.GetHeight() ); + Ymax_size = std::max( Ymax_size, Module->m_BoundaryBox.GetHeight() ); PlaceModule( Module, NULL, true ); diff --git a/pcbnew/board_items_to_polygon_shape_transform.cpp b/pcbnew/board_items_to_polygon_shape_transform.cpp index 47a8bbd736..824f9fd5b9 100644 --- a/pcbnew/board_items_to_polygon_shape_transform.cpp +++ b/pcbnew/board_items_to_polygon_shape_transform.cpp @@ -661,8 +661,8 @@ void CreateThermalReliefPadPolygon( std::vector& aCornerBuffer, if( aCopperThickness < 0 ) aCopperThickness = 0; - copper_thickness.x = min( dx, aCopperThickness ); - copper_thickness.y = min( dy, aCopperThickness ); + copper_thickness.x = std::min( dx, aCopperThickness ); + copper_thickness.y = std::min( dy, aCopperThickness ); switch( aPad.GetShape() ) { diff --git a/pcbnew/class_board_connected_item.cpp b/pcbnew/class_board_connected_item.cpp index 8f829e8387..a4ea8b150d 100644 --- a/pcbnew/class_board_connected_item.cpp +++ b/pcbnew/class_board_connected_item.cpp @@ -116,7 +116,7 @@ int BOARD_CONNECTED_ITEM::GetClearance( BOARD_CONNECTED_ITEM* aItem ) const if( aItem ) { int hisClearance = aItem->GetClearance(); - return max( hisClearance, myClearance ); + return std::max( hisClearance, myClearance ); } return myClearance; diff --git a/pcbnew/class_pad.cpp b/pcbnew/class_pad.cpp index 9b79c76976..856a26d68b 100644 --- a/pcbnew/class_pad.cpp +++ b/pcbnew/class_pad.cpp @@ -348,7 +348,7 @@ int D_PAD::GetClearance( BOARD_CONNECTED_ITEM* aItem ) const if( aItem ) { int hisClearance = aItem->GetClearance(); - return max( hisClearance, clearance ); + return std::max( hisClearance, clearance ); } // Return the specific clearance. diff --git a/pcbnew/class_pad_draw_functions.cpp b/pcbnew/class_pad_draw_functions.cpp index 639e25fc03..d5aee5a3cf 100644 --- a/pcbnew/class_pad_draw_functions.cpp +++ b/pcbnew/class_pad_draw_functions.cpp @@ -618,9 +618,9 @@ void D_PAD::DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo ) { ReturnStringPadName( buffer ); int numpad_len = buffer.Len(); - numpad_len = MAX( numpad_len, MIN_CHAR_COUNT ); + numpad_len = std::max( numpad_len, MIN_CHAR_COUNT ); - tsize = min( AreaSize.y, AreaSize.x / numpad_len ); + tsize = std::min( AreaSize.y, AreaSize.x / numpad_len ); #define CHAR_SIZE_MIN 5 if( aDC->LogicalToDeviceXRel( tsize ) >= CHAR_SIZE_MIN ) // Not drawable when size too small. @@ -638,7 +638,7 @@ void D_PAD::DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo ) return; shortname_len = MAX( shortname_len, MIN_CHAR_COUNT ); - tsize = min( AreaSize.y, AreaSize.x / shortname_len ); + tsize = std::min( AreaSize.y, AreaSize.x / shortname_len ); if( aDC->LogicalToDeviceXRel( tsize ) >= CHAR_SIZE_MIN ) // Not drawable in size too small. { diff --git a/pcbnew/class_zone.cpp b/pcbnew/class_zone.cpp index 53024e5ea4..09c18e6574 100644 --- a/pcbnew/class_zone.cpp +++ b/pcbnew/class_zone.cpp @@ -245,8 +245,8 @@ void ZONE_CONTAINER::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode, const void ZONE_CONTAINER::DrawFilledArea( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode, const wxPoint& offset ) { - static vector CornersTypeBuffer; - static vector CornersBuffer; + static std::vector CornersTypeBuffer; + static std::vector CornersBuffer; // outline_mode is false to show filled polys, // and true to show polygons outlines only (test and debug purposes) @@ -615,7 +615,7 @@ int ZONE_CONTAINER::GetClearance( BOARD_CONNECTED_ITEM* aItem ) const if( aItem ) { int hisClearance = aItem->GetClearance( NULL ); - myClearance = max( hisClearance, myClearance ); + myClearance = std::max( hisClearance, myClearance ); } return myClearance; diff --git a/pcbnew/class_zone.h b/pcbnew/class_zone.h index e305050ac2..0042999267 100644 --- a/pcbnew/class_zone.h +++ b/pcbnew/class_zone.h @@ -274,24 +274,6 @@ public: */ void AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ); - /** - * Function CopyPolygonsFromBoolengineToFilledPolysList - * Copy (Add) polygons created by kbool (after Do_Operation) to m_FilledPolysList - * @param aBoolengine = the kbool engine used in Do_Operation - * @return the corner count - */ - int CopyPolygonsFromBoolengineToFilledPolysList( Bool_Engine* aBoolengine ); - - /** - * Function CopyPolygonsFromFilledPolysListToBoolengine - * Copy (Add) polygons created by kbool (after Do_Operation) to m_FilledPolysList - * @param aBoolengine = kbool engine - * @param aGroup = group in kbool engine (GROUP_A or GROUP_B only) - * @return the corner count - */ - int CopyPolygonsFromFilledPolysListToBoolengine( Bool_Engine* aBoolengine, - GroupType aGroup = GROUP_A ); - /** * Function HitTestForCorner * tests if the given wxPoint near a corner diff --git a/pcbnew/dialogs/dialog_design_rules_base.cpp b/pcbnew/dialogs/dialog_design_rules_base.cpp index db20706cb5..e84d3d62c1 100644 --- a/pcbnew/dialogs/dialog_design_rules_base.cpp +++ b/pcbnew/dialogs/dialog_design_rules_base.cpp @@ -1,12 +1,10 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 30 2011) +// C++ code generated with wxFormBuilder (version Apr 10 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#include "dialog_design_rules_aux_helper_class.h" - #include "dialog_design_rules_base.h" /////////////////////////////////////////////////////////////////////////// @@ -86,8 +84,10 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID buttonBoxSizer->Add( m_moveUpButton, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + sbSizerUpper->Add( buttonBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); + bpanelNetClassesSizer->Add( sbSizerUpper, 1, wxRIGHT|wxLEFT|wxEXPAND, 5 ); wxStaticBoxSizer* sbSizerNetSelectMain; @@ -104,6 +104,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID leftNetSelectBoxSizer->Add( m_leftListCtrl, 1, wxEXPAND|wxTOP, 5 ); + sbSizerNetSelectMain->Add( leftNetSelectBoxSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); wxBoxSizer* bmiddleSizerNetSelect; @@ -129,6 +130,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID bmiddleSizerNetSelect->Add( m_buttonRightSelAll, 0, wxALIGN_BOTTOM|wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + sbSizerNetSelectMain->Add( bmiddleSizerNetSelect, 0, wxALIGN_CENTER_VERTICAL, 5 ); wxBoxSizer* rghtNetSelectBoxSizer; @@ -142,14 +144,17 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID rghtNetSelectBoxSizer->Add( m_rightListCtrl, 1, wxEXPAND|wxTOP, 5 ); + sbSizerNetSelectMain->Add( rghtNetSelectBoxSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + bpanelNetClassesSizer->Add( sbSizerNetSelectMain, 2, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + m_panelNetClassesEditor->SetSizer( bpanelNetClassesSizer ); m_panelNetClassesEditor->Layout(); bpanelNetClassesSizer->Fit( m_panelNetClassesEditor ); - m_DRnotebook->AddPage( m_panelNetClassesEditor, _("Net Classes Editor"), true ); + m_DRnotebook->AddPage( m_panelNetClassesEditor, _("Net Classes Editor"), false ); m_panelGolbalDesignRules = new wxPanel( m_DRnotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); wxBoxSizer* bpanelGlobRulesSizer; bpanelGlobRulesSizer = new wxBoxSizer( wxVERTICAL ); @@ -162,7 +167,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID wxString m_OptViaTypeChoices[] = { _("Through via"), _("Blind or buried via") }; int m_OptViaTypeNChoices = sizeof( m_OptViaTypeChoices ) / sizeof( wxString ); - m_OptViaType = new wxRadioBox( m_panelGolbalDesignRules, wxID_ANY, _("Default Via Type"), wxDefaultPosition, wxDefaultSize, m_OptViaTypeNChoices, m_OptViaTypeChoices, 1, wxRA_SPECIFY_COLS ); + m_OptViaType = new wxRadioBox( m_panelGolbalDesignRules, wxID_ANY, _("Default Via Type:"), wxDefaultPosition, wxDefaultSize, m_OptViaTypeNChoices, m_OptViaTypeChoices, 1, wxRA_SPECIFY_COLS ); m_OptViaType->SetSelection( 0 ); m_OptViaType->SetToolTip( _("Select the current via type.\nTrough via is the usual selection") ); @@ -176,6 +181,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID sbViasOptionSizer->Add( m_AllowMicroViaCtrl, 0, wxALL|wxEXPAND, 5 ); + bDesignRulesUpperSizer->Add( sbViasOptionSizer, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); wxStaticBoxSizer* sbMinSizesSizer; @@ -224,16 +230,19 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID m_SetMicroViasMinDrillCtrl->SetMaxLength( 6 ); fgMinValuesSizer->Add( m_SetMicroViasMinDrillCtrl, 0, wxEXPAND|wxALL, 5 ); + sbMinSizesSizer->Add( fgMinValuesSizer, 0, wxEXPAND, 5 ); + bDesignRulesUpperSizer->Add( sbMinSizesSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + bpanelGlobRulesSizer->Add( bDesignRulesUpperSizer, 0, wxEXPAND, 5 ); m_staticline1 = new wxStaticLine( m_panelGolbalDesignRules, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); bpanelGlobRulesSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); - m_staticTextInfo = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Specific via diameters and track widths, which \ncan be used to replace default Netclass values \non demand, for arbitrary via or track segments."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextInfo = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Specific via diameters and track widths, which \ncan be used to replace default Netclass values \non demand, for arbitrary vias or track segments."), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextInfo->Wrap( -1 ); bpanelGlobRulesSizer->Add( m_staticTextInfo, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); @@ -287,6 +296,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID m_gridViaSizeList->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); sViaSizeBox->Add( m_gridViaSizeList, 0, wxALL|wxEXPAND, 5 ); + bDesignRulesLowerSizer->Add( sViaSizeBox, 1, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5 ); wxStaticBoxSizer* sbTracksListSizer; @@ -347,14 +357,17 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID m_gridTrackWidthList->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); sbTracksListSizer->Add( m_gridTrackWidthList, 0, wxALL|wxEXPAND, 5 ); + bDesignRulesLowerSizer->Add( sbTracksListSizer, 1, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5 ); + bpanelGlobRulesSizer->Add( bDesignRulesLowerSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + m_panelGolbalDesignRules->SetSizer( bpanelGlobRulesSizer ); m_panelGolbalDesignRules->Layout(); bpanelGlobRulesSizer->Fit( m_panelGolbalDesignRules ); - m_DRnotebook->AddPage( m_panelGolbalDesignRules, _("Global Design Rules"), false ); + m_DRnotebook->AddPage( m_panelGolbalDesignRules, _("Global Design Rules"), true ); bMainSizer->Add( m_DRnotebook, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); @@ -376,10 +389,13 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerButtons->Add( m_buttonCancel, 0, wxALL|wxEXPAND, 5 ); + sbSizer2->Add( bSizerButtons, 0, 0, 5 ); + bMainSizer->Add( sbSizer2, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + this->SetSizer( bMainSizer ); this->Layout(); diff --git a/pcbnew/dialogs/dialog_design_rules_base.fbp b/pcbnew/dialogs/dialog_design_rules_base.fbp index cc33864e2d..efa8b990e1 100644 --- a/pcbnew/dialogs/dialog_design_rules_base.fbp +++ b/pcbnew/dialogs/dialog_design_rules_base.fbp @@ -2,10 +2,11 @@ - + C++ 1 source_name + 0 0 res UTF-8 @@ -15,111 +16,78 @@ none 1 dialog_design_rules_base - + . - + 1 + 1 1 1 0 - 1 - 1 - 1 - 1 0 - - - - - 1 - - 0 - 1 - + wxAUI_MGR_DEFAULT + + + 1 - 0 - Dock - 0 - Left 1 impl_virtual - - - 1 - - 0 + + + 0 wxID_ANY - - - 0 - - - 0 + -1,-1 - 1 DIALOG_DESIGN_RULES_BASE - 1 - - - 1 - - - Resizable - - 1 + 777,697 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - + Design Rules Editor - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + bMainSizer wxVERTICAL none @@ -132,167 +100,159 @@ 1 1 1 - - - - - + + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - - + 0 - - + + 0 - + 1 m_DRnotebook 1 - - + + protected 1 - - + Resizable - 1 - + wxNB_TOP - + 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + Net Classes Editor - 1 + 0 1 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - - + 0 - - + + 0 - + 1 m_panelNetClassesEditor 1 - - + + protected 1 - - + Resizable - 1 - - + + 0 - - - wxFILTER_NONE - wxDefaultValidator - - - + + + wxSUNKEN_BORDER|wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + bpanelNetClassesSizer wxVERTICAL none @@ -303,11 +263,11 @@ wxID_ANY Net Classes: - + sbSizerUpper wxVERTICAL none - + 5 wxEXPAND @@ -317,17 +277,20 @@ 1 1 1 - + + + + 0 1 - - - + + + 1 - - + + wxALIGN_LEFT - + wxALIGN_TOP 0 1 @@ -337,7 +300,7 @@ wxALIGN_CENTRE 6 100,120,84,85,81,90 - + 1 0 Dock @@ -349,110 +312,103 @@ 1 1 1 - + 1 - - + + 1 0 0 wxID_ANY - - - - + + + 0 0 - + 0 - - + + 0 -1,-1 1 m_grid 1 - - + + protected 1 - - + Resizable - wxALIGN_LEFT 120 "Default" wxALIGN_CENTRE - + 1 1 - - + + 0 Net Class parameters - - wxFILTER_NONE - wxDefaultValidator - - - + + wxHSCROLL|wxSIMPLE_BORDER|wxVSCROLL - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + OnNetClassesNameLeftClick - + OnNetClassesNameRightClick - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -460,7 +416,7 @@ wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT 0 - + buttonBoxSizer wxHORIZONTAL none @@ -473,14 +429,17 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -488,68 +447,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_ADD_NETCLASS Add - - + 0 - - + + 0 - + 1 m_addButton 1 - - + + protected 1 - - + Resizable - 1 - - - + + + 0 Add another Net Class - + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnAddNetclassClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -561,14 +517,17 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -576,68 +535,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_REMOVE_NETCLASS Remove - - + 0 - - + + 0 - + 1 m_removeButton 1 - - + + protected 1 - - + Resizable - 1 - - - + + + 0 Remove the currently select Net Class The default Net Class cannot be removed - + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnRemoveNetclassClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -649,14 +605,17 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -664,68 +623,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_ANY Move Up - - + 0 - - + + 0 - + 1 m_moveUpButton 1 - - + + protected 1 - - + Resizable - 1 - - - + + + 0 Move the currently selected Net Class up one row - + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnMoveUpSelectedNetClass - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -739,17 +695,17 @@ wxID_ANY Membership: - + sbSizerNetSelectMain wxHORIZONTAL none - + 5 wxEXPAND|wxRIGHT|wxLEFT 1 - + leftNetSelectBoxSizer wxVERTICAL none @@ -762,85 +718,86 @@ 1 1 1 - - - - + + + + + + + 1 0 - + 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - - + 0 - - + + 0 - + 1 m_leftClassChoice 1 - - + + protected 1 - - + Resizable - + -1 1 - + wxCB_READONLY - + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - + + + + + + OnLeftCBSelection - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -852,100 +809,100 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - - + 0 - - + + 0 220,200 1 m_leftListCtrl 1 - - + + protected 1 - - + Resizable - 1 - + wxLC_HRULES|wxLC_REPORT|wxLC_VIRTUAL|wxLC_VRULES NETS_LIST_CTRL; dialog_design_rules_aux_helper_class.h 0 - - + + wxFILTER_NONE wxDefaultValidator - - - + + + wxSUNKEN_BORDER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -955,7 +912,7 @@ wxALIGN_CENTER_VERTICAL 0 - + bmiddleSizerNetSelect wxVERTICAL none @@ -968,14 +925,17 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -983,68 +943,65 @@ 0 Left 1 - + 1 - + 0 0 ID_LEFT_TO_RIGHT_COPY <<< - - + 0 - - + + 0 - + 1 m_buttonRightToLeft 1 - - + + protected 1 - - + Resizable - 1 - - - + + + 0 Move the selected nets in the right list to the left list - + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnRightToLeftCopyButton - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1056,14 +1013,17 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -1071,68 +1031,65 @@ 0 Left 1 - + 1 - + 0 0 ID_RIGHT_TO_LEFT_COPY >>> - - + 0 - - + + 0 - + 1 m_buttonLeftToRight 1 - - + + protected 1 - - + Resizable - 1 - - - + + + 0 Move the selected nets in the left list to the right list - + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnLeftToRightCopyButton - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1144,14 +1101,17 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -1159,68 +1119,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_ANY << Select All - - + 0 - - + + 0 - + 1 m_buttonLeftSelAll 1 - - + + protected 1 - - + Resizable - 1 - - - + + + 0 Select all nets in the left list - + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnLeftSelectAllButton - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1232,14 +1189,17 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -1247,68 +1207,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_ANY Select All >> - - + 0 - - + + 0 - + 1 m_buttonRightSelAll 1 - - + + protected 1 - - + Resizable - 1 - - - + + + 0 Select all nets in the right list - + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnRightSelectAllButton - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1318,7 +1275,7 @@ wxEXPAND|wxRIGHT|wxLEFT 1 - + rghtNetSelectBoxSizer wxVERTICAL none @@ -1331,85 +1288,86 @@ 1 1 1 - - - - + + + + + + + 1 0 - + 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - - + 0 - - + + 0 - + 1 m_rightClassChoice 1 - - + + protected 1 - - + Resizable - + -1 1 - + wxCB_READONLY - + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - + + + + + + OnRightCBSelection - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -1421,100 +1379,100 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - - + 0 - - + + 0 220,-1 1 m_rightListCtrl 1 - - + + protected 1 - - + Resizable - 1 - + wxLC_HRULES|wxLC_REPORT|wxLC_VIRTUAL|wxLC_VRULES NETS_LIST_CTRL; dialog_design_rules_aux_helper_class.h 0 - - + + wxFILTER_NONE wxDefaultValidator - - - + + + wxSUNKEN_BORDER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1525,89 +1483,85 @@ - + Global Design Rules - 0 + 1 1 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - - + 0 - - + + 0 - + 1 m_panelGolbalDesignRules 1 - - + + protected 1 - - + Resizable - 1 - - + + 0 - - - wxFILTER_NONE - wxDefaultValidator - - - + + + wxSUNKEN_BORDER|wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + bpanelGlobRulesSizer wxVERTICAL none @@ -1616,7 +1570,7 @@ wxEXPAND 0 - + bDesignRulesUpperSizer wxHORIZONTAL none @@ -1627,11 +1581,11 @@ wxID_ANY Via Options: - + sbViasOptionSizer wxVERTICAL none - + 5 wxALL|wxEXPAND @@ -1641,85 +1595,85 @@ 1 1 1 - - - - + + + + + + + 1 0 "Through via" "Blind or buried via" 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - Default Via Type - + Default Via Type: 1 - + 0 - - + + 0 - + 1 m_OptViaType 1 - - + + protected 1 - - + Resizable - 0 1 - + wxRA_SPECIFY_COLS - + 0 Select the current via type. Trough via is the usual selection - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1731,85 +1685,85 @@ 1 1 1 - - - - + + + + + + + 1 0 "Do not allow micro vias" "Allow micro vias" 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Micro Vias: - 1 - + 0 - - + + 0 - + 1 m_AllowMicroViaCtrl 1 - - + + protected 1 - - + Resizable - 0 1 - + wxRA_SPECIFY_COLS - + 0 Allows or do not allow use of micro vias They are very small vias only from an external copper layer to its near neightbour - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1821,11 +1775,11 @@ wxID_ANY Minimum Allowed Values: - + sbMinSizesSizer wxVERTICAL none - + 5 wxEXPAND @@ -1834,9 +1788,9 @@ 2 wxBOTH 1 - + 0 - + fgMinValuesSizer wxFLEX_GROWMODE_SPECIFIED none @@ -1851,82 +1805,78 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Min track width - - + 0 - - + + 0 - + 1 m_TrackMinWidthTitle 1 - - + + protected 1 - - + Resizable - 1 - - - + + + 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1938,86 +1888,86 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - - + 0 - + 0 - + 0 - + 1 m_SetTrackMinWidthCtrl 1 - - + + protected 1 - - + Resizable - 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2029,82 +1979,78 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Min via diameter - - + 0 - - + + 0 - + 1 m_ViaMinTitle 1 - - + + protected 1 - - + Resizable - 1 - - - + + + 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -2116,86 +2062,86 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - - + 0 - + 0 - + 0 - + 1 m_SetViasMinSizeCtrl 1 - - + + protected 1 - - + Resizable - 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2207,82 +2153,78 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Min via drill dia - - + 0 - - + + 0 - + 1 m_ViaMinDrillTitle 1 - - + + protected 1 - - + Resizable - 1 - - - + + + 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -2294,86 +2236,86 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - - + 0 - + 0 - + 0 - + 1 m_SetViasMinDrillCtrl 1 - - + + protected 1 - - + Resizable - 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2385,82 +2327,78 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Min uvia diameter - - + 0 - - + + 0 - + 1 m_MicroViaMinSizeTitle 1 - - + + protected 1 - - + Resizable - 1 - - - + + + 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -2472,86 +2410,86 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - - + 0 - + 6 - + 0 - + 1 m_SetMicroViasMinSizeCtrl 1 - - + + protected 1 - - + Resizable - 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2563,82 +2501,78 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Min uvia drill dia - - + 0 - - + + 0 - + 1 m_MicroViaMinDrillTitle 1 - - + + protected 1 - - + Resizable - 1 - - - + + + 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -2650,86 +2584,86 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - - + 0 - + 6 - + 0 - + 1 m_SetMicroViasMinDrillCtrl 1 - - + + protected 1 - - + Resizable - 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2747,80 +2681,76 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - - + 0 - - + + 0 - + 1 m_staticline1 1 - - + + protected 1 - - + Resizable - 1 - + wxLI_HORIZONTAL - + 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2832,82 +2762,78 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - Specific via diameters and track widths, which can be used to replace default Netclass values on demand, for arbitrary via or track segments. - - + Specific via diameters and track widths, which can be used to replace default Netclass values on demand, for arbitrary vias or track segments. + 0 - - + + 0 - + 1 m_staticTextInfo 1 - - + + protected 1 - - + Resizable - 1 - - - + + + 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -2915,7 +2841,7 @@ wxALIGN_CENTER_HORIZONTAL|wxEXPAND 0 - + bDesignRulesLowerSizer wxHORIZONTAL none @@ -2926,11 +2852,11 @@ wxID_ANY Custom Via Sizes: - + sViaSizeBox wxVERTICAL none - + 5 wxALL @@ -2940,82 +2866,78 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Drill value: a blank or 0 => default Netclass value - - + 0 - - + + 0 - + 1 m_staticText7 1 - - + + protected 1 - - + Resizable - 1 - - - + + + 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -3027,17 +2949,20 @@ 1 1 1 - + + + + 0 0 - - - + + + 1 - - + + wxALIGN_LEFT - + wxALIGN_TOP 0 1 @@ -3046,8 +2971,8 @@ "Diameter" "Drill" wxALIGN_CENTRE 2 - - + + 1 0 Dock @@ -3059,110 +2984,103 @@ 1 1 1 - + 1 - - + + 1 0 0 wxID_ANY - - - - + + + 0 0 - + 0 - - + + 0 - + 1 m_gridViaSizeList 1 - - + + protected 1 - - + Resizable - wxALIGN_CENTRE 80 "Via 1" "Via 2" "Via 3" "Via 4" "Via 5" "Via 6" "Via 7" "Via 8" "Via 9" "Via 10" "Via 11" "Via 12" wxALIGN_CENTRE - + 12 1 - - + + 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3174,11 +3092,11 @@ wxID_ANY Custom Track Widths: - + sbTracksListSizer wxVERTICAL none - + 5 wxALL @@ -3188,82 +3106,78 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - - - + + 0 - - + + 0 - + 1 m_staticText8 1 - - + + protected 1 - - + Resizable - 1 - - - + + + 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -3275,17 +3189,20 @@ 1 1 1 - + + + + 0 0 - - - + + + 1 - - + + wxALIGN_LEFT - + wxALIGN_TOP 0 1 @@ -3294,8 +3211,8 @@ "Width" wxALIGN_CENTRE 1 - - + + 1 0 Dock @@ -3307,37 +3224,34 @@ 1 1 1 - + 1 - - + + 1 0 0 wxID_ANY - - - - + + + 0 0 - + 0 - - + + 0 - + 1 m_gridTrackWidthList 1 - - + + protected 1 - - + Resizable - wxALIGN_CENTRE 80 "Track 1" "Track 2" "Track 3" "Track 4" "Track 5" "Track 6" "Track 7" "Track 8" "Track 9" "Track 10" "Track 11" "Track 12" @@ -3345,72 +3259,68 @@ 17,17,17,17,17,17,17,17,17,17,17,17 12 1 - - + + 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3429,11 +3339,11 @@ wxID_ANY Messages: - + sbSizer2 wxHORIZONTAL none - + 5 wxEXPAND @@ -3443,91 +3353,87 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - - + 0 - - + + 0 -1,90 1 m_MessagesList 1 - - + + protected 1 - - + Resizable - 1 - + wxHW_SCROLLBAR_AUTO - + 0 - - - wxFILTER_NONE - wxDefaultValidator - - - + + + wxSUNKEN_BORDER - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + 5 - + 0 - + bSizerButtons wxVERTICAL none @@ -3540,14 +3446,17 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 1 0 @@ -3555,68 +3464,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_OK OK - - + 0 - - + + 0 - + 1 m_buttonOk 1 - - + + protected 1 - - + Resizable - 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnOkButtonClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -3628,14 +3534,17 @@ 1 1 1 - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -3643,68 +3552,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_CANCEL Cancel - - + 0 - - + + 0 - + 1 m_buttonCancel 1 - - + + protected 1 - - + Resizable - 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnCancelButtonClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pcbnew/dialogs/dialog_design_rules_base.h b/pcbnew/dialogs/dialog_design_rules_base.h index b29df0fa9c..e3f0a341d0 100644 --- a/pcbnew/dialogs/dialog_design_rules_base.h +++ b/pcbnew/dialogs/dialog_design_rules_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 30 2011) +// C++ code generated with wxFormBuilder (version Apr 10 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -11,8 +11,7 @@ #include #include #include -class NETS_LIST_CTRL; - +#include "dialog_design_rules_aux_helper_class.h" #include #include #include @@ -51,7 +50,7 @@ class DIALOG_DESIGN_RULES_BASE : public wxDialog wxID_ADD_NETCLASS = 1000, wxID_REMOVE_NETCLASS, ID_LEFT_TO_RIGHT_COPY, - ID_RIGHT_TO_LEFT_COPY, + ID_RIGHT_TO_LEFT_COPY }; wxNotebook* m_DRnotebook; diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index a8d7690caf..5e95dfe8d6 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -5,7 +5,8 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2011 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2011 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr + * Copyright (C) 2009 Dick Hollenbeck, dick@softplc.com * Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors. * * This program is free software; you can redistribute it and/or diff --git a/pcbnew/dialogs/dialog_drc.h b/pcbnew/dialogs/dialog_drc.h index 4ab241c59a..b96c3a936b 100644 --- a/pcbnew/dialogs/dialog_drc.h +++ b/pcbnew/dialogs/dialog_drc.h @@ -1,8 +1,28 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dialog_drc.h -// Author: jean-pierre Charras -// Licence: GPL -///////////////////////////////////////////////////////////////////////////// +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2011 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr + * Copyright (C) 2009 Dick Hollenbeck, dick@softplc.com + * Copyright (C) 2004-2012 KiCad Developers, see change_log.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + #ifndef _DIALOG_DRC_H_ #define _DIALOG_DRC_H_ @@ -18,25 +38,15 @@ #include #include +#include // forward declarations class DRCLISTBOX; class BOARD_DESIGN_SETTINGS; - //end forward declarations -// outside @end control identifiers since wxFormBuilder knows not DRCLISTBOX -#define ID_DRCLISTCTRL 14000 -#define ID_POPUP_UNCONNECTED_A 14001 -#define ID_POPUP_UNCONNECTED_B 14002 -#define ID_POPUP_MARKERS_A 14003 -#define ID_POPUP_MARKERS_B 14004 - - - - /*! * DrcDialog class declaration */ @@ -126,266 +136,5 @@ private: int m_UnconnectedCount; }; - -/** - * Class DRC_LIST_MARKERS - * is an implementation of the interface named DRC_ITEM_LIST which uses - * a BOARD instance to fulfill the interface. No ownership is taken of the - * BOARD. - */ -class DRC_LIST_MARKERS : public DRC_ITEM_LIST -{ - BOARD* m_board; - -public: - - DRC_LIST_MARKERS( BOARD* aBoard ) : - m_board(aBoard) - { - } - - /* no destructor since we do not own anything to delete, not even the BOARD. - ~DRC_LIST_MARKERS() {} - */ - - - //-------------------------------------------- - - void DeleteAllItems() - { - m_board->DeleteMARKERs(); - } - - - const DRC_ITEM* GetItem( int aIndex ) - { - const MARKER_PCB* marker = m_board->GetMARKER( aIndex ); - if( marker ) - return &marker->GetReporter(); - return NULL; - } - - void DeleteItem( int aIndex ) - { - MARKER_PCB* marker = m_board->GetMARKER( aIndex ); - if( marker ) - m_board->Delete( marker ); - } - - - /** - * Function GetCount - * returns the number of items in the list. - */ - int GetCount() - { - return m_board->GetMARKERCount(); - } - - //------------------------------------------- - -}; - - -/** - * Class DRC_LIST_UNCONNECTED - * is an implementation of the interface named DRC_ITEM_LIST which uses - * a vector of pointers to DRC_ITEMs to fulfill the interface. No ownership is taken of the - * vector, which will reside in class DRC - */ -class DRC_LIST_UNCONNECTED : public DRC_ITEM_LIST -{ - DRC_LIST* m_vector; - -public: - - DRC_LIST_UNCONNECTED( DRC_LIST* aList ) : - m_vector(aList) - { - } - - /* no destructor since we do not own anything to delete, not even the BOARD. - ~DRC_LIST_UNCONNECTED() {} - */ - - - //-------------------------------------------- - - void DeleteAllItems() - { - if( m_vector ) - { - for( unsigned i=0; isize(); ++i ) - delete (*m_vector)[i]; - - m_vector->clear(); - } - } - - - const DRC_ITEM* GetItem( int aIndex ) - { - if( m_vector && (unsigned)aIndex < m_vector->size() ) - { - const DRC_ITEM* item = (*m_vector)[aIndex]; - return item; - } - return NULL; - } - - void DeleteItem( int aIndex ) - { - if( m_vector && (unsigned)aIndex < m_vector->size() ) - { - delete (*m_vector)[aIndex]; - m_vector->erase( m_vector->begin()+aIndex ); - } - } - - - /** - * Function GetCount - * returns the number of items in the list. - */ - int GetCount() - { - if( m_vector ) - { - return m_vector->size(); - } - return 0; - } - - //------------------------------------------- - -}; - - - -/** - * Class DRCLISTBOX - * is used to display a DRC_ITEM_LIST. - */ -class DRCLISTBOX : public wxHtmlListBox -{ -private: - DRC_ITEM_LIST* m_list; ///< wxHtmlListBox does not own the list, I do - -public: - DRCLISTBOX( wxWindow* parent, wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = 0, const wxString choices[] = NULL, int unused = 0) - : wxHtmlListBox( parent, id, pos, size, style ) - { - m_list = 0; - } - - - ~DRCLISTBOX() - { - delete m_list; // I own it, I destroy it. - } - - - /** - * Function SetList - * sets the DRC_ITEM_LIST for this listbox. Ownership of the DRC_ITEM_LIST is - * transfered to this DRCLISTBOX. - * @param aList The DRC_ITEM_LIST* containing the DRC_ITEMs which will be - * displayed in the wxHtmlListBox - */ - void SetList( DRC_ITEM_LIST* aList ) - { - delete m_list; - - m_list = aList; - SetItemCount( aList->GetCount() ); - Refresh(); - } - - - /** - * Function GetItem - * returns a requested DRC_ITEM* or NULL. - */ - const DRC_ITEM* GetItem( int aIndex ) - { - if( m_list ) - { - return m_list->GetItem( aIndex ); - } - return NULL; - } - - - /** - * Function OnGetItem - * returns the html text associated with the DRC_ITEM given by index 'n'. - * @param n An index into the list. - * @return wxString - the simple html text to show in the listbox. - */ - wxString OnGetItem( size_t n ) const - { - if( m_list ) - { - const DRC_ITEM* item = m_list->GetItem( (int) n ); - if( item ) - return item->ShowHtml(); - } - return wxString(); - } - - - /** - * Function OnGetItem - * returns the html text associated with the given index 'n'. - * @param n An index into the list. - * @return wxString - the simple html text to show in the listbox. - */ - wxString OnGetItemMarkup( size_t n ) const - { - return OnGetItem( n ); - } - - - /** - * Function DeleteElement - * will delete one of the items in the list. - * @param aIndex The index into the list to delete. - */ - void DeleteItem( int aIndex ) - { - if( m_list ) - { - int selection = GetSelection(); - - m_list->DeleteItem( aIndex ); - int count = m_list->GetCount(); - SetItemCount( count ); - - // if old selection >= new count - if( selection >= count ) - SetSelection( count-1 ); // -1 is "no selection" - Refresh(); - } - } - - - /** - * Function DeleteAllItems - * deletes all items in the list. - */ - void DeleteAllItems() - { - if( m_list ) - { - m_list->DeleteAllItems(); - SetItemCount(0); - SetSelection( -1 ); // -1 is no selection - Refresh(); - } - } -}; - #endif // _DIALOG_DRC_H_ diff --git a/pcbnew/dialogs/dialog_drc_base.cpp b/pcbnew/dialogs/dialog_drc_base.cpp index 8034db8a0b..62092b5ab3 100644 --- a/pcbnew/dialogs/dialog_drc_base.cpp +++ b/pcbnew/dialogs/dialog_drc_base.cpp @@ -1,12 +1,10 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 16 2008) +// C++ code generated with wxFormBuilder (version Apr 10 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#include "dialog_drc.h" - #include "dialog_drc_base.h" /////////////////////////////////////////////////////////////////////////// @@ -69,13 +67,13 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i m_SetMicroViakMinSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); fgMinValuesSizer->Add( m_SetMicroViakMinSizeCtrl, 0, wxALL|wxEXPAND, 5 ); + bSizer7->Add( fgMinValuesSizer, 1, wxEXPAND, 5 ); wxStaticBoxSizer* ReportFileSizer; ReportFileSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Create Report File") ), wxHORIZONTAL ); m_CreateRptCtrl = new wxCheckBox( this, ID_CHECKBOX_RPT_FILE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_CreateRptCtrl->SetToolTip( _("Enable writing report to this file") ); ReportFileSizer->Add( m_CreateRptCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); @@ -89,10 +87,13 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i m_BrowseButton = new wxButton( this, ID_BUTTON_BROWSE_RPT_FILE, _("..."), wxDefaultPosition, wxSize( 50,-1 ), 0 ); ReportFileSizer->Add( m_BrowseButton, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); + bSizer7->Add( ReportFileSizer, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + sbSizerOptions->Add( bSizer7, 1, wxEXPAND, 5 ); + m_CommandSizer->Add( sbSizerOptions, 1, 0, 5 ); wxBoxSizer* bSizerMessages; @@ -105,7 +106,8 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i m_Messages = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxTE_MULTILINE|wxTE_READONLY ); m_Messages->SetMinSize( wxSize( 220,-1 ) ); - bSizerMessages->Add( m_Messages, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + bSizerMessages->Add( m_Messages, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + m_CommandSizer->Add( bSizerMessages, 1, wxEXPAND, 5 ); @@ -129,12 +131,14 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i bSizer11->Add( m_DeleteAllButton, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5 ); m_DeleteCurrentMarkerButton = new wxButton( this, wxID_ANY, _("Delete Current Marker"), wxDefaultPosition, wxDefaultSize, 0 ); - m_DeleteCurrentMarkerButton->SetToolTip( _("Delete the marker selected in the listBox below") ); + m_DeleteCurrentMarkerButton->SetToolTip( _("Delete the marker selected in the list box below") ); bSizer11->Add( m_DeleteCurrentMarkerButton, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 5 ); + m_CommandSizer->Add( bSizer11, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_MainSizer->Add( m_CommandSizer, 0, wxALL|wxEXPAND, 5 ); m_staticTextErrMsg = new wxStaticText( this, wxID_ANY, _("Error Messages:"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -152,6 +156,7 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i bSizeClearanceBox->Add( m_ClearanceListBox, 1, wxALL|wxEXPAND, 5 ); + m_panelClearanceListBox->SetSizer( bSizeClearanceBox ); m_panelClearanceListBox->Layout(); bSizeClearanceBox->Fit( m_panelClearanceListBox ); @@ -165,6 +170,7 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i bSizerUnconnectedBox->Add( m_UnconnectedListBox, 1, wxALL|wxEXPAND, 5 ); + m_panelUnconnectedBox->SetSizer( bSizerUnconnectedBox ); m_panelUnconnectedBox->Layout(); bSizerUnconnectedBox->Fit( m_panelUnconnectedBox ); @@ -178,8 +184,10 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); m_sdbSizer1->Realize(); + m_MainSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 5 ); + this->SetSizer( m_MainSizer ); this->Layout(); m_MainSizer->Fit( this ); @@ -214,4 +222,5 @@ DIALOG_DRC_CONTROL_BASE::~DIALOG_DRC_CONTROL_BASE() m_UnconnectedListBox->Disconnect( wxEVT_RIGHT_UP, wxMouseEventHandler( DIALOG_DRC_CONTROL_BASE::OnRightUpUnconnected ), NULL, this ); m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnCancelClick ), NULL, this ); m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnOkClick ), NULL, this ); + } diff --git a/pcbnew/dialogs/dialog_drc_base.fbp b/pcbnew/dialogs/dialog_drc_base.fbp index 56efabdafd..49a3ae26b7 100644 --- a/pcbnew/dialogs/dialog_drc_base.fbp +++ b/pcbnew/dialogs/dialog_drc_base.fbp @@ -1,10 +1,14 @@ - + - + C++ 1 + source_name + 0 + 0 + res UTF-8 connect dialog_drc_base @@ -12,66 +16,78 @@ none 1 dialog_drc_base - + . - + 1 + 1 + 1 0 0 - - - + 0 + wxAUI_MGR_DEFAULT + + + + 1 1 - - - + impl_virtual + + + 0 wxID_ANY - - + + DIALOG_DRC_CONTROL_BASE - + -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - + DRC Control - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + m_MainSizer wxVERTICAL none @@ -80,28 +96,28 @@ wxALL|wxEXPAND 0 - + m_CommandSizer wxHORIZONTAL none 5 - + 1 wxID_ANY Options: - + sbSizerOptions wxHORIZONTAL none - + 5 wxEXPAND 1 - + bSizer7 wxVERTICAL none @@ -113,9 +129,9 @@ 2 wxHORIZONTAL 1 - + 0 - + fgMinValuesSizer wxFLEX_GROWMODE_SPECIFIED none @@ -126,50 +142,82 @@ wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 0 - - + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 wxID_ANY Clearance - - + + 0 + + + 0 + + 1 m_ClearanceTitle + 1 + + protected - - - - - - - - + 1 + + Resizable + 1 + + + + 0 + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -177,54 +225,90 @@ wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 - - + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left 0 - - + + 1 + + 0 0 wxID_ANY - + + 0 + 0 - + + 0 + + 1 m_SetClearance + 1 + + public - - - - - + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + By Netclass - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -232,50 +316,82 @@ wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 0 - - + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 wxID_ANY Min track width - - + + 0 + + + 0 + + 1 m_TrackMinWidthTitle + 1 + + protected - - - - + 1 + + Resizable + 1 + + + + 0 Enter the minimum acceptable value for a track width - - - + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -283,54 +399,90 @@ wxALL|wxEXPAND 0 - - + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 wxID_ANY - + + 0 + 0 - + + 0 + + 1 m_SetTrackMinWidthCtrl + 1 + + public - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -338,50 +490,82 @@ wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 0 - + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 Enter the minimum acceptable diameter for a standard via + 1 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 wxID_ANY Min via size - - + + 0 + + + 0 + + 1 m_ViaMinTitle + 1 + + protected - - - - - - - - + 1 + + Resizable + 1 + + + + 0 + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -389,54 +573,90 @@ wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 - - + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 wxID_ANY - + + 0 + 0 - + + 0 + + 1 m_SetViaMinSizeCtrl + 1 + + public - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -444,50 +664,82 @@ wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 0 - - + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 wxID_ANY Min uVia size - - + + 0 + + + 0 + + 1 m_MicroViaMinTitle + 1 + + protected - - - - + 1 + + Resizable + 1 + + + + 0 Enter the minimum acceptable diameter for a micro via - - - + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -495,54 +747,90 @@ wxALL|wxEXPAND 0 - - + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 wxID_ANY - + + 0 + 0 - + + 0 + + 1 m_SetMicroViakMinSizeCtrl + 1 + + public - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -554,61 +842,97 @@ wxID_ANY Create Report File - + ReportFileSizer wxHORIZONTAL none - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 0 - + 1 + + 1 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 ID_CHECKBOX_RPT_FILE - - - + + + 0 + + + 0 + + 1 m_CreateRptCtrl + 1 + + public - - - - + 1 + + Resizable + 1 + + + + 0 Enable writing report to this file - - - - + + wxFILTER_NONE + wxDefaultValidator + + + + + OnReportCheckBoxClicked - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -616,54 +940,90 @@ wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL 1 - - + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 wxID_ANY - + + 0 + 0 + + 0 180,-1 + 1 m_RptFilenameCtrl + 1 + + public - - - - + 1 + + Resizable + 1 + + + + 0 Enter the report filename - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -671,51 +1031,87 @@ wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT 0 - - + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 0 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 ID_BUTTON_BROWSE_RPT_FILE ... + + 0 -1,-1 - + + 0 + + 1 m_BrowseButton + 1 + + protected - + 1 + + Resizable + 1 50,-1 - - - - - - + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + OnButtonBrowseRptFileClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -729,7 +1125,7 @@ wxEXPAND 1 - + bSizerMessages wxVERTICAL none @@ -738,105 +1134,173 @@ wxRIGHT|wxLEFT 0 - - + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 wxID_ANY Messages: - - + + 0 + + + 0 + + 1 m_staticText6 + 1 + + protected - - - - - - - - + 1 + + Resizable + 1 + + + + 0 + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND + wxEXPAND|wxRIGHT|wxLEFT 1 - - + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 wxID_ANY - + + 0 + 0 + + 0 220,-1 + 1 m_Messages + 1 + + protected - - + 1 + + Resizable + 1 + wxHSCROLL|wxTE_MULTILINE|wxTE_READONLY - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -846,7 +1310,7 @@ wxALIGN_CENTER_VERTICAL 0 - + bSizer11 wxVERTICAL none @@ -855,51 +1319,87 @@ wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND 0 - - + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 1 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 ID_STARTDRC Start DRC - - + + 0 + + + 0 + + 1 m_buttonRunDRC + 1 + + protected - - - - + 1 + + Resizable + 1 + + + + 0 Start the Design Rule Checker - - - + + wxFILTER_NONE + wxDefaultValidator + + + + OnStartdrcClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -907,51 +1407,87 @@ wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND 0 - - + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 0 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 ID_LIST_UNCONNECTED List Unconnected - - + + 0 + + + 0 + + 1 m_buttonListUnconnected + 1 + + protected - - - - + 1 + + Resizable + 1 + + + + 0 List unconnected pads or tracks - - - + + wxFILTER_NONE + wxDefaultValidator + + + + OnListUnconnectedClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -959,51 +1495,87 @@ wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND 0 - - + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 0 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 ID_DELETE_ALL Delete All Markers - - + + 0 + + + 0 + + 1 m_DeleteAllButton + 1 + + protected - - - - + 1 + + Resizable + 1 + + + + 0 Delete every marker - - - + + wxFILTER_NONE + wxDefaultValidator + + + + OnDeleteAllClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1011,51 +1583,87 @@ wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL 0 - - + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 0 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 wxID_ANY Delete Current Marker - - + + 0 + + + 0 + + 1 m_DeleteCurrentMarkerButton + 1 + + protected - - - - - Delete the marker selected in the listBox below - - - + 1 + + Resizable + 1 + + + + 0 + Delete the marker selected in the list box below + + wxFILTER_NONE + wxDefaultValidator + + + + OnDeleteOneClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1067,50 +1675,82 @@ wxALL 0 - - + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 wxID_ANY Error Messages: - - + + 0 + + + 0 + + 1 m_staticTextErrMsg + 1 + + protected - - - - - - - - + 1 + + Resizable + 1 + + + + 0 + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1118,99 +1758,163 @@ wxEXPAND | wxALL 1 - - - + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 ID_NOTEBOOK1 - - + + 0 + + + 0 + + 1 m_Notebook + 1 + + protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 1 + + Resizable + 1 + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + Problems / Markers 1 - - + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 wxID_ANY - - + + 0 + + + 0 + + 1 m_panelClearanceListBox + 1 + + protected - - + 1 + + Resizable + 1 + ; - - - + 0 + + + wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + bSizeClearanceBox wxVERTICAL none @@ -1219,104 +1923,172 @@ wxALL|wxEXPAND 1 - - - + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 ID_CLEARANCE_LIST - + + 0 + + + 0 -1,80 + 1 m_ClearanceListBox + 1 + + public - - - - DRCLISTBOX; dialog_drc.h + 1 + + Resizable + 1 + + + DRCLISTBOX; dialog_drclistbox.h + 0 MARKERs, double click any to go there in PCB, right click for popup menu - - - - - - - - - - + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + OnLeftDClickClearance - - - - - - - - - - - - - + + + + + + + + + + + + + OnRightUpClearance - - - + + + - + Unconnected 0 - - + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 wxID_ANY - - + + 0 + + + 0 + + 1 m_panelUnconnectedBox + 1 + + protected - - - - - - + 1 + + Resizable + 1 + + + 0 + + + wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + bSizerUnconnectedBox wxVERTICAL none @@ -1325,51 +2097,87 @@ wxALL|wxEXPAND 1 - - - + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left 1 - - + + 1 + + 0 0 ID_UNCONNECTED_LIST - - + + 0 + + + 0 + + 1 m_UnconnectedListBox + 1 + + public - - - + 1 + + Resizable + 1 + + DRCLISTBOX; + 0 A list of unconnected pads, right click for popup menu - - - - - - - - - - + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + OnLeftDClickUnconnected - - - - - - - - - - - - - + + + + + + + + + + + + + OnRightUpUnconnected - - - + + + @@ -1390,17 +2198,17 @@ 1 0 0 - + m_sdbSizer1 protected - + OnCancelClick - - - + + + OnOkClick - - + + diff --git a/pcbnew/dialogs/dialog_drc_base.h b/pcbnew/dialogs/dialog_drc_base.h index 9495bca9f7..8a9c6aae93 100644 --- a/pcbnew/dialogs/dialog_drc_base.h +++ b/pcbnew/dialogs/dialog_drc_base.h @@ -1,17 +1,17 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 16 2008) +// C++ code generated with wxFormBuilder (version Apr 10 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#ifndef __dialog_drc_base__ -#define __dialog_drc_base__ +#ifndef __DIALOG_DRC_BASE_H__ +#define __DIALOG_DRC_BASE_H__ +#include +#include #include - -class DRCLISTBOX; - +#include "dialog_drclistbox.h" #include #include #include @@ -70,18 +70,18 @@ class DIALOG_DRC_CONTROL_BASE : public wxDialog wxButton* m_sdbSizer1Cancel; // Virtual event handlers, overide them in your derived class - virtual void OnReportCheckBoxClicked( wxCommandEvent& event ){ event.Skip(); } - virtual void OnButtonBrowseRptFileClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnStartdrcClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnListUnconnectedClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnDeleteAllClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnDeleteOneClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnLeftDClickClearance( wxMouseEvent& event ){ event.Skip(); } - virtual void OnRightUpClearance( wxMouseEvent& event ){ event.Skip(); } - virtual void OnLeftDClickUnconnected( wxMouseEvent& event ){ event.Skip(); } - virtual void OnRightUpUnconnected( wxMouseEvent& event ){ event.Skip(); } - virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); } + virtual void OnReportCheckBoxClicked( wxCommandEvent& event ) { event.Skip(); } + virtual void OnButtonBrowseRptFileClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnStartdrcClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnListUnconnectedClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnDeleteAllClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnDeleteOneClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnLeftDClickClearance( wxMouseEvent& event ) { event.Skip(); } + virtual void OnRightUpClearance( wxMouseEvent& event ) { event.Skip(); } + virtual void OnLeftDClickUnconnected( wxMouseEvent& event ) { event.Skip(); } + virtual void OnRightUpUnconnected( wxMouseEvent& event ) { event.Skip(); } + virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } public: @@ -93,9 +93,10 @@ class DIALOG_DRC_CONTROL_BASE : public wxDialog wxTextCtrl* m_RptFilenameCtrl; DRCLISTBOX* m_ClearanceListBox; DRCLISTBOX* m_UnconnectedListBox; - DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("DRC Control"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + + DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("DRC Control"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_DRC_CONTROL_BASE(); }; -#endif //__dialog_drc_base__ +#endif //__DIALOG_DRC_BASE_H__ diff --git a/pcbnew/dialogs/dialog_drclistbox.h b/pcbnew/dialogs/dialog_drclistbox.h new file mode 100644 index 0000000000..48485040d4 --- /dev/null +++ b/pcbnew/dialogs/dialog_drclistbox.h @@ -0,0 +1,311 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2009 Dick Hollenbeck, dick@softplc.com + * Copyright (C) 2004-2012 KiCad Developers, see change_log.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#ifndef _DIALOG_DRCLISTBOX_H_ +#define _DIALOG_DRCLISTBOX_H_ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + + +// outside @end control identifiers since wxFormBuilder knows not DRCLISTBOX +#define ID_DRCLISTCTRL 14000 +#define ID_POPUP_UNCONNECTED_A 14001 +#define ID_POPUP_UNCONNECTED_B 14002 +#define ID_POPUP_MARKERS_A 14003 +#define ID_POPUP_MARKERS_B 14004 + + +/** + * Class DRC_LIST_MARKERS + * is an implementation of the interface named DRC_ITEM_LIST which uses + * a BOARD instance to fulfill the interface. No ownership is taken of the + * BOARD. + */ +class DRC_LIST_MARKERS : public DRC_ITEM_LIST +{ + BOARD* m_board; + +public: + + DRC_LIST_MARKERS( BOARD* aBoard ) : + m_board(aBoard) + { + } + + /* no destructor since we do not own anything to delete, not even the BOARD. + ~DRC_LIST_MARKERS() {} + */ + + + //-------------------------------------------- + + void DeleteAllItems() + { + m_board->DeleteMARKERs(); + } + + + const DRC_ITEM* GetItem( int aIndex ) + { + const MARKER_PCB* marker = m_board->GetMARKER( aIndex ); + if( marker ) + return &marker->GetReporter(); + return NULL; + } + + void DeleteItem( int aIndex ) + { + MARKER_PCB* marker = m_board->GetMARKER( aIndex ); + if( marker ) + m_board->Delete( marker ); + } + + + /** + * Function GetCount + * returns the number of items in the list. + */ + int GetCount() + { + return m_board->GetMARKERCount(); + } + + //------------------------------------------- + +}; + + +/** + * Class DRC_LIST_UNCONNECTED + * is an implementation of the interface named DRC_ITEM_LIST which uses + * a vector of pointers to DRC_ITEMs to fulfill the interface. No ownership is taken of the + * vector, which will reside in class DRC + */ +class DRC_LIST_UNCONNECTED : public DRC_ITEM_LIST +{ + DRC_LIST* m_vector; + +public: + + DRC_LIST_UNCONNECTED( DRC_LIST* aList ) : + m_vector(aList) + { + } + + /* no destructor since we do not own anything to delete, not even the BOARD. + ~DRC_LIST_UNCONNECTED() {} + */ + + + //-------------------------------------------- + + void DeleteAllItems() + { + if( m_vector ) + { + for( unsigned i=0; isize(); ++i ) + delete (*m_vector)[i]; + + m_vector->clear(); + } + } + + + const DRC_ITEM* GetItem( int aIndex ) + { + if( m_vector && (unsigned)aIndex < m_vector->size() ) + { + const DRC_ITEM* item = (*m_vector)[aIndex]; + return item; + } + return NULL; + } + + void DeleteItem( int aIndex ) + { + if( m_vector && (unsigned)aIndex < m_vector->size() ) + { + delete (*m_vector)[aIndex]; + m_vector->erase( m_vector->begin()+aIndex ); + } + } + + + /** + * Function GetCount + * returns the number of items in the list. + */ + int GetCount() + { + if( m_vector ) + { + return m_vector->size(); + } + return 0; + } + + //------------------------------------------- + +}; + + + +/** + * Class DRCLISTBOX + * is used to display a DRC_ITEM_LIST. + */ +class DRCLISTBOX : public wxHtmlListBox +{ +private: + DRC_ITEM_LIST* m_list; ///< wxHtmlListBox does not own the list, I do + +public: + DRCLISTBOX( wxWindow* parent, wxWindowID id = wxID_ANY, + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, + long style = 0, const wxString choices[] = NULL, int unused = 0) + : wxHtmlListBox( parent, id, pos, size, style ) + { + m_list = 0; + } + + + ~DRCLISTBOX() + { + delete m_list; // I own it, I destroy it. + } + + + /** + * Function SetList + * sets the DRC_ITEM_LIST for this listbox. Ownership of the DRC_ITEM_LIST is + * transfered to this DRCLISTBOX. + * @param aList The DRC_ITEM_LIST* containing the DRC_ITEMs which will be + * displayed in the wxHtmlListBox + */ + void SetList( DRC_ITEM_LIST* aList ) + { + delete m_list; + + m_list = aList; + SetItemCount( aList->GetCount() ); + Refresh(); + } + + + /** + * Function GetItem + * returns a requested DRC_ITEM* or NULL. + */ + const DRC_ITEM* GetItem( int aIndex ) + { + if( m_list ) + { + return m_list->GetItem( aIndex ); + } + return NULL; + } + + + /** + * Function OnGetItem + * returns the html text associated with the DRC_ITEM given by index 'n'. + * @param n An index into the list. + * @return wxString - the simple html text to show in the listbox. + */ + wxString OnGetItem( size_t n ) const + { + if( m_list ) + { + const DRC_ITEM* item = m_list->GetItem( (int) n ); + if( item ) + return item->ShowHtml(); + } + return wxString(); + } + + + /** + * Function OnGetItem + * returns the html text associated with the given index 'n'. + * @param n An index into the list. + * @return wxString - the simple html text to show in the listbox. + */ + wxString OnGetItemMarkup( size_t n ) const + { + return OnGetItem( n ); + } + + + /** + * Function DeleteElement + * will delete one of the items in the list. + * @param aIndex The index into the list to delete. + */ + void DeleteItem( int aIndex ) + { + if( m_list ) + { + int selection = GetSelection(); + + m_list->DeleteItem( aIndex ); + int count = m_list->GetCount(); + SetItemCount( count ); + + // if old selection >= new count + if( selection >= count ) + SetSelection( count-1 ); // -1 is "no selection" + Refresh(); + } + } + + + /** + * Function DeleteAllItems + * deletes all items in the list. + */ + void DeleteAllItems() + { + if( m_list ) + { + m_list->DeleteAllItems(); + SetItemCount(0); + SetSelection( -1 ); // -1 is no selection + Refresh(); + } + } +}; + +#endif // _DIALOG_DRCLISTBOX_H_ + diff --git a/pcbnew/dialogs/dialog_find.cpp b/pcbnew/dialogs/dialog_find.cpp index db30c764c0..6929d4f281 100644 --- a/pcbnew/dialogs/dialog_find.cpp +++ b/pcbnew/dialogs/dialog_find.cpp @@ -67,10 +67,11 @@ bool DIALOG_FIND::warpMouse = true; DIALOG_FIND::DIALOG_FIND( PCB_BASE_FRAME* aParent ) : DIALOG_FIND_BASE( aParent ) { parent = aParent; - SetFocus(); GetSizer()->SetSizeHints( this ); m_SearchTextCtrl->AppendText( prevSearchString ); + m_SearchTextCtrl->SetFocus(); + m_SearchTextCtrl->SetSelection( -1, -1 ); m_NoMouseWarpCheckBox->SetValue( !warpMouse ); itemCount = markerCount = 0; diff --git a/pcbnew/dialogs/dialog_find_base.fbp b/pcbnew/dialogs/dialog_find_base.fbp index e324765420..182bf6ea49 100644 --- a/pcbnew/dialogs/dialog_find_base.fbp +++ b/pcbnew/dialogs/dialog_find_base.fbp @@ -97,7 +97,7 @@ 1 - bSizer3 + bSizerLeft wxVERTICAL none @@ -370,7 +370,7 @@ 0 - bSizer4 + bSizerRight wxVERTICAL none diff --git a/pcbnew/dialogs/dialog_global_modules_fields_edition.cpp b/pcbnew/dialogs/dialog_global_modules_fields_edition.cpp index a734b59b25..190214daa3 100644 --- a/pcbnew/dialogs/dialog_global_modules_fields_edition.cpp +++ b/pcbnew/dialogs/dialog_global_modules_fields_edition.cpp @@ -120,8 +120,8 @@ void DIALOG_GLOBAL_MODULES_FIELDS_EDITION::OnOKClick( wxCommandEvent& event ) m_brdSettings->m_ModuleTextWidth = ReturnValueFromTextCtrl( *m_TicknessValue ); // clip m_ModuleTextWidth to the 1/4 of min size, to keep it always readable - int minsize = min( m_brdSettings->m_ModuleTextSize.x, - m_brdSettings->m_ModuleTextSize.y ) / 4; + int minsize = std::min( m_brdSettings->m_ModuleTextSize.x, + m_brdSettings->m_ModuleTextSize.y ) / 4; if( m_brdSettings->m_ModuleTextWidth > minsize ) m_brdSettings->m_ModuleTextWidth = minsize; diff --git a/pcbnew/editrack.cpp b/pcbnew/editrack.cpp index b43eeacf44..1c7c5feeda 100644 --- a/pcbnew/editrack.cpp +++ b/pcbnew/editrack.cpp @@ -323,10 +323,10 @@ bool PCB_EDIT_FRAME::Add45DegreeSegment( wxDC* aDC ) dy1 = curTrack->m_End.y - curTrack->m_Start.y; // Segments should have a min length. - if( max( abs( dx0 ), abs( dy0 ) ) < ( segm_step_45 * 2 ) ) + if( std::max( abs( dx0 ), abs( dy0 ) ) < ( segm_step_45 * 2 ) ) return false; - if( max( abs( dx1 ), abs( dy1 ) ) < ( segm_step_45 * 2 ) ) + if( std::max( abs( dx1 ), abs( dy1 ) ) < ( segm_step_45 * 2 ) ) return false; // Create a new segment and connect it with the previous 2 segments. @@ -851,7 +851,7 @@ void CalculateSegmentEndPoint( const wxPoint& aPosition, int ox, int oy, int* fx break; case 45: - deltax = min( deltax, deltay ); + deltax = std::min( deltax, deltay ); deltay = deltax; // Recalculate the signs for deltax and deltaY. @@ -946,7 +946,7 @@ void ComputeBreakPoint( TRACK* track, int SegmentCount, wxPoint end ) break; case 45: - iDx = min( iDx, iDy ); + iDx = std::min( iDx, iDy ); iDy = iDx; // Recalculate the signs for deltax and deltaY. diff --git a/pcbnew/gen_holes_and_tools_lists_for_drill.cpp b/pcbnew/gen_holes_and_tools_lists_for_drill.cpp index 5820ca893c..187982a127 100644 --- a/pcbnew/gen_holes_and_tools_lists_for_drill.cpp +++ b/pcbnew/gen_holes_and_tools_lists_for_drill.cpp @@ -128,7 +128,7 @@ void Build_Holes_List( BOARD* aPcb, new_hole.m_Tool_Reference = -1; // Flag is: Not initialized new_hole.m_Hole_Orient = pad->GetOrientation(); new_hole.m_Hole_Shape = 0; // hole shape: round - new_hole.m_Hole_Diameter = min( pad->GetDrillSize().x, pad->GetDrillSize().y ); + new_hole.m_Hole_Diameter = std::min( pad->GetDrillSize().x, pad->GetDrillSize().y ); new_hole.m_Hole_Size.x = new_hole.m_Hole_Size.y = new_hole.m_Hole_Diameter; if( pad->GetDrillShape() != PAD_CIRCLE ) diff --git a/pcbnew/hotkeys_board_editor.cpp b/pcbnew/hotkeys_board_editor.cpp index 416507b60c..b428ce3986 100644 --- a/pcbnew/hotkeys_board_editor.cpp +++ b/pcbnew/hotkeys_board_editor.cpp @@ -317,7 +317,7 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit if( GetBoard()->GetCopperLayerCount() < 2 ) // Single layer ll = LAYER_N_BACK; else if( ll == LAYER_N_FRONT ) - ll = max( LAYER_N_BACK, GetBoard()->GetCopperLayerCount() - 2 ); + ll = std::max( LAYER_N_BACK, GetBoard()->GetCopperLayerCount() - 2 ); else ll--; diff --git a/pcbnew/magnetic_tracks_functions.cpp b/pcbnew/magnetic_tracks_functions.cpp index de78eac847..7db072d242 100644 --- a/pcbnew/magnetic_tracks_functions.cpp +++ b/pcbnew/magnetic_tracks_functions.cpp @@ -59,7 +59,7 @@ static bool Join( wxPoint* res, wxPoint a0, wxPoint a1, wxPoint b0, wxPoint b1 ) t = ((double) b1.y * b0.x - (double) b1.x * b0.y ) / denom; - t = min( max( t, 0.0 ), 1.0 ); + t = std::min( std::max( t, 0.0 ), 1.0 ); res->x = KiROUND( a0.x + t * a1.x ); res->y = KiROUND( a0.y + t * a1.y ); @@ -83,7 +83,7 @@ bool Project( wxPoint* res, wxPoint on_grid, const TRACK* track ) double( on_grid.y - track->m_Start.y ) * vec.y; t /= (double) vec.x * vec.x + (double) vec.y * vec.y; - t = min( max( t, 0.0 ), 1.0 ); + t = std::min( std::max( t, 0.0 ), 1.0 ); res->x = KiROUND( track->m_Start.x + t * vec.x ); res->y = KiROUND( track->m_Start.y + t * vec.y ); diff --git a/pcbnew/pcb_parser.cpp b/pcbnew/pcb_parser.cpp index a7f164beb7..f015cb8e2b 100644 --- a/pcbnew/pcb_parser.cpp +++ b/pcbnew/pcb_parser.cpp @@ -48,6 +48,7 @@ #include +using namespace std; double PCB_PARSER::parseDouble() throw( IO_ERROR ) { diff --git a/pcbnew/print_board_functions.cpp b/pcbnew/print_board_functions.cpp index 43c2132bfa..9fb303d487 100644 --- a/pcbnew/print_board_functions.cpp +++ b/pcbnew/print_board_functions.cpp @@ -300,7 +300,7 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC, int diameter; if( drillShapeOpt == PRINT_PARAMETERS::SMALL_DRILL_SHAPE ) - diameter = min( SMALL_DRILL, pt_trace->GetDrillValue() ); + diameter = std::min( SMALL_DRILL, pt_trace->GetDrillValue() ); else diameter = pt_trace->GetDrillValue(); @@ -349,8 +349,8 @@ static void Print_Module( EDA_DRAW_PANEL* aPanel, wxDC* aDC, MODULE* aModule, case PRINT_PARAMETERS::SMALL_DRILL_SHAPE: { - wxSize sz( min( SMALL_DRILL, pad->GetDrillSize().x ), - min( SMALL_DRILL, pad->GetDrillSize().y ) ); + wxSize sz( std::min( SMALL_DRILL, pad->GetDrillSize().x ), + std::min( SMALL_DRILL, pad->GetDrillSize().y ) ); pad->SetDrillSize( sz ); } diff --git a/pcbnew/ratsnest.cpp b/pcbnew/ratsnest.cpp index 6d75074156..2d6bd56481 100644 --- a/pcbnew/ratsnest.cpp +++ b/pcbnew/ratsnest.cpp @@ -304,7 +304,7 @@ void PCB_BASE_FRAME::DrawGeneralRatsnest( wxDC* aDC, int aNetcode ) * @return last subratsnest id in use */ static int tst_links_between_blocks( NETINFO_ITEM* aNetinfo, - vector& aRatsnestBuffer ) + std::vector& aRatsnestBuffer ) { int subratsnest_id, min_id; RATSNEST_ITEM* link, * best_link; diff --git a/pcbnew/zone_filling_algorithm.cpp b/pcbnew/zone_filling_algorithm.cpp index 0a29804f28..48841414dc 100644 --- a/pcbnew/zone_filling_algorithm.cpp +++ b/pcbnew/zone_filling_algorithm.cpp @@ -135,9 +135,10 @@ int ZONE_CONTAINER::Fill_Zone_Areas_With_Segments() int istart, iend; // index od the starting and the endif corner of one filled area in m_FilledPolysList int margin = m_ZoneMinThickness * 2 / 10; - margin = max (2, margin); + int minwidth = Mils2iu( 2 ); + margin = std::max ( minwidth, margin ); int step = m_ZoneMinThickness - margin; - step = max(step, 2); + step = std::max( step, minwidth ); // Read all filled areas in m_FilledPolysList m_FillSegmList.clear(); diff --git a/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp b/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp index 85d9012b4d..f316a4d349 100644 --- a/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp +++ b/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp @@ -174,7 +174,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) * Note also the "local" clearance is used for clearance between non copper items * or items like texts on copper layers */ - int zone_clearance = max( m_ZoneClearance, GetClearance() ); + int zone_clearance = std::max( m_ZoneClearance, GetClearance() ); zone_clearance += margin; /* store holes (i.e. tracks and pads areas as polygons outlines) @@ -187,7 +187,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) EDA_RECT item_boundingbox; EDA_RECT zone_boundingbox = GetBoundingBox(); int biggest_clearance = aPcb->GetBiggestClearanceValue(); - biggest_clearance = max( biggest_clearance, zone_clearance ); + biggest_clearance = std::max( biggest_clearance, zone_clearance ); zone_boundingbox.Inflate( biggest_clearance ); /* @@ -244,7 +244,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) if( item_boundingbox.Intersects( zone_boundingbox ) ) { - int clearance = max( zone_clearance, item_clearance ); + int clearance = std::max( zone_clearance, item_clearance ); pad->TransformShapeWithClearanceToPolygon( cornerBufferPolysToSubstract, clearance, s_CircleToSegmentsCount, @@ -291,7 +291,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) if( item_boundingbox.Intersects( zone_boundingbox ) ) { - int clearance = max( zone_clearance, item_clearance ); + int clearance = std::max( zone_clearance, item_clearance ); track->TransformShapeWithClearanceToPolygon( cornerBufferPolysToSubstract, clearance, s_CircleToSegmentsCount, diff --git a/pcbnew/zones_convert_to_polygons_aux_functions.cpp b/pcbnew/zones_convert_to_polygons_aux_functions.cpp index 6c48611839..d78f3aa251 100644 --- a/pcbnew/zones_convert_to_polygons_aux_functions.cpp +++ b/pcbnew/zones_convert_to_polygons_aux_functions.cpp @@ -66,7 +66,7 @@ void BuildUnconnectedThermalStubsPolygonList( std::vector& aCornerBuffe EDA_RECT item_boundingbox; EDA_RECT zone_boundingbox = aZone->GetBoundingBox(); int biggest_clearance = aPcb->GetBiggestClearanceValue(); - biggest_clearance = max( biggest_clearance, zone_clearance ); + biggest_clearance = std::max( biggest_clearance, zone_clearance ); zone_boundingbox.Inflate( biggest_clearance ); // half size of the pen used to draw/plot zones outlines @@ -83,7 +83,7 @@ void BuildUnconnectedThermalStubsPolygonList( std::vector& aCornerBuffe && pad->GetAttribute() != PAD_STANDARD ) continue; - if( aZone->GetPadConnection( pad ) != THERMAL_PAD + if( aZone->GetPadConnection( pad ) != THERMAL_PAD && aZone->GetPadConnection( pad ) != THT_THERMAL ) continue; @@ -109,8 +109,8 @@ void BuildUnconnectedThermalStubsPolygonList( std::vector& aCornerBuffe if( copperThickness < 0 ) copperThickness = 0; - startpoint.x = min( pad->GetSize().x, copperThickness ); - startpoint.y = min( pad->GetSize().y, copperThickness ); + startpoint.x = std::min( pad->GetSize().x, copperThickness ); + startpoint.y = std::min( pad->GetSize().y, copperThickness ); startpoint.x /= 2; startpoint.y /= 2; diff --git a/pcbnew/zones_functions_for_undo_redo.cpp b/pcbnew/zones_functions_for_undo_redo.cpp index 7d13e3b6b4..8a1e629476 100644 --- a/pcbnew/zones_functions_for_undo_redo.cpp +++ b/pcbnew/zones_functions_for_undo_redo.cpp @@ -174,8 +174,8 @@ int SaveCopyOfZones( PICKED_ITEMS_LIST& aPickList, BOARD* aPcb, int aNetCode, in * @param aPcb = the Board * * aAuxiliaryList is a list of pickers updated by zone algorithms: - * In this list are put zone taht were added or deleted during the zone combine process - * aPickList :is a list of zone that can be modified (changed or deleted, or not modified) + * This list cointains zones which were added or deleted during the zones combine process + * aPickList :is a list of zones that can be modified (changed or deleted, or not modified) * >> if the picked zone is not changed, it is removed from list * >> if the picked zone was deleted (i.e. not found in boad list), the picker is modified: * - its status becomes UR_DELETED @@ -187,8 +187,9 @@ int SaveCopyOfZones( PICKED_ITEMS_LIST& aPickList, BOARD* aPcb, int aNetCode, in * After aPickList is cleaned, the aAuxiliaryList is read * All pickers flagged UR_NEW are moved to aPickList * (the corresponding zones are zone that were created by the zone combine process, mainly when adding cutaout areas) - * At the end of the update process the aAuxiliaryList must be void, because all pickers created by the combine process - * must have been removed (removed for new and deleted zones, or moved in aPickList.) + * At the end of the update process the aAuxiliaryList must be void, + * because all pickers created by the combine process + * must have been removed (removed for new and deleted zones, or moved in aPickList.) * If not an error is set. */ void UpdateCopyOfZonesList( PICKED_ITEMS_LIST& aPickList, diff --git a/polygon/PolyLine.h b/polygon/PolyLine.h index b7e44b30fc..736b4d0554 100644 --- a/polygon/PolyLine.h +++ b/polygon/PolyLine.h @@ -23,15 +23,6 @@ #include -// inflection modes for DS_LINE and DS_LINE_VERTEX, used in math_for_graphics.cpp -/*enum { - IM_NONE = 0, - IM_90_45, - IM_45_90, - IM_90 -}; -*/ - class CRect { public: @@ -58,18 +49,6 @@ public: } }; -/* -class CArc -{ -public: - enum { ARC_STEPS = 16 }; // arc approximation step is 16 segm / 90 degres - int style; - int xi, yi, xf, yf; - int n_steps; // number of straight-line segments in gpc_poly - bool bFound; -}; -*/ - class CPolyPt : public wxPoint { public: