Commit e70eac29 authored by jean-pierre charras's avatar jean-pierre charras

Dialog design rules cosmetic enhancement

parent cf8f8ca2
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_design_rules.cpp
/////////////////////////////////////////////////////////////////////////////
......@@ -45,6 +44,10 @@
#include "wx/generic/gridctrl.h"
#include "dialog_design_rules_aux_helper_class.h"
// Column labels for net lists
#define NET_TITLE _( "Net" )
#define CLASS_TITLE _( "Class" )
// Field Positions on rules grid
enum {
GRID_CLEARANCE,
......@@ -161,8 +164,8 @@ DIALOG_DESIGN_RULES::DIALOG_DESIGN_RULES( PCB_EDIT_FRAME* parent ) :
column0.SetMask( wxLIST_MASK_TEXT );
column1.SetMask( wxLIST_MASK_TEXT );
column0.SetText( _( "Net" ) );
column1.SetText( _( "Class" ) );
column0.SetText( NET_TITLE );
column1.SetText( CLASS_TITLE );
m_leftListCtrl->InsertColumn( 0, column0 );
m_leftListCtrl->InsertColumn( 1, column1 );
......@@ -429,24 +432,30 @@ void DIALOG_DESIGN_RULES::FillListBoxWithNetNames( NETS_LIST_CTRL* aListCtrl,
#endif
// to speed up inserting we hide the control temporarily
aListCtrl->Hide();
// Add netclass info to m_Netnames and m_Classnames wxArrayString buffers
// aListCtrl uses wxLC_VIRTUAL option, so this is fast
wxClientDC sDC(aListCtrl);
int row = 0;
// recompute the column widths here, after setting texts
int net_colsize = sDC.GetTextExtent( NET_TITLE ).x;
int class_colsize = sDC.GetTextExtent( CLASS_TITLE ).x;
for( PNETCUPS::iterator i = ptrList.begin(); i!=ptrList.end(); ++i, ++row )
{
wxSize net_needed = sDC.GetTextExtent( (*i)->net );
wxSize class_needed = sDC.GetTextExtent( (*i)->clazz );
net_colsize = MAX( net_colsize, net_needed.x );
class_colsize = MAX( class_colsize, class_needed.x );
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();
int margin = sDC.GetTextExtent( wxT("XX") ).x;;
aListCtrl->SetColumnWidth( 0, net_colsize + margin);
aListCtrl->SetColumnWidth( 1, class_colsize + margin);
aListCtrl->Refresh();
}
/* Initialize the combo boxes by the list of existing net classes
/* Populates combo boxes with the list of existing net classes
*/
void DIALOG_DESIGN_RULES::InitializeRulesSelectionBoxes()
{
......
......@@ -153,7 +153,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
m_panelNetClassesEditor->SetSizer( bpanelNetClassesSizer );
m_panelNetClassesEditor->Layout();
bpanelNetClassesSizer->Fit( m_panelNetClassesEditor );
m_DRnotebook->AddPage( m_panelNetClassesEditor, _("Net Classes Editor"), true );
m_DRnotebook->AddPage( m_panelNetClassesEditor, _("Net Classes Editor"), false );
m_panelGolbalDesignRules = new wxPanel( m_DRnotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
wxBoxSizer* bpanelGlobRulesSizer;
bpanelGlobRulesSizer = new wxBoxSizer( wxVERTICAL );
......@@ -172,72 +172,21 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
sbViasOptionSizer->Add( m_OptViaType, 0, wxALL|wxEXPAND, 5 );
wxFlexGridSizer* fgViasMinValuesSizer;
fgViasMinValuesSizer = new wxFlexGridSizer( 2, 2, 0, 0 );
fgViasMinValuesSizer->AddGrowableCol( 1 );
fgViasMinValuesSizer->SetFlexibleDirection( wxBOTH );
fgViasMinValuesSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_ViaMinTitle = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Min via diameter"), wxDefaultPosition, wxDefaultSize, 0 );
m_ViaMinTitle->Wrap( -1 );
fgViasMinValuesSizer->Add( m_ViaMinTitle, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_SetViasMinSizeCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgViasMinValuesSizer->Add( m_SetViasMinSizeCtrl, 0, wxEXPAND|wxALL, 5 );
m_ViaMinDrillTitle = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Min via drill dia"), wxDefaultPosition, wxDefaultSize, 0 );
m_ViaMinDrillTitle->Wrap( -1 );
fgViasMinValuesSizer->Add( m_ViaMinDrillTitle, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_RIGHT, 5 );
m_SetViasMinDrillCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgViasMinValuesSizer->Add( m_SetViasMinDrillCtrl, 0, wxALL|wxEXPAND, 5 );
sbViasOptionSizer->Add( fgViasMinValuesSizer, 0, wxEXPAND, 5 );
bDesignRulesUpperSizer->Add( sbViasOptionSizer, 1, wxALIGN_CENTER_VERTICAL, 5 );
wxStaticBoxSizer* sbuViasSizer;
sbuViasSizer = new wxStaticBoxSizer( new wxStaticBox( m_panelGolbalDesignRules, wxID_ANY, _("Micro Via Options:") ), wxVERTICAL );
wxString m_AllowMicroViaCtrlChoices[] = { _("Do not allow micro vias"), _("Allow micro vias") };
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 );
m_AllowMicroViaCtrl->SetSelection( 0 );
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") );
sbuViasSizer->Add( m_AllowMicroViaCtrl, 0, wxALL|wxEXPAND, 5 );
wxFlexGridSizer* fgMinMicroviasValuesSizer;
fgMinMicroviasValuesSizer = new wxFlexGridSizer( 2, 2, 0, 0 );
fgMinMicroviasValuesSizer->AddGrowableCol( 1 );
fgMinMicroviasValuesSizer->SetFlexibleDirection( wxBOTH );
fgMinMicroviasValuesSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_MicroViaMinSizeTitle = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Min uvia diameter"), wxDefaultPosition, wxDefaultSize, 0 );
m_MicroViaMinSizeTitle->Wrap( -1 );
fgMinMicroviasValuesSizer->Add( m_MicroViaMinSizeTitle, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_SetMicroViasMinSizeCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_SetMicroViasMinSizeCtrl->SetMaxLength( 6 );
fgMinMicroviasValuesSizer->Add( m_SetMicroViasMinSizeCtrl, 0, wxALL|wxEXPAND, 5 );
m_MicroViaMinDrillTitle = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Min uvia drill dia"), wxDefaultPosition, wxDefaultSize, 0 );
m_MicroViaMinDrillTitle->Wrap( -1 );
fgMinMicroviasValuesSizer->Add( m_MicroViaMinDrillTitle, 0, wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_SetMicroViasMinDrillCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_SetMicroViasMinDrillCtrl->SetMaxLength( 6 );
fgMinMicroviasValuesSizer->Add( m_SetMicroViasMinDrillCtrl, 0, wxALL|wxEXPAND, 5 );
sbViasOptionSizer->Add( m_AllowMicroViaCtrl, 0, wxALL|wxEXPAND, 5 );
sbuViasSizer->Add( fgMinMicroviasValuesSizer, 1, wxEXPAND, 5 );
bDesignRulesUpperSizer->Add( sbuViasSizer, 1, wxALIGN_CENTER_VERTICAL, 5 );
bDesignRulesUpperSizer->Add( sbViasOptionSizer, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
wxStaticBoxSizer* sbMinSizesSizer;
sbMinSizesSizer = new wxStaticBoxSizer( new wxStaticBox( m_panelGolbalDesignRules, wxID_ANY, _("Minimum Allowed Values:") ), wxVERTICAL );
wxFlexGridSizer* fgMinValuesSizer;
fgMinValuesSizer = new wxFlexGridSizer( 1, 2, 0, 0 );
fgMinValuesSizer = new wxFlexGridSizer( 5, 2, 0, 0 );
fgMinValuesSizer->AddGrowableCol( 1 );
fgMinValuesSizer->SetFlexibleDirection( wxBOTH );
fgMinValuesSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
......@@ -249,9 +198,39 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
m_SetTrackMinWidthCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgMinValuesSizer->Add( m_SetTrackMinWidthCtrl, 0, wxALL|wxEXPAND, 5 );
sbMinSizesSizer->Add( fgMinValuesSizer, 0, 0, 5 );
m_ViaMinTitle = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Min via diameter"), wxDefaultPosition, wxDefaultSize, 0 );
m_ViaMinTitle->Wrap( -1 );
fgMinValuesSizer->Add( m_ViaMinTitle, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT, 5 );
m_SetViasMinSizeCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgMinValuesSizer->Add( m_SetViasMinSizeCtrl, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
m_ViaMinDrillTitle = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Min via drill dia"), wxDefaultPosition, wxDefaultSize, 0 );
m_ViaMinDrillTitle->Wrap( -1 );
fgMinValuesSizer->Add( m_ViaMinDrillTitle, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_RIGHT, 5 );
m_SetViasMinDrillCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgMinValuesSizer->Add( m_SetViasMinDrillCtrl, 0, wxALL|wxEXPAND, 5 );
m_MicroViaMinSizeTitle = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Min uvia diameter"), wxDefaultPosition, wxDefaultSize, 0 );
m_MicroViaMinSizeTitle->Wrap( -1 );
fgMinValuesSizer->Add( m_MicroViaMinSizeTitle, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT, 5 );
m_SetMicroViasMinSizeCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_SetMicroViasMinSizeCtrl->SetMaxLength( 6 );
fgMinValuesSizer->Add( m_SetMicroViasMinSizeCtrl, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
m_MicroViaMinDrillTitle = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Min uvia drill dia"), wxDefaultPosition, wxDefaultSize, 0 );
m_MicroViaMinDrillTitle->Wrap( -1 );
fgMinValuesSizer->Add( m_MicroViaMinDrillTitle, 0, wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_SetMicroViasMinDrillCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_SetMicroViasMinDrillCtrl->SetMaxLength( 6 );
fgMinValuesSizer->Add( m_SetMicroViasMinDrillCtrl, 0, wxEXPAND|wxALL, 5 );
sbMinSizesSizer->Add( fgMinValuesSizer, 0, wxEXPAND, 5 );
bDesignRulesUpperSizer->Add( sbMinSizesSizer, 1, wxEXPAND, 5 );
bDesignRulesUpperSizer->Add( sbMinSizesSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
bpanelGlobRulesSizer->Add( bDesignRulesUpperSizer, 0, wxEXPAND, 5 );
......@@ -357,7 +336,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
m_panelGolbalDesignRules->SetSizer( bpanelGlobRulesSizer );
m_panelGolbalDesignRules->Layout();
bpanelGlobRulesSizer->Fit( m_panelGolbalDesignRules );
m_DRnotebook->AddPage( m_panelGolbalDesignRules, _("Global Design Rules"), false );
m_DRnotebook->AddPage( m_panelGolbalDesignRules, _("Global Design Rules"), true );
bMainSizer->Add( m_DRnotebook, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
......
This diff is collapsed.
......@@ -71,17 +71,17 @@ class DIALOG_DESIGN_RULES_BASE : public wxDialog
NETS_LIST_CTRL* m_rightListCtrl;
wxPanel* m_panelGolbalDesignRules;
wxRadioBox* m_OptViaType;
wxRadioBox* m_AllowMicroViaCtrl;
wxStaticText* m_TrackMinWidthTitle;
wxTextCtrl* m_SetTrackMinWidthCtrl;
wxStaticText* m_ViaMinTitle;
wxTextCtrl* m_SetViasMinSizeCtrl;
wxStaticText* m_ViaMinDrillTitle;
wxTextCtrl* m_SetViasMinDrillCtrl;
wxRadioBox* m_AllowMicroViaCtrl;
wxStaticText* m_MicroViaMinSizeTitle;
wxTextCtrl* m_SetMicroViasMinSizeCtrl;
wxStaticText* m_MicroViaMinDrillTitle;
wxTextCtrl* m_SetMicroViasMinDrillCtrl;
wxStaticText* m_TrackMinWidthTitle;
wxTextCtrl* m_SetTrackMinWidthCtrl;
wxStaticLine* m_staticline1;
wxStaticText* m_staticTextInfo;
wxStaticText* m_staticText7;
......
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)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_exchange_modules_base__
#define __dialog_exchange_modules_base__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/radiobox.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
#define ID_SELECTION_CLICKED 1000
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_EXCHANGE_MODULE_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_EXCHANGE_MODULE_BASE : public wxDialog
{
private:
protected:
wxStaticText* m_staticText6;
wxTextCtrl* m_OldModule;
wxStaticText* m_staticText7;
wxTextCtrl* m_OldValue;
wxStaticText* m_staticText8;
wxTextCtrl* m_NewModule;
wxRadioBox* m_Selection;
wxButton* m_OKbutton;
wxButton* m_Quitbutton;
wxButton* m_Browsebutton;
wxTextCtrl* m_WinMessages;
// Virtual event handlers, overide them in your derived class
virtual void OnSelectionClicked( wxCommandEvent& event ){ event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnQuit( wxCommandEvent& event ){ event.Skip(); }
virtual void BrowseAndSelectFootprint( wxCommandEvent& event ){ event.Skip(); }
public:
DIALOG_EXCHANGE_MODULE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Exchange Modules"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 416,469 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_EXCHANGE_MODULE_BASE();
};
#endif //__dialog_exchange_modules_base__
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Nov 17 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_exchange_modules_base__
#define __dialog_exchange_modules_base__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/radiobox.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
#define ID_SELECTION_CLICKED 1000
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_EXCHANGE_MODULE_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_EXCHANGE_MODULE_BASE : public wxDialog
{
private:
protected:
wxStaticText* m_staticText6;
wxTextCtrl* m_OldModule;
wxStaticText* m_staticText7;
wxTextCtrl* m_OldValue;
wxStaticText* m_staticText8;
wxTextCtrl* m_NewModule;
wxRadioBox* m_Selection;
wxButton* m_OKbutton;
wxButton* m_Quitbutton;
wxButton* m_Browsebutton;
wxStaticText* m_staticTextMsg;
wxTextCtrl* m_WinMessages;
// Virtual event handlers, overide them in your derived class
virtual void OnSelectionClicked( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnQuit( wxCommandEvent& event ) { event.Skip(); }
virtual void BrowseAndSelectFootprint( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_EXCHANGE_MODULE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Exchange Modules"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 416,469 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_EXCHANGE_MODULE_BASE();
};
#endif //__dialog_exchange_modules_base__
......@@ -68,7 +68,7 @@ void PCB_EDIT_FRAME::InstallExchangeModuleFrame( MODULE* Module )
void DIALOG_EXCHANGE_MODULE::OnQuit( wxCommandEvent& event )
{
s_SelectionMode = m_Selection->GetSelection();
Close( true ); // true is to force the frame to close
EndModal( 0 );
}
......
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