From 8e5e2164e81b72ae4ab6091d633d462923c692e7 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Fri, 2 Oct 2015 15:11:33 -0400 Subject: [PATCH] Pcbnew: design rules dialog fixes and improvements. (fixes lp:1499538) * Use default dialog size to allow sizers to do their job. * General layout and sizer improvements. * Remove HTML message window which could not be used when error dialog was displayed. * Use wxStdDialogButtonSizer for the OK and Cancel buttons. * Check for design rule validity in TransferDataFromWindow() to prevent dialog from being closed and all new design rules being lost when an error is detected. This gives the user a chance to fix any design rules errors before dismissing the dialog. * Add missing test for extra via drill diameter violations. * Remove unnecessary OK and Cancel butten clicked event handlers. --- pcbnew/dialogs/dialog_design_rules.cpp | 134 ++++---- pcbnew/dialogs/dialog_design_rules.h | 25 +- pcbnew/dialogs/dialog_design_rules_base.cpp | 53 +--- pcbnew/dialogs/dialog_design_rules_base.fbp | 321 ++------------------ pcbnew/dialogs/dialog_design_rules_base.h | 14 +- 5 files changed, 126 insertions(+), 421 deletions(-) diff --git a/pcbnew/dialogs/dialog_design_rules.cpp b/pcbnew/dialogs/dialog_design_rules.cpp index 8d1d5dbf83..3a5f44c7fa 100644 --- a/pcbnew/dialogs/dialog_design_rules.cpp +++ b/pcbnew/dialogs/dialog_design_rules.cpp @@ -7,7 +7,7 @@ * * Copyright (C) 2004-2009 Jean-Pierre Charras, jean-pierre.charras@gpisa-lab.inpg.fr * Copyright (C) 2009 Dick Hollenbeck, dick@softplc.com - * Copyright (C) 2009 KiCad Developers, see change_log.txt for contributors. + * Copyright (C) 2009-2015 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 @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -177,6 +178,7 @@ DIALOG_DESIGN_RULES::DIALOG_DESIGN_RULES( PCB_EDIT_FRAME* parent ) : Layout(); GetSizer()->Fit( this ); GetSizer()->SetSizeHints( this ); + m_sdbSizer1OK->SetDefault(); // Allow tabbing out of grid controls. Only available on wxWidgets 2.9.5 or later. #if wxCHECK_VERSION( 2, 9, 5 ) @@ -189,29 +191,10 @@ DIALOG_DESIGN_RULES::DIALOG_DESIGN_RULES( PCB_EDIT_FRAME* parent ) : } -void DIALOG_DESIGN_RULES::PrintCurrentSettings() -{ - wxString msg, value; - - m_MessagesList->AppendToPage( _( "Current general settings:
" ) ); - - // Display min values: - value = StringFromValue( g_UserUnit, m_BrdSettings->m_TrackMinWidth, true ); - msg.Printf( _( "Minimum value for tracks width: %s
\n" ), GetChars( value ) ); - m_MessagesList->AppendToPage( msg ); - - value = StringFromValue( g_UserUnit, m_BrdSettings->m_ViasMinSize, true ); - msg.Printf( _( "Minimum value for vias diameter: %s
\n" ), GetChars( value ) ); - m_MessagesList->AppendToPage( msg ); - - value = StringFromValue( g_UserUnit, m_BrdSettings->m_MicroViasMinSize, true ); - msg.Printf( _( "Minimum value for microvias diameter: %s
\n" ), GetChars( value ) ); - m_MessagesList->AppendToPage( msg ); -} - - void DIALOG_DESIGN_RULES::InitDialogRules() { + // @todo: Move the initialization code into TransferDataToWindow() to follow wxWidgets + // dialog data transfer convention. SetFocus(); SetReturnCode( 0 ); @@ -223,7 +206,8 @@ void DIALOG_DESIGN_RULES::InitDialogRules() // copy all NETs into m_AllNets by adding them as NETCUPs. - // @todo go fix m_Pcb->SynchronizeNetsAndNetClasses() so that the netcode==0 is not present in the BOARD::m_NetClasses + // @todo go fix m_Pcb->SynchronizeNetsAndNetClasses() so that the netcode==0 is not + // present in the BOARD::m_NetClasses NETCLASSES& netclasses = m_BrdSettings->m_NetClasses; NETCLASSPTR netclass = netclasses.GetDefault(); @@ -246,8 +230,6 @@ void DIALOG_DESIGN_RULES::InitDialogRules() InitializeRulesSelectionBoxes(); InitGlobalRules(); - - PrintCurrentSettings(); } @@ -631,31 +613,32 @@ void DIALOG_DESIGN_RULES::CopyDimensionsListsToBoard() } -void DIALOG_DESIGN_RULES::OnCancelButtonClick( wxCommandEvent& event ) +void DIALOG_DESIGN_RULES::OnNotebookPageChanged( wxNotebookEvent& event ) { - s_LastTabSelection = m_DRnotebook->GetSelection(); - - EndModal( wxID_CANCEL ); + s_LastTabSelection = event.GetSelection(); } -void DIALOG_DESIGN_RULES::OnOkButtonClick( wxCommandEvent& event ) +bool DIALOG_DESIGN_RULES::TransferDataFromWindow() { - s_LastTabSelection = m_DRnotebook->GetSelection(); + if( !wxDialog::TransferDataFromWindow() ) + return false; - if( !TestDataValidity() ) + wxString errorMsg; + + if( !TestDataValidity( &errorMsg ) ) { - DisplayError( this, _( "Errors detected, Abort" ) ); - return; + HTML_MESSAGE_BOX dlg( this, _( "Design Rule Setting Error" ) ); + dlg.MessageSet( errorMsg ); + dlg.ShowModal(); + return false; } CopyRulesListToBoard(); CopyGlobalRulesToBoard(); CopyDimensionsListsToBoard(); - - EndModal( wxID_OK ); - m_BrdSettings->SetCurrentNetClass( NETCLASS::Default ); + return true; } @@ -903,13 +886,12 @@ void DIALOG_DESIGN_RULES::setNetClass( const wxString& aNetName, const wxString& } -bool DIALOG_DESIGN_RULES::TestDataValidity() +bool DIALOG_DESIGN_RULES::TestDataValidity( wxString* aErrorMsg ) { - bool result = true; - - m_MessagesList->SetPage( wxEmptyString ); // Clear message list + bool result = true; wxString msg; + wxString errorMsg; int minViaDia = ValueFromTextCtrl( *m_SetViasMinSizeCtrl ); int minViaDrill = ValueFromTextCtrl( *m_SetViasMinDrillCtrl ); @@ -918,8 +900,10 @@ bool DIALOG_DESIGN_RULES::TestDataValidity() int minTrackWidth = ValueFromTextCtrl( *m_SetTrackMinWidthCtrl ); int maxval = 1000 * IU_PER_MILS; // a max value for tracks and vias sizes (1 inch) + // @todo Change this code to set the focus to the control where the first error occurs + // so the user doesn't have to figure out where the issue is. - + // Test net class parameters. for( int row = 0; row < m_grid->GetNumberRows(); row++ ) { int tracksize = ValueFromString( g_UserUnit, @@ -929,8 +913,7 @@ bool DIALOG_DESIGN_RULES::TestDataValidity() result = false; msg.Printf( _( "%s: Track Size < Min Track Size
" ), GetChars( m_grid->GetRowLabelValue( row ) ) ); - - m_MessagesList->AppendToPage( msg ); + errorMsg += msg; } // Test vias @@ -942,8 +925,7 @@ bool DIALOG_DESIGN_RULES::TestDataValidity() result = false; msg.Printf( _( "%s: Via Diameter < Minimun Via Diameter
" ), GetChars( m_grid->GetRowLabelValue( row ) ) ); - - m_MessagesList->AppendToPage( msg ); + errorMsg += msg; } int viadrill = ValueFromString( g_UserUnit, @@ -954,8 +936,7 @@ bool DIALOG_DESIGN_RULES::TestDataValidity() result = false; msg.Printf( _( "%s: Via DrillVia Dia
" ), GetChars( m_grid->GetRowLabelValue( row ) ) ); - - m_MessagesList->AppendToPage( msg ); + errorMsg += msg; } if( viadrill < minViaDrill ) @@ -963,8 +944,7 @@ bool DIALOG_DESIGN_RULES::TestDataValidity() result = false; msg.Printf( _( "%s: Via Drill < Min Via Drill
" ), GetChars( m_grid->GetRowLabelValue( row ) ) ); - - m_MessagesList->AppendToPage( msg ); + errorMsg += msg; } // Test Micro vias @@ -976,8 +956,7 @@ bool DIALOG_DESIGN_RULES::TestDataValidity() result = false; msg.Printf( _( "%s: MicroVia Diameter < MicroVia Min Diameter
" ), GetChars( m_grid->GetRowLabelValue( row ) ) ); - - m_MessagesList->AppendToPage( msg ); + errorMsg += msg; } int muviadrill = ValueFromString( g_UserUnit, @@ -988,8 +967,7 @@ bool DIALOG_DESIGN_RULES::TestDataValidity() result = false; msg.Printf( _( "%s: MicroVia DrillMicroVia Dia
" ), GetChars( m_grid->GetRowLabelValue( row ) ) ); - - m_MessagesList->AppendToPage( msg ); + errorMsg += msg; } if( muviadrill < minUViaDrill ) @@ -997,13 +975,11 @@ bool DIALOG_DESIGN_RULES::TestDataValidity() result = false; msg.Printf( _( "%s: MicroVia Drill < MicroVia Min Drill
" ), GetChars( m_grid->GetRowLabelValue( row ) ) ); - - m_MessagesList->AppendToPage( msg ); + errorMsg += msg; } } - // Test list of values for specific vias and tracks - // Test tracks + // Test custom tracks for( int row = 0; row < m_gridTrackWidthList->GetNumberRows(); ++row ) { wxString tvalue = m_gridTrackWidthList->GetCellValue( row, 0 ); @@ -1019,7 +995,7 @@ bool DIALOG_DESIGN_RULES::TestDataValidity() msg.Printf( _( "Extra Track %d Size %s < Min Track Size
" ), row + 1, GetChars( tvalue ) ); - m_MessagesList->AppendToPage( msg ); + errorMsg += msg; } if( tracksize > maxval ) @@ -1028,11 +1004,11 @@ bool DIALOG_DESIGN_RULES::TestDataValidity() msg.Printf( _( "Extra Track %d Size %s > 1 inch!
" ), row + 1, GetChars( tvalue ) ); - m_MessagesList->AppendToPage( msg ); + errorMsg += msg; } } - // Test vias + // Test custom vias for( int row = 0; row < m_gridViaSizeList->GetNumberRows(); ++row ) { wxString tvalue = m_gridViaSizeList->GetCellValue( row, 0 ); @@ -1041,19 +1017,34 @@ bool DIALOG_DESIGN_RULES::TestDataValidity() continue; int viadia = ValueFromString( g_UserUnit, tvalue ); - int viadrill = 0; - wxString drlvalue = m_gridViaSizeList->GetCellValue( row, 1 ); - - if( !drlvalue.IsEmpty() ) - viadrill = ValueFromString( g_UserUnit, drlvalue ); if( viadia < minViaDia ) { result = false; msg.Printf( _( "Extra Via %d Size %s < Min Via Size
" ), row + 1, GetChars( tvalue ) ); + errorMsg += msg; + } - m_MessagesList->AppendToPage( msg ); + wxString drlvalue = m_gridViaSizeList->GetCellValue( row, 1 ); + + if( drlvalue.IsEmpty() ) + { + result = false; + msg.Printf( _( "No via drill size define in row %d
" ), row + 1 ); + errorMsg += msg; + continue; + } + + int viadrill = ValueFromString( g_UserUnit, drlvalue ); + + if( viadrill < minViaDrill ) + { + result = false; + msg.Printf( _( "Extra Via %d Drill %s < Min Via Drill %s
" ), + row + 1, GetChars( drlvalue ), + GetChars( m_SetViasMinDrillCtrl->GetValue() ) ); + errorMsg += msg; } if( viadia <= viadrill ) @@ -1061,8 +1052,7 @@ bool DIALOG_DESIGN_RULES::TestDataValidity() result = false; msg.Printf( _( "Extra Via %d Size %s ≤ Drill Size %s
" ), row + 1, GetChars( tvalue ), GetChars( drlvalue ) ); - - m_MessagesList->AppendToPage( msg ); + errorMsg += msg; } // Test for a reasonable via size: @@ -1071,10 +1061,12 @@ bool DIALOG_DESIGN_RULES::TestDataValidity() result = false; msg.Printf( _( "Extra Via %d Size%s > 1 inch!
" ), row + 1, GetChars( tvalue ) ); - - m_MessagesList->AppendToPage( msg ); + errorMsg += msg; } } + if( !result && aErrorMsg ) + *aErrorMsg = errorMsg; + return result; } diff --git a/pcbnew/dialogs/dialog_design_rules.h b/pcbnew/dialogs/dialog_design_rules.h index c31481866f..9544f92c9a 100644 --- a/pcbnew/dialogs/dialog_design_rules.h +++ b/pcbnew/dialogs/dialog_design_rules.h @@ -3,7 +3,7 @@ * * Copyright (C) 2004-2009 Jean-Pierre Charras, jean-pierre.charras@gpisa-lab.inpg.fr * Copyright (C) 2009 Dick Hollenbeck, dick@softplc.com - * Copyright (C) 2009 KiCad Developers, see change_log.txt for contributors. + * Copyright (C) 2009-2015 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 @@ -73,7 +73,7 @@ private: /** * A two column table which gets filled once and never loses any elements, so it is * basically constant, except that the NETCUP::clazz member can change for any - * given row a NET is moved in and out of a class. clazz reflects the respective + * given row a NET is moved in and out of a class. class reflects the respective * NET's current net class. */ NETCUPS m_AllNets; @@ -85,8 +85,6 @@ private: private: void OnNetClassesNameLeftClick( wxGridEvent& event ){ event.Skip(); } void OnNetClassesNameRightClick( wxGridEvent& event ){ event.Skip(); } - void OnCancelButtonClick( wxCommandEvent& event ); - void OnOkButtonClick( wxCommandEvent& event ); void OnAddNetclassClick( wxCommandEvent& event ); void OnRemoveNetclassClick( wxCommandEvent& event ); @@ -110,6 +108,8 @@ private: void OnRightToLeftCopyButton( wxCommandEvent& event ); void OnLeftToRightCopyButton( wxCommandEvent& event ); + void OnNotebookPageChanged( wxNotebookEvent& event ); + /* * Called on clicking the left "select all" button: * select all items of the left netname list list box @@ -125,11 +125,12 @@ private: /* * Function TestDataValidity * - * Performs a control of data validity - * set the background of a bad cell in RED and display an info message + * Performs a check of design rule data validity and displays an error message if errors + * are found. + * @param aErrorMsg is a pointer to a wxString to copy the error message into. Can be NULL. * @return true if Ok, false if error */ - bool TestDataValidity( ); + bool TestDataValidity( wxString* aErrorMsg = NULL ); void InitDialogRules(); void InitGlobalRules(); @@ -159,13 +160,6 @@ private: */ void FillListBoxWithNetNames( NETS_LIST_CTRL* aListCtrl, const wxString& aNetClass ); - /** - * Function PrintCurrentSettings - * Display on m_MessagesList the current global settings: - * minimal values for tracks, vias, clearance ... - */ - void PrintCurrentSettings( ); - /** * Function swapNetClass * replaces one net class name with another in the master list, m_AllNets. @@ -188,8 +182,9 @@ private: public: DIALOG_DESIGN_RULES( PCB_EDIT_FRAME* parent ); - ~DIALOG_DESIGN_RULES( ) { }; + ~DIALOG_DESIGN_RULES( ) { } + virtual bool TransferDataFromWindow(); }; #endif //__dialog_design_rules_h_ diff --git a/pcbnew/dialogs/dialog_design_rules_base.cpp b/pcbnew/dialogs/dialog_design_rules_base.cpp index 631d43cde2..4fd6dc6e95 100644 --- a/pcbnew/dialogs/dialog_design_rules_base.cpp +++ b/pcbnew/dialogs/dialog_design_rules_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Mar 9 2015) +// C++ code generated with wxFormBuilder (version Jun 5 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -64,7 +64,6 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID // Cell Defaults m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); m_grid->SetToolTip( _("Net Class parameters") ); - m_grid->SetMinSize( wxSize( -1,150 ) ); sbSizerUpper->Add( m_grid, 1, wxEXPAND, 5 ); @@ -87,10 +86,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 ); + sbSizerUpper->Add( buttonBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxLEFT|wxRIGHT|wxTOP, 5 ); - bpanelNetClassesSizer->Add( sbSizerUpper, 1, wxRIGHT|wxLEFT|wxEXPAND, 5 ); + bpanelNetClassesSizer->Add( sbSizerUpper, 2, wxEXPAND|wxLEFT|wxRIGHT, 5 ); wxStaticBoxSizer* sbSizerNetSelectMain; sbSizerNetSelectMain = new wxStaticBoxSizer( new wxStaticBox( m_panelNetClassesEditor, wxID_ANY, _("Membership:") ), wxHORIZONTAL ); @@ -102,8 +101,6 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID leftNetSelectBoxSizer->Add( m_leftClassChoice, 0, wxEXPAND, 5 ); m_leftListCtrl = new NETS_LIST_CTRL( m_panelNetClassesEditor, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VIRTUAL|wxLC_VRULES|wxSUNKEN_BORDER ); - m_leftListCtrl->SetMinSize( wxSize( 220,200 ) ); - leftNetSelectBoxSizer->Add( m_leftListCtrl, 1, wxEXPAND|wxTOP, 5 ); @@ -142,15 +139,13 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID rghtNetSelectBoxSizer->Add( m_rightClassChoice, 0, wxEXPAND, 5 ); m_rightListCtrl = new NETS_LIST_CTRL( m_panelNetClassesEditor, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VIRTUAL|wxLC_VRULES|wxSUNKEN_BORDER ); - m_rightListCtrl->SetMinSize( wxSize( 220,-1 ) ); - rghtNetSelectBoxSizer->Add( m_rightListCtrl, 1, wxEXPAND|wxTOP, 5 ); sbSizerNetSelectMain->Add( rghtNetSelectBoxSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - bpanelNetClassesSizer->Add( sbSizerNetSelectMain, 2, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + bpanelNetClassesSizer->Add( sbSizerNetSelectMain, 3, wxEXPAND|wxRIGHT|wxLEFT, 5 ); m_panelNetClassesEditor->SetSizer( bpanelNetClassesSizer ); @@ -264,7 +259,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID m_gridViaSizeList = new wxGrid( m_panelGolbalDesignRules, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); // Grid - m_gridViaSizeList->CreateGrid( 12, 2 ); + m_gridViaSizeList->CreateGrid( 8, 2 ); m_gridViaSizeList->EnableEditing( true ); m_gridViaSizeList->EnableGridLines( true ); m_gridViaSizeList->EnableDragGridSize( false ); @@ -314,7 +309,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID m_gridTrackWidthList = new wxGrid( m_panelGolbalDesignRules, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); // Grid - m_gridTrackWidthList->CreateGrid( 12, 1 ); + m_gridTrackWidthList->CreateGrid( 8, 1 ); m_gridTrackWidthList->EnableEditing( true ); m_gridTrackWidthList->EnableGridLines( true ); m_gridTrackWidthList->EnableDragGridSize( false ); @@ -364,35 +359,22 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID bMainSizer->Add( m_DRnotebook, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - wxStaticBoxSizer* sbSizer2; - sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Messages:") ), wxHORIZONTAL ); + m_sdbSizer1 = new wxStdDialogButtonSizer(); + m_sdbSizer1OK = new wxButton( this, wxID_OK ); + m_sdbSizer1->AddButton( m_sdbSizer1OK ); + m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); + m_sdbSizer1->Realize(); - m_MessagesList = new wxHtmlWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO|wxSUNKEN_BORDER ); - m_MessagesList->SetMinSize( wxSize( -1,90 ) ); - - sbSizer2->Add( m_MessagesList, 1, wxEXPAND, 5 ); - - wxBoxSizer* bSizerButtons; - bSizerButtons = new wxBoxSizer( wxVERTICAL ); - - m_buttonOk = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonOk->SetDefault(); - bSizerButtons->Add( m_buttonOk, 0, wxALL|wxEXPAND, 5 ); - - 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 ); + bMainSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 5 ); this->SetSizer( bMainSizer ); this->Layout(); + bMainSizer->Fit( this ); // Connect Events + m_DRnotebook->Connect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( DIALOG_DESIGN_RULES_BASE::OnNotebookPageChanged ), NULL, this ); m_grid->Connect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesNameLeftClick ), NULL, this ); m_grid->Connect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesNameRightClick ), NULL, this ); m_addButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnAddNetclassClick ), NULL, this ); @@ -404,13 +386,12 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID m_buttonLeftSelAll->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftSelectAllButton ), NULL, this ); m_buttonRightSelAll->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightSelectAllButton ), NULL, this ); m_rightClassChoice->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightCBSelection ), NULL, this ); - m_buttonOk->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnOkButtonClick ), NULL, this ); - m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnCancelButtonClick ), NULL, this ); } DIALOG_DESIGN_RULES_BASE::~DIALOG_DESIGN_RULES_BASE() { // Disconnect Events + m_DRnotebook->Disconnect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( DIALOG_DESIGN_RULES_BASE::OnNotebookPageChanged ), NULL, this ); m_grid->Disconnect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesNameLeftClick ), NULL, this ); m_grid->Disconnect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesNameRightClick ), NULL, this ); m_addButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnAddNetclassClick ), NULL, this ); @@ -422,7 +403,5 @@ DIALOG_DESIGN_RULES_BASE::~DIALOG_DESIGN_RULES_BASE() m_buttonLeftSelAll->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftSelectAllButton ), NULL, this ); m_buttonRightSelAll->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightSelectAllButton ), NULL, this ); m_rightClassChoice->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightCBSelection ), NULL, this ); - m_buttonOk->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnOkButtonClick ), NULL, this ); - m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnCancelButtonClick ), NULL, this ); } diff --git a/pcbnew/dialogs/dialog_design_rules_base.fbp b/pcbnew/dialogs/dialog_design_rules_base.fbp index 973a9eaaf1..4d2392d6c3 100644 --- a/pcbnew/dialogs/dialog_design_rules_base.fbp +++ b/pcbnew/dialogs/dialog_design_rules_base.fbp @@ -44,7 +44,7 @@ -1,-1 DIALOG_DESIGN_RULES_BASE - 777,697 + -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h Design Rules Editor @@ -166,7 +166,7 @@ - + OnNotebookPageChanged @@ -260,8 +260,8 @@ none 5 - wxRIGHT|wxLEFT|wxEXPAND - 1 + wxEXPAND|wxLEFT|wxRIGHT + 2 wxID_ANY Net Classes: @@ -332,7 +332,7 @@ 0 - -1,150 + -1,-1 1 m_grid 1 @@ -415,7 +415,7 @@ 5 - wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT + wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxLEFT|wxRIGHT|wxTOP 0 @@ -693,7 +693,7 @@ 5 wxEXPAND|wxRIGHT|wxLEFT - 2 + 3 wxID_ANY Membership: @@ -839,7 +839,7 @@ 0 - 220,200 + -1,-1 1 m_leftListCtrl 1 @@ -1409,7 +1409,7 @@ 0 - 220,-1 + -1,-1 1 m_rightListCtrl 1 @@ -3019,7 +3019,7 @@ "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 + 8 1 @@ -3259,7 +3259,7 @@ "Track 1" "Track 2" "Track 3" "Track 4" "Track 5" "Track 6" "Track 7" "Track 8" "Track 9" "Track 10" "Track 11" "Track 12" wxALIGN_CENTRE - 12 + 8 1 @@ -3336,287 +3336,28 @@ 5 - wxEXPAND|wxRIGHT|wxLEFT + wxALL|wxEXPAND 0 - - wxID_ANY - Messages: + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 - sbSizer2 - wxHORIZONTAL - none - - - 5 - wxEXPAND - 1 - - 1 - 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 - - - - wxSUNKEN_BORDER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - 0 - - - bSizerButtons - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_OK - OK - - 0 - - - 0 - - 1 - m_buttonOk - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnOkButtonClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_CANCEL - Cancel - - 0 - - - 0 - - 1 - m_buttonCancel - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnCancelButtonClick - - - - - - - - - - - - - - - - - - - - - - - - - - - + m_sdbSizer1 + protected + + + + + + + + diff --git a/pcbnew/dialogs/dialog_design_rules_base.h b/pcbnew/dialogs/dialog_design_rules_base.h index 891d390014..0de97bff52 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 Mar 9 2015) +// C++ code generated with wxFormBuilder (version Jun 5 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -35,7 +35,6 @@ class NETS_LIST_CTRL; #include #include #include -#include #include /////////////////////////////////////////////////////////////////////////// @@ -89,11 +88,12 @@ class DIALOG_DESIGN_RULES_BASE : public DIALOG_SHIM wxGrid* m_gridViaSizeList; wxStaticText* m_staticText8; wxGrid* m_gridTrackWidthList; - wxHtmlWindow* m_MessagesList; - wxButton* m_buttonOk; - wxButton* m_buttonCancel; + wxStdDialogButtonSizer* m_sdbSizer1; + wxButton* m_sdbSizer1OK; + wxButton* m_sdbSizer1Cancel; // Virtual event handlers, overide them in your derived class + virtual void OnNotebookPageChanged( wxNotebookEvent& event ) { event.Skip(); } virtual void OnNetClassesNameLeftClick( wxGridEvent& event ) { event.Skip(); } virtual void OnNetClassesNameRightClick( wxGridEvent& event ) { event.Skip(); } virtual void OnAddNetclassClick( wxCommandEvent& event ) { event.Skip(); } @@ -105,13 +105,11 @@ class DIALOG_DESIGN_RULES_BASE : public DIALOG_SHIM virtual void OnLeftSelectAllButton( wxCommandEvent& event ) { event.Skip(); } virtual void OnRightSelectAllButton( wxCommandEvent& event ) { event.Skip(); } virtual void OnRightCBSelection( wxCommandEvent& event ) { event.Skip(); } - virtual void OnOkButtonClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCancelButtonClick( wxCommandEvent& event ) { event.Skip(); } public: - DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Design Rules Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 777,697 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Design Rules Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_DESIGN_RULES_BASE(); };