Commit bc62df64 authored by charras's avatar charras

fixed resize problem in design rules dialog and minor enhancement

parent 6c3968a1
...@@ -86,7 +86,7 @@ DIALOG_DESIGN_RULES::DIALOG_DESIGN_RULES( WinEDA_PcbFrame* parent ) : ...@@ -86,7 +86,7 @@ DIALOG_DESIGN_RULES::DIALOG_DESIGN_RULES( WinEDA_PcbFrame* parent ) :
m_rightListCtrl->SetColumnWidth( 1, wxLIST_AUTOSIZE ); m_rightListCtrl->SetColumnWidth( 1, wxLIST_AUTOSIZE );
Init(); InitDialogRules();
SetAutoLayout( true ); SetAutoLayout( true );
GetSizer()->Fit( this ); GetSizer()->Fit( this );
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
...@@ -105,23 +105,23 @@ void DIALOG_DESIGN_RULES::PrintCurrentSettings( ) ...@@ -105,23 +105,23 @@ void DIALOG_DESIGN_RULES::PrintCurrentSettings( )
// Display min values: // Display min values:
value = ReturnStringFromValue( g_UnitMetric, g_DesignSettings.m_TrackMinWidth, internal_units, true ); value = ReturnStringFromValue( g_UnitMetric, g_DesignSettings.m_TrackMinWidth, internal_units, true );
msg.Printf(_("Minimum value for tracks width: <b>%s</b><br>\n"), GetChars( value ) ); msg.Printf(_("Minimum value for tracks width: <b>%s</b><br>\n"), value.c_str( ) );
m_MessagesList->AppendToPage(msg); m_MessagesList->AppendToPage(msg);
value = ReturnStringFromValue( g_UnitMetric, g_DesignSettings.m_ViasMinSize, internal_units, true ); value = ReturnStringFromValue( g_UnitMetric, g_DesignSettings.m_ViasMinSize, internal_units, true );
msg.Printf(_("Minimum value for vias diameter: <b>%s</b><br>\n"), GetChars( value ) ); msg.Printf(_("Minimum value for vias diameter: <b>%s</b><br>\n"), value.c_str( ) );
m_MessagesList->AppendToPage(msg); m_MessagesList->AppendToPage(msg);
value = ReturnStringFromValue( g_UnitMetric, g_DesignSettings.m_MicroViasMinSize, internal_units, true ); value = ReturnStringFromValue( g_UnitMetric, g_DesignSettings.m_MicroViasMinSize, internal_units, true );
msg.Printf(_("Minimum value for microvias diameter: <b>%s</b><br>\n"), GetChars( value ) ); msg.Printf(_("Minimum value for microvias diameter: <b>%s</b><br>\n"), value.c_str( ) );
m_MessagesList->AppendToPage(msg); m_MessagesList->AppendToPage(msg);
} }
/********************************************************************/ /**************************************/
void DIALOG_DESIGN_RULES::Init() void DIALOG_DESIGN_RULES::InitDialogRules()
/********************************************************************/ /**************************************/
{ {
SetFocus(); SetFocus();
SetReturnCode( 0 ); SetReturnCode( 0 );
...@@ -409,7 +409,7 @@ void DIALOG_DESIGN_RULES::CopyRulesListToBoard() ...@@ -409,7 +409,7 @@ void DIALOG_DESIGN_RULES::CopyRulesListToBoard()
void DIALOG_DESIGN_RULES::OnCancelButtonClick( wxCommandEvent& event ) void DIALOG_DESIGN_RULES::OnCancelButtonClick( wxCommandEvent& event )
/*****************************************************************/ /*****************************************************************/
{ {
EndModal( 0 ); EndModal( wxID_CANCEL );
} }
......
...@@ -57,7 +57,7 @@ private: ...@@ -57,7 +57,7 @@ private:
void OnLeftSelectAllButton( wxCommandEvent& event ); void OnLeftSelectAllButton( wxCommandEvent& event );
void OnRightSelectAllButton( wxCommandEvent& event ); void OnRightSelectAllButton( wxCommandEvent& event );
bool TestDataValidity( ); bool TestDataValidity( );
void Init(); void InitDialogRules();
void InitRulesList(); void InitRulesList();
void InitializeRulesSelectionBoxes(); void InitializeRulesSelectionBoxes();
void CopyRulesListToBoard(); void CopyRulesListToBoard();
......
...@@ -94,7 +94,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID ...@@ -94,7 +94,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
m_leftClassChoice->SetSelection( 0 ); m_leftClassChoice->SetSelection( 0 );
leftNetSelectBoxSizer->Add( m_leftClassChoice, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); leftNetSelectBoxSizer->Add( m_leftClassChoice, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
m_leftListCtrl = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES ); m_leftListCtrl = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES|wxSUNKEN_BORDER );
m_leftListCtrl->SetMinSize( wxSize( 220,300 ) ); m_leftListCtrl->SetMinSize( wxSize( 220,300 ) );
leftNetSelectBoxSizer->Add( m_leftListCtrl, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); leftNetSelectBoxSizer->Add( m_leftListCtrl, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 );
...@@ -105,21 +105,16 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID ...@@ -105,21 +105,16 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
bmiddleSizerNetSelect = new wxBoxSizer( wxVERTICAL ); bmiddleSizerNetSelect = new wxBoxSizer( wxVERTICAL );
m_buttonRightToLeft = new wxButton( this, ID_LEFT_TO_RIGHT_COPY, _("<<<"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonRightToLeft = new wxButton( this, ID_LEFT_TO_RIGHT_COPY, _("<<<"), wxDefaultPosition, wxDefaultSize, 0 );
bmiddleSizerNetSelect->Add( m_buttonRightToLeft, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); bmiddleSizerNetSelect->Add( m_buttonRightToLeft, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_buttonLeftToRight = new wxButton( this, ID_RIGHT_TO_LEFT_COPY, _(">>>"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonLeftToRight = new wxButton( this, ID_RIGHT_TO_LEFT_COPY, _(">>>"), wxDefaultPosition, wxDefaultSize, 0 );
bmiddleSizerNetSelect->Add( m_buttonLeftToRight, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); bmiddleSizerNetSelect->Add( m_buttonLeftToRight, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
wxBoxSizer* bSizerButtonsSelecAll;
bSizerButtonsSelecAll = new wxBoxSizer( wxHORIZONTAL );
m_buttonLeftSelAll = new wxButton( this, wxID_ANY, _("<< Select All"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonLeftSelAll = new wxButton( this, wxID_ANY, _("<< Select All"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtonsSelecAll->Add( m_buttonLeftSelAll, 0, wxALL, 5 ); bmiddleSizerNetSelect->Add( m_buttonLeftSelAll, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_buttonRightSelAll = new wxButton( this, wxID_ANY, _("Select All >>"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonRightSelAll = new wxButton( this, wxID_ANY, _("Select All >>"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtonsSelecAll->Add( m_buttonRightSelAll, 0, wxALIGN_BOTTOM|wxALIGN_RIGHT|wxALL, 5 ); bmiddleSizerNetSelect->Add( m_buttonRightSelAll, 0, wxALIGN_BOTTOM|wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
bmiddleSizerNetSelect->Add( bSizerButtonsSelecAll, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
sbSizer4->Add( bmiddleSizerNetSelect, 0, wxALIGN_CENTER_VERTICAL, 5 ); sbSizer4->Add( bmiddleSizerNetSelect, 0, wxALIGN_CENTER_VERTICAL, 5 );
...@@ -131,12 +126,12 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID ...@@ -131,12 +126,12 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
m_rightClassChoice->SetSelection( 0 ); m_rightClassChoice->SetSelection( 0 );
rghtNetSelectBoxSizer->Add( m_rightClassChoice, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); rghtNetSelectBoxSizer->Add( m_rightClassChoice, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
m_rightListCtrl = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES ); m_rightListCtrl = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES|wxSUNKEN_BORDER );
m_rightListCtrl->SetMinSize( wxSize( 220,-1 ) ); m_rightListCtrl->SetMinSize( wxSize( 220,-1 ) );
rghtNetSelectBoxSizer->Add( m_rightListCtrl, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); rghtNetSelectBoxSizer->Add( m_rightListCtrl, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 );
sbSizer4->Add( rghtNetSelectBoxSizer, 0, wxALL|wxEXPAND, 5 ); sbSizer4->Add( rghtNetSelectBoxSizer, 1, wxALL|wxEXPAND, 5 );
bMainSizer->Add( sbSizer4, 2, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); bMainSizer->Add( sbSizer4, 2, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
...@@ -156,7 +151,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID ...@@ -156,7 +151,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
m_sdbSizer1->Realize(); m_sdbSizer1->Realize();
bMainSizer->Add( m_sdbSizer1, 0, wxALIGN_RIGHT|wxALL|wxEXPAND, 5 ); bMainSizer->Add( m_sdbSizer1, 0, wxALL|wxALIGN_RIGHT, 5 );
this->SetSizer( bMainSizer ); this->SetSizer( bMainSizer );
this->Layout(); this->Layout();
......
This diff is collapsed.
...@@ -26,13 +26,6 @@ ...@@ -26,13 +26,6 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#define wxID_ADD_NETCLASS 1000
#define wxID_REMOVE_NETCLASS 1001
#define ID_LEFT_CHOICE_CLICK 1002
#define ID_LEFT_TO_RIGHT_COPY 1003
#define ID_RIGHT_TO_LEFT_COPY 1004
#define ID_RIGHT_CHOICE_CLICK 1005
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_DESIGN_RULES_BASE /// Class DIALOG_DESIGN_RULES_BASE
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
...@@ -41,6 +34,16 @@ class DIALOG_DESIGN_RULES_BASE : public wxDialog ...@@ -41,6 +34,16 @@ class DIALOG_DESIGN_RULES_BASE : public wxDialog
private: private:
protected: protected:
enum
{
wxID_ADD_NETCLASS = 1000,
wxID_REMOVE_NETCLASS,
ID_LEFT_CHOICE_CLICK,
ID_LEFT_TO_RIGHT_COPY,
ID_RIGHT_TO_LEFT_COPY,
ID_RIGHT_CHOICE_CLICK,
};
wxGrid* m_grid; wxGrid* m_grid;
wxButton* m_addButton; wxButton* m_addButton;
wxButton* m_removeButton; wxButton* m_removeButton;
......
...@@ -65,6 +65,20 @@ void DIALOG_DRC_CONTROL::Init() ...@@ -65,6 +65,20 @@ void DIALOG_DRC_CONTROL::Init()
// m_SetClearance->SetSelection(0,0); // m_SetClearance->SetSelection(0,0);
} }
/* accept DRC parameters (min clearance value and min sizes
*/
void DIALOG_DRC_CONTROL::SetDrcParmeters( )
{
g_DesignSettings.m_TrackClearance =
ReturnValueFromTextCtrl( *m_SetClearance, m_Parent->m_InternalUnits );
g_DesignSettings.m_TrackMinWidth =
ReturnValueFromTextCtrl( *m_SetTrackMinWidthCtrl, m_Parent->m_InternalUnits );
g_DesignSettings.m_ViasMinSize =
ReturnValueFromTextCtrl( *m_SetViaMinSizeCtrl, m_Parent->m_InternalUnits );
g_DesignSettings.m_MicroViasMinSize =
ReturnValueFromTextCtrl( *m_SetMicroViakMinSizeCtrl, m_Parent->m_InternalUnits );
}
/*! /*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DRC_RUN * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DRC_RUN
...@@ -87,14 +101,7 @@ void DIALOG_DRC_CONTROL::OnStartdrcClick( wxCommandEvent& event ) ...@@ -87,14 +101,7 @@ void DIALOG_DRC_CONTROL::OnStartdrcClick( wxCommandEvent& event )
reportName = m_RptFilenameCtrl->GetValue(); reportName = m_RptFilenameCtrl->GetValue();
} }
g_DesignSettings.m_TrackClearance = SetDrcParmeters( );
ReturnValueFromTextCtrl( *m_SetClearance, m_Parent->m_InternalUnits );
g_DesignSettings.m_TrackMinWidth =
ReturnValueFromTextCtrl( *m_SetTrackMinWidthCtrl, m_Parent->m_InternalUnits );
g_DesignSettings.m_ViasMinSize =
ReturnValueFromTextCtrl( *m_SetViaMinSizeCtrl, m_Parent->m_InternalUnits );
g_DesignSettings.m_MicroViasMinSize =
ReturnValueFromTextCtrl( *m_SetMicroViakMinSizeCtrl, m_Parent->m_InternalUnits );
m_tester->SetSettings( true, // Pad to pad DRC test enabled m_tester->SetSettings( true, // Pad to pad DRC test enabled
true, // unconnected pdas DRC test enabled true, // unconnected pdas DRC test enabled
...@@ -172,14 +179,7 @@ void DIALOG_DRC_CONTROL::OnListUnconnectedClick( wxCommandEvent& event ) ...@@ -172,14 +179,7 @@ void DIALOG_DRC_CONTROL::OnListUnconnectedClick( wxCommandEvent& event )
reportName = m_RptFilenameCtrl->GetValue(); reportName = m_RptFilenameCtrl->GetValue();
} }
g_DesignSettings.m_TrackClearance = SetDrcParmeters( );
ReturnValueFromTextCtrl( *m_SetClearance, m_Parent->m_InternalUnits );
g_DesignSettings.m_TrackMinWidth =
ReturnValueFromTextCtrl( *m_SetTrackMinWidthCtrl, m_Parent->m_InternalUnits );
g_DesignSettings.m_ViasMinSize =
ReturnValueFromTextCtrl( *m_SetViaMinSizeCtrl, m_Parent->m_InternalUnits );
g_DesignSettings.m_MicroViasMinSize =
ReturnValueFromTextCtrl( *m_SetMicroViakMinSizeCtrl, m_Parent->m_InternalUnits );
m_tester->SetSettings( true, // Pad to pad DRC test enabled m_tester->SetSettings( true, // Pad to pad DRC test enabled
true, // unconnected pdas DRC test enabled true, // unconnected pdas DRC test enabled
...@@ -252,6 +252,7 @@ void DIALOG_DRC_CONTROL::OnButtonBrowseRptFileClick( wxCommandEvent& event ) ...@@ -252,6 +252,7 @@ void DIALOG_DRC_CONTROL::OnButtonBrowseRptFileClick( wxCommandEvent& event )
void DIALOG_DRC_CONTROL::OnOkClick( wxCommandEvent& event ) void DIALOG_DRC_CONTROL::OnOkClick( wxCommandEvent& event )
{ {
SetReturnCode( wxID_OK ); SetReturnCode( wxID_OK );
SetDrcParmeters( );
m_tester->DestroyDialog( wxID_OK ); m_tester->DestroyDialog( wxID_OK );
} }
...@@ -283,8 +284,6 @@ void DIALOG_DRC_CONTROL::OnReportCheckBoxClicked( wxCommandEvent& event ) ...@@ -283,8 +284,6 @@ void DIALOG_DRC_CONTROL::OnReportCheckBoxClicked( wxCommandEvent& event )
m_RptFilenameCtrl->Enable( false ); m_RptFilenameCtrl->Enable( false );
m_BrowseButton->Enable( false ); m_BrowseButton->Enable( false );
} }
// event.Skip();
} }
......
...@@ -53,6 +53,8 @@ private: ...@@ -53,6 +53,8 @@ private:
void Init( ); void Init( );
void SetDrcParmeters( );
/// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX
void OnReportCheckBoxClicked( wxCommandEvent& event ); void OnReportCheckBoxClicked( wxCommandEvent& event );
......
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