Commit 997270d8 authored by charras's avatar charras

First work about net classes. This is a work in progress and a moving target

parent e7c9ae2b
...@@ -8,7 +8,7 @@ email address. ...@@ -8,7 +8,7 @@ email address.
================================================================================ ================================================================================
++pcbnew ++pcbnew
First work about net classes. This is a work in progress and a moving target. First work about net classes. This is a work in progress and a moving target.
Manual routing and DRC do not used yet this feature Manual routing and DRC do not use yet this feature
2009-Jul-13 UPDATE Dick Hollenbeck <dick@softplc.com> 2009-Jul-13 UPDATE Dick Hollenbeck <dick@softplc.com>
......
...@@ -23,11 +23,11 @@ ...@@ -23,11 +23,11 @@
#define LAYERS_GRID_NAME_POSITION 2 #define LAYERS_GRID_NAME_POSITION 2
// Fields Positions on rules grid // Fields Positions on rules grid
#define RULE_GRID_TRACKSIZE_POSITION 0 #define RULE_GRID_TRACKSIZE_POSITION 0
#define RULE_GRID_VIASIZE_POSITION 1 #define RULE_GRID_VIASIZE_POSITION 1
#define RULE_GRID_CLEARANCE_POSITION 2 #define RULE_GRID_CLEARANCE_POSITION 2
#define RULE_GRID_MINTRACKSIZE_POSITION 3 #define RULE_GRID_MINTRACKSIZE_POSITION 3
#define RULE_GRID_MINVIASIZE_POSITION 4 #define RULE_GRID_MINVIASIZE_POSITION 4
/***********************************************************************************/ /***********************************************************************************/
DIALOG_DESIGN_RULES::DIALOG_DESIGN_RULES( WinEDA_PcbFrame* parent ) : DIALOG_DESIGN_RULES::DIALOG_DESIGN_RULES( WinEDA_PcbFrame* parent ) :
...@@ -48,11 +48,11 @@ void DIALOG_DESIGN_RULES::Init() ...@@ -48,11 +48,11 @@ void DIALOG_DESIGN_RULES::Init()
/********************************************************************/ /********************************************************************/
{ {
SetFocus(); SetFocus();
SetReturnCode( 0 );
// Initialize the layers grid: // Initialize the layers grid:
m_ActivesLayersCount = g_DesignSettings.m_CopperLayerCount; m_ActivesLayersCount = g_DesignSettings.m_CopperLayerCount;
m_Pcb = m_Parent->GetBoard(); m_Pcb = m_Parent->GetBoard();
m_Changes = 0;
m_LayersCountSelection->SetSelection( m_ActivesLayersCount / 2 ); m_LayersCountSelection->SetSelection( m_ActivesLayersCount / 2 );
...@@ -100,67 +100,74 @@ void DIALOG_DESIGN_RULES::Init() ...@@ -100,67 +100,74 @@ void DIALOG_DESIGN_RULES::Init()
InitRulesList(); InitRulesList();
/* Initialize the list of nets buffers /* Initialize the list of nets buffers
(note the netcode 0 is not a real net, so it is not loaded) * (note the netcode 0 is not a real net, so it is not loaded)
*/ */
for ( unsigned ii = 1; ; ii ++ ) for( unsigned ii = 1; ; ii++ )
{ {
NETINFO_ITEM* net = m_Pcb->FindNet( ii ); NETINFO_ITEM* net = m_Pcb->FindNet( ii );
if( net == NULL ) if( net == NULL )
break; break;
m_StockNets.push_back(net); m_StockNets.push_back( net );
// search the index in rules list for this net // search the index in rules list for this net
int rules_idx = 0; int rules_idx = 0;
for (int jj = 0; jj < m_gridNetClassesProperties->GetNumberRows(); jj++ ) for( int jj = 0; jj < m_gridNetClassesProperties->GetNumberRows(); jj++ )
{ {
if( m_gridNetClassesProperties->GetRowLabelValue(jj).CmpNoCase(net->GetClassName()) == 0 ) if( m_gridNetClassesProperties->GetRowLabelValue( jj ).CmpNoCase( net->GetClassName() )
== 0 )
{ {
rules_idx = jj; rules_idx = jj;
break; break;
} }
} }
m_NetsLinkToClasses.push_back(rules_idx); // All nets are set to default net class
m_NetsLinkToClasses.push_back( rules_idx ); // All nets are set to default net class
} }
InitializeRulesSelectionBoxes(); InitializeRulesSelectionBoxes();
} }
/** Function FillListBoxWithNetsNames /** Function FillListBoxWithNetsNames
* populates the aListBox with net names members of the aNetclassIndex net class * populates the aListBox with net names members of the aNetclassIndex net class
* the "Client Data pointer" is used to store the index of nets in ne nets lists * the "Client Data pointer" is used to store the index of nets in ne nets lists
*/ */
void DIALOG_DESIGN_RULES::FillListBoxWithNetsNames(wxListBox* aListBox, int aNetclassIndex) void DIALOG_DESIGN_RULES::FillListBoxWithNetsNames( wxListBox* aListBox, int aNetclassIndex )
{ {
aListBox->Clear(); aListBox->Clear();
unsigned idx = 0; unsigned idx = 0;
for(unsigned ii = 0; ii < m_StockNets.size(); ii++ ) for( unsigned ii = 0; ii < m_StockNets.size(); ii++ )
{ {
if (aNetclassIndex == m_NetsLinkToClasses[ii] ) if( aNetclassIndex == m_NetsLinkToClasses[ii] )
{ {
aListBox->Append( m_StockNets[ii]->GetNetname() ); aListBox->Append( m_StockNets[ii]->GetNetname() );
// Store the index of this net // Store the index of this net
aListBox->SetClientData(idx, (void *) ii); aListBox->SetClientData( idx, (void*) ii );
idx++; idx++;
} }
} }
} }
/* Initialize the combno boxes by the list of existing net classes /* Initialize the combno boxes by the list of existing net classes
*/ */
void DIALOG_DESIGN_RULES::InitializeRulesSelectionBoxes() void DIALOG_DESIGN_RULES::InitializeRulesSelectionBoxes()
{ {
m_CBoxRightSelection->Clear(); m_CBoxRightSelection->Clear();
m_CBoxLeftSelection->Clear(); m_CBoxLeftSelection->Clear();
for (int ii = 0; ii < m_gridNetClassesProperties->GetNumberRows(); ii++ ) for( int ii = 0; ii < m_gridNetClassesProperties->GetNumberRows(); ii++ )
{ {
m_CBoxRightSelection->Append(m_gridNetClassesProperties->GetRowLabelValue(ii)); m_CBoxRightSelection->Append( m_gridNetClassesProperties->GetRowLabelValue( ii ) );
m_CBoxLeftSelection->Append(m_gridNetClassesProperties->GetRowLabelValue(ii)); m_CBoxLeftSelection->Append( m_gridNetClassesProperties->GetRowLabelValue( ii ) );
} }
m_CBoxRightSelection->Select(0);
m_CBoxLeftSelection->Select(0); m_CBoxRightSelection->Select( 0 );
m_buttonRightToLeft->Enable(false); m_CBoxLeftSelection->Select( 0 );
m_buttonLeftToRight->Enable(false);; m_buttonRightToLeft->Enable( false );
FillListBoxWithNetsNames(m_listBoxLeftNetSelect, m_CBoxLeftSelection->GetCurrentSelection() ); m_buttonLeftToRight->Enable( false );;
FillListBoxWithNetsNames(m_listBoxRightNetSelect, m_CBoxRightSelection->GetCurrentSelection() ); FillListBoxWithNetsNames( m_listBoxLeftNetSelect, m_CBoxLeftSelection->GetCurrentSelection() );
FillListBoxWithNetsNames( m_listBoxRightNetSelect, m_CBoxRightSelection->GetCurrentSelection() );
} }
...@@ -179,97 +186,111 @@ void DIALOG_DESIGN_RULES::SetRoutableLayerStatus() ...@@ -179,97 +186,111 @@ void DIALOG_DESIGN_RULES::SetRoutableLayerStatus()
value = wxT( "1" ); value = wxT( "1" );
m_gridLayersProperties->SetCellValue( ii, LAYERS_GRID_ROUTABLE_POSITION, value ); m_gridLayersProperties->SetCellValue( ii, LAYERS_GRID_ROUTABLE_POSITION, value );
m_gridLayersProperties->SetReadOnly( ii, LAYERS_GRID_ROUTABLE_POSITION ); m_gridLayersProperties->SetReadOnly( ii, LAYERS_GRID_ROUTABLE_POSITION );
// Set to Read Only cell for non existing copper layers: // Set to Read Only cell for non existing copper layers:
m_gridLayersProperties->SetReadOnly( ii, LAYERS_GRID_STATUS_POSITION, value != wxT( "1" ) ); m_gridLayersProperties->SetReadOnly( ii, LAYERS_GRID_STATUS_POSITION, value != wxT( "1" ) );
m_gridLayersProperties->SetReadOnly( ii, LAYERS_GRID_NAME_POSITION, value != wxT( "1" ) ); m_gridLayersProperties->SetReadOnly( ii, LAYERS_GRID_NAME_POSITION, value != wxT( "1" ) );
} }
} }
/* Initialize the rules list from board /* Initialize the rules list from board
*/ */
void DIALOG_DESIGN_RULES::InitRulesList() void DIALOG_DESIGN_RULES::InitRulesList()
{ {
for( int ii = 0; ; ii++ ) for( int ii = 0; ; ii++ )
{ {
const NETCLASS * netclass = m_Pcb->m_NetClassesList.GetNetClass(ii); const NETCLASS* netclass = m_Pcb->m_NetClassesList.GetNetClass( ii );
if ( netclass == NULL ) if( netclass == NULL )
break; break;
// Creates one entry if needed // Creates one entry if needed
if (ii >= m_gridNetClassesProperties->GetNumberRows() ) if( ii >= m_gridNetClassesProperties->GetNumberRows() )
m_gridNetClassesProperties->AppendRows( ); m_gridNetClassesProperties->AppendRows();
// Init name // Init name
m_gridNetClassesProperties->SetRowLabelValue(ii, netclass->m_Name); m_gridNetClassesProperties->SetRowLabelValue( ii, netclass->m_Name );
// Init data // Init data
wxString msg; wxString msg;
msg = ReturnStringFromValue( g_UnitMetric, msg = ReturnStringFromValue( g_UnitMetric,
netclass->m_NetParams.m_TracksWidth, netclass->m_NetParams.m_TracksWidth,
m_Parent->m_InternalUnits, false ); m_Parent->m_InternalUnits, false );
m_gridNetClassesProperties->SetCellValue(ii, RULE_GRID_TRACKSIZE_POSITION, msg); m_gridNetClassesProperties->SetCellValue( ii, RULE_GRID_TRACKSIZE_POSITION, msg );
msg = ReturnStringFromValue( g_UnitMetric, msg = ReturnStringFromValue( g_UnitMetric,
netclass->m_NetParams.m_ViasSize, netclass->m_NetParams.m_ViasSize,
m_Parent->m_InternalUnits, false ); m_Parent->m_InternalUnits, false );
m_gridNetClassesProperties->SetCellValue(ii, RULE_GRID_VIASIZE_POSITION, msg); m_gridNetClassesProperties->SetCellValue( ii, RULE_GRID_VIASIZE_POSITION, msg );
msg = ReturnStringFromValue( g_UnitMetric, msg = ReturnStringFromValue( g_UnitMetric,
netclass->m_NetParams.m_Clearance, netclass->m_NetParams.m_Clearance,
m_Parent->m_InternalUnits, false ); m_Parent->m_InternalUnits, false );
m_gridNetClassesProperties->SetCellValue(ii, RULE_GRID_CLEARANCE_POSITION, msg); m_gridNetClassesProperties->SetCellValue( ii, RULE_GRID_CLEARANCE_POSITION, msg );
msg = ReturnStringFromValue( g_UnitMetric, msg = ReturnStringFromValue( g_UnitMetric,
netclass->m_NetParams.m_TracksMinWidth, netclass->m_NetParams.m_TracksMinWidth,
m_Parent->m_InternalUnits, false ); m_Parent->m_InternalUnits, false );
m_gridNetClassesProperties->SetCellValue(ii, RULE_GRID_MINTRACKSIZE_POSITION, msg); m_gridNetClassesProperties->SetCellValue( ii, RULE_GRID_MINTRACKSIZE_POSITION, msg );
msg = ReturnStringFromValue( g_UnitMetric, msg = ReturnStringFromValue( g_UnitMetric,
netclass->m_NetParams.m_ViasMinSize, netclass->m_NetParams.m_ViasMinSize,
m_Parent->m_InternalUnits, false ); m_Parent->m_InternalUnits, false );
m_gridNetClassesProperties->SetCellValue(ii, RULE_GRID_MINVIASIZE_POSITION, msg); m_gridNetClassesProperties->SetCellValue( ii, RULE_GRID_MINVIASIZE_POSITION, msg );
} }
} }
/* Copy the rules list to board /* Copy the rules list to board
*/ */
void DIALOG_DESIGN_RULES::CopyRulesListToBoard() void DIALOG_DESIGN_RULES::CopyRulesListToBoard()
{ {
m_Pcb->m_NetClassesList.ClearList(); m_Pcb->m_NetClassesList.ClearList();
for( int ii = 0; ii < m_gridNetClassesProperties->GetNumberRows(); ii++ ) for( int ii = 0; ii < m_gridNetClassesProperties->GetNumberRows(); ii++ )
{ {
NETCLASS * netclass = new NETCLASS(m_Pcb, NETCLASS* netclass = new NETCLASS( m_Pcb,
m_gridNetClassesProperties->GetRowLabelValue(ii) ); m_gridNetClassesProperties->GetRowLabelValue( ii ) );
m_Pcb->m_NetClassesList.AddNetclass(netclass); m_Pcb->m_NetClassesList.AddNetclass( netclass );
// Init data // Init data
netclass->m_NetParams.m_TracksWidth = netclass->m_NetParams.m_TracksWidth =
ReturnValueFromString( g_UnitMetric, ReturnValueFromString( g_UnitMetric,
m_gridNetClassesProperties->GetCellValue(ii, RULE_GRID_TRACKSIZE_POSITION), m_gridNetClassesProperties->GetCellValue( ii,
m_Parent->m_InternalUnits ); RULE_GRID_TRACKSIZE_POSITION ),
m_Parent->m_InternalUnits );
netclass->m_NetParams.m_ViasSize = netclass->m_NetParams.m_ViasSize =
ReturnValueFromString( g_UnitMetric, ReturnValueFromString( g_UnitMetric,
m_gridNetClassesProperties->GetCellValue(ii, RULE_GRID_VIASIZE_POSITION), m_gridNetClassesProperties->GetCellValue( ii,
m_Parent->m_InternalUnits ); RULE_GRID_VIASIZE_POSITION ),
m_Parent->m_InternalUnits );
netclass->m_NetParams.m_Clearance = netclass->m_NetParams.m_Clearance =
ReturnValueFromString( g_UnitMetric, ReturnValueFromString( g_UnitMetric,
m_gridNetClassesProperties->GetCellValue(ii, RULE_GRID_CLEARANCE_POSITION), m_gridNetClassesProperties->GetCellValue( ii,
m_Parent->m_InternalUnits ); RULE_GRID_CLEARANCE_POSITION ),
m_Parent->m_InternalUnits );
netclass->m_NetParams.m_TracksMinWidth = netclass->m_NetParams.m_TracksMinWidth =
ReturnValueFromString( g_UnitMetric, ReturnValueFromString( g_UnitMetric,
m_gridNetClassesProperties->GetCellValue(ii, RULE_GRID_MINTRACKSIZE_POSITION), m_gridNetClassesProperties->GetCellValue( ii,
m_Parent->m_InternalUnits ); RULE_GRID_MINTRACKSIZE_POSITION ),
m_Parent->m_InternalUnits );
netclass->m_NetParams.m_ViasMinSize = netclass->m_NetParams.m_ViasMinSize =
ReturnValueFromString( g_UnitMetric, ReturnValueFromString( g_UnitMetric,
m_gridNetClassesProperties->GetCellValue(ii, RULE_GRID_MINVIASIZE_POSITION), m_gridNetClassesProperties->GetCellValue( ii,
m_Parent->m_InternalUnits ); RULE_GRID_MINVIASIZE_POSITION ),
m_Parent->m_InternalUnits );
// Copy the list of nets associated to this netclass: // Copy the list of nets associated to this netclass:
for(unsigned idx = 0; idx < m_StockNets.size(); idx++ ) for( unsigned idx = 0; idx < m_StockNets.size(); idx++ )
{ {
if( m_NetsLinkToClasses[idx] == ii ) if( m_NetsLinkToClasses[idx] == ii )
netclass->AddMember(m_StockNets[idx]->GetNetname()); netclass->AddMember( m_StockNets[idx]->GetNetname() );
} }
} }
m_Pcb->TransfertDesignRulesToNets( ); m_Pcb->TransfertDesignRulesToNets();
} }
/*****************************************************************/ /*****************************************************************/
void DIALOG_DESIGN_RULES::OnCancelButtonClick( wxCommandEvent& event ) void DIALOG_DESIGN_RULES::OnCancelButtonClick( wxCommandEvent& event )
/*****************************************************************/ /*****************************************************************/
...@@ -282,6 +303,12 @@ void DIALOG_DESIGN_RULES::OnCancelButtonClick( wxCommandEvent& event ) ...@@ -282,6 +303,12 @@ void DIALOG_DESIGN_RULES::OnCancelButtonClick( wxCommandEvent& event )
void DIALOG_DESIGN_RULES::OnOkButtonClick( wxCommandEvent& event ) void DIALOG_DESIGN_RULES::OnOkButtonClick( wxCommandEvent& event )
/**************************************************************************/ /**************************************************************************/
{ {
if( !TestDataValidity() )
{
DisplayError( this, _( "Errors detected, Abort" ) );
return;
}
g_DesignSettings.m_CopperLayerCount = m_ActivesLayersCount; g_DesignSettings.m_CopperLayerCount = m_ActivesLayersCount;
// Initialize the new layer name // Initialize the new layer name
...@@ -311,7 +338,7 @@ void DIALOG_DESIGN_RULES::OnOkButtonClick( wxCommandEvent& event ) ...@@ -311,7 +338,7 @@ void DIALOG_DESIGN_RULES::OnOkButtonClick( wxCommandEvent& event )
CopyRulesListToBoard(); CopyRulesListToBoard();
EndModal( 1 ); EndModal( wxID_OK );
} }
...@@ -333,7 +360,8 @@ void DIALOG_DESIGN_RULES::OnAddNetclassClick( wxCommandEvent& event ) ...@@ -333,7 +360,8 @@ void DIALOG_DESIGN_RULES::OnAddNetclassClick( wxCommandEvent& event )
/**************************************************************************/ /**************************************************************************/
{ {
wxString class_name; wxString class_name;
if( Get_Message( _("New Net Class Name:"),
if( Get_Message( _( "New Net Class Name:" ),
wxEmptyString, wxEmptyString,
class_name, class_name,
this ) ) this ) )
...@@ -343,26 +371,28 @@ void DIALOG_DESIGN_RULES::OnAddNetclassClick( wxCommandEvent& event ) ...@@ -343,26 +371,28 @@ void DIALOG_DESIGN_RULES::OnAddNetclassClick( wxCommandEvent& event )
for( int ii = 0; ii < m_gridNetClassesProperties->GetNumberRows(); ii++ ) for( int ii = 0; ii < m_gridNetClassesProperties->GetNumberRows(); ii++ )
{ {
wxString value; wxString value;
value = m_gridNetClassesProperties->GetRowLabelValue(ii); value = m_gridNetClassesProperties->GetRowLabelValue( ii );
if( class_name.CmpNoCase( value) == 0 ) // Already exists! if( class_name.CmpNoCase( value ) == 0 ) // Already exists!
{ {
DisplayError(this, _("This NetClass is alerady existing, cannot add it") ); DisplayError( this, _( "This NetClass is already existing, cannot add it; Aborted" ) );
return; return;
} }
} }
m_gridNetClassesProperties->AppendRows( ); m_gridNetClassesProperties->AppendRows();
m_gridNetClassesProperties->SetRowLabelValue( m_gridNetClassesProperties->SetRowLabelValue(
m_gridNetClassesProperties->GetNumberRows()-1, m_gridNetClassesProperties->GetNumberRows() - 1,
class_name); class_name );
// Copy values of the previous class: // Copy values of the previous class:
int irow = m_gridNetClassesProperties->GetNumberRows()-1; int irow = m_gridNetClassesProperties->GetNumberRows() - 1;
for( int icol = 0; icol < m_gridNetClassesProperties->GetNumberCols(); icol++ ) for( int icol = 0; icol < m_gridNetClassesProperties->GetNumberCols(); icol++ )
{ {
wxString value; wxString value;
value = m_gridNetClassesProperties->GetCellValue(irow-1, icol); value = m_gridNetClassesProperties->GetCellValue( irow - 1, icol );
m_gridNetClassesProperties->SetCellValue(irow, icol, value); m_gridNetClassesProperties->SetCellValue( irow, icol, value );
} }
InitializeRulesSelectionBoxes(); InitializeRulesSelectionBoxes();
} }
...@@ -372,116 +402,194 @@ void DIALOG_DESIGN_RULES::OnRemoveNetclassClick( wxCommandEvent& event ) ...@@ -372,116 +402,194 @@ void DIALOG_DESIGN_RULES::OnRemoveNetclassClick( wxCommandEvent& event )
/**************************************************************************/ /**************************************************************************/
{ {
wxArrayInt select = m_gridNetClassesProperties->GetSelectedRows(); wxArrayInt select = m_gridNetClassesProperties->GetSelectedRows();
for( int ii = select.GetCount()-1; ii >= 0; ii-- )
for( int ii = select.GetCount() - 1; ii >= 0; ii-- )
{ {
if( select[ii] != 0 ) // Do not remove the default class if( select[ii] != 0 ) // Do not remove the default class
{ {
m_gridNetClassesProperties->DeleteRows(select[ii]); m_gridNetClassesProperties->DeleteRows( select[ii] );
// reset the net class to default for nets member of the removed net class // reset the net class to default for nets member of the removed net class
for ( unsigned jj = 0; jj< m_NetsLinkToClasses.size(); jj++ ) for( unsigned jj = 0; jj< m_NetsLinkToClasses.size(); jj++ )
if( m_NetsLinkToClasses[jj] == ii ) if( m_NetsLinkToClasses[jj] == ii )
m_NetsLinkToClasses[jj] = 0; // Reset to default net class m_NetsLinkToClasses[jj] = 0; // Reset to default net class
} }
} }
InitializeRulesSelectionBoxes(); InitializeRulesSelectionBoxes();
} }
/* /*
* Called on the left Choice Box selection * Called on the left Choice Box selection
*/ */
void DIALOG_DESIGN_RULES::OnLeftCBSelection( wxCommandEvent& event ) void DIALOG_DESIGN_RULES::OnLeftCBSelection( wxCommandEvent& event )
{ {
FillListBoxWithNetsNames(m_listBoxLeftNetSelect, m_CBoxLeftSelection->GetCurrentSelection() ); FillListBoxWithNetsNames( m_listBoxLeftNetSelect, m_CBoxLeftSelection->GetCurrentSelection() );
if ( m_CBoxLeftSelection->GetCurrentSelection() == m_CBoxRightSelection->GetCurrentSelection() ) if( m_CBoxLeftSelection->GetCurrentSelection() == m_CBoxRightSelection->GetCurrentSelection() )
{ {
m_buttonRightToLeft->Enable(false); m_buttonRightToLeft->Enable( false );
m_buttonLeftToRight->Enable(false); m_buttonLeftToRight->Enable( false );
} }
else else
{ {
m_buttonRightToLeft->Enable(true); m_buttonRightToLeft->Enable( true );
m_buttonLeftToRight->Enable(true); m_buttonLeftToRight->Enable( true );
} }
} }
/* /*
* Called on the Right Choice Box selection * Called on the Right Choice Box selection
*/ */
void DIALOG_DESIGN_RULES::OnRightCBSelection( wxCommandEvent& event ) void DIALOG_DESIGN_RULES::OnRightCBSelection( wxCommandEvent& event )
{ {
FillListBoxWithNetsNames(m_listBoxRightNetSelect, m_CBoxRightSelection->GetCurrentSelection() ); FillListBoxWithNetsNames( m_listBoxRightNetSelect, m_CBoxRightSelection->GetCurrentSelection() );
if ( m_CBoxLeftSelection->GetCurrentSelection() == m_CBoxRightSelection->GetCurrentSelection() ) if( m_CBoxLeftSelection->GetCurrentSelection() == m_CBoxRightSelection->GetCurrentSelection() )
{ {
m_buttonRightToLeft->Enable(false); m_buttonRightToLeft->Enable( false );
m_buttonLeftToRight->Enable(false);; m_buttonLeftToRight->Enable( false );;
} }
else else
{ {
m_buttonRightToLeft->Enable(true); m_buttonRightToLeft->Enable( true );
m_buttonLeftToRight->Enable(true); m_buttonLeftToRight->Enable( true );
} }
} }
/* Called on clicking the "<<<" or Copy Right to Left button: /* Called on clicking the "<<<" or Copy Right to Left button:
* Selected items are moved from the right list to the left list * Selected items are moved from the right list to the left list
*/ */
void DIALOG_DESIGN_RULES::OnRightToLeftCopyButton( wxCommandEvent& event ) void DIALOG_DESIGN_RULES::OnRightToLeftCopyButton( wxCommandEvent& event )
{ {
int idx_class = m_CBoxLeftSelection->GetCurrentSelection(); int idx_class = m_CBoxLeftSelection->GetCurrentSelection();
if ( idx_class == wxNOT_FOUND )
if( idx_class == wxNOT_FOUND )
return; return;
for( unsigned ii = 0; ii < m_listBoxRightNetSelect->GetCount(); ii++ ) for( unsigned ii = 0; ii < m_listBoxRightNetSelect->GetCount(); ii++ )
{ {
if( ! m_listBoxRightNetSelect->IsSelected(ii) ) if( !m_listBoxRightNetSelect->IsSelected( ii ) )
continue; continue;
unsigned idx = (unsigned) m_listBoxRightNetSelect->GetClientData( ii); unsigned idx = (unsigned) m_listBoxRightNetSelect->GetClientData( ii );
m_NetsLinkToClasses[idx] = idx_class; m_NetsLinkToClasses[idx] = idx_class;
} }
FillListBoxWithNetsNames(m_listBoxLeftNetSelect, m_CBoxLeftSelection->GetCurrentSelection()); FillListBoxWithNetsNames( m_listBoxLeftNetSelect, m_CBoxLeftSelection->GetCurrentSelection() );
FillListBoxWithNetsNames(m_listBoxRightNetSelect, m_CBoxRightSelection->GetCurrentSelection()); FillListBoxWithNetsNames( m_listBoxRightNetSelect, m_CBoxRightSelection->GetCurrentSelection() );
} }
/* Called on clicking the ">>>" or Copy Left to Right button: /* Called on clicking the ">>>" or Copy Left to Right button:
* Selected items are moved from the left list to the right list * Selected items are moved from the left list to the right list
*/ */
void DIALOG_DESIGN_RULES::OnLeftToRightCopyButton( wxCommandEvent& event ) void DIALOG_DESIGN_RULES::OnLeftToRightCopyButton( wxCommandEvent& event )
{ {
int idx_class = m_CBoxRightSelection->GetCurrentSelection(); int idx_class = m_CBoxRightSelection->GetCurrentSelection();
if ( idx_class == wxNOT_FOUND )
if( idx_class == wxNOT_FOUND )
return; return;
for( unsigned ii = 0; ii < m_listBoxLeftNetSelect->GetCount(); ii++ ) for( unsigned ii = 0; ii < m_listBoxLeftNetSelect->GetCount(); ii++ )
{ {
if( ! m_listBoxLeftNetSelect->IsSelected(ii) ) if( !m_listBoxLeftNetSelect->IsSelected( ii ) )
continue; continue;
unsigned idx = (unsigned) m_listBoxLeftNetSelect->GetClientData(ii); unsigned idx = (unsigned) m_listBoxLeftNetSelect->GetClientData( ii );
m_NetsLinkToClasses[idx] = idx_class; m_NetsLinkToClasses[idx] = idx_class;
} }
FillListBoxWithNetsNames(m_listBoxLeftNetSelect, m_CBoxLeftSelection->GetCurrentSelection()); FillListBoxWithNetsNames( m_listBoxLeftNetSelect, m_CBoxLeftSelection->GetCurrentSelection() );
FillListBoxWithNetsNames(m_listBoxRightNetSelect, m_CBoxRightSelection->GetCurrentSelection()); FillListBoxWithNetsNames( m_listBoxRightNetSelect, m_CBoxRightSelection->GetCurrentSelection() );
} }
/* Called on clicking the left "select all" button: /* Called on clicking the left "select all" button:
* select alls items of the left netname list lisxt box * select alls items of the left netname list lisxt box
*/ */
void DIALOG_DESIGN_RULES::OnLeftSelectAllButton( wxCommandEvent& event ) void DIALOG_DESIGN_RULES::OnLeftSelectAllButton( wxCommandEvent& event )
{ {
for( unsigned ii = 0; ii < m_listBoxLeftNetSelect->GetCount(); ii++ ) for( unsigned ii = 0; ii < m_listBoxLeftNetSelect->GetCount(); ii++ )
m_listBoxLeftNetSelect->SetSelection(ii); m_listBoxLeftNetSelect->SetSelection( ii );
} }
/* Called on clicking the right "select all" button: /* Called on clicking the right "select all" button:
* select alls items of the right netname list lisxt box * select alls items of the right netname list lisxt box
*/ */
void DIALOG_DESIGN_RULES::OnRightSelectAllButton( wxCommandEvent& event ) void DIALOG_DESIGN_RULES::OnRightSelectAllButton( wxCommandEvent& event )
{ {
for( unsigned ii = 0; ii < m_listBoxRightNetSelect->GetCount(); ii++ ) for( unsigned ii = 0; ii < m_listBoxRightNetSelect->GetCount(); ii++ )
m_listBoxRightNetSelect->SetSelection(ii); m_listBoxRightNetSelect->SetSelection( ii );
} }
/* TestDataValidity
* Performs a control of data validity
* set the background of a bad cell in RED and display an info message
* @return true if Ok, false if error
*/
bool DIALOG_DESIGN_RULES::TestDataValidity()
{
bool success = true;
m_MessagesList->SetPage(wxEmptyString); // Clear message list
// Test duplicate layers names
for( int ii = 0; ii < m_gridLayersProperties->GetNumberRows() - 1; ii++ )
{
wxString value = m_gridLayersProperties->GetCellValue( ii, LAYERS_GRID_NAME_POSITION );
for( int jj = ii+1; jj < m_gridLayersProperties->GetNumberRows(); jj++ )
{
wxString othervalue = m_gridLayersProperties->GetCellValue( ii,
LAYERS_GRID_NAME_POSITION );
othervalue = m_gridLayersProperties->GetCellValue( jj, LAYERS_GRID_NAME_POSITION );
if( value.CmpNoCase( othervalue ) == 0 ) // Already exists!
{
wxString text;
text.Printf( _(
"<small>This layer name <b>%s</b> is already existing<br>" ),
value.GetData() );
m_MessagesList->AppendToPage( text );
success = false;
}
}
}
int value;
int minvalue;
for( int ii = 0; ii < m_gridNetClassesProperties->GetNumberRows(); ii++ )
{
value = ReturnValueFromString( g_UnitMetric,
m_gridNetClassesProperties->GetCellValue(
ii, RULE_GRID_TRACKSIZE_POSITION ),
m_Parent->m_InternalUnits );
minvalue = ReturnValueFromString( g_UnitMetric,
m_gridNetClassesProperties->GetCellValue( ii,
RULE_GRID_MINTRACKSIZE_POSITION ),
m_Parent->m_InternalUnits );
if( value < minvalue )
{
success = false;
m_MessagesList->AppendToPage( _( "The <b>track</b> minimum size is bigger than the size<br>" ) );
}
value = ReturnValueFromString( g_UnitMetric,
m_gridNetClassesProperties->GetCellValue(
ii, RULE_GRID_VIASIZE_POSITION ),
m_Parent->m_InternalUnits );
minvalue = ReturnValueFromString( g_UnitMetric,
m_gridNetClassesProperties->GetCellValue( ii,
RULE_GRID_MINVIASIZE_POSITION ),
m_Parent->m_InternalUnits );
if( value < minvalue )
{
success = false;
m_MessagesList->AppendToPage( _( "The <b>via</b> minimum size is bigger than the size<br>" ) );
}
}
return success;
}
...@@ -14,7 +14,6 @@ class DIALOG_DESIGN_RULES : public DIALOG_DESIGN_RULES_BASE ...@@ -14,7 +14,6 @@ class DIALOG_DESIGN_RULES : public DIALOG_DESIGN_RULES_BASE
WinEDA_PcbFrame * m_Parent; WinEDA_PcbFrame * m_Parent;
int m_ActivesLayersCount; int m_ActivesLayersCount;
BOARD * m_Pcb; BOARD * m_Pcb;
int m_Changes;
LAYER_T m_LayersType[4]; LAYER_T m_LayersType[4];
wxString m_LayersTypeName[4]; wxString m_LayersTypeName[4];
std::vector<NETINFO_ITEM*> m_StockNets; // full list of nets on board std::vector<NETINFO_ITEM*> m_StockNets; // full list of nets on board
...@@ -36,6 +35,7 @@ class DIALOG_DESIGN_RULES : public DIALOG_DESIGN_RULES_BASE ...@@ -36,6 +35,7 @@ class DIALOG_DESIGN_RULES : public DIALOG_DESIGN_RULES_BASE
void OnLeftToRightCopyButton( wxCommandEvent& event ); void OnLeftToRightCopyButton( wxCommandEvent& event );
void OnLeftSelectAllButton( wxCommandEvent& event ); void OnLeftSelectAllButton( wxCommandEvent& event );
void OnRightSelectAllButton( wxCommandEvent& event ); void OnRightSelectAllButton( wxCommandEvent& event );
bool TestDataValidity( );
void Init(); void Init();
void InitRulesList(); void InitRulesList();
void InitializeRulesSelectionBoxes(); void InitializeRulesSelectionBoxes();
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
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 ) 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( 600,450 ), wxDefaultSize ); this->SetSizeHints( wxSize( 600,520 ), wxDefaultSize );
wxBoxSizer* bMainSizer; wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL ); bMainSizer = new wxBoxSizer( wxVERTICAL );
...@@ -124,7 +124,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID ...@@ -124,7 +124,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
// Cell Defaults // Cell Defaults
m_gridNetClassesProperties->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); m_gridNetClassesProperties->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
m_gridNetClassesProperties->SetMinSize( wxSize( -1,100 ) ); m_gridNetClassesProperties->SetMinSize( wxSize( -1,150 ) );
sbSizer1->Add( m_gridNetClassesProperties, 1, wxALL|wxEXPAND, 5 ); sbSizer1->Add( m_gridNetClassesProperties, 1, wxALL|wxEXPAND, 5 );
...@@ -139,7 +139,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID ...@@ -139,7 +139,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
sbSizer1->Add( bSizerButtons, 0, wxALIGN_CENTER_VERTICAL, 5 ); sbSizer1->Add( bSizerButtons, 0, wxALIGN_CENTER_VERTICAL, 5 );
bmainSizerNclasses->Add( sbSizer1, 1, wxEXPAND, 5 ); bmainSizerNclasses->Add( sbSizer1, 0, wxEXPAND, 5 );
wxBoxSizer* bSizerNetSelect; wxBoxSizer* bSizerNetSelect;
bSizerNetSelect = new wxBoxSizer( wxHORIZONTAL ); bSizerNetSelect = new wxBoxSizer( wxHORIZONTAL );
...@@ -194,15 +194,6 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID ...@@ -194,15 +194,6 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
bmainSizerNclasses->Add( bSizerNetSelect, 1, wxEXPAND, 5 ); bmainSizerNclasses->Add( bSizerNetSelect, 1, wxEXPAND, 5 );
m_staticTextMsg = new wxStaticText( m_panelNetClasses, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextMsg->Wrap( -1 );
bmainSizerNclasses->Add( m_staticTextMsg, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_MessagesList = new wxHtmlWindow( m_panelNetClasses, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO|wxSUNKEN_BORDER );
m_MessagesList->SetMinSize( wxSize( -1,100 ) );
bmainSizerNclasses->Add( m_MessagesList, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_panelNetClasses->SetSizer( bmainSizerNclasses ); m_panelNetClasses->SetSizer( bmainSizerNclasses );
m_panelNetClasses->Layout(); m_panelNetClasses->Layout();
bmainSizerNclasses->Fit( m_panelNetClasses ); bmainSizerNclasses->Fit( m_panelNetClasses );
...@@ -210,6 +201,15 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID ...@@ -210,6 +201,15 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
bMainSizer->Add( m_notebook, 1, wxALL|wxEXPAND, 5 ); bMainSizer->Add( m_notebook, 1, wxALL|wxEXPAND, 5 );
m_staticTextMsg = new wxStaticText( this, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextMsg->Wrap( -1 );
bMainSizer->Add( m_staticTextMsg, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_MessagesList = new wxHtmlWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO|wxSUNKEN_BORDER );
m_MessagesList->SetMinSize( wxSize( -1,100 ) );
bMainSizer->Add( m_MessagesList, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_sdbSizer1 = new wxStdDialogButtonSizer(); m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK ); m_sdbSizer1OK = new wxButton( this, wxID_OK );
m_sdbSizer1->AddButton( m_sdbSizer1OK ); m_sdbSizer1->AddButton( m_sdbSizer1OK );
......
...@@ -29,10 +29,10 @@ ...@@ -29,10 +29,10 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size">600,450</property> <property name="minimum_size">600,520</property>
<property name="name">DIALOG_DESIGN_RULES_BASE</property> <property name="name">DIALOG_DESIGN_RULES_BASE</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size">684,486</property> <property name="size">684,568</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property> <property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="title">Design Rules Editor</property> <property name="title">Design Rules Editor</property>
...@@ -398,7 +398,7 @@ ...@@ -398,7 +398,7 @@
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1"> <object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Net classes:</property> <property name="label">Net classes:</property>
...@@ -445,7 +445,7 @@ ...@@ -445,7 +445,7 @@
<property name="margin_height">0</property> <property name="margin_height">0</property>
<property name="margin_width">0</property> <property name="margin_width">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size">-1,100</property> <property name="minimum_size">-1,150</property>
<property name="name">m_gridNetClassesProperties</property> <property name="name">m_gridNetClassesProperties</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
...@@ -1104,114 +1104,114 @@ ...@@ -1104,114 +1104,114 @@
</object> </object>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Messages:</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_staticTextMsg</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxHtmlWindow" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size">-1,100</property>
<property name="name">m_MessagesList</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxHW_SCROLLBAR_AUTO</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxSUNKEN_BORDER</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHtmlCellClicked"></event>
<event name="OnHtmlCellHover"></event>
<event name="OnHtmlLinkClicked"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object> </object>
</object> </object>
</object> </object>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Messages:</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_staticTextMsg</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxHtmlWindow" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size">-1,100</property>
<property name="name">m_MessagesList</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxHW_SCROLLBAR_AUTO</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxSUNKEN_BORDER</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHtmlCellClicked"></event>
<event name="OnHtmlCellHover"></event>
<event name="OnHtmlLinkClicked"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_RIGHT</property> <property name="flag">wxALIGN_RIGHT</property>
......
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
#include <wx/statbox.h> #include <wx/statbox.h>
#include <wx/choice.h> #include <wx/choice.h>
#include <wx/listbox.h> #include <wx/listbox.h>
#include <wx/notebook.h>
#include <wx/stattext.h> #include <wx/stattext.h>
#include <wx/html/htmlwin.h> #include <wx/html/htmlwin.h>
#include <wx/notebook.h>
#include <wx/dialog.h> #include <wx/dialog.h>
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
...@@ -91,7 +91,7 @@ class DIALOG_DESIGN_RULES_BASE : public wxDialog ...@@ -91,7 +91,7 @@ class DIALOG_DESIGN_RULES_BASE : public wxDialog
public: 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( 684,486 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Design Rules Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 684,568 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_DESIGN_RULES_BASE(); ~DIALOG_DESIGN_RULES_BASE();
}; };
......
...@@ -651,8 +651,8 @@ void WinEDA_PcbFrame::Show3D_Frame( wxCommandEvent& event ) ...@@ -651,8 +651,8 @@ void WinEDA_PcbFrame::Show3D_Frame( wxCommandEvent& event )
void WinEDA_PcbFrame::ShowDesignRulesEditor( wxCommandEvent& event ) void WinEDA_PcbFrame::ShowDesignRulesEditor( wxCommandEvent& event )
{ {
DIALOG_DESIGN_RULES dR_editor( this ); DIALOG_DESIGN_RULES dR_editor( this );
int change = dR_editor.ShowModal( ); int returncode = dR_editor.ShowModal( );
if ( change ) if ( returncode == wxID_OK ) // New rules, or others changes.
{ {
ReCreateLayerBox( NULL ); ReCreateLayerBox( NULL );
GetScreen()->SetModify(); GetScreen()->SetModify();
......
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