Commit 76adcc60 authored by jean-pierre charras's avatar jean-pierre charras

Design rules dialog: use wxLC_VIRTUAL options in wxListBoxes to speed up nets...

Design rules dialog: use wxLC_VIRTUAL options in wxListBoxes to speed  up nets lists display (which was *very long* for boards with a lot of nets)
parents d00f3744 86210d10
...@@ -113,8 +113,10 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) ...@@ -113,8 +113,10 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
description << wxT( "<p>" ); description << wxT( "<p>" );
description << wxT( "<b><u>" ) << _( "Description" ) << wxT( "</u></b>" ); // bold & underlined font for caption description << wxT( "<b><u>" ) << _( "Description" ) << wxT( "</u></b>" ); // bold & underlined font for caption
description << wxT( description << wxT( "<p>" ) <<
"<p>The KiCad EDA Suite is a set of open source applications for the creation of electronic schematics and to design printed circuit boards.</p>" ); _(
"The KiCad EDA Suite is a set of open source applications for the creation of electronic schematics and to design printed circuit boards." )
<< wxT( "</p>" );
description << wxT( "</p>" ); description << wxT( "</p>" );
...@@ -170,7 +172,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) ...@@ -170,7 +172,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
<< HtmlNewline( 4 ) << HtmlNewline( 4 )
<< _( "The complete KiCad EDA Suite is released under the" ) << HtmlNewline( 2 ) << _( "The complete KiCad EDA Suite is released under the" ) << HtmlNewline( 2 )
<< HtmlHyperlink( wxT( "http://www.gnu.org/licenses" ), << HtmlHyperlink( wxT( "http://www.gnu.org/licenses" ),
_( "GNU General Public License version 2" ) ) _( "GNU General Public License (GPL) version 2" ) )
<< wxT( "</div>" ); << wxT( "</div>" );
info.SetLicense( license ); info.SetLicense( license );
...@@ -201,7 +203,8 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) ...@@ -201,7 +203,8 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
info.AddDeveloper( new Contributor( wxT( "Lorenzo Marcantonio" ), wxT( "lomarcan@tin.it" ) ) ); info.AddDeveloper( new Contributor( wxT( "Lorenzo Marcantonio" ), wxT( "lomarcan@tin.it" ) ) );
info.AddDeveloper( new Contributor( wxT( "Marco Serantoni" ), wxT( "marco.serantoni@gmail.com" ) ) ); info.AddDeveloper( new Contributor( wxT( "Marco Serantoni" ), wxT( "marco.serantoni@gmail.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Marco Mattila" ), wxT( "marcom99@gmail.com" ) ) ); info.AddDeveloper( new Contributor( wxT( "Marco Mattila" ), wxT( "marcom99@gmail.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Rafael Sokolowski" ), wxT( "rafael.sokolowski@web.de" ) ) ); info.AddDeveloper( new Contributor( wxT( "Rafael Sokolowski" ),
wxT( "rafael.sokolowski@web.de" ) ) );
info.AddDeveloper( new Contributor( wxT( "Rok Markovic" ), wxT( "rok@kanardia.eu" ) ) ); info.AddDeveloper( new Contributor( wxT( "Rok Markovic" ), wxT( "rok@kanardia.eu" ) ) );
info.AddDeveloper( new Contributor( wxT( "Tim Hanson" ), wxT( "sideskate@gmail.com" ) ) ); info.AddDeveloper( new Contributor( wxT( "Tim Hanson" ), wxT( "sideskate@gmail.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Vesa Solonen" ), wxT( "vesa.solonen@hut.fi" ) ) ); info.AddDeveloper( new Contributor( wxT( "Vesa Solonen" ), wxT( "vesa.solonen@hut.fi" ) ) );
......
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: dialog_design_rules.cpp // Name: dialog_design_rules.cpp
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
...@@ -42,7 +43,7 @@ ...@@ -42,7 +43,7 @@
#include "pcbnew_id.h" #include "pcbnew_id.h"
#include "dialog_design_rules.h" #include "dialog_design_rules.h"
#include "wx/generic/gridctrl.h" #include "wx/generic/gridctrl.h"
#include "dialog_design_rules_aux_helper_class.h"
// Field Positions on rules grid // Field Positions on rules grid
enum { enum {
...@@ -54,15 +55,62 @@ enum { ...@@ -54,15 +55,62 @@ enum {
GRID_uVIADRILL, GRID_uVIADRILL,
}; };
const wxString DIALOG_DESIGN_RULES::wildCard = _("* (Any)"); const wxString DIALOG_DESIGN_RULES::wildCard = _( "* (Any)" );
// dialog should remember its previously selected tab // dialog should remember its previously selected tab
int DIALOG_DESIGN_RULES::s_LastTabSelection = -1; int DIALOG_DESIGN_RULES:: s_LastTabSelection = -1;
// dialog should remember its previous screen position and size // dialog should remember its previous screen position and size
wxPoint DIALOG_DESIGN_RULES::s_LastPos( -1, -1 ); wxPoint DIALOG_DESIGN_RULES:: s_LastPos( -1, -1 );
wxSize DIALOG_DESIGN_RULES::s_LastSize; wxSize DIALOG_DESIGN_RULES:: s_LastSize;
// methods for the helper class NETS_LIST_CTRL
/** OnGetItemText (overlaid method)
* needed by wxListCtrl with wxLC_VIRTUAL options
*/
wxString NETS_LIST_CTRL::OnGetItemText( long item, long column ) const
{
if( column == 0 )
{
if( item < (long) m_Netnames.GetCount() )
return m_Netnames[item];
else
return wxEmptyString;
}
else if( item < (long) m_Classnames.GetCount() )
return m_Classnames[item];
return wxEmptyString;
}
/** Function setRowItems
* Initialize the net name and the net class name at row aRow
* @param aRow = row index (if aRow > number of stored row, empty rows will be created)
* @param aNetname = the string to display in row aRow, column 0
* @param aNetclassName = the string to display in row aRow, column 1
*/
void NETS_LIST_CTRL::setRowItems( unsigned aRow,
const wxString& aNetname,
const wxString& aNetclassName )
{
// insert blanks if aRow is larger than existing row count
unsigned cnt = m_Netnames.GetCount();
if( cnt <= aRow )
m_Netnames.Add( wxEmptyString, aRow - cnt + 1 );
cnt = m_Classnames.GetCount();
if( cnt <= aRow )
m_Classnames.Add( wxEmptyString, aRow - cnt + 1 );
if( (int)aRow <= GetItemCount() )
SetItemCount( aRow + 1 );
m_Netnames[aRow] = aNetname;
m_Classnames[aRow] = aNetclassName;
}
/** /**
...@@ -71,6 +119,7 @@ wxSize DIALOG_DESIGN_RULES::s_LastSize; ...@@ -71,6 +119,7 @@ wxSize DIALOG_DESIGN_RULES::s_LastSize;
* column titles and not on the grid cell requirements, assuming that the grid * column titles and not on the grid cell requirements, assuming that the grid
* cell width requirements are narrower than the column title requirements. * cell width requirements are narrower than the column title requirements.
*/ */
// @todo: maybe move this to common.cpp if it works. // @todo: maybe move this to common.cpp if it works.
void EnsureGridColumnWidths( wxGrid* aGrid ) void EnsureGridColumnWidths( wxGrid* aGrid )
{ {
...@@ -79,12 +128,12 @@ void EnsureGridColumnWidths( wxGrid* aGrid ) ...@@ -79,12 +128,12 @@ void EnsureGridColumnWidths( wxGrid* aGrid )
sDC.SetFont( aGrid->GetLabelFont() ); sDC.SetFont( aGrid->GetLabelFont() );
int colCount = aGrid->GetNumberCols(); int colCount = aGrid->GetNumberCols();
for( int col=0; col<colCount; ++col ) for( int col = 0; col<colCount; ++col )
{ {
// add two spaces to the text and size it. // add two spaces to the text and size it.
wxString colText = aGrid->GetColLabelValue( col ) + wxT( " " ); wxString colText = aGrid->GetColLabelValue( col ) + wxT( " " );
wxSize needed = sDC.GetTextExtent( colText ); wxSize needed = sDC.GetTextExtent( colText );
// set the width of this column // set the width of this column
aGrid->SetColSize( col, needed.x ); aGrid->SetColSize( col, needed.x );
...@@ -102,14 +151,14 @@ DIALOG_DESIGN_RULES::DIALOG_DESIGN_RULES( WinEDA_PcbFrame* parent ) : ...@@ -102,14 +151,14 @@ DIALOG_DESIGN_RULES::DIALOG_DESIGN_RULES( WinEDA_PcbFrame* parent ) :
EnsureGridColumnWidths( m_grid ); // override any column widths set by wxformbuilder. EnsureGridColumnWidths( m_grid ); // override any column widths set by wxformbuilder.
wxListItem column0; wxListItem column0;
wxListItem column1; wxListItem column1;
column0.Clear(); column0.Clear();
column1.Clear(); column1.Clear();
column0.SetMask(wxLIST_MASK_TEXT); column0.SetMask( wxLIST_MASK_TEXT );
column1.SetMask(wxLIST_MASK_TEXT); column1.SetMask( wxLIST_MASK_TEXT );
column0.SetText( _( "Net" ) ); column0.SetText( _( "Net" ) );
column1.SetText( _( "Class" ) ); column1.SetText( _( "Class" ) );
...@@ -148,26 +197,31 @@ DIALOG_DESIGN_RULES::DIALOG_DESIGN_RULES( WinEDA_PcbFrame* parent ) : ...@@ -148,26 +197,31 @@ DIALOG_DESIGN_RULES::DIALOG_DESIGN_RULES( WinEDA_PcbFrame* parent ) :
/* Display on m_MessagesList the current global settings: /* Display on m_MessagesList the current global settings:
* minimal values for tracks, vias, clearance ... * minimal values for tracks, vias, clearance ...
*/ */
void DIALOG_DESIGN_RULES::PrintCurrentSettings( ) void DIALOG_DESIGN_RULES::PrintCurrentSettings()
{ {
wxString msg, value; wxString msg, value;
int internal_units = m_Parent->m_InternalUnits; int internal_units = m_Parent->m_InternalUnits;
m_MessagesList->AppendToPage(_("<b>Current general settings:</b><br>") ); m_MessagesList->AppendToPage( _( "<b>Current general settings:</b><br>" ) );
// Display min values: // Display min values:
value = ReturnStringFromValue( g_UserUnit, m_BrdSettings->m_TrackMinWidth, internal_units, true ); value = ReturnStringFromValue( g_UserUnit,
msg.Printf(_("Minimum value for tracks width: <b>%s</b><br>\n"), GetChars( value ) ); m_BrdSettings->m_TrackMinWidth,
m_MessagesList->AppendToPage(msg); internal_units,
true );
value = ReturnStringFromValue( g_UserUnit, m_BrdSettings->m_ViasMinSize, internal_units, true ); msg.Printf( _( "Minimum value for tracks width: <b>%s</b><br>\n" ), GetChars( value ) );
msg.Printf(_("Minimum value for vias diameter: <b>%s</b><br>\n"), GetChars( value ) ); m_MessagesList->AppendToPage( msg );
m_MessagesList->AppendToPage(msg);
value = ReturnStringFromValue( g_UserUnit, m_BrdSettings->m_ViasMinSize, internal_units, true );
value = ReturnStringFromValue( g_UserUnit, m_BrdSettings->m_MicroViasMinSize, internal_units, true ); msg.Printf( _( "Minimum value for vias diameter: <b>%s</b><br>\n" ), GetChars( value ) );
msg.Printf(_("Minimum value for microvias diameter: <b>%s</b><br>\n"), GetChars( value ) ); m_MessagesList->AppendToPage( msg );
m_MessagesList->AppendToPage(msg);
value = ReturnStringFromValue( g_UserUnit,
m_BrdSettings->m_MicroViasMinSize,
internal_units,
true );
msg.Printf( _( "Minimum value for microvias diameter: <b>%s</b><br>\n" ), GetChars( value ) );
m_MessagesList->AppendToPage( msg );
} }
...@@ -215,9 +269,10 @@ void DIALOG_DESIGN_RULES::InitDialogRules() ...@@ -215,9 +269,10 @@ void DIALOG_DESIGN_RULES::InitDialogRules()
InitializeRulesSelectionBoxes(); InitializeRulesSelectionBoxes();
InitGlobalRules(); InitGlobalRules();
PrintCurrentSettings( ); PrintCurrentSettings();
} }
/*******************************************/ /*******************************************/
void DIALOG_DESIGN_RULES::InitGlobalRules() void DIALOG_DESIGN_RULES::InitGlobalRules()
/*******************************************/ /*******************************************/
...@@ -229,29 +284,33 @@ void DIALOG_DESIGN_RULES::InitGlobalRules() ...@@ -229,29 +284,33 @@ void DIALOG_DESIGN_RULES::InitGlobalRules()
AddUnitSymbol( *m_TrackMinWidthTitle ); AddUnitSymbol( *m_TrackMinWidthTitle );
int Internal_Unit = m_Parent->m_InternalUnits; int Internal_Unit = m_Parent->m_InternalUnits;
PutValueInLocalUnits( *m_SetViasMinSizeCtrl, m_BrdSettings->m_ViasMinSize, Internal_Unit ); PutValueInLocalUnits( *m_SetViasMinSizeCtrl, m_BrdSettings->m_ViasMinSize, Internal_Unit );
PutValueInLocalUnits( *m_SetViasMinDrillCtrl, m_BrdSettings->m_ViasMinDrill, Internal_Unit ); PutValueInLocalUnits( *m_SetViasMinDrillCtrl, m_BrdSettings->m_ViasMinDrill, Internal_Unit );
if( m_BrdSettings->m_CurrentViaType != VIA_THROUGH ) if( m_BrdSettings->m_CurrentViaType != VIA_THROUGH )
m_OptViaType->SetSelection( 1 ); m_OptViaType->SetSelection( 1 );
m_AllowMicroViaCtrl->SetSelection( m_BrdSettings->m_MicroViasAllowed ? 1 : 0); m_AllowMicroViaCtrl->SetSelection( m_BrdSettings->m_MicroViasAllowed ? 1 : 0 );
PutValueInLocalUnits( *m_SetMicroViasMinSizeCtrl, m_BrdSettings->m_MicroViasMinSize, Internal_Unit ); PutValueInLocalUnits( *m_SetMicroViasMinSizeCtrl,
PutValueInLocalUnits( *m_SetMicroViasMinDrillCtrl, m_BrdSettings->m_MicroViasMinDrill, Internal_Unit ); m_BrdSettings->m_MicroViasMinSize,
Internal_Unit );
PutValueInLocalUnits( *m_SetMicroViasMinDrillCtrl,
m_BrdSettings->m_MicroViasMinDrill,
Internal_Unit );
PutValueInLocalUnits( *m_SetTrackMinWidthCtrl, m_BrdSettings->m_TrackMinWidth, Internal_Unit ); PutValueInLocalUnits( *m_SetTrackMinWidthCtrl, m_BrdSettings->m_TrackMinWidth, Internal_Unit );
// Initialize Vias and Tracks sizes lists. // Initialize Vias and Tracks sizes lists.
// note we display only extra values, never the current netclass value. // note we display only extra values, never the current netclass value.
// (the first value in histories list) // (the first value in histories list)
m_TracksWidthList = m_Parent->GetBoard()->m_TrackWidthList; m_TracksWidthList = m_Parent->GetBoard()->m_TrackWidthList;
m_TracksWidthList.erase( m_TracksWidthList.begin() ); // remove the netclass value m_TracksWidthList.erase( m_TracksWidthList.begin() ); // remove the netclass value
m_ViasDimensionsList = m_Parent->GetBoard()->m_ViasDimensionsList; m_ViasDimensionsList = m_Parent->GetBoard()->m_ViasDimensionsList;
m_ViasDimensionsList.erase( m_ViasDimensionsList.begin() ); // remove the netclass value m_ViasDimensionsList.erase( m_ViasDimensionsList.begin() ); // remove the netclass value
InitDimensionsLists(); InitDimensionsLists();
} }
/***************************************************/ /***************************************************/
void DIALOG_DESIGN_RULES::InitDimensionsLists() void DIALOG_DESIGN_RULES::InitDimensionsLists()
/***************************************************/ /***************************************************/
...@@ -271,12 +330,12 @@ void DIALOG_DESIGN_RULES::InitDimensionsLists() ...@@ -271,12 +330,12 @@ void DIALOG_DESIGN_RULES::InitDimensionsLists()
for( unsigned ii = 0; ii < m_ViasDimensionsList.size(); ii++ ) for( unsigned ii = 0; ii < m_ViasDimensionsList.size(); ii++ )
{ {
msg = ReturnStringFromValue( g_UserUnit, m_ViasDimensionsList[ii].m_Diameter, msg = ReturnStringFromValue( g_UserUnit, m_ViasDimensionsList[ii].m_Diameter,
Internal_Unit, false ); Internal_Unit, false );
m_gridViaSizeList->SetCellValue( ii, 0, msg ); m_gridViaSizeList->SetCellValue( ii, 0, msg );
if( m_ViasDimensionsList[ii].m_Drill > 0 ) if( m_ViasDimensionsList[ii].m_Drill > 0 )
{ {
msg = ReturnStringFromValue( g_UserUnit, m_ViasDimensionsList[ii].m_Drill, msg = ReturnStringFromValue( g_UserUnit, m_ViasDimensionsList[ii].m_Drill,
Internal_Unit, false ); Internal_Unit, false );
m_gridViaSizeList->SetCellValue( ii, 1, msg ); m_gridViaSizeList->SetCellValue( ii, 1, msg );
} }
} }
...@@ -286,6 +345,7 @@ void DIALOG_DESIGN_RULES::InitDimensionsLists() ...@@ -286,6 +345,7 @@ void DIALOG_DESIGN_RULES::InitDimensionsLists()
m_gridTrackWidthList->SetColumnWidth( 0, wxLIST_AUTOSIZE ); m_gridTrackWidthList->SetColumnWidth( 0, wxLIST_AUTOSIZE );
} }
// Sort comparison function (helper for makePointers() ) // Sort comparison function (helper for makePointers() )
static bool sortByClassThenName( NETCUP* a, NETCUP* b ) static bool sortByClassThenName( NETCUP* a, NETCUP* b )
{ {
...@@ -303,6 +363,7 @@ static bool sortByClassThenName( NETCUP* a, NETCUP* b ) ...@@ -303,6 +363,7 @@ static bool sortByClassThenName( NETCUP* a, NETCUP* b )
return false; return false;
} }
void DIALOG_DESIGN_RULES::makePointers( PNETCUPS* aList, const wxString& aNetClassName ) void DIALOG_DESIGN_RULES::makePointers( PNETCUPS* aList, const wxString& aNetClassName )
{ {
aList->clear(); aList->clear();
...@@ -331,38 +392,16 @@ void DIALOG_DESIGN_RULES::makePointers( PNETCUPS* aList, const wxString& aNetCla ...@@ -331,38 +392,16 @@ void DIALOG_DESIGN_RULES::makePointers( PNETCUPS* aList, const wxString& aNetCla
} }
void DIALOG_DESIGN_RULES::setRowItem( wxListCtrl* aListCtrl, int aRow, NETCUP* aNetAndClass )
{
wxASSERT( aRow >= 0 );
// insert blanks if aRow is larger than existing count
while( aRow >= aListCtrl->GetItemCount() )
{
long ndx = aListCtrl->InsertItem( aListCtrl->GetItemCount(), wxEmptyString );
wxASSERT( ndx >= 0 );
aListCtrl->SetItem( ndx, 1, wxEmptyString );
}
aListCtrl->SetItem( aRow, 0, aNetAndClass->net );
aListCtrl->SetItem( aRow, 1, aNetAndClass->clazz );
// recompute the column widths here, after setting texts
aListCtrl->SetColumnWidth( 0, wxLIST_AUTOSIZE );
aListCtrl->SetColumnWidth( 1, wxLIST_AUTOSIZE );
}
/** /**
* Function FillListBoxWithNetNames * Function FillListBoxWithNetNames
* populates aListCtrl with net names and class names from m_AllNets in a two column display. * populates aListCtrl with net names and class names from m_AllNets in a two column display.
*/ */
void DIALOG_DESIGN_RULES::FillListBoxWithNetNames( wxListCtrl* aListCtrl, const wxString& aNetClass ) void DIALOG_DESIGN_RULES::FillListBoxWithNetNames( NETS_LIST_CTRL* aListCtrl,
const wxString& aNetClass )
{ {
aListCtrl->DeleteAllItems(); aListCtrl->ClearList();
PNETCUPS ptrList; PNETCUPS ptrList;
// get a subset of m_AllNets in pointer form, sorted as desired. // get a subset of m_AllNets in pointer form, sorted as desired.
makePointers( &ptrList, aNetClass ); makePointers( &ptrList, aNetClass );
...@@ -371,8 +410,9 @@ void DIALOG_DESIGN_RULES::FillListBoxWithNetNames( wxListCtrl* aListCtrl, const ...@@ -371,8 +410,9 @@ void DIALOG_DESIGN_RULES::FillListBoxWithNetNames( wxListCtrl* aListCtrl, const
int r = 0; int r = 0;
for( PNETCUPS::iterator i = ptrList.begin(); i!=ptrList.end(); ++i, ++r ) for( PNETCUPS::iterator i = ptrList.begin(); i!=ptrList.end(); ++i, ++r )
{ {
printf("[%d]: %s %s\n", r, CONV_TO_UTF8( (*i)->net ), CONV_TO_UTF8( (*i)->clazz ) ); printf( "[%d]: %s %s\n", r, CONV_TO_UTF8( (*i)->net ), CONV_TO_UTF8( (*i)->clazz ) );
} }
#endif #endif
// to speed up inserting we hide the control temporarily // to speed up inserting we hide the control temporarily
...@@ -381,9 +421,13 @@ void DIALOG_DESIGN_RULES::FillListBoxWithNetNames( wxListCtrl* aListCtrl, const ...@@ -381,9 +421,13 @@ void DIALOG_DESIGN_RULES::FillListBoxWithNetNames( wxListCtrl* aListCtrl, const
int row = 0; int row = 0;
for( PNETCUPS::iterator i = ptrList.begin(); i!=ptrList.end(); ++i, ++row ) for( PNETCUPS::iterator i = ptrList.begin(); i!=ptrList.end(); ++i, ++row )
{ {
setRowItem( aListCtrl, row, *i ); aListCtrl->setRowItems( row, (*i)->net, (*i)->clazz );
} }
// recompute the column widths here, after setting texts
aListCtrl->SetColumnWidth( 0, wxLIST_AUTOSIZE );
aListCtrl->SetColumnWidth( 1, wxLIST_AUTOSIZE );
aListCtrl->Show(); aListCtrl->Show();
} }
...@@ -444,6 +488,7 @@ static void class2gridRow( wxGrid* grid, int row, NETCLASS* nc, int units ) ...@@ -444,6 +488,7 @@ static void class2gridRow( wxGrid* grid, int row, NETCLASS* nc, int units )
grid->SetCellValue( row, GRID_uVIADRILL, msg ); grid->SetCellValue( row, GRID_uVIADRILL, msg );
} }
/** Function InitRulesList() /** Function InitRulesList()
* Fill the grid showing current rules with values * Fill the grid showing current rules with values
*/ */
...@@ -452,9 +497,9 @@ void DIALOG_DESIGN_RULES::InitRulesList() ...@@ -452,9 +497,9 @@ void DIALOG_DESIGN_RULES::InitRulesList()
NETCLASSES& netclasses = m_Pcb->m_NetClasses; NETCLASSES& netclasses = m_Pcb->m_NetClasses;
// the +1 is for the Default NETCLASS. // the +1 is for the Default NETCLASS.
if( netclasses.GetCount()+1 > (unsigned) m_grid->GetNumberRows() ) if( netclasses.GetCount() + 1 > (unsigned) m_grid->GetNumberRows() )
{ {
m_grid->AppendRows( netclasses.GetCount()+1 - m_grid->GetNumberRows() ); m_grid->AppendRows( netclasses.GetCount() + 1 - m_grid->GetNumberRows() );
} }
// enter the Default NETCLASS. // enter the Default NETCLASS.
...@@ -462,7 +507,7 @@ void DIALOG_DESIGN_RULES::InitRulesList() ...@@ -462,7 +507,7 @@ void DIALOG_DESIGN_RULES::InitRulesList()
// enter others netclasses // enter others netclasses
int row = 1; int row = 1;
for( NETCLASSES::iterator i=netclasses.begin(); i!=netclasses.end(); ++i, ++row ) for( NETCLASSES::iterator i = netclasses.begin(); i!=netclasses.end(); ++i, ++row )
{ {
NETCLASS* netclass = i->second; NETCLASS* netclass = i->second;
...@@ -473,15 +518,15 @@ void DIALOG_DESIGN_RULES::InitRulesList() ...@@ -473,15 +518,15 @@ void DIALOG_DESIGN_RULES::InitRulesList()
static void gridRow2class( wxGrid* grid, int row, NETCLASS* nc, int units ) static void gridRow2class( wxGrid* grid, int row, NETCLASS* nc, int units )
{ {
#define MYCELL(col) \ #define MYCELL( col ) \
ReturnValueFromString( g_UserUnit, grid->GetCellValue( row, col ), units ) ReturnValueFromString( g_UserUnit, grid->GetCellValue( row, col ), units )
nc->SetClearance( MYCELL( GRID_CLEARANCE ) ); nc->SetClearance( MYCELL( GRID_CLEARANCE ) );
nc->SetTrackWidth( MYCELL( GRID_TRACKSIZE ) ); nc->SetTrackWidth( MYCELL( GRID_TRACKSIZE ) );
nc->SetViaDiameter( MYCELL( GRID_VIASIZE ) ); nc->SetViaDiameter( MYCELL( GRID_VIASIZE ) );
nc->SetViaDrill( MYCELL( GRID_VIADRILL ) ); nc->SetViaDrill( MYCELL( GRID_VIADRILL ) );
nc->SetuViaDiameter( MYCELL( GRID_uVIASIZE ) ); nc->SetuViaDiameter( MYCELL( GRID_uVIASIZE ) );
nc->SetuViaDrill( MYCELL( GRID_uVIADRILL ) ); nc->SetuViaDrill( MYCELL( GRID_uVIADRILL ) );
} }
...@@ -507,8 +552,8 @@ void DIALOG_DESIGN_RULES::CopyRulesListToBoard() ...@@ -507,8 +552,8 @@ void DIALOG_DESIGN_RULES::CopyRulesListToBoard()
// this netclass cannot be added because an other netclass with the same name exists // this netclass cannot be added because an other netclass with the same name exists
// Should not occur because OnAddNetclassClick() tests for existing NetClass names // Should not occur because OnAddNetclassClick() tests for existing NetClass names
wxString msg; wxString msg;
msg.Printf( wxT("CopyRulesListToBoard(): The NetClass \"%s\" already exists. Skip"), msg.Printf( wxT( "CopyRulesListToBoard(): The NetClass \"%s\" already exists. Skip" ),
GetChars( m_grid->GetRowLabelValue( row ) ) ); GetChars( m_grid->GetRowLabelValue( row ) ) );
wxMessageBox( msg ); wxMessageBox( msg );
delete nc; delete nc;
continue; continue;
...@@ -528,35 +573,37 @@ void DIALOG_DESIGN_RULES::CopyRulesListToBoard() ...@@ -528,35 +573,37 @@ void DIALOG_DESIGN_RULES::CopyRulesListToBoard()
m_Pcb->SynchronizeNetsAndNetClasses(); m_Pcb->SynchronizeNetsAndNetClasses();
} }
/*************************************************/ /*************************************************/
void DIALOG_DESIGN_RULES::CopyGlobalRulesToBoard() void DIALOG_DESIGN_RULES::CopyGlobalRulesToBoard()
/*************************************************/ /*************************************************/
{ {
m_BrdSettings->m_CurrentViaType = VIA_THROUGH; m_BrdSettings->m_CurrentViaType = VIA_THROUGH;
if( m_OptViaType->GetSelection() > 0 ) if( m_OptViaType->GetSelection() > 0 )
m_BrdSettings->m_CurrentViaType = VIA_BLIND_BURIED; m_BrdSettings->m_CurrentViaType = VIA_BLIND_BURIED;
// Update vias minimum values for DRC // Update vias minimum values for DRC
m_BrdSettings->m_ViasMinSize = m_BrdSettings->m_ViasMinSize =
ReturnValueFromTextCtrl( *m_SetViasMinSizeCtrl, m_Parent->m_InternalUnits ); ReturnValueFromTextCtrl( *m_SetViasMinSizeCtrl, m_Parent->m_InternalUnits );
m_BrdSettings->m_ViasMinDrill = m_BrdSettings->m_ViasMinDrill =
ReturnValueFromTextCtrl( *m_SetViasMinDrillCtrl, m_Parent->m_InternalUnits ); ReturnValueFromTextCtrl( *m_SetViasMinDrillCtrl, m_Parent->m_InternalUnits );
m_BrdSettings->m_MicroViasAllowed = m_AllowMicroViaCtrl->GetSelection() == 1; m_BrdSettings->m_MicroViasAllowed = m_AllowMicroViaCtrl->GetSelection() == 1;
// Update microvias minimum values for DRC // Update microvias minimum values for DRC
m_BrdSettings->m_MicroViasMinSize = m_BrdSettings->m_MicroViasMinSize =
ReturnValueFromTextCtrl( *m_SetMicroViasMinSizeCtrl, m_Parent->m_InternalUnits ); ReturnValueFromTextCtrl( *m_SetMicroViasMinSizeCtrl, m_Parent->m_InternalUnits );
m_BrdSettings->m_MicroViasMinDrill = m_BrdSettings->m_MicroViasMinDrill =
ReturnValueFromTextCtrl( *m_SetMicroViasMinDrillCtrl, m_Parent->m_InternalUnits ); ReturnValueFromTextCtrl( *m_SetMicroViasMinDrillCtrl, m_Parent->m_InternalUnits );
// Update tracks minimum values for DRC // Update tracks minimum values for DRC
m_BrdSettings->m_TrackMinWidth = m_BrdSettings->m_TrackMinWidth =
ReturnValueFromTextCtrl( *m_SetTrackMinWidthCtrl, m_Parent->m_InternalUnits ); ReturnValueFromTextCtrl( *m_SetTrackMinWidthCtrl, m_Parent->m_InternalUnits );
} }
/*******************************************************************/ /*******************************************************************/
void DIALOG_DESIGN_RULES::CopyDimensionsListsToBoard( ) void DIALOG_DESIGN_RULES::CopyDimensionsListsToBoard()
/*******************************************************************/ /*******************************************************************/
{ {
wxString msg; wxString msg;
...@@ -568,9 +615,10 @@ void DIALOG_DESIGN_RULES::CopyDimensionsListsToBoard( ) ...@@ -568,9 +615,10 @@ void DIALOG_DESIGN_RULES::CopyDimensionsListsToBoard( )
msg = m_gridTrackWidthList->GetCellValue( row, 0 ); msg = m_gridTrackWidthList->GetCellValue( row, 0 );
if( msg.IsEmpty() ) if( msg.IsEmpty() )
continue; continue;
int value = ReturnValueFromString( g_UserUnit, msg, m_Parent->m_InternalUnits ); int value = ReturnValueFromString( g_UserUnit, msg, m_Parent->m_InternalUnits );
m_TracksWidthList.push_back( value); m_TracksWidthList.push_back( value );
} }
// Sort new list by by increasing value // Sort new list by by increasing value
sort( m_TracksWidthList.begin(), m_TracksWidthList.end() ); sort( m_TracksWidthList.begin(), m_TracksWidthList.end() );
...@@ -581,23 +629,24 @@ void DIALOG_DESIGN_RULES::CopyDimensionsListsToBoard( ) ...@@ -581,23 +629,24 @@ void DIALOG_DESIGN_RULES::CopyDimensionsListsToBoard( )
msg = m_gridViaSizeList->GetCellValue( row, 0 ); msg = m_gridViaSizeList->GetCellValue( row, 0 );
if( msg.IsEmpty() ) if( msg.IsEmpty() )
continue; continue;
int value = ReturnValueFromString( g_UserUnit, msg, m_Parent->m_InternalUnits ); int value = ReturnValueFromString( g_UserUnit, msg, m_Parent->m_InternalUnits );
VIA_DIMENSION via_dim; VIA_DIMENSION via_dim;
via_dim.m_Diameter = value; via_dim.m_Diameter = value;
msg = m_gridViaSizeList->GetCellValue( row, 1 ); msg = m_gridViaSizeList->GetCellValue( row, 1 );
if( ! msg.IsEmpty() ) if( !msg.IsEmpty() )
{ {
value = ReturnValueFromString( g_UserUnit, msg, m_Parent->m_InternalUnits ); value = ReturnValueFromString( g_UserUnit, msg, m_Parent->m_InternalUnits );
via_dim.m_Drill = value; via_dim.m_Drill = value;
} }
m_ViasDimensionsList.push_back( via_dim); m_ViasDimensionsList.push_back( via_dim );
} }
// Sort new list by by increasing value // Sort new list by by increasing value
sort( m_ViasDimensionsList.begin(), m_ViasDimensionsList.end() ); sort( m_ViasDimensionsList.begin(), m_ViasDimensionsList.end() );
std::vector <int>* tlist = &m_Parent->GetBoard()->m_TrackWidthList; std::vector <int>* tlist = &m_Parent->GetBoard()->m_TrackWidthList;
tlist->erase( tlist->begin() + 1, tlist->end() ); // Remove old "custom" sizes tlist->erase( tlist->begin() + 1, tlist->end() ); // Remove old "custom" sizes
tlist->insert( tlist->end(), m_TracksWidthList.begin(), m_TracksWidthList.end() ); //Add new "custom" sizes tlist->insert( tlist->end(), m_TracksWidthList.begin(), m_TracksWidthList.end() ); //Add new "custom" sizes
// Reinitialize m_ViaSizeList // Reinitialize m_ViaSizeList
std::vector <VIA_DIMENSION>* vialist = &m_Parent->GetBoard()->m_ViasDimensionsList; std::vector <VIA_DIMENSION>* vialist = &m_Parent->GetBoard()->m_ViasDimensionsList;
...@@ -636,7 +685,7 @@ void DIALOG_DESIGN_RULES::OnOkButtonClick( wxCommandEvent& event ) ...@@ -636,7 +685,7 @@ void DIALOG_DESIGN_RULES::OnOkButtonClick( wxCommandEvent& event )
CopyRulesListToBoard(); CopyRulesListToBoard();
CopyGlobalRulesToBoard(); CopyGlobalRulesToBoard();
CopyDimensionsListsToBoard( ); CopyDimensionsListsToBoard();
// Save the dialog's position before finishing // Save the dialog's position before finishing
s_LastPos = GetPosition(); s_LastPos = GetPosition();
...@@ -654,13 +703,14 @@ void DIALOG_DESIGN_RULES::OnOkButtonClick( wxCommandEvent& event ) ...@@ -654,13 +703,14 @@ void DIALOG_DESIGN_RULES::OnOkButtonClick( wxCommandEvent& event )
void DIALOG_DESIGN_RULES::OnAddNetclassClick( wxCommandEvent& event ) void DIALOG_DESIGN_RULES::OnAddNetclassClick( wxCommandEvent& event )
/**************************************************************************/ /**************************************************************************/
{ {
wxString class_name; wxString class_name;
wxTextEntryDialog dlg( this, _( "New Net Class Name:" ), wxEmptyString, class_name );
wxTextEntryDialog dlg( this, _( "New Net Class Name:" ), wxEmptyString, class_name );
if( dlg.ShowModal() != wxID_OK ) if( dlg.ShowModal() != wxID_OK )
return; // cancelled by user return; // cancelled by user
class_name = dlg.GetValue( ); class_name = dlg.GetValue();
class_name.Trim( true ); class_name.Trim( true );
class_name.Trim( false ); class_name.Trim( false );
if( class_name.IsEmpty() ) if( class_name.IsEmpty() )
...@@ -695,25 +745,31 @@ void DIALOG_DESIGN_RULES::OnAddNetclassClick( wxCommandEvent& event ) ...@@ -695,25 +745,31 @@ void DIALOG_DESIGN_RULES::OnAddNetclassClick( wxCommandEvent& event )
InitializeRulesSelectionBoxes(); InitializeRulesSelectionBoxes();
} }
// Sort function for wxArrayInt. Items (ints) are sorted by decreasing value // Sort function for wxArrayInt. Items (ints) are sorted by decreasing value
// used in DIALOG_DESIGN_RULES::OnRemoveNetclassClick // used in DIALOG_DESIGN_RULES::OnRemoveNetclassClick
int sort_int(int *first, int *second) int sort_int( int* first, int* second )
{ {
return * second - *first; return *second - *first;
} }
/**************************************************************************/ /**************************************************************************/
void DIALOG_DESIGN_RULES::OnRemoveNetclassClick( wxCommandEvent& event ) void DIALOG_DESIGN_RULES::OnRemoveNetclassClick( wxCommandEvent& event )
/**************************************************************************/ /**************************************************************************/
{ {
wxArrayInt select = m_grid->GetSelectedRows(); wxArrayInt select = m_grid->GetSelectedRows();
// Sort selection by decreasing index order: // Sort selection by decreasing index order:
select.Sort(sort_int); select.Sort( sort_int );
bool reinit = false; bool reinit = false;
// rows labels are not removed when deleting rows: they are not deleted. // rows labels are not removed when deleting rows: they are not deleted.
// So we must store them, remove correponding labels and reinit them // So we must store them, remove correponding labels and reinit them
wxArrayString labels; wxArrayString labels;
for( int ii = 0; ii < m_grid->GetNumberRows(); ii++ ) for( int ii = 0; ii < m_grid->GetNumberRows(); ii++ )
labels.Add(m_grid->GetRowLabelValue(ii)); labels.Add( m_grid->GetRowLabelValue( ii ) );
// Delete rows from last to first (this is the order wxArrayInt select after sorting) ) // Delete rows from last to first (this is the order wxArrayInt select after sorting) )
// This order is Ok when removing rows // This order is Ok when removing rows
for( unsigned ii = 0; ii < select.GetCount(); ii++ ) for( unsigned ii = 0; ii < select.GetCount(); ii++ )
...@@ -723,25 +779,27 @@ void DIALOG_DESIGN_RULES::OnRemoveNetclassClick( wxCommandEvent& event ) ...@@ -723,25 +779,27 @@ void DIALOG_DESIGN_RULES::OnRemoveNetclassClick( wxCommandEvent& event )
{ {
wxString classname = m_grid->GetRowLabelValue( grid_row ); wxString classname = m_grid->GetRowLabelValue( grid_row );
m_grid->DeleteRows( grid_row ); m_grid->DeleteRows( grid_row );
labels.RemoveAt(grid_row); // Remove corresponding row label labels.RemoveAt( grid_row ); // Remove corresponding row label
reinit = true; reinit = true;
// reset the net class to default for members of the removed class // reset the net class to default for members of the removed class
swapNetClass( classname, NETCLASS::Default ); swapNetClass( classname, NETCLASS::Default );
} }
else else
wxMessageBox(_("The defaut Netclass cannot be removed") ); wxMessageBox( _( "The defaut Netclass cannot be removed" ) );
} }
if( reinit ) if( reinit )
{ {
// Reinit labels : // Reinit labels :
for( unsigned ii = 1; ii < labels.GetCount(); ii++ ) for( unsigned ii = 1; ii < labels.GetCount(); ii++ )
m_grid->SetRowLabelValue(ii, labels[ii]); m_grid->SetRowLabelValue( ii, labels[ii] );
InitializeRulesSelectionBoxes(); InitializeRulesSelectionBoxes();
} }
} }
/* /*
* Called on "Move Up" button click * Called on "Move Up" button click
* the selected(s) rules are moved up * the selected(s) rules are moved up
...@@ -754,26 +812,27 @@ void DIALOG_DESIGN_RULES::OnMoveUpSelectedNetClass( wxCommandEvent& event ) ...@@ -754,26 +812,27 @@ void DIALOG_DESIGN_RULES::OnMoveUpSelectedNetClass( wxCommandEvent& event )
return; return;
wxArrayInt select = m_grid->GetSelectedRows(); wxArrayInt select = m_grid->GetSelectedRows();
bool reinit = false; bool reinit = false;
for( unsigned irow = 0; irow < select.GetCount(); irow++ ) for( unsigned irow = 0; irow < select.GetCount(); irow++ )
{ {
int ii = select[irow]; int ii = select[irow];
if( ii < 2 ) // The default netclass *must* be the first netclass if( ii < 2 ) // The default netclass *must* be the first netclass
continue; // so we cannot move up line 0 and 1 continue; // so we cannot move up line 0 and 1
// Swap the rule and the previous rule // Swap the rule and the previous rule
wxString curr_value, previous_value; wxString curr_value, previous_value;
for( int icol = 0; icol < m_grid->GetNumberCols(); icol++ ) for( int icol = 0; icol < m_grid->GetNumberCols(); icol++ )
{ {
reinit = true; reinit = true;
curr_value = m_grid->GetCellValue( ii, icol ); curr_value = m_grid->GetCellValue( ii, icol );
previous_value = m_grid->GetCellValue( ii-1, icol ); previous_value = m_grid->GetCellValue( ii - 1, icol );
m_grid->SetCellValue( ii, icol, previous_value ); m_grid->SetCellValue( ii, icol, previous_value );
m_grid->SetCellValue( ii-1, icol, curr_value ); m_grid->SetCellValue( ii - 1, icol, curr_value );
} }
curr_value = m_grid->GetRowLabelValue( ii );
previous_value = m_grid->GetRowLabelValue( ii-1 ); curr_value = m_grid->GetRowLabelValue( ii );
m_grid->SetRowLabelValue(ii, previous_value ); previous_value = m_grid->GetRowLabelValue( ii - 1 );
m_grid->SetRowLabelValue(ii-1, curr_value ); m_grid->SetRowLabelValue( ii, previous_value );
m_grid->SetRowLabelValue( ii - 1, curr_value );
} }
if( reinit ) if( reinit )
...@@ -819,11 +878,12 @@ void DIALOG_DESIGN_RULES::OnRightCBSelection( wxCommandEvent& event ) ...@@ -819,11 +878,12 @@ void DIALOG_DESIGN_RULES::OnRightCBSelection( wxCommandEvent& event )
} }
void DIALOG_DESIGN_RULES::moveSelectedItems( wxListCtrl* src, const wxString& newClassName ) void DIALOG_DESIGN_RULES::moveSelectedItems( NETS_LIST_CTRL* src, const wxString& newClassName )
{ {
wxListItem item; wxListItem item;
wxString netName; wxString netName;
item.m_mask |= wxLIST_MASK_TEXT ; // Validate the member m_text of the wxListItem item
item.m_mask |= wxLIST_MASK_TEXT; // Validate the member m_text of the wxListItem item
for( int row = 0; row < src->GetItemCount(); ++row ) for( int row = 0; row < src->GetItemCount(); ++row )
{ {
...@@ -851,6 +911,7 @@ void DIALOG_DESIGN_RULES::OnRightToLeftCopyButton( wxCommandEvent& event ) ...@@ -851,6 +911,7 @@ void DIALOG_DESIGN_RULES::OnRightToLeftCopyButton( wxCommandEvent& event )
FillListBoxWithNetNames( m_rightListCtrl, m_rightClassChoice->GetStringSelection() ); FillListBoxWithNetNames( m_rightListCtrl, m_rightClassChoice->GetStringSelection() );
} }
void DIALOG_DESIGN_RULES::OnLeftToRightCopyButton( wxCommandEvent& event ) void DIALOG_DESIGN_RULES::OnLeftToRightCopyButton( wxCommandEvent& event )
{ {
wxString newClassName = m_rightClassChoice->GetStringSelection(); wxString newClassName = m_rightClassChoice->GetStringSelection();
...@@ -904,53 +965,58 @@ bool DIALOG_DESIGN_RULES::TestDataValidity() ...@@ -904,53 +965,58 @@ bool DIALOG_DESIGN_RULES::TestDataValidity()
{ {
bool result = true; bool result = true;
m_MessagesList->SetPage(wxEmptyString); // Clear message list m_MessagesList->SetPage( wxEmptyString ); // Clear message list
wxString msg; wxString msg;
int minViaDia = ReturnValueFromTextCtrl( *m_SetViasMinSizeCtrl, m_Parent->m_InternalUnits ); int minViaDia = ReturnValueFromTextCtrl( *m_SetViasMinSizeCtrl,
int minViaDrill = ReturnValueFromTextCtrl( *m_SetViasMinDrillCtrl, m_Parent->m_InternalUnits ); m_Parent->m_InternalUnits );
int minUViaDia = ReturnValueFromTextCtrl( *m_SetMicroViasMinSizeCtrl, m_Parent->m_InternalUnits ); int minViaDrill = ReturnValueFromTextCtrl( *m_SetViasMinDrillCtrl,
int minUViaDrill = ReturnValueFromTextCtrl( *m_SetMicroViasMinDrillCtrl, m_Parent->m_InternalUnits ); m_Parent->m_InternalUnits );
int minTrackWidth = ReturnValueFromTextCtrl( *m_SetTrackMinWidthCtrl, m_Parent->m_InternalUnits ); int minUViaDia = ReturnValueFromTextCtrl( *m_SetMicroViasMinSizeCtrl,
m_Parent->m_InternalUnits );
int minUViaDrill = ReturnValueFromTextCtrl( *m_SetMicroViasMinDrillCtrl,
m_Parent->m_InternalUnits );
int minTrackWidth = ReturnValueFromTextCtrl( *m_SetTrackMinWidthCtrl,
m_Parent->m_InternalUnits );
for( int row = 0; row < m_grid->GetNumberRows(); row++ ) for( int row = 0; row < m_grid->GetNumberRows(); row++ )
{ {
int tracksize = ReturnValueFromString( g_UserUnit, int tracksize = ReturnValueFromString( g_UserUnit,
m_grid->GetCellValue( row, GRID_TRACKSIZE ), m_grid->GetCellValue( row, GRID_TRACKSIZE ),
m_Parent->m_InternalUnits ); m_Parent->m_InternalUnits );
if( tracksize < minTrackWidth ) if( tracksize < minTrackWidth )
{ {
result = false; result = false;
msg.Printf( _( "%s: <b>Track Size</b> &lt; <b>Min Track Size</b><br>" ), msg.Printf( _( "%s: <b>Track Size</b> &lt; <b>Min Track Size</b><br>" ),
GetChars( m_grid->GetRowLabelValue(row)) ); GetChars( m_grid->GetRowLabelValue( row ) ) );
m_MessagesList->AppendToPage( msg ); m_MessagesList->AppendToPage( msg );
} }
// Test vias // Test vias
int viadia = ReturnValueFromString( g_UserUnit, int viadia = ReturnValueFromString( g_UserUnit,
m_grid->GetCellValue( row, GRID_VIASIZE ), m_grid->GetCellValue( row, GRID_VIASIZE ),
m_Parent->m_InternalUnits ); m_Parent->m_InternalUnits );
if( viadia < minViaDia ) if( viadia < minViaDia )
{ {
result = false; result = false;
msg.Printf( _( "%s: <b>Via Diameter</b> &lt; <b>Minimun Via Diameter</b><br>" ), msg.Printf( _( "%s: <b>Via Diameter</b> &lt; <b>Minimun Via Diameter</b><br>" ),
GetChars( m_grid->GetRowLabelValue(row)) ); GetChars( m_grid->GetRowLabelValue( row ) ) );
m_MessagesList->AppendToPage( msg ); m_MessagesList->AppendToPage( msg );
} }
int viadrill = ReturnValueFromString( g_UserUnit, int viadrill = ReturnValueFromString( g_UserUnit,
m_grid->GetCellValue( row, GRID_VIADRILL ), m_grid->GetCellValue( row, GRID_VIADRILL ),
m_Parent->m_InternalUnits ); m_Parent->m_InternalUnits );
if( viadrill >= viadia ) if( viadrill >= viadia )
{ {
result = false; result = false;
msg.Printf( _( "%s: <b>Via Drill</b> &ge; <b>Via Dia</b><br>" ), msg.Printf( _( "%s: <b>Via Drill</b> &ge; <b>Via Dia</b><br>" ),
GetChars( m_grid->GetRowLabelValue(row)) ); GetChars( m_grid->GetRowLabelValue( row ) ) );
m_MessagesList->AppendToPage( msg ); m_MessagesList->AppendToPage( msg );
} }
...@@ -959,33 +1025,33 @@ bool DIALOG_DESIGN_RULES::TestDataValidity() ...@@ -959,33 +1025,33 @@ bool DIALOG_DESIGN_RULES::TestDataValidity()
{ {
result = false; result = false;
msg.Printf( _( "%s: <b>Via Drill</b> &lt; <b>Min Via Drill</b><br>" ), msg.Printf( _( "%s: <b>Via Drill</b> &lt; <b>Min Via Drill</b><br>" ),
GetChars( m_grid->GetRowLabelValue(row)) ); GetChars( m_grid->GetRowLabelValue( row ) ) );
m_MessagesList->AppendToPage( msg ); m_MessagesList->AppendToPage( msg );
} }
// Test Micro vias // Test Micro vias
int muviadia = ReturnValueFromString( g_UserUnit, int muviadia = ReturnValueFromString( g_UserUnit,
m_grid->GetCellValue( row, GRID_uVIASIZE ), m_grid->GetCellValue( row, GRID_uVIASIZE ),
m_Parent->m_InternalUnits ); m_Parent->m_InternalUnits );
if( muviadia < minUViaDia ) if( muviadia < minUViaDia )
{ {
result = false; result = false;
msg.Printf( _( "%s: <b>MicroVia Diameter</b> &lt; <b>MicroVia Min Diameter</b><br>" ), msg.Printf( _( "%s: <b>MicroVia Diameter</b> &lt; <b>MicroVia Min Diameter</b><br>" ),
GetChars( m_grid->GetRowLabelValue(row)) ); GetChars( m_grid->GetRowLabelValue( row ) ) );
m_MessagesList->AppendToPage( msg ); m_MessagesList->AppendToPage( msg );
} }
int muviadrill = ReturnValueFromString( g_UserUnit, int muviadrill = ReturnValueFromString( g_UserUnit,
m_grid->GetCellValue( row, GRID_uVIADRILL ), m_grid->GetCellValue( row, GRID_uVIADRILL ),
m_Parent->m_InternalUnits ); m_Parent->m_InternalUnits );
if( muviadrill >= muviadia ) if( muviadrill >= muviadia )
{ {
result = false; result = false;
msg.Printf( _( "%s: <b>MicroVia Drill</b> &ge; <b>MicroVia Dia</b><br>" ), msg.Printf( _( "%s: <b>MicroVia Drill</b> &ge; <b>MicroVia Dia</b><br>" ),
GetChars( m_grid->GetRowLabelValue(row)) ); GetChars( m_grid->GetRowLabelValue( row ) ) );
m_MessagesList->AppendToPage( msg ); m_MessagesList->AppendToPage( msg );
} }
...@@ -994,7 +1060,7 @@ bool DIALOG_DESIGN_RULES::TestDataValidity() ...@@ -994,7 +1060,7 @@ bool DIALOG_DESIGN_RULES::TestDataValidity()
{ {
result = false; result = false;
msg.Printf( _( "%s: <b>MicroVia Drill</b> &lt; <b>MicroVia Min Drill</b><br>" ), msg.Printf( _( "%s: <b>MicroVia Drill</b> &lt; <b>MicroVia Min Drill</b><br>" ),
GetChars( m_grid->GetRowLabelValue(row)) ); GetChars( m_grid->GetRowLabelValue( row ) ) );
m_MessagesList->AppendToPage( msg ); m_MessagesList->AppendToPage( msg );
} }
...@@ -1003,18 +1069,18 @@ bool DIALOG_DESIGN_RULES::TestDataValidity() ...@@ -1003,18 +1069,18 @@ bool DIALOG_DESIGN_RULES::TestDataValidity()
// Test list of values for specific vias and tracks // Test list of values for specific vias and tracks
for( int row = 1; row < m_gridTrackWidthList->GetNumberRows(); ++row ) for( int row = 1; row < m_gridTrackWidthList->GetNumberRows(); ++row )
{ {
wxString tvalue = m_gridTrackWidthList->GetCellValue(row, 0); wxString tvalue = m_gridTrackWidthList->GetCellValue( row, 0 );
if( tvalue.IsEmpty() ) if( tvalue.IsEmpty() )
continue; continue;
int tracksize = ReturnValueFromString( g_UserUnit, int tracksize = ReturnValueFromString( g_UserUnit,
tvalue, tvalue,
m_Parent->m_InternalUnits ); m_Parent->m_InternalUnits );
if( tracksize < minTrackWidth ) if( tracksize < minTrackWidth )
{ {
result = false; result = false;
msg.Printf( _( "<b>Extra Track %d Size</b> %s &lt; <b>Min Track Size</b><br>" ), msg.Printf( _( "<b>Extra Track %d Size</b> %s &lt; <b>Min Track Size</b><br>" ),
row+1, GetChars( tvalue ) ); row + 1, GetChars( tvalue ) );
m_MessagesList->AppendToPage( msg ); m_MessagesList->AppendToPage( msg );
} }
...@@ -1022,7 +1088,7 @@ bool DIALOG_DESIGN_RULES::TestDataValidity() ...@@ -1022,7 +1088,7 @@ bool DIALOG_DESIGN_RULES::TestDataValidity()
{ {
result = false; result = false;
msg.Printf( _( "<b>Extra Track %d Size</b> %s &gt; <b>1 inch!</b><br>" ), msg.Printf( _( "<b>Extra Track %d Size</b> %s &gt; <b>1 inch!</b><br>" ),
row+1, GetChars( tvalue ) ); row + 1, GetChars( tvalue ) );
m_MessagesList->AppendToPage( msg ); m_MessagesList->AppendToPage( msg );
} }
...@@ -1030,18 +1096,18 @@ bool DIALOG_DESIGN_RULES::TestDataValidity() ...@@ -1030,18 +1096,18 @@ bool DIALOG_DESIGN_RULES::TestDataValidity()
for( int row = 1; row < m_gridViaSizeList->GetNumberRows(); ++row ) for( int row = 1; row < m_gridViaSizeList->GetNumberRows(); ++row )
{ {
wxString tvalue = m_gridViaSizeList->GetCellValue(row, 0); wxString tvalue = m_gridViaSizeList->GetCellValue( row, 0 );
if( tvalue.IsEmpty() ) if( tvalue.IsEmpty() )
continue; continue;
int viadia = ReturnValueFromString( g_UserUnit, int viadia = ReturnValueFromString( g_UserUnit,
tvalue, tvalue,
m_Parent->m_InternalUnits ); m_Parent->m_InternalUnits );
if( viadia < minViaDia ) if( viadia < minViaDia )
{ {
result = false; result = false;
msg.Printf( _( "<b>Extra Via %d Size</b> %s &lt; <b>Min Via Size</b><br>" ), msg.Printf( _( "<b>Extra Via %d Size</b> %s &lt; <b>Min Via Size</b><br>" ),
row+1, GetChars( tvalue ) ); row + 1, GetChars( tvalue ) );
m_MessagesList->AppendToPage( msg ); m_MessagesList->AppendToPage( msg );
} }
...@@ -1049,7 +1115,7 @@ bool DIALOG_DESIGN_RULES::TestDataValidity() ...@@ -1049,7 +1115,7 @@ bool DIALOG_DESIGN_RULES::TestDataValidity()
{ {
result = false; result = false;
msg.Printf( _( "<b>Extra Via %d Size</b>%s &gt; <b>1 inch!</b><br>" ), msg.Printf( _( "<b>Extra Via %d Size</b>%s &gt; <b>1 inch!</b><br>" ),
row+1, GetChars( tvalue ) ); row + 1, GetChars( tvalue ) );
m_MessagesList->AppendToPage( msg ); m_MessagesList->AppendToPage( msg );
} }
...@@ -1057,4 +1123,3 @@ bool DIALOG_DESIGN_RULES::TestDataValidity() ...@@ -1057,4 +1123,3 @@ bool DIALOG_DESIGN_RULES::TestDataValidity()
return result; return result;
} }
...@@ -76,7 +76,7 @@ private: ...@@ -76,7 +76,7 @@ private:
void CopyGlobalRulesToBoard(); void CopyGlobalRulesToBoard();
void CopyDimensionsListsToBoard( ); void CopyDimensionsListsToBoard( );
void SetRoutableLayerStatus(); void SetRoutableLayerStatus();
void FillListBoxWithNetNames( wxListCtrl* aListCtrl, const wxString& aNetClass ); void FillListBoxWithNetNames( NETS_LIST_CTRL* aListCtrl, const wxString& aNetClass );
void PrintCurrentSettings( ); void PrintCurrentSettings( );
/** /**
...@@ -96,9 +96,7 @@ private: ...@@ -96,9 +96,7 @@ private:
void setNetClass( const wxString& aNetName, const wxString& aClassName ); void setNetClass( const wxString& aNetName, const wxString& aClassName );
static void setRowItem( wxListCtrl* aListCtrl, int aRow, NETCUP* aNetAndClass ); void moveSelectedItems( NETS_LIST_CTRL* src, const wxString& newClassName );
void moveSelectedItems( wxListCtrl* src, const wxString& newClassName );
public: public:
......
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_DESIGN_RULES
///////////////////////////////////////////////////////////////////////////////
#ifndef __dialog_design_rules_aux_helper_class_h_
#define __dialog_design_rules_aux_helper_class_h_
#include <wx/listctrl.h>
/* helper class to display lists of nets and associated netclasses
* used in dialog design rules.
* It s needed because the 2 wxListCtlr used to display lists of nets
* use the wxLC_VIRTUAL option.
* The virtual wxString OnGetItemText(long item, long column) const method
* must be overlaid.
*/
class NETS_LIST_CTRL: public wxListCtrl
{
private:
wxArrayString m_Netnames; ///< an array to store the list of nets (column 0)
wxArrayString m_Classnames; ///< an array to store the list of netclasse (column 1)
public:
NETS_LIST_CTRL(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxLC_ICON):
wxListCtrl( parent, id, pos, size, style )
{
};
NETS_LIST_CTRL()
{
};
void setRowItems(unsigned aRow, const wxString & aNetname, const wxString & aNetclassName );
void ClearList()
{
SetItemCount(0);
m_Netnames.Clear();
m_Classnames.Clear();
}
virtual wxString OnGetItemText(long item, long column) const;
};
#endif //__dialog_design_rules_aux_helper_class_h_
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008) // C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#include "dialog_design_rules_base.h" #include "dialog_design_rules_aux_helper_class.h"
/////////////////////////////////////////////////////////////////////////// #include "dialog_design_rules_base.h"
DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) ///////////////////////////////////////////////////////////////////////////
{
this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize ); DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
wxBoxSizer* bMainSizer; this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
bMainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bMainSizer;
m_DRnotebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_TOP ); bMainSizer = new wxBoxSizer( wxVERTICAL );
m_panelNetClassesEditor = new wxPanel( m_DRnotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
wxBoxSizer* bpanelNetClassesSizer; m_DRnotebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_TOP );
bpanelNetClassesSizer = new wxBoxSizer( wxVERTICAL ); m_panelNetClassesEditor = new wxPanel( m_DRnotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
wxBoxSizer* bpanelNetClassesSizer;
wxStaticBoxSizer* sbSizer1; bpanelNetClassesSizer = new wxBoxSizer( wxVERTICAL );
sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( m_panelNetClassesEditor, wxID_ANY, _("Net Classes:") ), wxVERTICAL );
wxStaticBoxSizer* sbSizer1;
m_grid = new wxGrid( m_panelNetClassesEditor, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxSIMPLE_BORDER|wxVSCROLL ); sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( m_panelNetClassesEditor, wxID_ANY, _("Net Classes:") ), wxVERTICAL );
// Grid m_grid = new wxGrid( m_panelNetClassesEditor, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxSIMPLE_BORDER|wxVSCROLL );
m_grid->CreateGrid( 1, 6 );
m_grid->EnableEditing( true ); // Grid
m_grid->EnableGridLines( true ); m_grid->CreateGrid( 1, 6 );
m_grid->EnableDragGridSize( false ); m_grid->EnableEditing( true );
m_grid->SetMargins( 0, 0 ); m_grid->EnableGridLines( true );
m_grid->EnableDragGridSize( false );
// Columns m_grid->SetMargins( 0, 0 );
m_grid->SetColSize( 0, 100 );
m_grid->SetColSize( 1, 120 ); // Columns
m_grid->SetColSize( 2, 84 ); m_grid->SetColSize( 0, 100 );
m_grid->SetColSize( 3, 85 ); m_grid->SetColSize( 1, 120 );
m_grid->SetColSize( 4, 81 ); m_grid->SetColSize( 2, 84 );
m_grid->SetColSize( 5, 90 ); m_grid->SetColSize( 3, 85 );
m_grid->EnableDragColMove( false ); m_grid->SetColSize( 4, 81 );
m_grid->EnableDragColSize( true ); m_grid->SetColSize( 5, 90 );
m_grid->SetColLabelSize( 40 ); m_grid->EnableDragColMove( false );
m_grid->SetColLabelValue( 0, _("Clearance") ); m_grid->EnableDragColSize( true );
m_grid->SetColLabelValue( 1, _("Track Width") ); m_grid->SetColLabelSize( 40 );
m_grid->SetColLabelValue( 2, _("Via Dia") ); m_grid->SetColLabelValue( 0, _("Clearance") );
m_grid->SetColLabelValue( 3, _("Via Drill") ); m_grid->SetColLabelValue( 1, _("Track Width") );
m_grid->SetColLabelValue( 4, _("uVia Dia") ); m_grid->SetColLabelValue( 2, _("Via Dia") );
m_grid->SetColLabelValue( 5, _("uVia Drill") ); m_grid->SetColLabelValue( 3, _("Via Drill") );
m_grid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); m_grid->SetColLabelValue( 4, _("uVia Dia") );
m_grid->SetColLabelValue( 5, _("uVia Drill") );
// Rows m_grid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
m_grid->AutoSizeRows();
m_grid->EnableDragRowSize( true ); // Rows
m_grid->SetRowLabelSize( 120 ); m_grid->AutoSizeRows();
m_grid->SetRowLabelValue( 0, _("Default") ); m_grid->EnableDragRowSize( true );
m_grid->SetRowLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); m_grid->SetRowLabelSize( 120 );
m_grid->SetRowLabelValue( 0, _("Default") );
// Label Appearance m_grid->SetRowLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTRE );
// Cell Defaults // Label Appearance
m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
m_grid->SetToolTip( _("Net Class parameters") ); // Cell Defaults
m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
sbSizer1->Add( m_grid, 1, wxEXPAND, 5 ); m_grid->SetToolTip( _("Net Class parameters") );
wxBoxSizer* buttonBoxSizer; sbSizer1->Add( m_grid, 1, wxEXPAND, 5 );
buttonBoxSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* buttonBoxSizer;
m_addButton = new wxButton( m_panelNetClassesEditor, wxID_ADD_NETCLASS, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); buttonBoxSizer = new wxBoxSizer( wxHORIZONTAL );
m_addButton->SetToolTip( _("Add another Net Class") );
m_addButton = new wxButton( m_panelNetClassesEditor, wxID_ADD_NETCLASS, _("Add"), wxDefaultPosition, wxDefaultSize, 0 );
buttonBoxSizer->Add( m_addButton, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); m_addButton->SetToolTip( _("Add another Net Class") );
m_removeButton = new wxButton( m_panelNetClassesEditor, wxID_REMOVE_NETCLASS, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); buttonBoxSizer->Add( m_addButton, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 );
m_removeButton->SetToolTip( _("Remove the currently select Net Class\nThe default Net Class cannot be removed") );
m_removeButton = new wxButton( m_panelNetClassesEditor, wxID_REMOVE_NETCLASS, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 );
buttonBoxSizer->Add( m_removeButton, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); m_removeButton->SetToolTip( _("Remove the currently select Net Class\nThe default Net Class cannot be removed") );
m_moveUpButton = new wxButton( m_panelNetClassesEditor, wxID_ANY, _("Move Up"), wxDefaultPosition, wxDefaultSize, 0 ); buttonBoxSizer->Add( m_removeButton, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 );
m_moveUpButton->SetToolTip( _("Move the currently selected Net Class up one row") );
m_moveUpButton = new wxButton( m_panelNetClassesEditor, wxID_ANY, _("Move Up"), wxDefaultPosition, wxDefaultSize, 0 );
buttonBoxSizer->Add( m_moveUpButton, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_moveUpButton->SetToolTip( _("Move the currently selected Net Class up one row") );
sbSizer1->Add( buttonBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); buttonBoxSizer->Add( m_moveUpButton, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
bpanelNetClassesSizer->Add( sbSizer1, 1, wxRIGHT|wxLEFT|wxEXPAND, 5 ); sbSizer1->Add( buttonBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 );
wxStaticBoxSizer* sbSizer4; bpanelNetClassesSizer->Add( sbSizer1, 1, wxRIGHT|wxLEFT|wxEXPAND, 5 );
sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( m_panelNetClassesEditor, wxID_ANY, _("Membership:") ), wxHORIZONTAL );
wxStaticBoxSizer* sbSizer4;
wxBoxSizer* leftNetSelectBoxSizer; sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( m_panelNetClassesEditor, wxID_ANY, _("Membership:") ), wxHORIZONTAL );
leftNetSelectBoxSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* leftNetSelectBoxSizer;
wxArrayString m_leftClassChoiceChoices; leftNetSelectBoxSizer = new wxBoxSizer( wxVERTICAL );
m_leftClassChoice = new wxChoice( m_panelNetClassesEditor, ID_LEFT_CHOICE_CLICK, wxDefaultPosition, wxDefaultSize, m_leftClassChoiceChoices, 0 );
m_leftClassChoice->SetSelection( 0 ); wxArrayString m_leftClassChoiceChoices;
leftNetSelectBoxSizer->Add( m_leftClassChoice, 0, wxEXPAND, 5 ); m_leftClassChoice = new wxChoice( m_panelNetClassesEditor, ID_LEFT_CHOICE_CLICK, wxDefaultPosition, wxDefaultSize, m_leftClassChoiceChoices, 0 );
m_leftClassChoice->SetSelection( 0 );
m_leftListCtrl = new wxListCtrl( m_panelNetClassesEditor, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES|wxSUNKEN_BORDER ); leftNetSelectBoxSizer->Add( m_leftClassChoice, 0, wxEXPAND, 5 );
m_leftListCtrl->SetMinSize( wxSize( 220,200 ) );
m_leftListCtrl = new NETS_LIST_CTRL( m_panelNetClassesEditor, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VIRTUAL|wxLC_VRULES|wxSUNKEN_BORDER );
leftNetSelectBoxSizer->Add( m_leftListCtrl, 1, wxEXPAND|wxTOP, 5 ); m_leftListCtrl->SetMinSize( wxSize( 220,200 ) );
sbSizer4->Add( leftNetSelectBoxSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); leftNetSelectBoxSizer->Add( m_leftListCtrl, 1, wxEXPAND|wxTOP, 5 );
wxBoxSizer* bmiddleSizerNetSelect; sbSizer4->Add( leftNetSelectBoxSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
bmiddleSizerNetSelect = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bmiddleSizerNetSelect;
m_buttonRightToLeft = new wxButton( m_panelNetClassesEditor, ID_LEFT_TO_RIGHT_COPY, _("<<<"), wxDefaultPosition, wxDefaultSize, 0 ); bmiddleSizerNetSelect = new wxBoxSizer( wxVERTICAL );
m_buttonRightToLeft->SetToolTip( _("Move the selected nets in the right list to the left list") );
m_buttonRightToLeft = new wxButton( m_panelNetClassesEditor, ID_LEFT_TO_RIGHT_COPY, _("<<<"), wxDefaultPosition, wxDefaultSize, 0 );
bmiddleSizerNetSelect->Add( m_buttonRightToLeft, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_buttonRightToLeft->SetToolTip( _("Move the selected nets in the right list to the left list") );
m_buttonLeftToRight = new wxButton( m_panelNetClassesEditor, ID_RIGHT_TO_LEFT_COPY, _(">>>"), wxDefaultPosition, wxDefaultSize, 0 ); bmiddleSizerNetSelect->Add( m_buttonRightToLeft, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_buttonLeftToRight->SetToolTip( _("Move the selected nets in the left list to the right list") );
m_buttonLeftToRight = new wxButton( m_panelNetClassesEditor, ID_RIGHT_TO_LEFT_COPY, _(">>>"), wxDefaultPosition, wxDefaultSize, 0 );
bmiddleSizerNetSelect->Add( m_buttonLeftToRight, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_buttonLeftToRight->SetToolTip( _("Move the selected nets in the left list to the right list") );
m_buttonLeftSelAll = new wxButton( m_panelNetClassesEditor, wxID_ANY, _("<< Select All"), wxDefaultPosition, wxDefaultSize, 0 ); bmiddleSizerNetSelect->Add( m_buttonLeftToRight, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_buttonLeftSelAll->SetToolTip( _("Select all nets in the left list") );
m_buttonLeftSelAll = new wxButton( m_panelNetClassesEditor, wxID_ANY, _("<< Select All"), wxDefaultPosition, wxDefaultSize, 0 );
bmiddleSizerNetSelect->Add( m_buttonLeftSelAll, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_buttonLeftSelAll->SetToolTip( _("Select all nets in the left list") );
m_buttonRightSelAll = new wxButton( m_panelNetClassesEditor, wxID_ANY, _("Select All >>"), wxDefaultPosition, wxDefaultSize, 0 ); bmiddleSizerNetSelect->Add( m_buttonLeftSelAll, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_buttonRightSelAll->SetToolTip( _("Select all nets in the right list") );
m_buttonRightSelAll = new wxButton( m_panelNetClassesEditor, wxID_ANY, _("Select All >>"), wxDefaultPosition, wxDefaultSize, 0 );
bmiddleSizerNetSelect->Add( m_buttonRightSelAll, 0, wxALIGN_BOTTOM|wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_buttonRightSelAll->SetToolTip( _("Select all nets in the right list") );
sbSizer4->Add( bmiddleSizerNetSelect, 0, wxALIGN_CENTER_VERTICAL, 5 ); bmiddleSizerNetSelect->Add( m_buttonRightSelAll, 0, wxALIGN_BOTTOM|wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
wxBoxSizer* rghtNetSelectBoxSizer; sbSizer4->Add( bmiddleSizerNetSelect, 0, wxALIGN_CENTER_VERTICAL, 5 );
rghtNetSelectBoxSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* rghtNetSelectBoxSizer;
wxArrayString m_rightClassChoiceChoices; rghtNetSelectBoxSizer = new wxBoxSizer( wxVERTICAL );
m_rightClassChoice = new wxChoice( m_panelNetClassesEditor, ID_RIGHT_CHOICE_CLICK, wxDefaultPosition, wxDefaultSize, m_rightClassChoiceChoices, 0 );
m_rightClassChoice->SetSelection( 0 ); wxArrayString m_rightClassChoiceChoices;
rghtNetSelectBoxSizer->Add( m_rightClassChoice, 0, wxEXPAND, 5 ); m_rightClassChoice = new wxChoice( m_panelNetClassesEditor, ID_RIGHT_CHOICE_CLICK, wxDefaultPosition, wxDefaultSize, m_rightClassChoiceChoices, 0 );
m_rightClassChoice->SetSelection( 0 );
m_rightListCtrl = new wxListCtrl( m_panelNetClassesEditor, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES|wxSUNKEN_BORDER ); rghtNetSelectBoxSizer->Add( m_rightClassChoice, 0, wxEXPAND, 5 );
m_rightListCtrl->SetMinSize( wxSize( 220,-1 ) );
m_rightListCtrl = new NETS_LIST_CTRL( m_panelNetClassesEditor, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VIRTUAL|wxLC_VRULES|wxSUNKEN_BORDER );
rghtNetSelectBoxSizer->Add( m_rightListCtrl, 1, wxEXPAND|wxTOP, 5 ); m_rightListCtrl->SetMinSize( wxSize( 220,-1 ) );
sbSizer4->Add( rghtNetSelectBoxSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); rghtNetSelectBoxSizer->Add( m_rightListCtrl, 1, wxEXPAND|wxTOP, 5 );
bpanelNetClassesSizer->Add( sbSizer4, 2, wxEXPAND|wxRIGHT|wxLEFT, 5 ); sbSizer4->Add( rghtNetSelectBoxSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_panelNetClassesEditor->SetSizer( bpanelNetClassesSizer ); bpanelNetClassesSizer->Add( sbSizer4, 2, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_panelNetClassesEditor->Layout();
bpanelNetClassesSizer->Fit( m_panelNetClassesEditor ); m_panelNetClassesEditor->SetSizer( bpanelNetClassesSizer );
m_DRnotebook->AddPage( m_panelNetClassesEditor, _("Net Classes Editor"), true ); m_panelNetClassesEditor->Layout();
m_panelGolbalDesignRules = new wxPanel( m_DRnotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); bpanelNetClassesSizer->Fit( m_panelNetClassesEditor );
wxBoxSizer* bpanelGlobRulesSizer; m_DRnotebook->AddPage( m_panelNetClassesEditor, _("Net Classes Editor"), true );
bpanelGlobRulesSizer = new wxBoxSizer( wxVERTICAL ); m_panelGolbalDesignRules = new wxPanel( m_DRnotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
wxBoxSizer* bpanelGlobRulesSizer;
wxBoxSizer* bDesignRulesUpperSizer; bpanelGlobRulesSizer = new wxBoxSizer( wxVERTICAL );
bDesignRulesUpperSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bDesignRulesUpperSizer;
wxStaticBoxSizer* sbViasOptionSizer; bDesignRulesUpperSizer = new wxBoxSizer( wxHORIZONTAL );
sbViasOptionSizer = new wxStaticBoxSizer( new wxStaticBox( m_panelGolbalDesignRules, wxID_ANY, _("Via Options:") ), wxVERTICAL );
wxStaticBoxSizer* sbViasOptionSizer;
wxString m_OptViaTypeChoices[] = { _("Through via"), _("Blind or buried via") }; sbViasOptionSizer = new wxStaticBoxSizer( new wxStaticBox( m_panelGolbalDesignRules, wxID_ANY, _("Via Options:") ), wxVERTICAL );
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 ); wxString m_OptViaTypeChoices[] = { _("Through via"), _("Blind or buried via") };
m_OptViaType->SetSelection( 0 ); int m_OptViaTypeNChoices = sizeof( m_OptViaTypeChoices ) / sizeof( wxString );
m_OptViaType->SetToolTip( _("Select the current via type.\nTrough via is the usual selection") ); 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 );
sbViasOptionSizer->Add( m_OptViaType, 0, wxALL|wxEXPAND, 5 ); m_OptViaType->SetToolTip( _("Select the current via type.\nTrough via is the usual selection") );
wxFlexGridSizer* fgViasMinValuesSizer; sbViasOptionSizer->Add( m_OptViaType, 0, wxALL|wxEXPAND, 5 );
fgViasMinValuesSizer = new wxFlexGridSizer( 1, 2, 0, 0 );
fgViasMinValuesSizer->AddGrowableCol( 1 ); wxFlexGridSizer* fgViasMinValuesSizer;
fgViasMinValuesSizer->SetFlexibleDirection( wxBOTH ); fgViasMinValuesSizer = new wxFlexGridSizer( 1, 2, 0, 0 );
fgViasMinValuesSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); fgViasMinValuesSizer->AddGrowableCol( 1 );
fgViasMinValuesSizer->SetFlexibleDirection( wxBOTH );
m_ViaMinTitle = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Min via diameter"), wxDefaultPosition, wxDefaultSize, 0 ); fgViasMinValuesSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_ViaMinTitle->Wrap( -1 );
fgViasMinValuesSizer->Add( m_ViaMinTitle, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); m_ViaMinTitle = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Min via diameter"), wxDefaultPosition, wxDefaultSize, 0 );
m_ViaMinTitle->Wrap( -1 );
m_SetViasMinSizeCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); fgViasMinValuesSizer->Add( m_ViaMinTitle, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
fgViasMinValuesSizer->Add( m_SetViasMinSizeCtrl, 0, wxEXPAND|wxALL, 5 );
m_SetViasMinSizeCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_ViaMinDrillTitle = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Min via drill dia"), wxDefaultPosition, wxDefaultSize, 0 ); fgViasMinValuesSizer->Add( m_SetViasMinSizeCtrl, 0, wxEXPAND|wxALL, 5 );
m_ViaMinDrillTitle->Wrap( -1 );
fgViasMinValuesSizer->Add( m_ViaMinDrillTitle, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_RIGHT, 5 ); m_ViaMinDrillTitle = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Min via drill dia"), wxDefaultPosition, wxDefaultSize, 0 );
m_ViaMinDrillTitle->Wrap( -1 );
m_SetViasMinDrillCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); fgViasMinValuesSizer->Add( m_ViaMinDrillTitle, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_RIGHT, 5 );
fgViasMinValuesSizer->Add( m_SetViasMinDrillCtrl, 0, wxALL|wxEXPAND, 5 );
m_SetViasMinDrillCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbViasOptionSizer->Add( fgViasMinValuesSizer, 0, wxEXPAND, 5 ); fgViasMinValuesSizer->Add( m_SetViasMinDrillCtrl, 0, wxALL|wxEXPAND, 5 );
bDesignRulesUpperSizer->Add( sbViasOptionSizer, 1, wxALIGN_CENTER_VERTICAL, 5 ); sbViasOptionSizer->Add( fgViasMinValuesSizer, 0, wxEXPAND, 5 );
wxStaticBoxSizer* sbuViasSizer; bDesignRulesUpperSizer->Add( sbViasOptionSizer, 1, wxALIGN_CENTER_VERTICAL, 5 );
sbuViasSizer = new wxStaticBoxSizer( new wxStaticBox( m_panelGolbalDesignRules, wxID_ANY, _("Micro Via Options:") ), wxVERTICAL );
wxStaticBoxSizer* sbuViasSizer;
wxString m_AllowMicroViaCtrlChoices[] = { _("Do not allow micro vias"), _("Allow micro vias") }; sbuViasSizer = new wxStaticBoxSizer( new wxStaticBox( m_panelGolbalDesignRules, wxID_ANY, _("Micro Via Options:") ), wxVERTICAL );
int m_AllowMicroViaCtrlNChoices = sizeof( m_AllowMicroViaCtrlChoices ) / sizeof( wxString );
m_AllowMicroViaCtrl = new wxRadioBox( m_panelGolbalDesignRules, wxID_ANY, _("Micro Vias:"), wxDefaultPosition, wxDefaultSize, m_AllowMicroViaCtrlNChoices, m_AllowMicroViaCtrlChoices, 1, wxRA_SPECIFY_COLS ); wxString m_AllowMicroViaCtrlChoices[] = { _("Do not allow micro vias"), _("Allow micro vias") };
m_AllowMicroViaCtrl->SetSelection( 0 ); int m_AllowMicroViaCtrlNChoices = sizeof( m_AllowMicroViaCtrlChoices ) / sizeof( wxString );
m_AllowMicroViaCtrl->SetToolTip( _("Allows or do not allow use of micro vias\nThey are very small vias only from an external copper layer to its near neightbour") ); m_AllowMicroViaCtrl = new wxRadioBox( m_panelGolbalDesignRules, wxID_ANY, _("Micro Vias:"), wxDefaultPosition, wxDefaultSize, m_AllowMicroViaCtrlNChoices, m_AllowMicroViaCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_AllowMicroViaCtrl->SetSelection( 0 );
sbuViasSizer->Add( m_AllowMicroViaCtrl, 0, wxALL|wxEXPAND, 5 ); m_AllowMicroViaCtrl->SetToolTip( _("Allows or do not allow use of micro vias\nThey are very small vias only from an external copper layer to its near neightbour") );
wxFlexGridSizer* fgMinMicroviasValuesSizer; sbuViasSizer->Add( m_AllowMicroViaCtrl, 0, wxALL|wxEXPAND, 5 );
fgMinMicroviasValuesSizer = new wxFlexGridSizer( 1, 2, 0, 0 );
fgMinMicroviasValuesSizer->AddGrowableCol( 1 ); wxFlexGridSizer* fgMinMicroviasValuesSizer;
fgMinMicroviasValuesSizer->SetFlexibleDirection( wxBOTH ); fgMinMicroviasValuesSizer = new wxFlexGridSizer( 1, 2, 0, 0 );
fgMinMicroviasValuesSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); fgMinMicroviasValuesSizer->AddGrowableCol( 1 );
fgMinMicroviasValuesSizer->SetFlexibleDirection( wxBOTH );
m_MicroViaMinSizeTitle = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Min uvia diameter"), wxDefaultPosition, wxDefaultSize, 0 ); fgMinMicroviasValuesSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_MicroViaMinSizeTitle->Wrap( -1 );
fgMinMicroviasValuesSizer->Add( m_MicroViaMinSizeTitle, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); m_MicroViaMinSizeTitle = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Min uvia diameter"), wxDefaultPosition, wxDefaultSize, 0 );
m_MicroViaMinSizeTitle->Wrap( -1 );
m_SetMicroViasMinSizeCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); fgMinMicroviasValuesSizer->Add( m_MicroViaMinSizeTitle, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_SetMicroViasMinSizeCtrl->SetMaxLength( 6 );
fgMinMicroviasValuesSizer->Add( m_SetMicroViasMinSizeCtrl, 0, wxALL|wxEXPAND, 5 ); m_SetMicroViasMinSizeCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_SetMicroViasMinSizeCtrl->SetMaxLength( 6 );
m_MicroViaMinDrillTitle = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Min uvia drill dia"), wxDefaultPosition, wxDefaultSize, 0 ); fgMinMicroviasValuesSizer->Add( m_SetMicroViasMinSizeCtrl, 0, wxALL|wxEXPAND, 5 );
m_MicroViaMinDrillTitle->Wrap( -1 );
fgMinMicroviasValuesSizer->Add( m_MicroViaMinDrillTitle, 0, wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT, 5 ); m_MicroViaMinDrillTitle = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Min uvia drill dia"), wxDefaultPosition, wxDefaultSize, 0 );
m_MicroViaMinDrillTitle->Wrap( -1 );
m_SetMicroViasMinDrillCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); fgMinMicroviasValuesSizer->Add( m_MicroViaMinDrillTitle, 0, wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_SetMicroViasMinDrillCtrl->SetMaxLength( 6 );
fgMinMicroviasValuesSizer->Add( m_SetMicroViasMinDrillCtrl, 0, wxALL|wxEXPAND, 5 ); m_SetMicroViasMinDrillCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_SetMicroViasMinDrillCtrl->SetMaxLength( 6 );
sbuViasSizer->Add( fgMinMicroviasValuesSizer, 1, wxEXPAND, 5 ); fgMinMicroviasValuesSizer->Add( m_SetMicroViasMinDrillCtrl, 0, wxALL|wxEXPAND, 5 );
bDesignRulesUpperSizer->Add( sbuViasSizer, 1, wxALIGN_CENTER_VERTICAL, 5 ); sbuViasSizer->Add( fgMinMicroviasValuesSizer, 1, wxEXPAND, 5 );
wxStaticBoxSizer* sbMinSizesSizer; bDesignRulesUpperSizer->Add( sbuViasSizer, 1, wxALIGN_CENTER_VERTICAL, 5 );
sbMinSizesSizer = new wxStaticBoxSizer( new wxStaticBox( m_panelGolbalDesignRules, wxID_ANY, _("Minimum Allowed Values:") ), wxVERTICAL );
wxStaticBoxSizer* sbMinSizesSizer;
wxFlexGridSizer* fgMinValuesSizer; sbMinSizesSizer = new wxStaticBoxSizer( new wxStaticBox( m_panelGolbalDesignRules, wxID_ANY, _("Minimum Allowed Values:") ), wxVERTICAL );
fgMinValuesSizer = new wxFlexGridSizer( 1, 2, 0, 0 );
fgMinValuesSizer->AddGrowableCol( 1 ); wxFlexGridSizer* fgMinValuesSizer;
fgMinValuesSizer->SetFlexibleDirection( wxBOTH ); fgMinValuesSizer = new wxFlexGridSizer( 1, 2, 0, 0 );
fgMinValuesSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); fgMinValuesSizer->AddGrowableCol( 1 );
fgMinValuesSizer->SetFlexibleDirection( wxBOTH );
m_TrackMinWidthTitle = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Min track width"), wxDefaultPosition, wxDefaultSize, 0 ); fgMinValuesSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_TrackMinWidthTitle->Wrap( -1 );
fgMinValuesSizer->Add( m_TrackMinWidthTitle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT, 5 ); m_TrackMinWidthTitle = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Min track width"), wxDefaultPosition, wxDefaultSize, 0 );
m_TrackMinWidthTitle->Wrap( -1 );
m_SetTrackMinWidthCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); fgMinValuesSizer->Add( m_TrackMinWidthTitle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT, 5 );
fgMinValuesSizer->Add( m_SetTrackMinWidthCtrl, 0, wxALL|wxEXPAND, 5 );
m_SetTrackMinWidthCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbMinSizesSizer->Add( fgMinValuesSizer, 0, 0, 5 ); fgMinValuesSizer->Add( m_SetTrackMinWidthCtrl, 0, wxALL|wxEXPAND, 5 );
bDesignRulesUpperSizer->Add( sbMinSizesSizer, 1, wxEXPAND, 5 ); sbMinSizesSizer->Add( fgMinValuesSizer, 0, 0, 5 );
bpanelGlobRulesSizer->Add( bDesignRulesUpperSizer, 0, wxEXPAND, 5 ); bDesignRulesUpperSizer->Add( sbMinSizesSizer, 1, wxEXPAND, 5 );
m_staticline1 = new wxStaticLine( m_panelGolbalDesignRules, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); bpanelGlobRulesSizer->Add( bDesignRulesUpperSizer, 0, wxEXPAND, 5 );
bpanelGlobRulesSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
m_staticline1 = new wxStaticLine( m_panelGolbalDesignRules, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
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 ); bpanelGlobRulesSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
m_staticTextInfo->Wrap( -1 );
bpanelGlobRulesSizer->Add( m_staticTextInfo, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 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->Wrap( -1 );
wxBoxSizer* bDesignRulesLowerSizer; bpanelGlobRulesSizer->Add( m_staticTextInfo, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
bDesignRulesLowerSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bDesignRulesLowerSizer;
wxStaticBoxSizer* sViaSizeBox; bDesignRulesLowerSizer = new wxBoxSizer( wxHORIZONTAL );
sViaSizeBox = new wxStaticBoxSizer( new wxStaticBox( m_panelGolbalDesignRules, wxID_ANY, _("Custom Via Sizes:") ), wxVERTICAL );
wxStaticBoxSizer* sViaSizeBox;
m_staticText7 = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Drill value: a blank or 0 => default Netclass value"), wxDefaultPosition, wxDefaultSize, 0 ); sViaSizeBox = new wxStaticBoxSizer( new wxStaticBox( m_panelGolbalDesignRules, wxID_ANY, _("Custom Via Sizes:") ), wxVERTICAL );
m_staticText7->Wrap( -1 );
sViaSizeBox->Add( m_staticText7, 0, wxALL, 5 ); m_staticText7 = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Drill value: a blank or 0 => default Netclass value"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText7->Wrap( -1 );
m_gridViaSizeList = new wxGrid( m_panelGolbalDesignRules, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); sViaSizeBox->Add( m_staticText7, 0, wxALL, 5 );
// Grid m_gridViaSizeList = new wxGrid( m_panelGolbalDesignRules, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_gridViaSizeList->CreateGrid( 7, 2 );
m_gridViaSizeList->EnableEditing( true ); // Grid
m_gridViaSizeList->EnableGridLines( true ); m_gridViaSizeList->CreateGrid( 7, 2 );
m_gridViaSizeList->EnableDragGridSize( false ); m_gridViaSizeList->EnableEditing( true );
m_gridViaSizeList->SetMargins( 0, 0 ); m_gridViaSizeList->EnableGridLines( true );
m_gridViaSizeList->EnableDragGridSize( false );
// Columns m_gridViaSizeList->SetMargins( 0, 0 );
m_gridViaSizeList->EnableDragColMove( false );
m_gridViaSizeList->EnableDragColSize( true ); // Columns
m_gridViaSizeList->SetColLabelSize( 30 ); m_gridViaSizeList->EnableDragColMove( false );
m_gridViaSizeList->SetColLabelValue( 0, _("Diameter") ); m_gridViaSizeList->EnableDragColSize( true );
m_gridViaSizeList->SetColLabelValue( 1, _("Drill") ); m_gridViaSizeList->SetColLabelSize( 30 );
m_gridViaSizeList->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); m_gridViaSizeList->SetColLabelValue( 0, _("Diameter") );
m_gridViaSizeList->SetColLabelValue( 1, _("Drill") );
// Rows m_gridViaSizeList->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
m_gridViaSizeList->EnableDragRowSize( true );
m_gridViaSizeList->SetRowLabelSize( 80 ); // Rows
m_gridViaSizeList->SetRowLabelValue( 0, _("Via 1") ); m_gridViaSizeList->EnableDragRowSize( true );
m_gridViaSizeList->SetRowLabelValue( 1, _("Via 2") ); m_gridViaSizeList->SetRowLabelSize( 80 );
m_gridViaSizeList->SetRowLabelValue( 2, _("Via 3") ); m_gridViaSizeList->SetRowLabelValue( 0, _("Via 1") );
m_gridViaSizeList->SetRowLabelValue( 3, _("Via 4") ); m_gridViaSizeList->SetRowLabelValue( 1, _("Via 2") );
m_gridViaSizeList->SetRowLabelValue( 4, _("Via 5") ); m_gridViaSizeList->SetRowLabelValue( 2, _("Via 3") );
m_gridViaSizeList->SetRowLabelValue( 5, _("Via 6") ); m_gridViaSizeList->SetRowLabelValue( 3, _("Via 4") );
m_gridViaSizeList->SetRowLabelValue( 6, _("Via 7") ); m_gridViaSizeList->SetRowLabelValue( 4, _("Via 5") );
m_gridViaSizeList->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); m_gridViaSizeList->SetRowLabelValue( 5, _("Via 6") );
m_gridViaSizeList->SetRowLabelValue( 6, _("Via 7") );
// Label Appearance m_gridViaSizeList->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Cell Defaults // Label Appearance
m_gridViaSizeList->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
sViaSizeBox->Add( m_gridViaSizeList, 0, wxALL, 5 ); // Cell Defaults
m_gridViaSizeList->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
bDesignRulesLowerSizer->Add( sViaSizeBox, 1, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5 ); sViaSizeBox->Add( m_gridViaSizeList, 0, wxALL, 5 );
wxStaticBoxSizer* sbTracksListSizer; bDesignRulesLowerSizer->Add( sViaSizeBox, 1, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5 );
sbTracksListSizer = new wxStaticBoxSizer( new wxStaticBox( m_panelGolbalDesignRules, wxID_ANY, _("Custom Track Widths:") ), wxVERTICAL );
wxStaticBoxSizer* sbTracksListSizer;
m_staticText8 = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); sbTracksListSizer = new wxStaticBoxSizer( new wxStaticBox( m_panelGolbalDesignRules, wxID_ANY, _("Custom Track Widths:") ), wxVERTICAL );
m_staticText8->Wrap( -1 );
sbTracksListSizer->Add( m_staticText8, 0, wxALL, 5 ); m_staticText8 = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_staticText8->Wrap( -1 );
m_gridTrackWidthList = new wxGrid( m_panelGolbalDesignRules, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); sbTracksListSizer->Add( m_staticText8, 0, wxALL, 5 );
// Grid m_gridTrackWidthList = new wxGrid( m_panelGolbalDesignRules, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_gridTrackWidthList->CreateGrid( 7, 1 );
m_gridTrackWidthList->EnableEditing( true ); // Grid
m_gridTrackWidthList->EnableGridLines( true ); m_gridTrackWidthList->CreateGrid( 7, 1 );
m_gridTrackWidthList->EnableDragGridSize( false ); m_gridTrackWidthList->EnableEditing( true );
m_gridTrackWidthList->SetMargins( 0, 0 ); m_gridTrackWidthList->EnableGridLines( true );
m_gridTrackWidthList->EnableDragGridSize( false );
// Columns m_gridTrackWidthList->SetMargins( 0, 0 );
m_gridTrackWidthList->EnableDragColMove( false );
m_gridTrackWidthList->EnableDragColSize( true ); // Columns
m_gridTrackWidthList->SetColLabelSize( 30 ); m_gridTrackWidthList->EnableDragColMove( false );
m_gridTrackWidthList->SetColLabelValue( 0, _("Width") ); m_gridTrackWidthList->EnableDragColSize( true );
m_gridTrackWidthList->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); m_gridTrackWidthList->SetColLabelSize( 30 );
m_gridTrackWidthList->SetColLabelValue( 0, _("Width") );
// Rows m_gridTrackWidthList->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
m_gridTrackWidthList->EnableDragRowSize( true );
m_gridTrackWidthList->SetRowLabelSize( 80 ); // Rows
m_gridTrackWidthList->SetRowLabelValue( 0, _("Track 1") ); m_gridTrackWidthList->EnableDragRowSize( true );
m_gridTrackWidthList->SetRowLabelValue( 1, _("Track 2") ); m_gridTrackWidthList->SetRowLabelSize( 80 );
m_gridTrackWidthList->SetRowLabelValue( 2, _("Track 3") ); m_gridTrackWidthList->SetRowLabelValue( 0, _("Track 1") );
m_gridTrackWidthList->SetRowLabelValue( 3, _("Track 4") ); m_gridTrackWidthList->SetRowLabelValue( 1, _("Track 2") );
m_gridTrackWidthList->SetRowLabelValue( 4, _("Track 5") ); m_gridTrackWidthList->SetRowLabelValue( 2, _("Track 3") );
m_gridTrackWidthList->SetRowLabelValue( 5, _("Track 6") ); m_gridTrackWidthList->SetRowLabelValue( 3, _("Track 4") );
m_gridTrackWidthList->SetRowLabelValue( 6, _("Track 7") ); m_gridTrackWidthList->SetRowLabelValue( 4, _("Track 5") );
m_gridTrackWidthList->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); m_gridTrackWidthList->SetRowLabelValue( 5, _("Track 6") );
m_gridTrackWidthList->SetRowLabelValue( 6, _("Track 7") );
// Label Appearance m_gridTrackWidthList->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Cell Defaults // Label Appearance
m_gridTrackWidthList->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
sbTracksListSizer->Add( m_gridTrackWidthList, 0, wxALL, 5 ); // Cell Defaults
m_gridTrackWidthList->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
bDesignRulesLowerSizer->Add( sbTracksListSizer, 1, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5 ); sbTracksListSizer->Add( m_gridTrackWidthList, 0, wxALL, 5 );
bpanelGlobRulesSizer->Add( bDesignRulesLowerSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); bDesignRulesLowerSizer->Add( sbTracksListSizer, 1, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5 );
m_panelGolbalDesignRules->SetSizer( bpanelGlobRulesSizer ); bpanelGlobRulesSizer->Add( bDesignRulesLowerSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
m_panelGolbalDesignRules->Layout();
bpanelGlobRulesSizer->Fit( m_panelGolbalDesignRules ); m_panelGolbalDesignRules->SetSizer( bpanelGlobRulesSizer );
m_DRnotebook->AddPage( m_panelGolbalDesignRules, _("Global Design Rules"), false ); m_panelGolbalDesignRules->Layout();
bpanelGlobRulesSizer->Fit( m_panelGolbalDesignRules );
bMainSizer->Add( m_DRnotebook, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); m_DRnotebook->AddPage( m_panelGolbalDesignRules, _("Global Design Rules"), false );
wxStaticBoxSizer* sbSizer2; bMainSizer->Add( m_DRnotebook, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Messages:") ), wxHORIZONTAL );
wxStaticBoxSizer* sbSizer2;
m_MessagesList = new wxHtmlWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO|wxSUNKEN_BORDER ); sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Messages:") ), wxHORIZONTAL );
m_MessagesList->SetMinSize( wxSize( -1,90 ) );
m_MessagesList = new wxHtmlWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO|wxSUNKEN_BORDER );
sbSizer2->Add( m_MessagesList, 1, wxEXPAND, 5 ); m_MessagesList->SetMinSize( wxSize( -1,90 ) );
wxBoxSizer* bSizerButtons; sbSizer2->Add( m_MessagesList, 1, wxEXPAND, 5 );
bSizerButtons = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerButtons;
m_buttonOk = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerButtons = new wxBoxSizer( wxVERTICAL );
m_buttonOk->SetDefault();
bSizerButtons->Add( m_buttonOk, 0, wxALL|wxEXPAND, 5 ); m_buttonOk = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonOk->SetDefault();
m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerButtons->Add( m_buttonOk, 0, wxALL|wxEXPAND, 5 );
bSizerButtons->Add( m_buttonCancel, 0, wxALL|wxEXPAND, 5 );
m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer2->Add( bSizerButtons, 0, 0, 5 ); bSizerButtons->Add( m_buttonCancel, 0, wxALL|wxEXPAND, 5 );
bMainSizer->Add( sbSizer2, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); sbSizer2->Add( bSizerButtons, 0, 0, 5 );
this->SetSizer( bMainSizer ); bMainSizer->Add( sbSizer2, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
this->Layout();
this->SetSizer( bMainSizer );
// Connect Events this->Layout();
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 ); // Connect Events
m_addButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnAddNetclassClick ), NULL, this ); m_grid->Connect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesNameLeftClick ), NULL, this );
m_removeButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRemoveNetclassClick ), NULL, this ); m_grid->Connect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesNameRightClick ), NULL, this );
m_moveUpButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnMoveUpSelectedNetClass ), NULL, this ); m_addButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnAddNetclassClick ), NULL, this );
m_leftClassChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftCBSelection ), NULL, this ); m_removeButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRemoveNetclassClick ), NULL, this );
m_buttonRightToLeft->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightToLeftCopyButton ), NULL, this ); m_moveUpButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnMoveUpSelectedNetClass ), NULL, this );
m_buttonLeftToRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftToRightCopyButton ), NULL, this ); m_leftClassChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftCBSelection ), NULL, this );
m_buttonLeftSelAll->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftSelectAllButton ), NULL, this ); m_buttonRightToLeft->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightToLeftCopyButton ), NULL, this );
m_buttonRightSelAll->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightSelectAllButton ), NULL, this ); m_buttonLeftToRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftToRightCopyButton ), NULL, this );
m_rightClassChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightCBSelection ), NULL, this ); m_buttonLeftSelAll->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftSelectAllButton ), NULL, this );
m_buttonOk->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnOkButtonClick ), NULL, this ); m_buttonRightSelAll->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightSelectAllButton ), NULL, this );
m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnCancelButtonClick ), NULL, this ); m_rightClassChoice->Connect( wxEVT_COMMAND_CHOICE_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 DIALOG_DESIGN_RULES_BASE::~DIALOG_DESIGN_RULES_BASE()
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 ); // Disconnect Events
m_addButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnAddNetclassClick ), NULL, this ); m_grid->Disconnect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesNameLeftClick ), NULL, this );
m_removeButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRemoveNetclassClick ), NULL, this ); m_grid->Disconnect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesNameRightClick ), NULL, this );
m_moveUpButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnMoveUpSelectedNetClass ), NULL, this ); m_addButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnAddNetclassClick ), NULL, this );
m_leftClassChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftCBSelection ), NULL, this ); m_removeButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRemoveNetclassClick ), NULL, this );
m_buttonRightToLeft->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightToLeftCopyButton ), NULL, this ); m_moveUpButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnMoveUpSelectedNetClass ), NULL, this );
m_buttonLeftToRight->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftToRightCopyButton ), NULL, this ); m_leftClassChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftCBSelection ), NULL, this );
m_buttonLeftSelAll->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftSelectAllButton ), NULL, this ); m_buttonRightToLeft->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightToLeftCopyButton ), NULL, this );
m_buttonRightSelAll->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightSelectAllButton ), NULL, this ); m_buttonLeftToRight->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftToRightCopyButton ), NULL, this );
m_rightClassChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightCBSelection ), NULL, this ); m_buttonLeftSelAll->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftSelectAllButton ), NULL, this );
m_buttonOk->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnOkButtonClick ), NULL, this ); m_buttonRightSelAll->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightSelectAllButton ), NULL, this );
m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnCancelButtonClick ), NULL, this ); m_rightClassChoice->Disconnect( wxEVT_COMMAND_CHOICE_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 );
}
This source diff could not be displayed because it is too large. You can view the blob instead.
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008) // C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_design_rules_base__ #ifndef __dialog_design_rules_base__
#define __dialog_design_rules_base__ #define __dialog_design_rules_base__
#include <wx/intl.h> #include <wx/intl.h>
#include <wx/colour.h> class NETS_LIST_CTRL;
#include <wx/settings.h>
#include <wx/string.h> #include <wx/colour.h>
#include <wx/font.h> #include <wx/settings.h>
#include <wx/grid.h> #include <wx/string.h>
#include <wx/gdicmn.h> #include <wx/font.h>
#include <wx/button.h> #include <wx/grid.h>
#include <wx/sizer.h> #include <wx/gdicmn.h>
#include <wx/statbox.h> #include <wx/button.h>
#include <wx/choice.h> #include <wx/sizer.h>
#include <wx/listctrl.h> #include <wx/statbox.h>
#include <wx/panel.h> #include <wx/choice.h>
#include <wx/bitmap.h> #include <wx/listctrl.h>
#include <wx/image.h> #include <wx/panel.h>
#include <wx/icon.h> #include <wx/bitmap.h>
#include <wx/radiobox.h> #include <wx/image.h>
#include <wx/stattext.h> #include <wx/icon.h>
#include <wx/textctrl.h> #include <wx/radiobox.h>
#include <wx/statline.h> #include <wx/stattext.h>
#include <wx/notebook.h> #include <wx/textctrl.h>
#include <wx/html/htmlwin.h> #include <wx/statline.h>
#include <wx/dialog.h> #include <wx/notebook.h>
#include <wx/html/htmlwin.h>
/////////////////////////////////////////////////////////////////////////// #include <wx/dialog.h>
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
/// Class DIALOG_DESIGN_RULES_BASE
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
class DIALOG_DESIGN_RULES_BASE : public wxDialog /// Class DIALOG_DESIGN_RULES_BASE
{ ///////////////////////////////////////////////////////////////////////////////
private: class DIALOG_DESIGN_RULES_BASE : public wxDialog
{
protected: private:
enum
{ protected:
wxID_ADD_NETCLASS = 1000, enum
wxID_REMOVE_NETCLASS, {
ID_LEFT_CHOICE_CLICK, wxID_ADD_NETCLASS = 1000,
ID_LEFT_TO_RIGHT_COPY, wxID_REMOVE_NETCLASS,
ID_RIGHT_TO_LEFT_COPY, ID_LEFT_CHOICE_CLICK,
ID_RIGHT_CHOICE_CLICK, ID_LEFT_TO_RIGHT_COPY,
}; ID_RIGHT_TO_LEFT_COPY,
ID_RIGHT_CHOICE_CLICK,
wxNotebook* m_DRnotebook; };
wxPanel* m_panelNetClassesEditor;
wxGrid* m_grid; wxNotebook* m_DRnotebook;
wxButton* m_addButton; wxPanel* m_panelNetClassesEditor;
wxButton* m_removeButton; wxGrid* m_grid;
wxButton* m_moveUpButton; wxButton* m_addButton;
wxChoice* m_leftClassChoice; wxButton* m_removeButton;
wxListCtrl* m_leftListCtrl; wxButton* m_moveUpButton;
wxButton* m_buttonRightToLeft; wxChoice* m_leftClassChoice;
wxButton* m_buttonLeftToRight; NETS_LIST_CTRL* m_leftListCtrl;
wxButton* m_buttonLeftSelAll; wxButton* m_buttonRightToLeft;
wxButton* m_buttonRightSelAll; wxButton* m_buttonLeftToRight;
wxChoice* m_rightClassChoice; wxButton* m_buttonLeftSelAll;
wxListCtrl* m_rightListCtrl; wxButton* m_buttonRightSelAll;
wxPanel* m_panelGolbalDesignRules; wxChoice* m_rightClassChoice;
wxRadioBox* m_OptViaType; NETS_LIST_CTRL* m_rightListCtrl;
wxStaticText* m_ViaMinTitle; wxPanel* m_panelGolbalDesignRules;
wxTextCtrl* m_SetViasMinSizeCtrl; wxRadioBox* m_OptViaType;
wxStaticText* m_ViaMinDrillTitle; wxStaticText* m_ViaMinTitle;
wxTextCtrl* m_SetViasMinDrillCtrl; wxTextCtrl* m_SetViasMinSizeCtrl;
wxRadioBox* m_AllowMicroViaCtrl; wxStaticText* m_ViaMinDrillTitle;
wxStaticText* m_MicroViaMinSizeTitle; wxTextCtrl* m_SetViasMinDrillCtrl;
wxTextCtrl* m_SetMicroViasMinSizeCtrl; wxRadioBox* m_AllowMicroViaCtrl;
wxStaticText* m_MicroViaMinDrillTitle; wxStaticText* m_MicroViaMinSizeTitle;
wxTextCtrl* m_SetMicroViasMinDrillCtrl; wxTextCtrl* m_SetMicroViasMinSizeCtrl;
wxStaticText* m_TrackMinWidthTitle; wxStaticText* m_MicroViaMinDrillTitle;
wxTextCtrl* m_SetTrackMinWidthCtrl; wxTextCtrl* m_SetMicroViasMinDrillCtrl;
wxStaticLine* m_staticline1; wxStaticText* m_TrackMinWidthTitle;
wxStaticText* m_staticTextInfo; wxTextCtrl* m_SetTrackMinWidthCtrl;
wxStaticText* m_staticText7; wxStaticLine* m_staticline1;
wxGrid* m_gridViaSizeList; wxStaticText* m_staticTextInfo;
wxStaticText* m_staticText8; wxStaticText* m_staticText7;
wxGrid* m_gridTrackWidthList; wxGrid* m_gridViaSizeList;
wxHtmlWindow* m_MessagesList; wxStaticText* m_staticText8;
wxButton* m_buttonOk; wxGrid* m_gridTrackWidthList;
wxButton* m_buttonCancel; wxHtmlWindow* m_MessagesList;
wxButton* m_buttonOk;
// Virtual event handlers, overide them in your derived class wxButton* m_buttonCancel;
virtual void OnNetClassesNameLeftClick( wxGridEvent& event ){ event.Skip(); }
virtual void OnNetClassesNameRightClick( wxGridEvent& event ){ event.Skip(); } // Virtual event handlers, overide them in your derived class
virtual void OnAddNetclassClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnNetClassesNameLeftClick( wxGridEvent& event ){ event.Skip(); }
virtual void OnRemoveNetclassClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnNetClassesNameRightClick( wxGridEvent& event ){ event.Skip(); }
virtual void OnMoveUpSelectedNetClass( wxCommandEvent& event ){ event.Skip(); } virtual void OnAddNetclassClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnLeftCBSelection( wxCommandEvent& event ){ event.Skip(); } virtual void OnRemoveNetclassClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnRightToLeftCopyButton( wxCommandEvent& event ){ event.Skip(); } virtual void OnMoveUpSelectedNetClass( wxCommandEvent& event ){ event.Skip(); }
virtual void OnLeftToRightCopyButton( wxCommandEvent& event ){ event.Skip(); } virtual void OnLeftCBSelection( wxCommandEvent& event ){ event.Skip(); }
virtual void OnLeftSelectAllButton( wxCommandEvent& event ){ event.Skip(); } virtual void OnRightToLeftCopyButton( wxCommandEvent& event ){ event.Skip(); }
virtual void OnRightSelectAllButton( wxCommandEvent& event ){ event.Skip(); } virtual void OnLeftToRightCopyButton( wxCommandEvent& event ){ event.Skip(); }
virtual void OnRightCBSelection( wxCommandEvent& event ){ event.Skip(); } virtual void OnLeftSelectAllButton( wxCommandEvent& event ){ event.Skip(); }
virtual void OnOkButtonClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnRightSelectAllButton( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelButtonClick( 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,640 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_DESIGN_RULES_BASE(); 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,640 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
}; ~DIALOG_DESIGN_RULES_BASE();
#endif //__dialog_design_rules_base__ };
#endif //__dialog_design_rules_base__
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment