diff --git a/cvpcb/dialogs/dialog_cvpcb_config_fbp.cpp b/cvpcb/dialogs/dialog_cvpcb_config_fbp.cpp index 3cc5bc80ce..8206be0e38 100644 --- a/cvpcb/dialogs/dialog_cvpcb_config_fbp.cpp +++ b/cvpcb/dialogs/dialog_cvpcb_config_fbp.cpp @@ -1,201 +1,202 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 16 2008) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "dialog_cvpcb_config_fbp.h" - -/////////////////////////////////////////////////////////////////////////// - -DIALOG_CVPCB_CONFIG_FBP::DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* bMainSizer; - bMainSizer = new wxBoxSizer( wxVERTICAL ); - - wxStaticBoxSizer* sbLibsChoiceSizer; - sbLibsChoiceSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Footprint library files") ), wxHORIZONTAL ); - - m_ListLibr = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_EXTENDED|wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE ); - m_ListLibr->SetToolTip( _("List of active library files.\nOnly library files in this list are loaded by Pcbnew.\nThe order of this list is important:\nPcbnew searchs for a given footprint using this list order priority.") ); - m_ListLibr->SetMinSize( wxSize( 450,90 ) ); - - sbLibsChoiceSizer->Add( m_ListLibr, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - - wxBoxSizer* bSizerLibButtons; - bSizerLibButtons = new wxBoxSizer( wxVERTICAL ); - - m_buttonAddLib = new wxButton( this, ID_ADD_LIB, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonAddLib->SetToolTip( _("Add a new library after the selected library, and load it") ); - - bSizerLibButtons->Add( m_buttonAddLib, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT, 5 ); - - m_buttonInsLib = new wxButton( this, ID_INSERT_LIB, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonInsLib->SetToolTip( _("Add a new library before the selected library, and load it") ); - - bSizerLibButtons->Add( m_buttonInsLib, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT, 5 ); - - m_buttonRemoveLib = new wxButton( this, ID_REMOVE_LIB, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonRemoveLib->SetToolTip( _("Unload the selected library") ); - - bSizerLibButtons->Add( m_buttonRemoveLib, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT, 5 ); - - m_buttonLibUp = new wxButton( this, ID_LIB_UP, _("Up"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerLibButtons->Add( m_buttonLibUp, 0, wxRIGHT|wxLEFT, 5 ); - - m_buttonLibDown = new wxButton( this, ID_LIB_DOWN, _("Down"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerLibButtons->Add( m_buttonLibDown, 0, wxRIGHT|wxLEFT, 5 ); - - sbLibsChoiceSizer->Add( bSizerLibButtons, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bMainSizer->Add( sbLibsChoiceSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - wxStaticBoxSizer* sbEquivChoiceSizer; - sbEquivChoiceSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Footprint alias files") ), wxHORIZONTAL ); - - m_ListEquiv = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_EXTENDED|wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE ); - m_ListEquiv->SetToolTip( _("List of active library files.\nOnly library files in this list are loaded by Pcbnew.\nThe order of this list is important:\nPcbnew searchs for a given footprint using this list order priority.") ); - m_ListEquiv->SetMinSize( wxSize( 400,-1 ) ); - - sbEquivChoiceSizer->Add( m_ListEquiv, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - - wxBoxSizer* bSizerEquButtons; - bSizerEquButtons = new wxBoxSizer( wxVERTICAL ); - - m_buttonAddEqu = new wxButton( this, ID_ADD_EQU, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonAddEqu->SetToolTip( _("Add a new library after the selected library, and load it") ); - - bSizerEquButtons->Add( m_buttonAddEqu, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); - - m_buttonInsEqu = new wxButton( this, ID_INSERT_EQU, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonInsEqu->SetToolTip( _("Add a new library before the selected library, and load it") ); - - bSizerEquButtons->Add( m_buttonInsEqu, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT, 5 ); - - m_buttonRemoveEqu = new wxButton( this, ID_REMOVE_EQU, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonRemoveEqu->SetToolTip( _("Unload the selected library") ); - - bSizerEquButtons->Add( m_buttonRemoveEqu, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); - - m_buttonEquUp = new wxButton( this, ID_EQU_UP, _("Up"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerEquButtons->Add( m_buttonEquUp, 0, wxRIGHT|wxLEFT, 5 ); - - m_buttonEquDown = new wxButton( this, ID_EQU_DOWN, _("Down"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerEquButtons->Add( m_buttonEquDown, 0, wxRIGHT|wxLEFT, 5 ); - - sbEquivChoiceSizer->Add( bSizerEquButtons, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bMainSizer->Add( sbEquivChoiceSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - wxStaticBoxSizer* sbModulesDocSizer; - sbModulesDocSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Footprint documentation file") ), wxHORIZONTAL ); - - m_TextHelpModulesFileName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - sbModulesDocSizer->Add( m_TextHelpModulesFileName, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - m_buttonModDoc = new wxButton( this, ID_BROWSE_MOD_DOC, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); - sbModulesDocSizer->Add( m_buttonModDoc, 0, wxRIGHT|wxLEFT, 5 ); - - bMainSizer->Add( sbModulesDocSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - wxStaticBoxSizer* sbSizer4; - sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User defined search paths") ), wxHORIZONTAL ); - - wxBoxSizer* bUserListSizer; - bUserListSizer = new wxBoxSizer( wxVERTICAL ); - - m_listUserPaths = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_NEEDED_SB ); - m_listUserPaths->SetToolTip( _("Additional paths used in this project. The priority is highter than default Kicad paths.") ); - m_listUserPaths->SetMinSize( wxSize( -1,70 ) ); - - bUserListSizer->Add( m_listUserPaths, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); - - sbSizer4->Add( bUserListSizer, 1, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 ); - - wxBoxSizer* bUserPathsButtonsSizer; - bUserPathsButtonsSizer = new wxBoxSizer( wxVERTICAL ); - - m_buttonAddPath = new wxButton( this, ID_LIB_PATH_SEL, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); - bUserPathsButtonsSizer->Add( m_buttonAddPath, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - m_buttonInsPath = new wxButton( this, ID_INSERT_PATH, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); - bUserPathsButtonsSizer->Add( m_buttonInsPath, 0, wxRIGHT|wxLEFT, 5 ); - - m_buttonRemovePath = new wxButton( this, ID_REMOVE_PATH, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); - bUserPathsButtonsSizer->Add( m_buttonRemovePath, 0, wxRIGHT|wxLEFT, 5 ); - - sbSizer4->Add( bUserPathsButtonsSizer, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bMainSizer->Add( sbSizer4, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - wxStaticBoxSizer* sbSizer6; - sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Current search path list") ), wxHORIZONTAL ); - - m_DefaultLibraryPathslistBox = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_NEEDED_SB ); - m_DefaultLibraryPathslistBox->SetToolTip( _("Paths (system paths and user paths) used to search and load libraries files and component doc files.\nSorted by decreasing priority order.") ); - m_DefaultLibraryPathslistBox->SetMinSize( wxSize( -1,70 ) ); - - sbSizer6->Add( m_DefaultLibraryPathslistBox, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - - bMainSizer->Add( sbSizer6, 1, wxALL|wxEXPAND, 5 ); - - m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bMainSizer->Add( m_staticline2, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - - m_sdbSizer2 = new wxStdDialogButtonSizer(); - m_sdbSizer2OK = new wxButton( this, wxID_OK ); - m_sdbSizer2->AddButton( m_sdbSizer2OK ); - m_sdbSizer2Cancel = new wxButton( this, wxID_CANCEL ); - m_sdbSizer2->AddButton( m_sdbSizer2Cancel ); - m_sdbSizer2->Realize(); - bMainSizer->Add( m_sdbSizer2, 0, wxALL|wxEXPAND, 5 ); - - this->SetSizer( bMainSizer ); - this->Layout(); - - this->Centre( wxBOTH ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnCloseWindow ) ); - m_buttonAddLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); - m_buttonInsLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); - m_buttonRemoveLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); - m_buttonLibUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnButtonUpClick ), NULL, this ); - m_buttonLibDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnButtonDownClick ), NULL, this ); - m_buttonAddEqu->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); - m_buttonInsEqu->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); - m_buttonRemoveEqu->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); - m_buttonEquUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnButtonUpClick ), NULL, this ); - m_buttonEquDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnButtonDownClick ), NULL, this ); - m_buttonModDoc->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnBrowseModDocFile ), NULL, this ); - m_buttonAddPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); - m_buttonInsPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); - m_buttonRemovePath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnRemoveUserPath ), NULL, this ); - m_sdbSizer2Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnCancelClick ), NULL, this ); - m_sdbSizer2OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnOkClick ), NULL, this ); -} - -DIALOG_CVPCB_CONFIG_FBP::~DIALOG_CVPCB_CONFIG_FBP() -{ - // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnCloseWindow ) ); - m_buttonAddLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); - m_buttonInsLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); - m_buttonRemoveLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); - m_buttonLibUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnButtonUpClick ), NULL, this ); - m_buttonLibDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnButtonDownClick ), NULL, this ); - m_buttonAddEqu->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); - m_buttonInsEqu->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); - m_buttonRemoveEqu->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); - m_buttonEquUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnButtonUpClick ), NULL, this ); - m_buttonEquDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnButtonDownClick ), NULL, this ); - m_buttonModDoc->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnBrowseModDocFile ), NULL, this ); - m_buttonAddPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); - m_buttonInsPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); - m_buttonRemovePath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnRemoveUserPath ), NULL, this ); - m_sdbSizer2Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnCancelClick ), NULL, this ); - m_sdbSizer2OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnOkClick ), NULL, this ); -} +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Sep 8 2010) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_cvpcb_config_fbp.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_CVPCB_CONFIG_FBP::DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bMainSizer; + bMainSizer = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sbLibsChoiceSizer; + sbLibsChoiceSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Footprint library files") ), wxHORIZONTAL ); + + m_ListLibr = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_EXTENDED|wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE ); + m_ListLibr->SetToolTip( _("List of active library files.\nOnly library files in this list are loaded by Pcbnew.\nThe order of this list is important:\nPcbnew searchs for a given footprint using this list order priority.") ); + m_ListLibr->SetMinSize( wxSize( 450,90 ) ); + + sbLibsChoiceSizer->Add( m_ListLibr, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + wxBoxSizer* bSizerLibButtons; + bSizerLibButtons = new wxBoxSizer( wxVERTICAL ); + + m_buttonAddLib = new wxButton( this, ID_ADD_LIB, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonAddLib->SetToolTip( _("Add a new library after the selected library, and load it") ); + + bSizerLibButtons->Add( m_buttonAddLib, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT, 5 ); + + m_buttonInsLib = new wxButton( this, ID_INSERT_LIB, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonInsLib->SetToolTip( _("Add a new library before the selected library, and load it") ); + + bSizerLibButtons->Add( m_buttonInsLib, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT, 5 ); + + m_buttonRemoveLib = new wxButton( this, ID_REMOVE_LIB, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonRemoveLib->SetToolTip( _("Unload the selected library") ); + + bSizerLibButtons->Add( m_buttonRemoveLib, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT, 5 ); + + m_buttonLibUp = new wxButton( this, ID_LIB_UP, _("Up"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerLibButtons->Add( m_buttonLibUp, 0, wxRIGHT|wxLEFT, 5 ); + + m_buttonLibDown = new wxButton( this, ID_LIB_DOWN, _("Down"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerLibButtons->Add( m_buttonLibDown, 0, wxRIGHT|wxLEFT, 5 ); + + sbLibsChoiceSizer->Add( bSizerLibButtons, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bMainSizer->Add( sbLibsChoiceSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + wxStaticBoxSizer* sbEquivChoiceSizer; + sbEquivChoiceSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Footprint alias files") ), wxHORIZONTAL ); + + m_ListEquiv = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_EXTENDED|wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE ); + m_ListEquiv->SetToolTip( _("List of active library files.\nOnly library files in this list are loaded by Pcbnew.\nThe order of this list is important:\nPcbnew searchs for a given footprint using this list order priority.") ); + m_ListEquiv->SetMinSize( wxSize( 400,-1 ) ); + + sbEquivChoiceSizer->Add( m_ListEquiv, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + wxBoxSizer* bSizerEquButtons; + bSizerEquButtons = new wxBoxSizer( wxVERTICAL ); + + m_buttonAddEqu = new wxButton( this, ID_ADD_EQU, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonAddEqu->SetToolTip( _("Add a new library after the selected library, and load it") ); + + bSizerEquButtons->Add( m_buttonAddEqu, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); + + m_buttonInsEqu = new wxButton( this, ID_INSERT_EQU, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonInsEqu->SetToolTip( _("Add a new library before the selected library, and load it") ); + + bSizerEquButtons->Add( m_buttonInsEqu, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT, 5 ); + + m_buttonRemoveEqu = new wxButton( this, ID_REMOVE_EQU, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonRemoveEqu->SetToolTip( _("Unload the selected library") ); + + bSizerEquButtons->Add( m_buttonRemoveEqu, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); + + m_buttonEquUp = new wxButton( this, ID_EQU_UP, _("Up"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerEquButtons->Add( m_buttonEquUp, 0, wxRIGHT|wxLEFT, 5 ); + + m_buttonEquDown = new wxButton( this, ID_EQU_DOWN, _("Down"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerEquButtons->Add( m_buttonEquDown, 0, wxRIGHT|wxLEFT, 5 ); + + sbEquivChoiceSizer->Add( bSizerEquButtons, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bMainSizer->Add( sbEquivChoiceSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + wxStaticBoxSizer* sbModulesDocSizer; + sbModulesDocSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Footprint documentation file") ), wxHORIZONTAL ); + + m_TextHelpModulesFileName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + sbModulesDocSizer->Add( m_TextHelpModulesFileName, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + m_buttonModDoc = new wxButton( this, ID_BROWSE_MOD_DOC, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); + sbModulesDocSizer->Add( m_buttonModDoc, 0, wxRIGHT|wxLEFT, 5 ); + + bMainSizer->Add( sbModulesDocSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + wxStaticBoxSizer* sbSizer4; + sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User defined search paths") ), wxHORIZONTAL ); + + wxBoxSizer* bUserListSizer; + bUserListSizer = new wxBoxSizer( wxVERTICAL ); + + m_listUserPaths = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_NEEDED_SB ); + m_listUserPaths->SetToolTip( _("Additional paths used in this project. The priority is higher than default KiCad paths.") ); + m_listUserPaths->SetMinSize( wxSize( -1,70 ) ); + + bUserListSizer->Add( m_listUserPaths, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + sbSizer4->Add( bUserListSizer, 1, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 ); + + wxBoxSizer* bUserPathsButtonsSizer; + bUserPathsButtonsSizer = new wxBoxSizer( wxVERTICAL ); + + m_buttonAddPath = new wxButton( this, ID_LIB_PATH_SEL, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); + bUserPathsButtonsSizer->Add( m_buttonAddPath, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + m_buttonInsPath = new wxButton( this, ID_INSERT_PATH, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); + bUserPathsButtonsSizer->Add( m_buttonInsPath, 0, wxRIGHT|wxLEFT, 5 ); + + m_buttonRemovePath = new wxButton( this, ID_REMOVE_PATH, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); + bUserPathsButtonsSizer->Add( m_buttonRemovePath, 0, wxRIGHT|wxLEFT, 5 ); + + sbSizer4->Add( bUserPathsButtonsSizer, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bMainSizer->Add( sbSizer4, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + wxStaticBoxSizer* sbSizer6; + sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Current search path list") ), wxHORIZONTAL ); + + m_DefaultLibraryPathslistBox = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_NEEDED_SB ); + m_DefaultLibraryPathslistBox->SetToolTip( _("System and user paths used to search and load library files and component doc files.\nSorted by decreasing priority order.") ); + m_DefaultLibraryPathslistBox->SetMinSize( wxSize( -1,70 ) ); + + sbSizer6->Add( m_DefaultLibraryPathslistBox, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + bMainSizer->Add( sbSizer6, 1, wxALL|wxEXPAND, 5 ); + + m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bMainSizer->Add( m_staticline2, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + m_sdbSizer2 = new wxStdDialogButtonSizer(); + m_sdbSizer2OK = new wxButton( this, wxID_OK ); + m_sdbSizer2->AddButton( m_sdbSizer2OK ); + m_sdbSizer2Cancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer2->AddButton( m_sdbSizer2Cancel ); + m_sdbSizer2->Realize(); + bMainSizer->Add( m_sdbSizer2, 0, wxALL|wxEXPAND, 5 ); + + this->SetSizer( bMainSizer ); + this->Layout(); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnCloseWindow ) ); + m_buttonAddLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); + m_buttonInsLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); + m_buttonRemoveLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); + m_buttonLibUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnButtonUpClick ), NULL, this ); + m_buttonLibDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnButtonDownClick ), NULL, this ); + m_buttonAddEqu->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); + m_buttonInsEqu->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); + m_buttonRemoveEqu->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); + m_buttonEquUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnButtonUpClick ), NULL, this ); + m_buttonEquDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnButtonDownClick ), NULL, this ); + m_buttonModDoc->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnBrowseModDocFile ), NULL, this ); + m_buttonAddPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); + m_buttonInsPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); + m_buttonRemovePath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnRemoveUserPath ), NULL, this ); + m_sdbSizer2Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnCancelClick ), NULL, this ); + m_sdbSizer2OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnOkClick ), NULL, this ); +} + +DIALOG_CVPCB_CONFIG_FBP::~DIALOG_CVPCB_CONFIG_FBP() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnCloseWindow ) ); + m_buttonAddLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); + m_buttonInsLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); + m_buttonRemoveLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); + m_buttonLibUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnButtonUpClick ), NULL, this ); + m_buttonLibDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnButtonDownClick ), NULL, this ); + m_buttonAddEqu->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); + m_buttonInsEqu->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); + m_buttonRemoveEqu->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); + m_buttonEquUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnButtonUpClick ), NULL, this ); + m_buttonEquDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnButtonDownClick ), NULL, this ); + m_buttonModDoc->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnBrowseModDocFile ), NULL, this ); + m_buttonAddPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); + m_buttonInsPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); + m_buttonRemovePath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnRemoveUserPath ), NULL, this ); + m_sdbSizer2Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnCancelClick ), NULL, this ); + m_sdbSizer2OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CVPCB_CONFIG_FBP::OnOkClick ), NULL, this ); + +} diff --git a/cvpcb/dialogs/dialog_cvpcb_config_fbp.fbp b/cvpcb/dialogs/dialog_cvpcb_config_fbp.fbp index b65d915341..ef8b51f8f6 100644 --- a/cvpcb/dialogs/dialog_cvpcb_config_fbp.fbp +++ b/cvpcb/dialogs/dialog_cvpcb_config_fbp.fbp @@ -1,1261 +1,1370 @@ - - - - - - C++ - 1 - UTF-8 - connect - dialog_cvpcb_config_fbp - 1000 - none - 1 - dialog_cvpcb_config_fbp - - . - - 1 - 1 - 0 - - - wxBOTH - - 1 - - - - 0 - wxID_ANY - - - DIALOG_CVPCB_CONFIG_FBP - - 570,625 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - - - - - - - - - - OnCloseWindow - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bMainSizer - wxVERTICAL - none - - 5 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 1 - - wxID_ANY - Footprint library files - - sbLibsChoiceSizer - wxHORIZONTAL - none - - - 5 - wxEXPAND|wxRIGHT|wxLEFT - 1 - - - - - 1 - - - 0 - wxID_ANY - -1,-1 - 450,90 - m_ListLibr - protected - - - wxLB_EXTENDED|wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE - - List of active library files. Only library files in this list are loaded by Pcbnew. The order of this list is important: Pcbnew searchs for a given footprint using this list order priority. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - - bSizerLibButtons - wxVERTICAL - none - - 5 - wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT - 0 - - - - 0 - 1 - - - 0 - ID_ADD_LIB - Add - - - m_buttonAddLib - protected - - - - - Add a new library after the selected library, and load it - - - - OnAddOrInsertLibClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT - 0 - - - - 0 - 1 - - - 0 - ID_INSERT_LIB - Insert - - - m_buttonInsLib - protected - - - - - Add a new library before the selected library, and load it - - - - OnAddOrInsertLibClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT - 0 - - - - 0 - 1 - - - 0 - ID_REMOVE_LIB - Remove - - - m_buttonRemoveLib - protected - - - - - Unload the selected library - - - - OnRemoveLibClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - ID_LIB_UP - Up - - - m_buttonLibUp - protected - - - - - - - - - OnButtonUpClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - ID_LIB_DOWN - Down - - - m_buttonLibDown - protected - - - - - - - - - OnButtonDownClick - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 1 - - wxID_ANY - Footprint alias files - - sbEquivChoiceSizer - wxHORIZONTAL - none - - - 5 - wxEXPAND|wxRIGHT|wxLEFT - 1 - - - - - 1 - - - 0 - wxID_ANY - -1,-1 - 400,-1 - m_ListEquiv - protected - - - wxLB_EXTENDED|wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE - - List of active library files. Only library files in this list are loaded by Pcbnew. The order of this list is important: Pcbnew searchs for a given footprint using this list order priority. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - - bSizerEquButtons - wxVERTICAL - none - - 5 - wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - ID_ADD_EQU - Add - - - m_buttonAddEqu - protected - - - - - Add a new library after the selected library, and load it - - - - OnAddOrInsertLibClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT - 0 - - - - 0 - 1 - - - 0 - ID_INSERT_EQU - Insert - - - m_buttonInsEqu - protected - - - - - Add a new library before the selected library, and load it - - - - OnAddOrInsertLibClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - ID_REMOVE_EQU - Remove - - - m_buttonRemoveEqu - protected - - - - - Unload the selected library - - - - OnRemoveLibClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - ID_EQU_UP - Up - - - m_buttonEquUp - protected - - - - - - - - - OnButtonUpClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - ID_EQU_DOWN - Down - - - m_buttonEquDown - protected - - - - - - - - - OnButtonDownClick - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 0 - - wxID_ANY - Footprint documentation file - - sbModulesDocSizer - wxHORIZONTAL - none - - - 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 1 - - - - 1 - - - 0 - wxID_ANY - - 0 - - m_TextHelpModulesFileName - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - ID_BROWSE_MOD_DOC - Browse - - - m_buttonModDoc - protected - - - - - - - - - OnBrowseModDocFile - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 1 - - wxID_ANY - User defined search paths - - sbSizer4 - wxHORIZONTAL - none - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND - 1 - - - bUserListSizer - wxVERTICAL - none - - 5 - wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT - 1 - - - - - 1 - - - 0 - wxID_ANY - -1,-1 - -1,70 - m_listUserPaths - protected - - - wxLB_NEEDED_SB - - Additional paths used in this project. The priority is highter than default Kicad paths. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - - bUserPathsButtonsSizer - wxVERTICAL - none - - 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - ID_LIB_PATH_SEL - Add - - - m_buttonAddPath - protected - - - - - - - - - OnAddOrInsertPath - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - ID_INSERT_PATH - Insert - - - m_buttonInsPath - protected - - - - - - - - - OnAddOrInsertPath - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - ID_REMOVE_PATH - Remove - - - m_buttonRemovePath - protected - - - - - - - - - OnRemoveUserPath - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 1 - - wxID_ANY - Current search path list - - sbSizer6 - wxHORIZONTAL - none - - - 5 - wxEXPAND|wxRIGHT|wxLEFT - 1 - - - - - 1 - - - 0 - wxID_ANY - - -1,70 - m_DefaultLibraryPathslistBox - protected - - - wxLB_NEEDED_SB - - Paths (system paths and user paths) used to search and load libraries files and component doc files. Sorted by decreasing priority order. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - - - m_staticline2 - protected - - - wxLI_HORIZONTAL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 - - m_sdbSizer2 - protected - - OnCancelClick - - - - OnOkClick - - - - - - - - + + + + + + C++ + 1 + source_name + 0 + UTF-8 + connect + dialog_cvpcb_config_fbp + 1000 + none + 1 + dialog_cvpcb_config_fbp + + . + + 1 + 1 + 1 + 0 + + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + wxID_ANY + + + DIALOG_CVPCB_CONFIG_FBP + + 570,625 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + OnCloseWindow + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bMainSizer + wxVERTICAL + none + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 1 + + wxID_ANY + Footprint library files + + sbLibsChoiceSizer + wxHORIZONTAL + none + + + 5 + wxEXPAND|wxRIGHT|wxLEFT + 1 + + + + + 1 + 1 + + + 0 + wxID_ANY + -1,-1 + 450,90 + m_ListLibr + protected + + + wxLB_EXTENDED|wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE + + List of active library files. Only library files in this list are loaded by Pcbnew. The order of this list is important: Pcbnew searchs for a given footprint using this list order priority. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + + bSizerLibButtons + wxVERTICAL + none + + 5 + wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT + 0 + + + + 1 + 0 + 1 + + + 0 + ID_ADD_LIB + Add + + + m_buttonAddLib + protected + + + + + Add a new library after the selected library, and load it + + wxFILTER_NONE + wxDefaultValidator + + + + + OnAddOrInsertLibClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT + 0 + + + + 1 + 0 + 1 + + + 0 + ID_INSERT_LIB + Insert + + + m_buttonInsLib + protected + + + + + Add a new library before the selected library, and load it + + wxFILTER_NONE + wxDefaultValidator + + + + + OnAddOrInsertLibClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT + 0 + + + + 1 + 0 + 1 + + + 0 + ID_REMOVE_LIB + Remove + + + m_buttonRemoveLib + protected + + + + + Unload the selected library + + wxFILTER_NONE + wxDefaultValidator + + + + + OnRemoveLibClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxLEFT + 0 + + + + 1 + 0 + 1 + + + 0 + ID_LIB_UP + Up + + + m_buttonLibUp + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnButtonUpClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxLEFT + 0 + + + + 1 + 0 + 1 + + + 0 + ID_LIB_DOWN + Down + + + m_buttonLibDown + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnButtonDownClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 1 + + wxID_ANY + Footprint alias files + + sbEquivChoiceSizer + wxHORIZONTAL + none + + + 5 + wxEXPAND|wxRIGHT|wxLEFT + 1 + + + + + 1 + 1 + + + 0 + wxID_ANY + -1,-1 + 400,-1 + m_ListEquiv + protected + + + wxLB_EXTENDED|wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE + + List of active library files. Only library files in this list are loaded by Pcbnew. The order of this list is important: Pcbnew searchs for a given footprint using this list order priority. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + + bSizerEquButtons + wxVERTICAL + none + + 5 + wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT + 0 + + + + 1 + 0 + 1 + + + 0 + ID_ADD_EQU + Add + + + m_buttonAddEqu + protected + + + + + Add a new library after the selected library, and load it + + wxFILTER_NONE + wxDefaultValidator + + + + + OnAddOrInsertLibClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT + 0 + + + + 1 + 0 + 1 + + + 0 + ID_INSERT_EQU + Insert + + + m_buttonInsEqu + protected + + + + + Add a new library before the selected library, and load it + + wxFILTER_NONE + wxDefaultValidator + + + + + OnAddOrInsertLibClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT + 0 + + + + 1 + 0 + 1 + + + 0 + ID_REMOVE_EQU + Remove + + + m_buttonRemoveEqu + protected + + + + + Unload the selected library + + wxFILTER_NONE + wxDefaultValidator + + + + + OnRemoveLibClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxLEFT + 0 + + + + 1 + 0 + 1 + + + 0 + ID_EQU_UP + Up + + + m_buttonEquUp + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnButtonUpClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxLEFT + 0 + + + + 1 + 0 + 1 + + + 0 + ID_EQU_DOWN + Down + + + m_buttonEquDown + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnButtonDownClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 0 + + wxID_ANY + Footprint documentation file + + sbModulesDocSizer + wxHORIZONTAL + none + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 1 + + + + 1 + 1 + + + 0 + wxID_ANY + + 0 + + m_TextHelpModulesFileName + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxLEFT + 0 + + + + 1 + 0 + 1 + + + 0 + ID_BROWSE_MOD_DOC + Browse + + + m_buttonModDoc + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnBrowseModDocFile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 1 + + wxID_ANY + User defined search paths + + sbSizer4 + wxHORIZONTAL + none + + + 5 + wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND + 1 + + + bUserListSizer + wxVERTICAL + none + + 5 + wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT + 1 + + + + + 1 + 1 + + + 0 + wxID_ANY + -1,-1 + -1,70 + m_listUserPaths + protected + + + wxLB_NEEDED_SB + + Additional paths used in this project. The priority is higher than default KiCad paths. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + + bUserPathsButtonsSizer + wxVERTICAL + none + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + + + 1 + 0 + 1 + + + 0 + ID_LIB_PATH_SEL + Add + + + m_buttonAddPath + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnAddOrInsertPath + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxLEFT + 0 + + + + 1 + 0 + 1 + + + 0 + ID_INSERT_PATH + Insert + + + m_buttonInsPath + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnAddOrInsertPath + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxLEFT + 0 + + + + 1 + 0 + 1 + + + 0 + ID_REMOVE_PATH + Remove + + + m_buttonRemovePath + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnRemoveUserPath + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 1 + + wxID_ANY + Current search path list + + sbSizer6 + wxHORIZONTAL + none + + + 5 + wxEXPAND|wxRIGHT|wxLEFT + 1 + + + + + 1 + 1 + + + 0 + wxID_ANY + + -1,70 + m_DefaultLibraryPathslistBox + protected + + + wxLB_NEEDED_SB + + System and user paths used to search and load library files and component doc files. Sorted by decreasing priority order. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + + + 1 + 1 + + + 0 + wxID_ANY + + + m_staticline2 + protected + + + wxLI_HORIZONTAL + + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer2 + protected + + OnCancelClick + + + + OnOkClick + + + + + + + + diff --git a/cvpcb/dialogs/dialog_cvpcb_config_fbp.h b/cvpcb/dialogs/dialog_cvpcb_config_fbp.h index aa6eba2649..aee31e10b0 100644 --- a/cvpcb/dialogs/dialog_cvpcb_config_fbp.h +++ b/cvpcb/dialogs/dialog_cvpcb_config_fbp.h @@ -1,97 +1,98 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 16 2008) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#ifndef __dialog_cvpcb_config_fbp__ -#define __dialog_cvpcb_config_fbp__ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_CVPCB_CONFIG_FBP -/////////////////////////////////////////////////////////////////////////////// -class DIALOG_CVPCB_CONFIG_FBP : public wxDialog -{ - private: - - protected: - enum - { - ID_ADD_LIB = 1000, - ID_INSERT_LIB, - ID_REMOVE_LIB, - ID_LIB_UP, - ID_LIB_DOWN, - ID_ADD_EQU, - ID_INSERT_EQU, - ID_REMOVE_EQU, - ID_EQU_UP, - ID_EQU_DOWN, - ID_BROWSE_MOD_DOC, - ID_LIB_PATH_SEL, - ID_INSERT_PATH, - ID_REMOVE_PATH, - }; - - wxListBox* m_ListLibr; - wxButton* m_buttonAddLib; - wxButton* m_buttonInsLib; - wxButton* m_buttonRemoveLib; - wxButton* m_buttonLibUp; - wxButton* m_buttonLibDown; - wxListBox* m_ListEquiv; - wxButton* m_buttonAddEqu; - wxButton* m_buttonInsEqu; - wxButton* m_buttonRemoveEqu; - wxButton* m_buttonEquUp; - wxButton* m_buttonEquDown; - wxTextCtrl* m_TextHelpModulesFileName; - wxButton* m_buttonModDoc; - wxListBox* m_listUserPaths; - wxButton* m_buttonAddPath; - wxButton* m_buttonInsPath; - wxButton* m_buttonRemovePath; - wxListBox* m_DefaultLibraryPathslistBox; - wxStaticLine* m_staticline2; - wxStdDialogButtonSizer* m_sdbSizer2; - wxButton* m_sdbSizer2OK; - wxButton* m_sdbSizer2Cancel; - - // Virtual event handlers, overide them in your derived class - virtual void OnCloseWindow( wxCloseEvent& event ){ event.Skip(); } - virtual void OnAddOrInsertLibClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnRemoveLibClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnButtonUpClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnButtonDownClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnBrowseModDocFile( wxCommandEvent& event ){ event.Skip(); } - virtual void OnAddOrInsertPath( wxCommandEvent& event ){ event.Skip(); } - virtual void OnRemoveUserPath( wxCommandEvent& event ){ event.Skip(); } - virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); } - - - public: - DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 570,625 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DIALOG_CVPCB_CONFIG_FBP(); - -}; - -#endif //__dialog_cvpcb_config_fbp__ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Sep 8 2010) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __dialog_cvpcb_config_fbp__ +#define __dialog_cvpcb_config_fbp__ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_CVPCB_CONFIG_FBP +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_CVPCB_CONFIG_FBP : public wxDialog +{ + private: + + protected: + enum + { + ID_ADD_LIB = 1000, + ID_INSERT_LIB, + ID_REMOVE_LIB, + ID_LIB_UP, + ID_LIB_DOWN, + ID_ADD_EQU, + ID_INSERT_EQU, + ID_REMOVE_EQU, + ID_EQU_UP, + ID_EQU_DOWN, + ID_BROWSE_MOD_DOC, + ID_LIB_PATH_SEL, + ID_INSERT_PATH, + ID_REMOVE_PATH, + }; + + wxListBox* m_ListLibr; + wxButton* m_buttonAddLib; + wxButton* m_buttonInsLib; + wxButton* m_buttonRemoveLib; + wxButton* m_buttonLibUp; + wxButton* m_buttonLibDown; + wxListBox* m_ListEquiv; + wxButton* m_buttonAddEqu; + wxButton* m_buttonInsEqu; + wxButton* m_buttonRemoveEqu; + wxButton* m_buttonEquUp; + wxButton* m_buttonEquDown; + wxTextCtrl* m_TextHelpModulesFileName; + wxButton* m_buttonModDoc; + wxListBox* m_listUserPaths; + wxButton* m_buttonAddPath; + wxButton* m_buttonInsPath; + wxButton* m_buttonRemovePath; + wxListBox* m_DefaultLibraryPathslistBox; + wxStaticLine* m_staticline2; + wxStdDialogButtonSizer* m_sdbSizer2; + wxButton* m_sdbSizer2OK; + wxButton* m_sdbSizer2Cancel; + + // Virtual event handlers, overide them in your derived class + virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); } + virtual void OnAddOrInsertLibClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnRemoveLibClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnButtonUpClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnButtonDownClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnBrowseModDocFile( wxCommandEvent& event ) { event.Skip(); } + virtual void OnAddOrInsertPath( wxCommandEvent& event ) { event.Skip(); } + virtual void OnRemoveUserPath( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } + + + public: + + DIALOG_CVPCB_CONFIG_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 570,625 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_CVPCB_CONFIG_FBP(); + +}; + +#endif //__dialog_cvpcb_config_fbp__ diff --git a/eeschema/dialogs/dialog_eeschema_config_fbp.cpp b/eeschema/dialogs/dialog_eeschema_config_fbp.cpp index 9dd99a097a..07980061e8 100644 --- a/eeschema/dialogs/dialog_eeschema_config_fbp.cpp +++ b/eeschema/dialogs/dialog_eeschema_config_fbp.cpp @@ -1,141 +1,141 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 6 2011) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "dialog_eeschema_config_fbp.h" - -/////////////////////////////////////////////////////////////////////////// - -DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* bMainSizer; - bMainSizer = new wxBoxSizer( wxVERTICAL ); - - wxStaticBoxSizer* sbLibsChoiceSizer; - sbLibsChoiceSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Component library files") ), wxHORIZONTAL ); - - m_ListLibr = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_EXTENDED|wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE ); - m_ListLibr->SetToolTip( _("List of active library files.\nOnly library files in this list are loaded by Eeschema.\nThe order of this list is important:\nEeschema searchs for a given component using this list order priority.") ); - m_ListLibr->SetMinSize( wxSize( 400,250 ) ); - - sbLibsChoiceSizer->Add( m_ListLibr, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - wxBoxSizer* bRightSizer; - bRightSizer = new wxBoxSizer( wxVERTICAL ); - - m_buttonAddLib = new wxButton( this, ID_ADD_LIB, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonAddLib->SetToolTip( _("Add a new library after the selected library, and load it") ); - - bRightSizer->Add( m_buttonAddLib, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5 ); - - m_buttonIns = new wxButton( this, wxID_ANY, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonIns->SetToolTip( _("Add a new library before the selected library, and load it") ); - - bRightSizer->Add( m_buttonIns, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5 ); - - m_buttonRemoveLib = new wxButton( this, ID_REMOVE_LIB, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonRemoveLib->SetToolTip( _("Unload the selected library") ); - - bRightSizer->Add( m_buttonRemoveLib, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - m_buttonUp = new wxButton( this, wxID_ANY, _("Up"), wxDefaultPosition, wxDefaultSize, 0 ); - bRightSizer->Add( m_buttonUp, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_buttonDown = new wxButton( this, wxID_ANY, _("Down"), wxDefaultPosition, wxDefaultSize, 0 ); - bRightSizer->Add( m_buttonDown, 0, wxALL|wxEXPAND, 5 ); - - sbLibsChoiceSizer->Add( bRightSizer, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - bMainSizer->Add( sbLibsChoiceSizer, 2, wxALL|wxEXPAND, 5 ); - - wxStaticBoxSizer* sbSizer4; - sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User defined search path") ), wxHORIZONTAL ); - - m_listUserPaths = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE ); - m_listUserPaths->SetToolTip( _("Additional paths used in this project. The priority is highter than default Kicad paths.") ); - m_listUserPaths->SetMinSize( wxSize( 400,90 ) ); - - sbSizer4->Add( m_listUserPaths, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - wxBoxSizer* bUserPathsButtonsSizer; - bUserPathsButtonsSizer = new wxBoxSizer( wxVERTICAL ); - - m_buttonAddPath = new wxButton( this, ID_LIB_PATH_SEL, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); - bUserPathsButtonsSizer->Add( m_buttonAddPath, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5 ); - - m_buttonInsPath = new wxButton( this, wxID_INSERT_PATH, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); - bUserPathsButtonsSizer->Add( m_buttonInsPath, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5 ); - - m_buttonRemovePath = new wxButton( this, wxID_REMOVE_PATH, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); - bUserPathsButtonsSizer->Add( m_buttonRemovePath, 0, wxALL|wxEXPAND, 5 ); - - sbSizer4->Add( bUserPathsButtonsSizer, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - bMainSizer->Add( sbSizer4, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - wxStaticBoxSizer* sbLibPathSizer; - sbLibPathSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Current search path list") ), wxVERTICAL ); - - m_DefaultLibraryPathslistBox = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_NEEDED_SB ); - m_DefaultLibraryPathslistBox->SetToolTip( _("Paths (system paths and user paths) used to search and load libraries files and component doc files.\nSorted by decreasing priority order.") ); - - sbLibPathSizer->Add( m_DefaultLibraryPathslistBox, 1, wxALL|wxEXPAND, 5 ); - - bMainSizer->Add( sbLibPathSizer, 1, wxALL|wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); - - m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bMainSizer->Add( m_staticline3, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - - m_sdbSizer1 = new wxStdDialogButtonSizer(); - m_sdbSizer1OK = new wxButton( this, wxID_OK ); - m_sdbSizer1->AddButton( m_sdbSizer1OK ); - m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); - m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); - m_sdbSizer1->Realize(); - bMainSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 5 ); - - this->SetSizer( bMainSizer ); - this->Layout(); - bMainSizer->Fit( this ); - - this->Centre( wxBOTH ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCloseWindow ) ); - m_ListLibr->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnFilesListClick ), NULL, this ); - m_ListLibr->Connect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnFilesListClick ), NULL, this ); - m_buttonAddLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); - m_buttonIns->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); - m_buttonRemoveLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); - m_buttonUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnButtonUpClick ), NULL, this ); - m_buttonDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnButtonDownClick ), NULL, this ); - m_buttonAddPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); - m_buttonInsPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); - m_buttonRemovePath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveUserPath ), NULL, this ); - m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCancelClick ), NULL, this ); - m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnOkClick ), NULL, this ); -} - -DIALOG_EESCHEMA_CONFIG_FBP::~DIALOG_EESCHEMA_CONFIG_FBP() -{ - // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCloseWindow ) ); - m_ListLibr->Disconnect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnFilesListClick ), NULL, this ); - m_ListLibr->Disconnect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnFilesListClick ), NULL, this ); - m_buttonAddLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); - m_buttonIns->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); - m_buttonRemoveLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); - m_buttonUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnButtonUpClick ), NULL, this ); - m_buttonDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnButtonDownClick ), NULL, this ); - m_buttonAddPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); - m_buttonInsPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); - m_buttonRemovePath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveUserPath ), NULL, this ); - m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCancelClick ), NULL, this ); - m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnOkClick ), NULL, this ); - -} +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Sep 8 2010) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_eeschema_config_fbp.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bMainSizer; + bMainSizer = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sbLibsChoiceSizer; + sbLibsChoiceSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Component library files") ), wxHORIZONTAL ); + + m_ListLibr = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_EXTENDED|wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE ); + m_ListLibr->SetToolTip( _("List of active library files.\nOnly library files in this list are loaded by Eeschema.\nThe order of this list is important:\nEeschema searchs for a given component using this list order priority.") ); + m_ListLibr->SetMinSize( wxSize( 400,250 ) ); + + sbLibsChoiceSizer->Add( m_ListLibr, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + wxBoxSizer* bRightSizer; + bRightSizer = new wxBoxSizer( wxVERTICAL ); + + m_buttonAddLib = new wxButton( this, ID_ADD_LIB, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonAddLib->SetToolTip( _("Add a new library after the selected library, and load it") ); + + bRightSizer->Add( m_buttonAddLib, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5 ); + + m_buttonIns = new wxButton( this, wxID_ANY, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonIns->SetToolTip( _("Add a new library before the selected library, and load it") ); + + bRightSizer->Add( m_buttonIns, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5 ); + + m_buttonRemoveLib = new wxButton( this, ID_REMOVE_LIB, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonRemoveLib->SetToolTip( _("Unload the selected library") ); + + bRightSizer->Add( m_buttonRemoveLib, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + m_buttonUp = new wxButton( this, wxID_ANY, _("Up"), wxDefaultPosition, wxDefaultSize, 0 ); + bRightSizer->Add( m_buttonUp, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_buttonDown = new wxButton( this, wxID_ANY, _("Down"), wxDefaultPosition, wxDefaultSize, 0 ); + bRightSizer->Add( m_buttonDown, 0, wxALL|wxEXPAND, 5 ); + + sbLibsChoiceSizer->Add( bRightSizer, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + bMainSizer->Add( sbLibsChoiceSizer, 2, wxALL|wxEXPAND, 5 ); + + wxStaticBoxSizer* sbSizer4; + sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User defined search path") ), wxHORIZONTAL ); + + m_listUserPaths = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE ); + m_listUserPaths->SetToolTip( _("Additional paths used in this project. The priority is higher than default KiCad paths.") ); + m_listUserPaths->SetMinSize( wxSize( 400,90 ) ); + + sbSizer4->Add( m_listUserPaths, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + wxBoxSizer* bUserPathsButtonsSizer; + bUserPathsButtonsSizer = new wxBoxSizer( wxVERTICAL ); + + m_buttonAddPath = new wxButton( this, ID_LIB_PATH_SEL, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); + bUserPathsButtonsSizer->Add( m_buttonAddPath, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5 ); + + m_buttonInsPath = new wxButton( this, wxID_INSERT_PATH, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); + bUserPathsButtonsSizer->Add( m_buttonInsPath, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5 ); + + m_buttonRemovePath = new wxButton( this, wxID_REMOVE_PATH, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); + bUserPathsButtonsSizer->Add( m_buttonRemovePath, 0, wxALL|wxEXPAND, 5 ); + + sbSizer4->Add( bUserPathsButtonsSizer, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + bMainSizer->Add( sbSizer4, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + wxStaticBoxSizer* sbLibPathSizer; + sbLibPathSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Current search path list") ), wxVERTICAL ); + + m_DefaultLibraryPathslistBox = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_NEEDED_SB ); + m_DefaultLibraryPathslistBox->SetToolTip( _("System and user paths used to search and load library files and component doc files.\nSorted by decreasing priority order.") ); + + sbLibPathSizer->Add( m_DefaultLibraryPathslistBox, 1, wxALL|wxEXPAND, 5 ); + + bMainSizer->Add( sbLibPathSizer, 1, wxALL|wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); + + m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bMainSizer->Add( m_staticline3, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + m_sdbSizer1 = new wxStdDialogButtonSizer(); + m_sdbSizer1OK = new wxButton( this, wxID_OK ); + m_sdbSizer1->AddButton( m_sdbSizer1OK ); + m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); + m_sdbSizer1->Realize(); + bMainSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 5 ); + + this->SetSizer( bMainSizer ); + this->Layout(); + bMainSizer->Fit( this ); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCloseWindow ) ); + m_ListLibr->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnFilesListClick ), NULL, this ); + m_ListLibr->Connect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnFilesListClick ), NULL, this ); + m_buttonAddLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); + m_buttonIns->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); + m_buttonRemoveLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); + m_buttonUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnButtonUpClick ), NULL, this ); + m_buttonDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnButtonDownClick ), NULL, this ); + m_buttonAddPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); + m_buttonInsPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); + m_buttonRemovePath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveUserPath ), NULL, this ); + m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCancelClick ), NULL, this ); + m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnOkClick ), NULL, this ); +} + +DIALOG_EESCHEMA_CONFIG_FBP::~DIALOG_EESCHEMA_CONFIG_FBP() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCloseWindow ) ); + m_ListLibr->Disconnect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnFilesListClick ), NULL, this ); + m_ListLibr->Disconnect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnFilesListClick ), NULL, this ); + m_buttonAddLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); + m_buttonIns->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); + m_buttonRemoveLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); + m_buttonUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnButtonUpClick ), NULL, this ); + m_buttonDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnButtonDownClick ), NULL, this ); + m_buttonAddPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); + m_buttonInsPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); + m_buttonRemovePath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveUserPath ), NULL, this ); + m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCancelClick ), NULL, this ); + m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnOkClick ), NULL, this ); + +} diff --git a/eeschema/dialogs/dialog_eeschema_config_fbp.fbp b/eeschema/dialogs/dialog_eeschema_config_fbp.fbp index 984b88a85f..4ba49ccf9c 100644 --- a/eeschema/dialogs/dialog_eeschema_config_fbp.fbp +++ b/eeschema/dialogs/dialog_eeschema_config_fbp.fbp @@ -1,1272 +1,861 @@ - - - - - - C++ - 1 - source_name - 0 - res - UTF-8 - connect - dialog_eeschema_config_fbp - 1000 - none - 1 - dialog_eeschema_config - - . - - 1 - 1 - 1 - 0 - - 1 - 1 - 1 - 1 - 0 - - - - - 1 - wxBOTH - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - impl_virtual - - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - DIALOG_EESCHEMA_CONFIG_FBP - 1 - - - 1 - - - Resizable - - 1 - -1,-1 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - OnCloseWindow - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bMainSizer - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 2 - - wxID_ANY - Component library files - - sbLibsChoiceSizer - wxHORIZONTAL - none - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 1 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - 400,250 - 1 - m_ListLibr - 1 - - - protected - 1 - - - Resizable - - 1 - - wxLB_EXTENDED|wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE - - 0 - List of active library files. Only library files in this list are loaded by Eeschema. The order of this list is important: Eeschema searchs for a given component using this list order priority. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - OnFilesListClick - OnFilesListClick - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - - bRightSizer - wxVERTICAL - none - - 5 - wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_ADD_LIB - Add - - - 0 - - - 0 - - 1 - m_buttonAddLib - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - Add a new library after the selected library, and load it - - wxFILTER_NONE - wxDefaultValidator - - - - - OnAddOrInsertLibClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Insert - - - 0 - - - 0 - - 1 - m_buttonIns - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - Add a new library before the selected library, and load it - - wxFILTER_NONE - wxDefaultValidator - - - - - OnAddOrInsertLibClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_REMOVE_LIB - Remove - - - 0 - - - 0 - - 1 - m_buttonRemoveLib - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - Unload the selected library - - wxFILTER_NONE - wxDefaultValidator - - - - - OnRemoveLibClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Up - - - 0 - - - 0 - - 1 - m_buttonUp - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnButtonUpClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Down - - - 0 - - - 0 - - 1 - m_buttonDown - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnButtonDownClick - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 1 - - wxID_ANY - User defined search path - - sbSizer4 - wxHORIZONTAL - none - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 1 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - 400,90 - 1 - m_listUserPaths - 1 - - - protected - 1 - - - Resizable - - 1 - - wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE - - 0 - Additional paths used in this project. The priority is highter than default Kicad paths. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - - bUserPathsButtonsSizer - wxVERTICAL - none - - 5 - wxLEFT|wxRIGHT|wxTOP|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_LIB_PATH_SEL - Add - - - 0 - - - 0 - - 1 - m_buttonAddPath - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnAddOrInsertPath - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxLEFT|wxRIGHT|wxTOP|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_INSERT_PATH - Insert - - - 0 - - - 0 - - 1 - m_buttonInsPath - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnAddOrInsertPath - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_REMOVE_PATH - Remove - - - 0 - - - 0 - - 1 - m_buttonRemovePath - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnRemoveUserPath - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT - 1 - - wxID_ANY - Current search path list - - sbLibPathSizer - wxVERTICAL - none - - - 5 - wxALL|wxEXPAND - 1 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - -1,-1 - 1 - m_DefaultLibraryPathslistBox - 1 - - - protected - 1 - - - Resizable - - 1 - - wxLB_NEEDED_SB - - 0 - Paths (system paths and user paths) used to search and load libraries files and component doc files. Sorted by decreasing priority order. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - m_staticline3 - 1 - - - protected - 1 - - - Resizable - - 1 - - wxLI_HORIZONTAL - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 - - m_sdbSizer1 - public - - OnCancelClick - - - - OnOkClick - - - - - - - - + + + + + + C++ + 1 + source_name + 0 + UTF-8 + connect + dialog_eeschema_config_fbp + 1000 + none + 1 + dialog_eeschema_config + + . + + 1 + 1 + 1 + 0 + + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + wxID_ANY + + + DIALOG_EESCHEMA_CONFIG_FBP + + -1,-1 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + OnCloseWindow + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bMainSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 2 + + wxID_ANY + Component library files + + sbLibsChoiceSizer + wxHORIZONTAL + none + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 1 + + + + + 1 + 1 + + + 0 + wxID_ANY + + 400,250 + m_ListLibr + protected + + + wxLB_EXTENDED|wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE + + List of active library files. Only library files in this list are loaded by Eeschema. The order of this list is important: Eeschema searchs for a given component using this list order priority. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + OnFilesListClick + OnFilesListClick + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + bRightSizer + wxVERTICAL + none + + 5 + wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP|wxEXPAND + 0 + + + + 1 + 0 + 1 + + + 0 + ID_ADD_LIB + Add + + + m_buttonAddLib + protected + + + + + Add a new library after the selected library, and load it + + wxFILTER_NONE + wxDefaultValidator + + + + + OnAddOrInsertLibClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP|wxEXPAND + 0 + + + + 1 + 0 + 1 + + + 0 + wxID_ANY + Insert + + + m_buttonIns + protected + + + + + Add a new library before the selected library, and load it + + wxFILTER_NONE + wxDefaultValidator + + + + + OnAddOrInsertLibClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND + 0 + + + + 1 + 0 + 1 + + + 0 + ID_REMOVE_LIB + Remove + + + m_buttonRemoveLib + protected + + + + + Unload the selected library + + wxFILTER_NONE + wxDefaultValidator + + + + + OnRemoveLibClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + 0 + 1 + + + 0 + wxID_ANY + Up + + + m_buttonUp + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnButtonUpClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + + 1 + 0 + 1 + + + 0 + wxID_ANY + Down + + + m_buttonDown + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnButtonDownClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 1 + + wxID_ANY + User defined search path + + sbSizer4 + wxHORIZONTAL + none + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 1 + + + + + 1 + 1 + + + 0 + wxID_ANY + + 400,90 + m_listUserPaths + protected + + + wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE + + Additional paths used in this project. The priority is higher than default KiCad paths. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + + bUserPathsButtonsSizer + wxVERTICAL + none + + 5 + wxLEFT|wxRIGHT|wxTOP|wxEXPAND + 0 + + + + 1 + 0 + 1 + + + 0 + ID_LIB_PATH_SEL + Add + + + m_buttonAddPath + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnAddOrInsertPath + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxLEFT|wxRIGHT|wxTOP|wxEXPAND + 0 + + + + 1 + 0 + 1 + + + 0 + wxID_INSERT_PATH + Insert + + + m_buttonInsPath + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnAddOrInsertPath + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + + 1 + 0 + 1 + + + 0 + wxID_REMOVE_PATH + Remove + + + m_buttonRemovePath + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnRemoveUserPath + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 1 + + wxID_ANY + Current search path list + + sbLibPathSizer + wxVERTICAL + none + + + 5 + wxALL|wxEXPAND + 1 + + + + + 1 + 1 + + + 0 + wxID_ANY + + -1,-1 + m_DefaultLibraryPathslistBox + protected + + + wxLB_NEEDED_SB + + System and user paths used to search and load library files and component doc files. Sorted by decreasing priority order. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + + + 1 + 1 + + + 0 + wxID_ANY + + + m_staticline3 + protected + + + wxLI_HORIZONTAL + + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer1 + public + + OnCancelClick + + + + OnOkClick + + + + + + + + diff --git a/eeschema/dialogs/dialog_eeschema_config_fbp.h b/eeschema/dialogs/dialog_eeschema_config_fbp.h index b92c801461..cfe10c54b1 100644 --- a/eeschema/dialogs/dialog_eeschema_config_fbp.h +++ b/eeschema/dialogs/dialog_eeschema_config_fbp.h @@ -1,80 +1,80 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 6 2011) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#ifndef __dialog_eeschema_config_fbp__ -#define __dialog_eeschema_config_fbp__ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_EESCHEMA_CONFIG_FBP -/////////////////////////////////////////////////////////////////////////////// -class DIALOG_EESCHEMA_CONFIG_FBP : public wxDialog -{ - private: - - protected: - enum - { - ID_ADD_LIB = 1000, - ID_REMOVE_LIB, - ID_LIB_PATH_SEL, - wxID_INSERT_PATH, - wxID_REMOVE_PATH, - }; - - wxListBox* m_ListLibr; - wxButton* m_buttonAddLib; - wxButton* m_buttonIns; - wxButton* m_buttonRemoveLib; - wxButton* m_buttonUp; - wxButton* m_buttonDown; - wxListBox* m_listUserPaths; - wxButton* m_buttonAddPath; - wxButton* m_buttonInsPath; - wxButton* m_buttonRemovePath; - wxListBox* m_DefaultLibraryPathslistBox; - wxStaticLine* m_staticline3; - - // Virtual event handlers, overide them in your derived class - virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); } - virtual void OnFilesListClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnAddOrInsertLibClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnRemoveLibClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnButtonUpClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnButtonDownClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnAddOrInsertPath( wxCommandEvent& event ) { event.Skip(); } - virtual void OnRemoveUserPath( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } - - - public: - wxStdDialogButtonSizer* m_sdbSizer1; - wxButton* m_sdbSizer1OK; - wxButton* m_sdbSizer1Cancel; - - DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DIALOG_EESCHEMA_CONFIG_FBP(); - -}; - -#endif //__dialog_eeschema_config_fbp__ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Sep 8 2010) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __dialog_eeschema_config_fbp__ +#define __dialog_eeschema_config_fbp__ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_EESCHEMA_CONFIG_FBP +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_EESCHEMA_CONFIG_FBP : public wxDialog +{ + private: + + protected: + enum + { + ID_ADD_LIB = 1000, + ID_REMOVE_LIB, + ID_LIB_PATH_SEL, + wxID_INSERT_PATH, + wxID_REMOVE_PATH, + }; + + wxListBox* m_ListLibr; + wxButton* m_buttonAddLib; + wxButton* m_buttonIns; + wxButton* m_buttonRemoveLib; + wxButton* m_buttonUp; + wxButton* m_buttonDown; + wxListBox* m_listUserPaths; + wxButton* m_buttonAddPath; + wxButton* m_buttonInsPath; + wxButton* m_buttonRemovePath; + wxListBox* m_DefaultLibraryPathslistBox; + wxStaticLine* m_staticline3; + + // Virtual event handlers, overide them in your derived class + virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); } + virtual void OnFilesListClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnAddOrInsertLibClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnRemoveLibClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnButtonUpClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnButtonDownClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnAddOrInsertPath( wxCommandEvent& event ) { event.Skip(); } + virtual void OnRemoveUserPath( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } + + + public: + wxStdDialogButtonSizer* m_sdbSizer1; + wxButton* m_sdbSizer1OK; + wxButton* m_sdbSizer1Cancel; + + DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_EESCHEMA_CONFIG_FBP(); + +}; + +#endif //__dialog_eeschema_config_fbp__ diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index 143f4648bf..d29c3f9184 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -24,7 +24,7 @@ */ /** - * @file files-io.cpp + * @file eeschema/files-io.cpp */ #include "fctsys.h" diff --git a/gerbview/class_gerber_draw_item.cpp b/gerbview/class_gerber_draw_item.cpp index 2e798a1583..8575083704 100644 --- a/gerbview/class_gerber_draw_item.cpp +++ b/gerbview/class_gerber_draw_item.cpp @@ -1,7 +1,3 @@ -/** - * @file class_gerber_draw_item.cpp - */ - /* * This program source code file is part of KiCad, a free EDA CAD application. * @@ -26,6 +22,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +/** + * @file class_gerber_draw_item.cpp + */ + #include "fctsys.h" #include "polygons_defs.h" #include "gr_basic.h" @@ -42,10 +42,8 @@ #include "class_GERBER.h" -/**********************************************************/ GERBER_DRAW_ITEM::GERBER_DRAW_ITEM( BOARD_ITEM* aParent, GERBER_IMAGE* aGerberparams ) : BOARD_ITEM( aParent, TYPE_GERBER_DRAW_ITEM ) -/**********************************************************/ { m_imageParams = aGerberparams; m_Layer = 0; @@ -105,15 +103,6 @@ GERBER_DRAW_ITEM* GERBER_DRAW_ITEM::Copy() const } -/** - * Function GetABPosition - * returns the image position of aPosition for this object. - * Image position is the value of aPosition, modified by image parameters: - * offsets, axis selection, scale, rotation - * @param aXYPosition = position in Y,X gerber axis - * @return const wxPoint& - The position in A,B axis. - * Because draw axis is top to bottom, the final y coordinates is negated - */ wxPoint GERBER_DRAW_ITEM::GetABPosition( const wxPoint& aXYPosition ) const { /* Note: RS274Xrevd_e is obscure about the order of transforms: @@ -124,10 +113,12 @@ wxPoint GERBER_DRAW_ITEM::GetABPosition( const wxPoint& aXYPosition ) const if( m_swapAxis ) EXCHG( abPos.x, abPos.y ); + abPos += m_layerOffset + m_imageParams->m_ImageOffset; abPos.x = wxRound( abPos.x * m_drawScale.x ); abPos.y = wxRound( abPos.y * m_drawScale.y ); int rotation = wxRound(m_lyrRotation*10) + (m_imageParams->m_ImageRotation*10); + if( rotation ) RotatePoint( &abPos, -rotation ); @@ -142,52 +133,44 @@ wxPoint GERBER_DRAW_ITEM::GetABPosition( const wxPoint& aXYPosition ) const } -/** - * Function GetXYPosition - * returns the image position of aPosition for this object. - * Image position is the value of aPosition, modified by image parameters: - * offsets, axis selection, scale, rotation - * @param aABPosition = position in A,B plotter axis - * @return const wxPoint - The given position in X,Y axis. - */ wxPoint GERBER_DRAW_ITEM::GetXYPosition( const wxPoint& aABPosition ) { - // do the inverse tranform made by GetABPosition + // do the inverse transform made by GetABPosition wxPoint xyPos = aABPosition; if( m_mirrorA ) NEGATE( xyPos.x ); + if( !m_mirrorB ) NEGATE( xyPos.y ); + int rotation = wxRound(m_lyrRotation*10) + (m_imageParams->m_ImageRotation*10); + if( rotation ) RotatePoint( &xyPos, rotation ); + xyPos.x = wxRound( xyPos.x / m_drawScale.x ); xyPos.y = wxRound( xyPos.y / m_drawScale.y ); xyPos -= m_layerOffset + m_imageParams->m_ImageOffset; + if( m_swapAxis ) EXCHG( xyPos.x, xyPos.y ); + return xyPos - m_imageParams->m_ImageJustifyOffset; } -/** - * Function SetLayerParameters - * Initialize draw parameters from Image and Layer parameters - * found in the gerber file: - * m_UnitsMetric, - * m_MirrorA, m_MirrorB, - * m_DrawScale, m_DrawOffset - */ void GERBER_DRAW_ITEM::SetLayerParameters() { m_UnitsMetric = m_imageParams->m_GerbMetric; m_swapAxis = m_imageParams->m_SwapAxis; // false if A = X, B = Y; + // true if A =Y, B = Y m_mirrorA = m_imageParams->m_MirrorA; // true: mirror / axe A m_mirrorB = m_imageParams->m_MirrorB; // true: mirror / axe B - m_drawScale = m_imageParams->m_Scale; // A and B scaling factor - m_layerOffset = m_imageParams->m_Offset; // Offset from OF command + m_drawScale = m_imageParams->m_Scale; // A and B scaling factor + m_layerOffset = m_imageParams->m_Offset; // Offset from OF command + // Rotation from RO command: m_lyrRotation = m_imageParams->m_LocalRotation; m_LayerNegative = m_imageParams->GetLayerParams().m_LayerNegative; @@ -226,8 +209,10 @@ wxString GERBER_DRAW_ITEM::ShowGBRShape() { wxString name = wxT( "apt_macro" ); D_CODE* dcode = GetDcodeDescr(); + if( dcode && dcode->GetMacro() ) name << wxT(" ") << dcode->GetMacro()->name; + return name; } @@ -237,11 +222,6 @@ wxString GERBER_DRAW_ITEM::ShowGBRShape() } -/** - * Function GetDcodeDescr - * returns the GetDcodeDescr of this object, or NULL. - * @return D_CODE* - a pointer to the DCode description (for flashed items). - */ D_CODE* GERBER_DRAW_ITEM::GetDcodeDescr() { if( (m_DCode < FIRST_DCODE) || (m_DCode > LAST_DCODE) ) @@ -269,11 +249,6 @@ EDA_RECT GERBER_DRAW_ITEM::GetBoundingBox() const } -/** - * Function MoveAB - * move this object. - * @param aMoveVector - the move vector for this object, in AB plotter axis. - */ void GERBER_DRAW_ITEM::MoveAB( const wxPoint& aMoveVector ) { wxPoint xymove = GetXYPosition( aMoveVector ); @@ -281,44 +256,32 @@ void GERBER_DRAW_ITEM::MoveAB( const wxPoint& aMoveVector ) m_Start += xymove; m_End += xymove; m_ArcCentre += xymove; + for( unsigned ii = 0; ii < m_PolyCorners.size(); ii++ ) m_PolyCorners[ii] += xymove; } -/** - * Function MoveXY - * move this object. - * @param aMoveVector - the move vector for this object, in XY gerber axis. - */ void GERBER_DRAW_ITEM::MoveXY( const wxPoint& aMoveVector ) { m_Start += aMoveVector; m_End += aMoveVector; m_ArcCentre += aMoveVector; + for( unsigned ii = 0; ii < m_PolyCorners.size(); ii++ ) m_PolyCorners[ii] += aMoveVector; } -/** - * Function Save. - * currently: no nothing, but must be defined to meet requirements - * of the basic class - */ bool GERBER_DRAW_ITEM::Save( FILE* aFile ) const { return true; } -/* Function HasNegativeItems - * return true if this item or at least one shape (when using aperture macros) - * must be drawn in background color - * useful to optimize screen refresh - */ bool GERBER_DRAW_ITEM::HasNegativeItems() { bool isClear = m_LayerNegative ^ m_imageParams->m_ImageNegative; + // if isClear is true, this item has negative shape // but if isClear is true, and if this item use an aperture macro definition, // we must see if this aperture macro uses a negative shape. @@ -327,11 +290,14 @@ bool GERBER_DRAW_ITEM::HasNegativeItems() // see for a macro def D_CODE* dcodeDescr = GetDcodeDescr(); + if( dcodeDescr == NULL ) return false; + if( m_Shape == GBR_SPOT_MACRO ) { APERTURE_MACRO* macro = dcodeDescr->GetMacro(); + if( macro ) // macro == NULL should not occurs return macro->HasNegativeItems( this ); } @@ -340,12 +306,11 @@ bool GERBER_DRAW_ITEM::HasNegativeItems() } -/*********************************************************************/ void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoint& aOffset ) -/*********************************************************************/ { - static D_CODE dummyD_CODE( 0 ); // used when a D_CODE is not found. default D_CODE to draw a flashed item + // used when a D_CODE is not found. default D_CODE to draw a flashed item + static D_CODE dummyD_CODE( 0 ); int color, alt_color; bool isFilled; int radius; @@ -362,13 +327,14 @@ void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, color = brd->GetLayerColor( GetLayer() ); - if( aDrawMode & GR_SURBRILL ) + if( aDrawMode & GR_HIGHLIGHT ) { if( aDrawMode & GR_AND ) color &= ~HIGHLIGHT_FLAG; else color |= HIGHLIGHT_FLAG; } + if( color & HIGHLIGHT_FLAG ) color = ColorRefs[color & MASKCOLOR].m_LightColor; @@ -379,6 +345,7 @@ void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, * when drawing so that an erasure happens. */ bool isDark = !(m_LayerNegative ^ m_imageParams->m_ImageNegative); + if( !isDark ) { // draw in background color ("negative" color) @@ -393,14 +360,16 @@ void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, { case GBR_POLYGON: isFilled = (g_DisplayPolygonsModeSketch == false); + if( !isDark ) isFilled = true; + DrawGbrPoly( &aPanel->m_ClipBox, aDC, color, aOffset, isFilled ); break; case GBR_CIRCLE: radius = wxRound(hypot( (double) ( m_End.x - m_Start.x ), - (double) ( m_End.y - m_Start.y ) )); + (double) ( m_End.y - m_Start.y ) )); halfPenWidth = m_Size.x >> 1; @@ -422,12 +391,14 @@ void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, case GBR_ARC: // Currently, arcs plotted with a rectangular aperture are not supported. // a round pen only is expected. -#if 0 // for arc debug only + +#if 0 // for arc debug only GRLine( &aPanel->m_ClipBox, aDC, GetABPosition( m_Start ), GetABPosition( m_ArcCentre ), 0, color ); GRLine( &aPanel->m_ClipBox, aDC, GetABPosition( m_End ), GetABPosition( m_ArcCentre ), 0, color ); #endif + if( !isFilled ) { GRArc1( &aPanel->m_ClipBox, aDC, GetABPosition( m_Start ), @@ -440,6 +411,7 @@ void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, GetABPosition( m_End ), GetABPosition( m_ArcCentre ), m_Size.x, color ); } + break; case GBR_SPOT_CIRCLE: @@ -462,6 +434,7 @@ void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, { if( m_PolyCorners.size() == 0 ) ConvertSegmentToPolygon( ); + DrawGbrPoly( &aPanel->m_ClipBox, aDC, color, aOffset, isFilled ); } else @@ -477,26 +450,21 @@ void GERBER_DRAW_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, GetABPosition( m_End ), m_Size.x, color ); } } + break; default: if( !show_err ) { wxMessageBox( wxT( "Trace_Segment() type error" ) ); - show_err = TRUE; + show_err = true; } + break; } } -/** - * Function ConvertSegmentToPolygon - * convert a line to an equivalent polygon. - * Useful when a line is plotted using a rectangular pen. - * In this case, the usual segment plot cannot be used - * The equivalent polygon is the area paint by the rectancular pen - * from m_Start to m_End. - */ + void GERBER_DRAW_ITEM::ConvertSegmentToPolygon( ) { m_PolyCorners.clear(); @@ -504,6 +472,7 @@ void GERBER_DRAW_ITEM::ConvertSegmentToPolygon( ) wxPoint start = m_Start; wxPoint end = m_End; + // make calculations more easy if ensure start.x < end.x // (only 2 quadrants to consider) if( start.x > end.x ) @@ -511,14 +480,17 @@ void GERBER_DRAW_ITEM::ConvertSegmentToPolygon( ) // calculate values relative to start point: wxPoint delta = end - start; + // calculate corners for the first quadrant only (delta.x and delta.y > 0 ) // currently, delta.x already is > 0. // make delta.y > 0 bool change = delta.y < 0; + if( change ) NEGATE( delta.y); + // Now create the full polygon. - // Due to previous chnages, the shape is always something like + // Due to previous changes, the shape is always something like // 3 4 // 2 5 // 1 6 @@ -528,15 +500,18 @@ void GERBER_DRAW_ITEM::ConvertSegmentToPolygon( ) m_PolyCorners.push_back( corner ); // Lower left corner, start point (1) corner.y += m_Size.y; m_PolyCorners.push_back( corner ); // upper left corner, start point (2) + if( delta.x || delta.y) { corner += delta; m_PolyCorners.push_back( corner ); // upper left corner, end point (3) } + corner.x += m_Size.x; m_PolyCorners.push_back( corner ); // upper right corner, end point (4) corner.y -= m_Size.y; m_PolyCorners.push_back( corner ); // lower right corner, end point (5) + if( delta.x || delta.y ) { corner -= delta; @@ -548,16 +523,12 @@ void GERBER_DRAW_ITEM::ConvertSegmentToPolygon( ) { if( change ) NEGATE( m_PolyCorners[ii].y); + m_PolyCorners[ii] += start; } } -/* - * Function DrawGbrPoly - * a helper function used id ::Draw to draw the polygon stored in m_PolyCorners - * Draw filled polygons - */ void GERBER_DRAW_ITEM::DrawGbrPoly( EDA_RECT* aClipBox, wxDC* aDC, int aColor, @@ -577,13 +548,6 @@ void GERBER_DRAW_ITEM::DrawGbrPoly( EDA_RECT* aClipBox, } -/** - * Function DisplayInfo - * has knowledge about the frame and how and where to put status information - * about this object into the frame's message panel. - * Display info about this GERBER item - * @param frame A EDA_DRAW_FRAME in which to print status information. - */ void GERBER_DRAW_ITEM::DisplayInfo( EDA_DRAW_FRAME* frame ) { wxString msg; @@ -623,18 +587,12 @@ void GERBER_DRAW_ITEM::DisplayInfo( EDA_DRAW_FRAME* frame ) } -/** - * Function HitTest - * tests if the given wxPoint is within the bounds of this object. - * @param aRefPos A wxPoint to test in AB axis - * @return bool - true if a hit, else false - */ bool GERBER_DRAW_ITEM::HitTest( const wxPoint& aRefPos ) { // calculate aRefPos in XY gerber axis: wxPoint ref_pos = GetXYPosition( aRefPos ); - // TODO: a better analyse of the shape (perhaps create a D_CODE::HitTest for flashed items) + // TODO: a better analyze of the shape (perhaps create a D_CODE::HitTest for flashed items) int radius = MIN( m_Size.x, m_Size.y ) >> 1; // delta is a vector from m_Start to m_End (an origin of m_Start) @@ -645,8 +603,7 @@ bool GERBER_DRAW_ITEM::HitTest( const wxPoint& aRefPos ) if( m_Flashed ) { - return (double) dist.x * dist.x + (double) dist.y * dist.y <= - (double) radius * radius; + return (double) dist.x * dist.x + (double) dist.y * dist.y <= (double) radius * radius; } else { @@ -658,35 +615,24 @@ bool GERBER_DRAW_ITEM::HitTest( const wxPoint& aRefPos ) } -/** - * Function HitTest (overlayed) - * tests if the given EDA_RECT intersect this object. - * For now, an ending point must be inside this rect. - * @param aRefArea : the given EDA_RECT in AB plotter axis - * @return bool - true if a hit, else false - */ bool GERBER_DRAW_ITEM::HitTest( EDA_RECT& aRefArea ) { wxPoint pos = GetABPosition( m_Start ); if( aRefArea.Contains( pos ) ) return true; + pos = GetABPosition( m_End ); + if( aRefArea.Contains( pos ) ) return true; + return false; } #if defined(DEBUG) -/** - * Function Show - * is used to output the object tree, currently for debugging only. - * @param nestLevel An aid to prettier tree indenting, and is the level - * of nesting of this object within the overall tree. - * @param os The ostream& to output to. - */ void GERBER_DRAW_ITEM::Show( int nestLevel, std::ostream& os ) { NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << @@ -703,5 +649,4 @@ void GERBER_DRAW_ITEM::Show( int nestLevel, std::ostream& os ) os << "\n"; } - #endif diff --git a/gerbview/class_gerber_draw_item.h b/gerbview/class_gerber_draw_item.h index 1f422d29a3..83298c6c0f 100644 --- a/gerbview/class_gerber_draw_item.h +++ b/gerbview/class_gerber_draw_item.h @@ -1,10 +1,3 @@ -/** - * @file class_gerber_draw_item.h - */ - -#ifndef CLASS_GERBER_DRAW_ITEM_H -#define CLASS_GERBER_DRAW_ITEM_H - /* * This program source code file is part of KiCad, a free EDA CAD application. * @@ -29,10 +22,20 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +/** + * @file class_gerber_draw_item.h + */ + +#ifndef CLASS_GERBER_DRAW_ITEM_H +#define CLASS_GERBER_DRAW_ITEM_H + #include "base_struct.h" #include "class_board_item.h" + + class GERBER_IMAGE; + /* Shapes id for basic shapes ( .m_Shape member ) */ enum Gbr_Basic_Shapes { GBR_SEGMENT = 0, // usual segment : line with rounded ends @@ -42,7 +45,7 @@ enum Gbr_Basic_Shapes { GBR_SPOT_CIRCLE, // flashed shape: round shape (can have hole) GBR_SPOT_RECT, // flashed shape: rectangular shape can have hole) GBR_SPOT_OVAL, // flashed shape: oval shape - GBR_SPOT_POLY, // flashed shape: regulat polygon, 3 to 12 edges + GBR_SPOT_POLY, // flashed shape: regular polygon, 3 to 12 edges GBR_SPOT_MACRO, // complex shape described by a macro GBR_LAST // last value for this list }; @@ -59,8 +62,8 @@ private: public: - bool m_UnitsMetric; /* store here the gerber units (inch/mm). - * Used only to calculate aperture macros shapes sizes */ + bool m_UnitsMetric; /* store here the gerber units (inch/mm). Used + * only to calculate aperture macros shapes sizes */ int m_Shape; // Shape and type of this gerber item wxPoint m_Start; // Line or arc start point or position of the shape // for flashed items @@ -77,16 +80,16 @@ public: // values 0 to 9 can be used for special purposes GERBER_IMAGE* m_imageParams; /* main GERBER info for this item * Note: some params stored in this class are common - * to the whole gerber file (i.e) the whole graphic layer - * and some can change when reaging the file, so they - * are stored inside this item - * there is no redundancy for these parameters + * to the whole gerber file (i.e) the whole graphic + * layer and some can change when reaging the file, + * so they are stored inside this item there is no + * redundancy for these parameters */ private: // These values are used to draw this item, according to gerber layers parameters - // Because they can change inside a gerber image, thery are stored here + // Because they can change inside a gerber image, they are stored here // for each item - bool m_LayerNegative; // TRUE = item in negative Layer + bool m_LayerNegative; // true = item in negative Layer bool m_swapAxis; // false if A = X, B = Y; true if A =Y, B = Y bool m_mirrorA; // true: mirror / axe A bool m_mirrorB; // true: mirror / axe B @@ -137,7 +140,7 @@ public: * m_MirrorA, m_MirrorB, * m_DrawScale, m_DrawOffset */ - void SetLayerParameters( ); + void SetLayerParameters(); void SetLayerPolarity( bool aNegative) { @@ -194,15 +197,15 @@ public: * returns the GetDcodeDescr of this object, or NULL. * @return D_CODE* - a pointer to the DCode description (for flashed items). */ - D_CODE* GetDcodeDescr(); + D_CODE* GetDcodeDescr(); EDA_RECT GetBoundingBox() const; /* Display on screen: */ - void Draw( EDA_DRAW_PANEL* aPanel, - wxDC* aDC, - int aDrawMode, - const wxPoint& aOffset = ZeroOffset ); + void Draw( EDA_DRAW_PANEL* aPanel, + wxDC* aDC, + int aDrawMode, + const wxPoint&aOffset = ZeroOffset ); /** * Function ConvertSegmentToPolygon @@ -210,7 +213,7 @@ public: * Useful when a line is plotted using a rectangular pen. * In this case, the usual segment plot function cannot be used */ - void ConvertSegmentToPolygon( ); + void ConvertSegmentToPolygon(); /** * Function DrawGbrPoly @@ -231,7 +234,7 @@ public: * Display info about this GERBER item * @param frame A EDA_DRAW_FRAME in which to print status information. */ - void DisplayInfo( EDA_DRAW_FRAME* frame ); + void DisplayInfo( EDA_DRAW_FRAME* frame ); wxString ShowGBRShape(); @@ -241,16 +244,16 @@ public: * @param aRefPos a wxPoint to test * @return bool - true if a hit, else false */ - bool HitTest( const wxPoint& aRefPos ); + bool HitTest( const wxPoint& aRefPos ); /** - * Function HitTest (overlayed) + * Function HitTest (overloaded) * tests if the given wxRect intersect this object. * For now, an ending point must be inside this rect. * @param aRefArea a wxPoint to test * @return bool - true if a hit, else false */ - bool HitTest( EDA_RECT& aRefArea ); + bool HitTest( EDA_RECT& aRefArea ); /** * Function GetClass @@ -263,7 +266,12 @@ public: } - bool Save( FILE* aFile ) const; + /** + * Function Save. + * currently: no nothing, but must be defined to meet requirements + * of the basic class + */ + bool Save( FILE* aFile ) const; #if defined(DEBUG) @@ -271,7 +279,7 @@ public: * Function Show * is used to output the object tree, currently for debugging only. * @param nestLevel An aid to prettier tree indenting, and is the level - * of nesting of this object within the overall tree. + * of nesting of this object within the overall tree. * @param os The ostream& to output to. */ virtual void Show( int nestLevel, std::ostream& os ); diff --git a/gerbview/dcode.cpp b/gerbview/dcode.cpp index 277a79a58a..0d9c29fba2 100644 --- a/gerbview/dcode.cpp +++ b/gerbview/dcode.cpp @@ -1,6 +1,32 @@ -/***************************/ -/**** class D_CODE ****/ -/***************************/ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2011 Wayne Stambaugh + * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/** + * @file dcode.cpp + * @brief D_CODE class implementation + */ #include "fctsys.h" #include "common.h" @@ -27,7 +53,7 @@ * D02 = light extinction (pen up) while moving * D03 = Flash * D04 to D09 = non used - * D10 ... D999 = Indentification Tool (Shape id) + * D10 ... D999 = Identification Tool (Shape id) * * For tools defining a shape): * DCode min = D10 @@ -96,16 +122,6 @@ const wxChar* D_CODE::ShowApertureType( APERTURE_T aType ) return ret; } -/** GetShapeDim - * Calculate a value that can be used to evaluate the size of text - * when displaying the D-Code of an item - * due to the complexity of some shapes, - * one cannot calculate the "size" of a shape (only a bounding box) - * but here, the "dimension" of the shape is the diameter of the primitive - * or for lines the width of the line if the shape is a line - * @param aParent = the parent GERBER_DRAW_ITEM which is actually drawn - * @return a dimension, or -1 if no dim to calculate - */ int D_CODE::GetShapeDim( GERBER_DRAW_ITEM* aParent ) { int dim = -1; @@ -137,17 +153,6 @@ int D_CODE::GetShapeDim( GERBER_DRAW_ITEM* aParent ) } -/* - * Function ReadDCodeDefinitionFile - * Can be useful only with old RS274D Gerber file format. - * Is not needed with RS274X files format. - * These files need an auxiliary DCode file description. There is no defined file format for this. - * This function read a file format I needed a long time ago. - * reads in a dcode file assuming ALSPCB file format with ';' indicating comments. - * Format is like CSV but with optional ';' delineated comments: - * tool, Horiz, Vert, drill, speed, accel. ,Type ; [DCODE (commentaire)] - * ex: 1, 12, 12, 0, 0, 0, 3 ; D10 - */ int GERBVIEW_FRAME::ReadDCodeDefinitionFile( const wxString& D_Code_FullFileName ) { int current_Dcode, ii, dcode_scale; @@ -200,11 +205,12 @@ int GERBVIEW_FRAME::ReadDCodeDefinitionFile( const wxString& D_Code_FullFileName /* Determine of the type of file from D_Code. */ ptcar = line; ii = 0; + while( *ptcar ) if( *(ptcar++) == ',' ) ii++; - if( ii >= 6 ) /* valeurs en mils */ + if( ii >= 6 ) /* value in mils */ { sscanf( line, "%d,%d,%d,%d,%d,%d,%d", &ii, &dimH, &dimV, &drill, &dummy, &dummy, &type_outil ); @@ -212,8 +218,10 @@ int GERBVIEW_FRAME::ReadDCodeDefinitionFile( const wxString& D_Code_FullFileName dimH = wxRound( dimH * dcode_scale ); dimV = wxRound( dimV * dcode_scale ); drill = wxRound( drill * dcode_scale ); + if( ii < 1 ) ii = 1; + current_Dcode = ii - 1 + FIRST_DCODE; } else /* Values in inches are converted to mils. */ @@ -223,6 +231,7 @@ int GERBVIEW_FRAME::ReadDCodeDefinitionFile( const wxString& D_Code_FullFileName sscanf( line, "%f,%f,%1s", &fdimV, &fdimH, c_type_outil ); ptcar = line; + while( *ptcar ) { if( *ptcar == 'D' ) @@ -231,7 +240,9 @@ int GERBVIEW_FRAME::ReadDCodeDefinitionFile( const wxString& D_Code_FullFileName break; } else + { ptcar++; + } } dimH = wxRound( fdimH * dcode_scale * 1000 ); @@ -239,7 +250,9 @@ int GERBVIEW_FRAME::ReadDCodeDefinitionFile( const wxString& D_Code_FullFileName drill = wxRound( fdrill * dcode_scale * 1000 ); if( strchr( "CLROP", c_type_outil[0] ) ) + { type_outil = (APERTURE_T) c_type_outil[0]; + } else { fclose( dest ); @@ -247,7 +260,7 @@ int GERBVIEW_FRAME::ReadDCodeDefinitionFile( const wxString& D_Code_FullFileName } } - /* Update the list of d_codes if consistant. */ + /* Update the list of d_codes if consistent. */ if( current_Dcode < FIRST_DCODE ) continue; @@ -259,7 +272,7 @@ int GERBVIEW_FRAME::ReadDCodeDefinitionFile( const wxString& D_Code_FullFileName dcode->m_Size.y = dimV; dcode->m_Shape = (APERTURE_T) type_outil; dcode->m_Drill.x = dcode->m_Drill.y = drill; - dcode->m_Defined = TRUE; + dcode->m_Defined = true; } fclose( dest ); @@ -268,8 +281,6 @@ int GERBVIEW_FRAME::ReadDCodeDefinitionFile( const wxString& D_Code_FullFileName } -/* Set Size Items (Lines, Flashes) from DCodes List - */ void GERBVIEW_FRAME::CopyDCodesSizeToItems() { static D_CODE dummy( 999 ); //Used if D_CODE not found in list @@ -284,9 +295,10 @@ void GERBVIEW_FRAME::CopyDCodesSizeToItems() if( dcode == NULL ) dcode = &dummy; - dcode->m_InUse = TRUE; + dcode->m_InUse = true; gerb_item->m_Size = dcode->m_Size; + if( // Line Item (gerb_item->m_Shape == GBR_SEGMENT ) /* rectilinear segment */ || (gerb_item->m_Shape == GBR_ARC ) /* segment arc (rounded tips) */ @@ -327,11 +339,6 @@ void GERBVIEW_FRAME::CopyDCodesSizeToItems() } -/* - * Function DrawFlashedShape - * Draw the dcode shape for flashed items. - * When an item is flashed, the DCode shape is the shape of the item - */ void D_CODE::DrawFlashedShape( GERBER_DRAW_ITEM* aParent, EDA_RECT* aClipBox, wxDC* aDC, int aColor, int aAltColor, wxPoint aShapePos, bool aFilledShape ) @@ -348,12 +355,13 @@ void D_CODE::DrawFlashedShape( GERBER_DRAW_ITEM* aParent, case APT_CIRCLE: radius = m_Size.x >> 1; if( !aFilledShape ) - GRCircle( aClipBox, aDC, aParent->GetABPosition(aShapePos), - radius, 0, aColor ); + GRCircle( aClipBox, aDC, aParent->GetABPosition(aShapePos), radius, 0, aColor ); else if( m_DrillShape == APT_DEF_NO_HOLE ) + { GRFilledCircle( aClipBox, aDC, aParent->GetABPosition(aShapePos), radius, aColor ); + } else if( APT_DEF_ROUND_HOLE == 1 ) // round hole in shape { int width = (m_Size.x - m_Drill.x ) / 2; @@ -364,6 +372,7 @@ void D_CODE::DrawFlashedShape( GERBER_DRAW_ITEM* aParent, { if( m_PolyCorners.size() == 0 ) ConvertShapeToPolygon(); + DrawFlashedPolygon( aParent, aClipBox, aDC, aColor, aFilledShape, aShapePos ); } break; @@ -376,20 +385,20 @@ void D_CODE::DrawFlashedShape( GERBER_DRAW_ITEM* aParent, wxPoint end = start + m_Size; start = aParent->GetABPosition( start ); end = aParent->GetABPosition( end ); + if( !aFilledShape ) { - GRRect( aClipBox, aDC, start.x, start.y, end.x, end.y, - 0, aColor ); + GRRect( aClipBox, aDC, start.x, start.y, end.x, end.y, 0, aColor ); } else if( m_DrillShape == APT_DEF_NO_HOLE ) { - GRFilledRect( aClipBox, aDC, start.x, start.y, end.x, end.y, - 0, aColor, aColor ); + GRFilledRect( aClipBox, aDC, start.x, start.y, end.x, end.y, 0, aColor, aColor ); } else { if( m_PolyCorners.size() == 0 ) ConvertShapeToPolygon(); + DrawFlashedPolygon( aParent, aClipBox, aDC, aColor, aFilledShape, aShapePos ); } } @@ -399,6 +408,7 @@ void D_CODE::DrawFlashedShape( GERBER_DRAW_ITEM* aParent, { wxPoint start = aShapePos; wxPoint end = aShapePos; + if( m_Size.x > m_Size.y ) // horizontal oval { int delta = (m_Size.x - m_Size.y) / 2; @@ -413,22 +423,23 @@ void D_CODE::DrawFlashedShape( GERBER_DRAW_ITEM* aParent, end.y += delta; radius = m_Size.x; } + start = aParent->GetABPosition( start ); end = aParent->GetABPosition( end ); + if( !aFilledShape ) { - GRCSegm( aClipBox, aDC, start.x, start.y, - end.x, end.y, radius, aColor ); + GRCSegm( aClipBox, aDC, start.x, start.y, end.x, end.y, radius, aColor ); } else if( m_DrillShape == APT_DEF_NO_HOLE ) { - GRFillCSegm( aClipBox, aDC, start.x, - start.y, end.x, end.y, radius, aColor ); + GRFillCSegm( aClipBox, aDC, start.x, start.y, end.x, end.y, radius, aColor ); } else { if( m_PolyCorners.size() == 0 ) ConvertShapeToPolygon(); + DrawFlashedPolygon( aParent, aClipBox, aDC, aColor, aFilledShape, aShapePos ); } } @@ -437,19 +448,13 @@ void D_CODE::DrawFlashedShape( GERBER_DRAW_ITEM* aParent, case APT_POLYGON: if( m_PolyCorners.size() == 0 ) ConvertShapeToPolygon(); + DrawFlashedPolygon( aParent, aClipBox, aDC, aColor, aFilledShape, aShapePos ); break; } } -/* - * Function DrawFlashedPolygon - * a helper function used id ::Draw to draw the polygon stored ion m_PolyCorners - * Draw some Apertures shapes when they are defined as filled polygons. - * APT_POLYGON is always a polygon, but some complex shapes are also converted to - * polygons (shapes with holes) - */ void D_CODE::DrawFlashedPolygon( GERBER_DRAW_ITEM* aParent, EDA_RECT* aClipBox, wxDC* aDC, int aColor, bool aFilled, @@ -460,6 +465,7 @@ void D_CODE::DrawFlashedPolygon( GERBER_DRAW_ITEM* aParent, std::vector points; points = m_PolyCorners; + for( unsigned ii = 0; ii < points.size(); ii++ ) { points[ii] += aPosition; @@ -472,20 +478,14 @@ void D_CODE::DrawFlashedPolygon( GERBER_DRAW_ITEM* aParent, #define SEGS_CNT 32 // number of segments to approximate a circle -// A helper function for D_CODE::ConvertShapeToPolygon(). -// Add a hole to a polygon + +// A helper function for D_CODE::ConvertShapeToPolygon(). Add a hole to a polygon static void addHoleToPolygon( std::vector& aBuffer, APERTURE_DEF_HOLETYPE aHoleShape, wxSize aSize, wxPoint aAnchorPos ); -/** - * Function ConvertShapeToPolygon - * convert a shape to an equivalent polygon. - * Arcs and circles are approximated by segments - * Useful when a shape is not a graphic primitive (shape with hole, - * Rotated shape ... ) and cannot be easily drawn. - */ + void D_CODE::ConvertShapeToPolygon() { wxPoint initialpos; @@ -498,6 +498,7 @@ void D_CODE::ConvertShapeToPolygon() case APT_CIRCLE: // creates only a circle with rectangular hole currpos.x = m_Size.x >> 1; initialpos = currpos; + for( unsigned ii = 0; ii <= SEGS_CNT; ii++ ) { currpos = initialpos; @@ -540,12 +541,14 @@ void D_CODE::ConvertShapeToPolygon() delta = (m_Size.y - m_Size.x) / 2; radius = m_Size.x / 2; } + currpos.y = radius; initialpos = currpos; m_PolyCorners.push_back( currpos ); // build the right arc of the shape unsigned ii = 0; + for( ; ii <= SEGS_CNT / 2; ii++ ) { currpos = initialpos; @@ -564,6 +567,7 @@ void D_CODE::ConvertShapeToPolygon() } m_PolyCorners.push_back( initialpos ); // close outline + if( m_Size.y > m_Size.x ) // vertical oval, rotate polygon. { for( unsigned jj = 0; jj < m_PolyCorners.size(); jj++ ) @@ -581,8 +585,10 @@ void D_CODE::ConvertShapeToPolygon() // rs274x said: m_EdgesCount = 3 ... 12 if( m_EdgesCount < 3 ) m_EdgesCount = 3; + if( m_EdgesCount > 12 ) m_EdgesCount = 12; + for( int ii = 0; ii <= m_EdgesCount; ii++ ) { currpos = initialpos; @@ -591,14 +597,17 @@ void D_CODE::ConvertShapeToPolygon() } addHoleToPolygon( m_PolyCorners, m_DrillShape, m_Drill, initialpos ); + if( m_Rotation ) // vertical oval, rotate polygon. { int angle = wxRound( m_Rotation * 10 ); + for( unsigned jj = 0; jj < m_PolyCorners.size(); jj++ ) { RotatePoint( &m_PolyCorners[jj], -angle ); } } + break; case APT_MACRO: @@ -618,23 +627,24 @@ static void addHoleToPolygon( std::vector& aBuffer, { wxPoint currpos; - if( aHoleShape == APT_DEF_ROUND_HOLE ) // build a round hole + if( aHoleShape == APT_DEF_ROUND_HOLE ) // build a round hole { for( int ii = 0; ii <= SEGS_CNT; ii++ ) { currpos.x = 0; - currpos.y = aSize.x / 2; // aSize.x / 2 is the radius of the hole + currpos.y = aSize.x / 2; // aSize.x / 2 is the radius of the hole RotatePoint( &currpos, ii * 3600 / SEGS_CNT ); aBuffer.push_back( currpos ); } aBuffer.push_back( aAnchorPos ); // link to outline } + if( aHoleShape == APT_DEF_RECT_HOLE ) // Create rectangular hole { currpos.x = aSize.x / 2; currpos.y = aSize.y / 2; - aBuffer.push_back( currpos ); // link to hole and begin hole + aBuffer.push_back( currpos ); // link to hole and begin hole currpos.x -= aSize.x; aBuffer.push_back( currpos ); currpos.y -= aSize.y; @@ -642,7 +652,7 @@ static void addHoleToPolygon( std::vector& aBuffer, currpos.x += aSize.x; aBuffer.push_back( currpos ); currpos.y += aSize.y; - aBuffer.push_back( currpos ); // close hole - aBuffer.push_back( aAnchorPos ); // link to outline + aBuffer.push_back( currpos ); // close hole + aBuffer.push_back( aAnchorPos ); // link to outline } } diff --git a/gerbview/dcode.h b/gerbview/dcode.h index daed654bc8..996d82b9fa 100644 --- a/gerbview/dcode.h +++ b/gerbview/dcode.h @@ -1,7 +1,3 @@ -/** - * @file dcode.h - */ - /* * This program source code file is part of KiCad, a free EDA CAD application. * @@ -27,15 +23,21 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +/** + * @file dcode.h + */ + #ifndef _DCODE_H_ #define _DCODE_H_ #include -//#include #include "base_struct.h" + + class GERBER_DRAW_ITEM; + /** * Enum APERTURE_T * is the set of all gerber aperture types allowed, according to page 16 of @@ -51,7 +53,7 @@ enum APERTURE_T { }; // In aperture definition, round, oval and rectangular flashed shapes -// can have a hole (ropund or rectangular) +// can have a hole (round or rectangular) // this option is stored in .m_DrillShape D_CODE member enum APERTURE_DEF_HOLETYPE { APT_DEF_NO_HOLE = 0, @@ -60,7 +62,7 @@ enum APERTURE_DEF_HOLETYPE { }; /* define min and max values for D Codes values. - * note: values >= 0 and > FIRST_DCODE can be used for specila purposes + * note: values >= 0 and > FIRST_DCODE can be used for special purposes */ #define FIRST_DCODE 10 #define LAST_DCODE 999 @@ -163,13 +165,14 @@ public: * @param aClipBox = DC clip box (NULL is no clip) * @param aDC = device context * @param aColor = the normal color to use - * @param aAltColor = the color used to draw with "reverse" exposure mode (used in aperture macros only) + * @param aAltColor = the color used to draw with "reverse" exposure mode (used in + * aperture macros only) * @param aShapePos = the actual shape position - * @param aFilledShape = true to draw in filled mode, false to draw in skecth mode + * @param aFilledShape = true to draw in filled mode, false to draw in sketch mode */ - void DrawFlashedShape( GERBER_DRAW_ITEM* aParent, EDA_RECT* aClipBox, - wxDC* aDC, int aColor, int aAltColor, - wxPoint aShapePos, bool aFilledShape ); + void DrawFlashedShape( GERBER_DRAW_ITEM* aParent, EDA_RECT* aClipBox, + wxDC* aDC, int aColor, int aAltColor, + wxPoint aShapePos, bool aFilledShape ); /** * Function DrawFlashedPolygon @@ -181,12 +184,12 @@ public: * @param aClipBox = DC clip box (NULL is no clip) * @param aDC = device context * @param aColor = the normal color to use - * @param aFilled = true to draw in filled mode, false to draw in skecth mode + * @param aFilled = true to draw in filled mode, false to draw in sketch mode * @param aPosition = the actual shape position - */ - void DrawFlashedPolygon( GERBER_DRAW_ITEM* aParent, - EDA_RECT* aClipBox, wxDC* aDC, int aColor, - bool aFilled, const wxPoint& aPosition ); + */ + void DrawFlashedPolygon( GERBER_DRAW_ITEM* aParent, + EDA_RECT* aClipBox, wxDC* aDC, int aColor, + bool aFilled, const wxPoint& aPosition ); /** * Function ConvertShapeToPolygon @@ -195,10 +198,11 @@ public: * Useful when a shape is not a graphic primitive (shape with hole, * rotated shape ... ) and cannot be easily drawn. */ - void ConvertShapeToPolygon(); + void ConvertShapeToPolygon(); - /** GetShapeDim - * Calculate a value that can be used to evaluate the size of text + /** + * Function GetShapeDim + * calculates a value that can be used to evaluate the size of text * when displaying the D-Code of an item * due to the complexity of some shapes, * one cannot calculate the "size" of a shape (only a bounding box) diff --git a/gerbview/draw_gerber_screen.cpp b/gerbview/draw_gerber_screen.cpp index db2de288a1..0c48d09c44 100644 --- a/gerbview/draw_gerber_screen.cpp +++ b/gerbview/draw_gerber_screen.cpp @@ -1,11 +1,33 @@ -/****************/ -/* tracepcb.cpp */ -/****************/ - /* - * Redraw the screen. + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2011 Wayne Stambaugh + * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +/** + * @file draw_gerber_screen.cpp + */ + + #include "fctsys.h" #include "gr_basic.h" #include "common.h" @@ -19,19 +41,10 @@ #include "class_GERBER.h" -/** - * Function PrintPage (virtual) - * Used to print the board (on printer, or when creating SVF files). - * Print the board, but only layers allowed by aPrintMaskLayer - * @param aDC = the print device context - * @param aPrintMasklayer = a 32 bits mask: bit n = 1 -> layer n is printed - * @param aPrintMirrorMode = true to plot mirrored - * @param aData = a pointer to an optional data (not used here: can be NULL) - */ void GERBVIEW_FRAME::PrintPage( wxDC* aDC, int aPrintMasklayer, bool aPrintMirrorMode, void* aData ) { - // Save current draw options, because print mode has specfic options: + // Save current draw options, because print mode has specific options: int DisplayPolygonsModeImg = g_DisplayPolygonsModeSketch; int visiblemask = GetBoard()->GetVisibleLayers(); DISPLAY_OPTIONS save_opt = DisplayOpt; @@ -56,8 +69,6 @@ void GERBVIEW_FRAME::PrintPage( wxDC* aDC, int aPrintMasklayer, } -/* Redraws the full screen, including axis and grid - */ void GERBVIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) { PCB_SCREEN* screen = (PCB_SCREEN*) GetScreen(); @@ -88,7 +99,7 @@ void GERBVIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) GetBoard()->Draw( DrawPanel, DC, drawMode, wxPoint( 0, 0 ) ); // Draw the "background" now, i.e. grid and axis after gerber layers - // because most of time the actual background is erased by succesive drawings of each gerber + // because most of time the actual background is erased by successive drawings of each gerber // layer mainly in COPY mode DrawPanel->DrawBackGround( DC ); @@ -115,10 +126,10 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoin { // Because Images can be negative (i.e with background filled in color) items are drawn // graphic layer per graphic layer, after the background is filled - // to a temporary biumap + // to a temporary bitmap // at least when aDrawMode = GR_COPY or aDrawMode = GR_OR // If aDrawMode = -1, items are drawn to the main screen, and therefore - // arfefacts can happen with negative items or negative images + // artifacts can happen with negative items or negative images wxColour bgColor = MakeColour( g_DrawBgColor ); wxBrush bgBrush( bgColor, wxSOLID ); @@ -136,9 +147,10 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoin // When each image must be drawn using GR_OR (transparency mode) // or GR_COPY (stacked mode) we must use a temporary bitmap // to draw gerber images. - // this is due to negative objects (drawn using background color) that create artefacct + // this is due to negative objects (drawn using background color) that create artifacts // on other images when drawn on screen bool useBufferBitmap = false; + if( (aDrawMode == GR_COPY) || ( aDrawMode == GR_OR ) ) useBufferBitmap = true; @@ -170,12 +182,14 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoin plotDC = &layerDC; } - bool doBlit = false; // this flag requests an image transfert to actual screen when true. + bool doBlit = false; // this flag requests an image transfer to actual screen when true. bool end = false; + for( int layer = 0; !end; layer++ ) { int active_layer = ( (GERBVIEW_FRAME*) m_PcbFrame )->getActiveLayer(); + if( layer == active_layer ) // active layer will be drawn after other layers continue; @@ -199,12 +213,13 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoin // layers are drawn in background color. if( gerber->HasNegativeItems() && doBlit ) { - // Set Device orgin, logical origin and scale to default values + // Set Device origin, logical origin and scale to default values // This is needed by Blit function when using a mask. // Beside, for Blit call, both layerDC and screenDc must have the same settings layerDC.SetDeviceOrigin(0,0); layerDC.SetLogicalOrigin( 0, 0 ); layerDC.SetUserScale( 1, 1 ); + if( aDrawMode == GR_COPY ) { // Use the layer bitmap itself as a mask when blitting. The bitmap @@ -212,22 +227,20 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoin layerDC.SelectObject( wxNullBitmap ); layerBitmap->SetMask( new wxMask( *layerBitmap, bgColor ) ); layerDC.SelectObject( *layerBitmap ); - screenDC.Blit( 0, 0, bitmapWidth, bitmapHeight, - &layerDC, 0, 0, wxCOPY, true ); + screenDC.Blit( 0, 0, bitmapWidth, bitmapHeight, &layerDC, 0, 0, wxCOPY, true ); } else if( aDrawMode == GR_OR ) { // On Linux with a large screen, this version is much faster and without // flicker, but gives a Pcbnew look where layer colors blend together. // Plus it works only because the background color is black. But it may - // be more useable for some. The difference is due in part because of + // be more usable for some. The difference is due in part because of // the cpu cycles needed to create the monochromatic bitmap above, and // the extra time needed to do bit indexing into the monochromatic bitmap // on the blit above. - screenDC.Blit( 0, 0, bitmapWidth, bitmapHeight, - &layerDC, 0, 0, wxOR ); + screenDC.Blit( 0, 0, bitmapWidth, bitmapHeight, &layerDC, 0, 0, wxOR ); } - // Restore actual values and clear bitmpap for next drawing + // Restore actual values and clear bitmap for next drawing layerDC.SetDeviceOrigin( dev_org.x, dev_org.y ); layerDC.SetLogicalOrigin( logical_org.x, logical_org.y ); layerDC.SetUserScale( scale, scale ); @@ -276,7 +289,8 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoin int drawMode = layerdrawMode; if( dcode_highlight && dcode_highlight == gerb_item->m_DCode ) - drawMode |= GR_SURBRILL; + drawMode |= GR_HIGHLIGHT; + gerb_item->Draw( aPanel, plotDC, drawMode ); doBlit = true; } @@ -285,40 +299,38 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoin if( doBlit && useBufferBitmap ) // Blit is used only if aDrawMode >= 0 { // For this Blit call, layerDC and screenDC must have the same settings - // So we set device orgin, logical origin and scale to default values + // So we set device origin, logical origin and scale to default values // in layerDC layerDC.SetDeviceOrigin(0,0); layerDC.SetLogicalOrigin( 0, 0 ); layerDC.SetUserScale( 1, 1 ); - // this is the last transfert to screenDC. If there are no negative items, this is + + // this is the last transfer to screenDC. If there are no negative items, this is // the only one if( aDrawMode == GR_COPY ) { layerDC.SelectObject( wxNullBitmap ); layerBitmap->SetMask( new wxMask( *layerBitmap, bgColor ) ); layerDC.SelectObject( *layerBitmap ); - screenDC.Blit( 0, 0, bitmapWidth, bitmapHeight, - &layerDC, 0, 0, wxCOPY, true ); + screenDC.Blit( 0, 0, bitmapWidth, bitmapHeight, &layerDC, 0, 0, wxCOPY, true ); } else if( aDrawMode == GR_OR ) { - screenDC.Blit( 0, 0, bitmapWidth, bitmapHeight, - &layerDC, 0, 0, wxOR ); + screenDC.Blit( 0, 0, bitmapWidth, bitmapHeight, &layerDC, 0, 0, wxOR ); } } if( useBufferBitmap ) { // For this Blit call, aDC and screenDC must have the same settings - // So we set device orgin, logical origin and scale to default values + // So we set device origin, logical origin and scale to default values // in aDC aDC->SetDeviceOrigin( 0, 0); aDC->SetLogicalOrigin( 0, 0 ); aDC->SetUserScale( 1, 1 ); - aDC->Blit( 0, 0, bitmapWidth, bitmapHeight, - &screenDC, 0, 0, wxCOPY ); + aDC->Blit( 0, 0, bitmapWidth, bitmapHeight, &screenDC, 0, 0, wxCOPY ); // Restore aDC values aDC->SetDeviceOrigin(dev_org.x, dev_org.y); @@ -333,10 +345,6 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoin } -/* Function DrawItemsDCodeID - * Draw the DCode value (if exists) corresponding to gerber item - * Polygons do not have a DCode - */ void GERBVIEW_FRAME::DrawItemsDCodeID( wxDC* aDC, int aDrawMode ) { wxPoint pos; @@ -357,7 +365,9 @@ void GERBVIEW_FRAME::DrawItemsDCodeID( wxDC* aDC, int aDrawMode ) continue; if( gerb_item->m_Flashed || gerb_item->m_Shape == GBR_ARC ) + { pos = gerb_item->m_Start; + } else { pos.x = (gerb_item->m_Start.x + gerb_item->m_End.x) / 2; @@ -377,7 +387,7 @@ void GERBVIEW_FRAME::DrawItemsDCodeID( wxDC* aDC, int aDrawMode ) if( gerb_item->m_Flashed ) { - // A reasonnable size for text is width/3 because most of time this text has 3 chars. + // A reasonable size for text is width/3 because most of time this text has 3 chars. width /= 3; } else // this item is a line @@ -387,7 +397,7 @@ void GERBVIEW_FRAME::DrawItemsDCodeID( wxDC* aDC, int aDrawMode ) if( abs( delta.x ) < abs( delta.y ) ) orient = TEXT_ORIENT_VERT; - // A reasonnable size for text is width/2 because text needs margin below and above it. + // A reasonable size for text is width/2 because text needs margin below and above it. // a margin = width/4 seems good width /= 2; } @@ -402,7 +412,7 @@ void GERBVIEW_FRAME::DrawItemsDCodeID( wxDC* aDC, int aDrawMode ) } -/* Virtual fonction needed by the PCB_SCREEN class derived from BASE_SCREEN +/* Virtual function needed by the PCB_SCREEN class derived from BASE_SCREEN * this is a virtual pure function in BASE_SCREEN * do nothing in GerbView * could be removed later diff --git a/gerbview/gerbview_config.cpp b/gerbview/gerbview_config.cpp index d2aeced043..25c3f58f37 100644 --- a/gerbview/gerbview_config.cpp +++ b/gerbview/gerbview_config.cpp @@ -1,3 +1,28 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2007 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2009 Wayne Stambaugh + * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + /** * @file gerbview_config.cpp * @brief GerbView configuration. @@ -9,14 +34,20 @@ #include "class_drawpanel.h" #include "gestfich.h" #include "pcbcommon.h" +#include "param_config.h" +#include "colors_selection.h" #include "gerbview.h" #include "hotkeys.h" #include "class_board_design_settings.h" -#include "gerbview_config.h" #include "dialog_hotkeys_editor.h" +#define GROUP wxT("/gerbview") + +#define INSETUP true + + void GERBVIEW_FRAME::Process_Config( wxCommandEvent& event ) { int id = event.GetId(); @@ -50,24 +81,6 @@ void GERBVIEW_FRAME::Process_Config( wxCommandEvent& event ) } -/* - * Return the GerbView applications settings list. - * (list of parameters that must be saved in GerbView parameters) - * - * This replaces the old statically define list that had the project - * file settings and the application settings mixed together. This - * was confusing and caused some settings to get saved and loaded - * incorrectly. Currently, only the settings that are needed at start - * up by the main window are defined here. There are other locally used - * settings scattered thoughout the GerbView source code. If you need - * to define a configuration setting that need to be loaded at run time, - * this is the place to define it. - * - * TODO: Define the configuration variables as member variables instead of - * global variables or move them to the object class where they are - * used. - */ - PARAM_CFG_ARRAY& GERBVIEW_FRAME::GetConfigurationSettings( void ) { if( !m_configSettings.empty() ) diff --git a/gerbview/gerbview_config.h b/gerbview/gerbview_config.h deleted file mode 100644 index fcd89b8258..0000000000 --- a/gerbview/gerbview_config.h +++ /dev/null @@ -1,10 +0,0 @@ -/*************************/ -/** gerberview_config.h **/ -/*************************/ - -#include "param_config.h" -#include "colors_selection.h" - -#define GROUP wxT("/gerbview") - -#define INSETUP TRUE diff --git a/gerbview/gerbview_frame.h b/gerbview/gerbview_frame.h index 8c464e4630..64e9b25c18 100644 --- a/gerbview/gerbview_frame.h +++ b/gerbview/gerbview_frame.h @@ -1,3 +1,28 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2007 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2011 Wayne Stambaugh + * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + /** * @file gerbview_frame.h */ @@ -73,8 +98,20 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title, // Virtual basic functions: void RedrawActiveWindow( wxDC* DC, bool EraseBg ); void ReCreateHToolbar(); + + /** + * Function ReCreateVToolbar + * creates or updates the right vertical toolbar. + * + * @note This is currently not used. + */ void ReCreateVToolbar(); + + /** + * Create or update the left vertical toolbar (option toolbar + */ void ReCreateOptToolbar(); + void ReCreateMenuBar(); void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); @@ -250,11 +287,10 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title, * Function GetConfigurationSettings * Populates the GerbView applications settings list. * (list of parameters that must be saved in GerbView parameters) - * Currently, only the settings that are needed at start - * up by the main window are defined here. There are other locally used - * settings scattered thoughout the GerbView source code (mainle in dialogs). - * If you need to define a configuration setting that need to be loaded at run time, - * this is the place to define it. + * Currently, only the settings that are needed at start up by the main window are + * defined here. There are other locally used settings scattered throughout the + * GerbView source code (mainly in dialogs). If you need to define a configuration + * setting that need to be loaded at run time, this is the place to define it. */ PARAM_CFG_ARRAY& GetConfigurationSettings( void ); @@ -292,7 +328,7 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title, /** * Function OnSelectActiveDCode * Selects the active DCode for the current active layer. - * Items using this DCode are hightlighted + * Items using this DCode are highlighted. */ void OnSelectActiveDCode( wxCommandEvent& event ); @@ -488,6 +524,10 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title, * 1 = read OK
*/ int ReadDCodeDefinitionFile( const wxString& D_Code_FullFileName ); + + /** + * Set Size Items (Lines, Flashes) from DCodes List + */ void CopyDCodesSizeToItems(); void Liste_D_Codes(); @@ -536,7 +576,7 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title, * Function DrawItemsDCodeID * Draw the DCode value (if exists) corresponding to gerber item * (polygons do not have a DCode) - * @param aDC = the current device contect + * @param aDC = the current device context * @param aDrawMode = GR_COPY, GR_OR ... */ void DrawItemsDCodeID( wxDC* aDC, int aDrawMode ); diff --git a/gerbview/initpcb.cpp b/gerbview/initpcb.cpp index 6784bce279..ff9d1bd49f 100644 --- a/gerbview/initpcb.cpp +++ b/gerbview/initpcb.cpp @@ -1,3 +1,27 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2007 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + /** * @file gerbview/initpcb.cpp */ @@ -49,7 +73,7 @@ bool GERBVIEW_FRAME::Clear_Pcb( bool query ) setActiveLayer(FIRST_COPPER_LAYER); m_LayersManager->UpdateLayerIcons(); syncLayerBox(); - return TRUE; + return true; } diff --git a/gerbview/pcbplot.h b/gerbview/pcbplot.h index 8dd7d6e193..8207402e82 100644 --- a/gerbview/pcbplot.h +++ b/gerbview/pcbplot.h @@ -1,6 +1,30 @@ -/******************/ -/* file pcbplot.h */ -/******************/ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2007 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/** + * @file gerbview/pcbplot.h + */ #ifndef PCBPLOT_H #define PCBPLOT_H @@ -26,7 +50,7 @@ struct PCB_Plot_Options int HPGL_Pen_Speed; int HPGL_Pen_Diam; int HPGL_Pen_Recouvrement; - bool HPGL_Org_Centre; // TRUE if, HPGL originally the center of the node + bool HPGL_Org_Centre; // true if, HPGL originally the center of the node int PlotPSColorOpt; // True for color Postscript output bool Plot_PS_Negative; // True to create a negative board ps plot diff --git a/gerbview/toolbars_gerber.cpp b/gerbview/toolbars_gerber.cpp index e4734d1dd4..be748528e3 100644 --- a/gerbview/toolbars_gerber.cpp +++ b/gerbview/toolbars_gerber.cpp @@ -1,6 +1,32 @@ -/*************************************/ -/* tool_gerber.cpp: Build tool bars */ -/*************************************/ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2011 Wayne Stambaugh + * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/** + * @file toolbars_gerber.cpp + * @brief Build tool bars + */ #include "fctsys.h" @@ -23,7 +49,7 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void ) if( m_HToolBar != NULL ) return; - m_HToolBar = new EDA_TOOLBAR( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE ); + m_HToolBar = new EDA_TOOLBAR( TOOLBAR_MAIN, this, ID_H_TOOLBAR, true ); // Set up toolbar m_HToolBar->AddTool( ID_GERBVIEW_ERASE_ALL, wxEmptyString, @@ -98,10 +124,6 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void ) } -/** - * Create or update the right vertical toolbar - * Current no used - */ void GERBVIEW_FRAME::ReCreateVToolbar( void ) { if( m_VToolBar ) @@ -117,9 +139,6 @@ void GERBVIEW_FRAME::ReCreateVToolbar( void ) } -/** - * Create or update the left vertical toolbar (option toolbar - */ void GERBVIEW_FRAME::ReCreateOptToolbar( void ) { if( m_OptionsToolBar ) @@ -175,12 +194,12 @@ void GERBVIEW_FRAME::ReCreateOptToolbar( void ) m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_1, wxEmptyString, KiBitmap( gbr_select_mode1_xpm ), _( "Show layers in stacked mode \ -(show negative items without artefact, sometimes slow)" ), +(show negative items without artifacts, sometimes slow)" ), wxITEM_CHECK ); m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_2, wxEmptyString, KiBitmap( gbr_select_mode2_xpm ), - _( "Show layers in tranparency mode \ -(show negative items without artefact, sometimes slow)" ), + _( "Show layers in transparency mode \ +(show negative items without artifacts, sometimes slow)" ), wxITEM_CHECK ); // Tools to show/hide toolbars: diff --git a/include/gr_basic.h b/include/gr_basic.h index 2dbe6a94e2..582171b067 100644 --- a/include/gr_basic.h +++ b/include/gr_basic.h @@ -1,6 +1,31 @@ -/**************/ -/* gr_basic.h */ -/**************/ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2006 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2011 Wayne Stambaugh + * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/** + * @file gr_basic.h + */ #ifndef GR_BASIC #define GR_BASIC @@ -17,7 +42,7 @@ class EDA_RECT; #define GR_NXOR 0x08000000 #define GR_INVERT 0x10000000 -#define GR_SURBRILL 0x80000000 +#define GR_HIGHLIGHT 0x80000000 #define GR_M_LEFT_DOWN 0x10000000 #define GR_M_RIGHT_DOWN 0x20000000 diff --git a/include/wxPcbStruct.h b/include/wxPcbStruct.h index 0e5003032b..985811c5ca 100644 --- a/include/wxPcbStruct.h +++ b/include/wxPcbStruct.h @@ -887,12 +887,20 @@ public: */ void OnEditItemRequest( wxDC* aDC, BOARD_ITEM* aItem ); - // Highlight functions: - int Select_High_Light( wxDC* DC ); - void High_Light( wxDC* DC ); + /** + * Locate track or pad and highlight the corresponding net. + * @return The Netcode, or -1 if no net located. + */ + int SelectHighLight( wxDC* DC ); + + /** + * Function HighLight. + * highlights the net at the current cursor position. + */ + void HighLight( wxDC* DC ); // Track and via edition: - void Via_Edit_Control( wxCommandEvent& event ); + void Via_Edit_Control( wxCommandEvent& event ); /** * Function IsMicroViaAcceptable @@ -928,9 +936,24 @@ public: */ void DisplayNetStatus( wxDC* DC ); + /** + * Function Delete_Segment + * removes 1 segment of track. + * 2 cases: + * If There is evidence of new track: delete new segment. + * Otherwise, delete segment under the cursor. + */ TRACK* Delete_Segment( wxDC* DC, TRACK* Track ); + void Delete_Track( wxDC* DC, TRACK* Track ); void Delete_net( wxDC* DC, TRACK* Track ); + + /** + * Function Remove_One_Track + * removes 1 track/ + * The leading segment is removed and all adjacent segments + * until a pad or a junction point of more than 2 segments is found + */ void Remove_One_Track( wxDC* DC, TRACK* pt_segm ); /** @@ -1087,12 +1110,17 @@ public: * Remove and delete the current outline segment in progress * @return 0 if no corner in list, or corner number */ - int Delete_LastCreatedCorner( wxDC* DC ); + int Delete_LastCreatedCorner( wxDC* DC ); /** * Function Begin_Zone - * initiates a zone edge creation process, - * or terminates the current zone edge and creates a new zone edge stub + * either initializes the first segment of a new zone, or adds an + * intermediate segment. + * A new zone can be: + * created from scratch: the user will be prompted to define parameters (layer, clearence ...) + * created from a similar zone (s_CurrentZone is used): parameters are copied from + * s_CurrentZone + * created as a cutout (an hole) inside s_CurrentZone */ int Begin_Zone( wxDC* DC ); @@ -1114,7 +1142,7 @@ public: * @param verbose = true to show error messages * @return error level (0 = no error) */ - int Fill_Zone( ZONE_CONTAINER* zone_container, bool verbose = TRUE ); + int Fill_Zone( ZONE_CONTAINER* zone_container, bool verbose = true ); /** * Function Fill_All_Zones @@ -1123,7 +1151,7 @@ public: * @param verbose = true to show error messages * @return error level (0 = no error) */ - int Fill_All_Zones( bool verbose = TRUE ); + int Fill_All_Zones( bool verbose = true ); /** diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 19898e5af4..2248ba6880 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -129,6 +129,7 @@ set(PCBNEW_SRCS globaleditpad.cpp gpcb_exchange.cpp graphpcb.cpp + highlight.cpp hotkeys.cpp hotkeys_board_editor.cpp hotkeys_module_editor.cpp @@ -174,7 +175,6 @@ set(PCBNEW_SRCS specctra_export.cpp specctra_import.cpp specctra_keywords.cpp - surbrill.cpp swap_layers.cpp tool_modedit.cpp tool_onrightclick.cpp diff --git a/pcbnew/attribut.cpp b/pcbnew/attribut.cpp index f3cf687d70..34dc7faa61 100644 --- a/pcbnew/attribut.cpp +++ b/pcbnew/attribut.cpp @@ -1,6 +1,32 @@ -/******************************************/ -/* Track editing: attribute flags editing */ -/******************************************/ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2006 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2011 Wayne Stambaugh + * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/** + * @file attribut.cpp + * @brief Track attribute flags editing. + */ #include "fctsys.h" #include "class_drawpanel.h" @@ -27,7 +53,7 @@ void PCB_EDIT_FRAME::Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On ) OnModify(); DrawPanel->CrossHairOff( DC ); // Erase cursor shape track->SetState( TRACK_LOCKED, Flag_On ); - track->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL ); + track->Draw( DrawPanel, DC, GR_OR | GR_HIGHLIGHT ); DrawPanel->CrossHairOn( DC ); // Display cursor shape track->DisplayInfo( this ); } @@ -44,7 +70,7 @@ void PCB_EDIT_FRAME::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On ) DrawPanel->CrossHairOff( DC ); // Erase cursor shape Track = GetBoard()->MarkTrace( track, &nb_segm, NULL, NULL, true ); - DrawTraces( DrawPanel, DC, Track, nb_segm, GR_OR | GR_SURBRILL ); + DrawTraces( DrawPanel, DC, Track, nb_segm, GR_OR | GR_HIGHLIGHT ); for( ; (Track != NULL) && (nb_segm > 0); nb_segm-- ) { @@ -86,7 +112,7 @@ void PCB_EDIT_FRAME::Attribut_net( wxDC* DC, int net_code, bool Flag_On ) OnModify(); Track->SetState( TRACK_LOCKED, Flag_On ); - Track->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL ); + Track->Draw( DrawPanel, DC, GR_OR | GR_HIGHLIGHT ); Track = Track->Next(); } diff --git a/pcbnew/class_pad.h b/pcbnew/class_pad.h index 43e0686ae6..37d4914287 100644 --- a/pcbnew/class_pad.h +++ b/pcbnew/class_pad.h @@ -254,7 +254,7 @@ public: * Draw a pad: * @param aPanel = the EDA_DRAW_PANEL panel * @param aDC = the current device context - * @param aDraw_mode = mode: GR_OR, GR_XOR, GR_AND... + * @param aDrawMode = mode: GR_OR, GR_XOR, GR_AND... * @param aOffset = draw offset */ void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, @@ -265,7 +265,12 @@ public: /** * Function DrawShape * basic function to draw a pad. - * used by Draw after calculation of parameters (color, ) final orientation ... + *

+ * This function is used by Draw after calculation of parameters (color, ) final + * orientation transforms are set. It can also be called to draw a pad on any panel + * even if this panel is not a EDA_DRAW_PANEL for instance on a wxPanel inside the + * pad editor. + *

*/ void DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo ); diff --git a/pcbnew/class_pad_draw_functions.cpp b/pcbnew/class_pad_draw_functions.cpp index a776fa0cfe..d28ae08bb4 100644 --- a/pcbnew/class_pad_draw_functions.cpp +++ b/pcbnew/class_pad_draw_functions.cpp @@ -1,3 +1,28 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2006 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2011 Wayne Stambaugh + * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + /** * @file class_pad_draw_functions.cpp */ @@ -49,19 +74,14 @@ PAD_DRAWINFO::PAD_DRAWINFO() } -/** Draw a pad: - * @param aPanel = the EDA_DRAW_PANEL panel - * @param aDraw_mode = mode: GR_OR, GR_XOR, GR_AND... - * @param aOffset = draw offset - */ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDraw_mode, const wxPoint& aOffset ) { int color = 0; wxSize mask_margin; // margin (clearance) used for some non copper layers #ifdef SHOW_PADMASK_REAL_SIZE_AND_COLOR - int showActualMaskSize = 0; /* == layer number if the actual pad size on mask layer can be displayed - * i.e. if only one layer is shown for this pad + int showActualMaskSize = 0; /* Layer number if the actual pad size on mask layer can + * be displayed i.e. if only one layer is shown for this pad * and this layer is a mask (solder mask or sloder paste */ #endif @@ -133,8 +153,7 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDraw_mode, const wxPoi if( color == 0 ) /* Not on copper layer */ { - // If the pad in on only one tech layer, use the layer color - // else use DARKGRAY + // If the pad in on only one tech layer, use the layer color else use DARKGRAY int mask_non_copper_layers = m_layerMask & ~ALL_CU_LAYERS; #ifdef SHOW_PADMASK_REAL_SIZE_AND_COLOR mask_non_copper_layers &= brd->GetVisibleLayers(); @@ -311,7 +330,7 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDraw_mode, const wxPoi } - if( aDraw_mode & GR_SURBRILL ) + if( aDraw_mode & GR_HIGHLIGHT ) { if( aDraw_mode & GR_AND ) color &= ~HIGHLIGHT_FLAG; @@ -361,13 +380,6 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDraw_mode, const wxPoi } -/** - * Function DrawShape - * basic function to draw a pad. - * used by D_PAD::Draw after calculation of parameters (color, final orientation ...) - * this function can be called to draw a pad on a panel - * even if this panel is not a EDA_DRAW_PANEL (for instance on a wxPanel inside the pad editor) - */ void D_PAD::DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo ) { wxPoint coord[4]; @@ -553,10 +565,9 @@ void D_PAD::DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo ) if( !aDrawInfo.m_Display_padnum && !aDrawInfo.m_Display_netname ) return; - wxPoint tpos0 = shape_pos; // Position of the centre of text + wxPoint tpos0 = shape_pos; // Position of the centre of text wxPoint tpos = tpos0; - wxSize AreaSize; // size of text area, normalized to - // AreaSize.y < AreaSize.x + wxSize AreaSize; // size of text area, normalized to AreaSize.y < AreaSize.x int shortname_len = m_ShortNetname.Len(); if( !aDrawInfo.m_Display_netname ) @@ -682,15 +693,6 @@ int D_PAD::BuildSegmentFromOvalShape(wxPoint& aSegStart, wxPoint& aSegEnd, int a } -/** - * Function BuildPadPolygon - * Has meaning only for polygonal pads (trapeziod and rectangular) - * Build the Corner list of the polygonal shape, - * depending on shape, extra size (clearance ...) and orientation - * @param aCoord = a buffer to fill. - * @param aInflateValue = wxSize: the clearance or margin value. value > 0: inflate, < 0 deflate - * @param aRotation = full rotation of the polygon, usually m_Orient - */ void D_PAD::BuildPadPolygon( wxPoint aCoord[4], wxSize aInflateValue, int aRotation ) const { if( (GetShape() != PAD_RECT) && (GetShape() != PAD_TRAPEZOID) ) diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index 7ca16dfc7e..bcf3ae0c4b 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -641,7 +641,7 @@ void TRACK::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint& } } - if( draw_mode & GR_SURBRILL ) + if( draw_mode & GR_HIGHLIGHT ) { if( draw_mode & GR_AND ) color &= ~HIGHLIGHT_FLAG; @@ -815,7 +815,7 @@ void SEGVIA::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wxPoint } } - if( draw_mode & GR_SURBRILL ) + if( draw_mode & GR_HIGHLIGHT ) { if( draw_mode & GR_AND ) color &= ~HIGHLIGHT_FLAG; @@ -1275,18 +1275,6 @@ TRACK* TRACK::GetVia( TRACK* aEndTrace, const wxPoint& aPosition, int aLayerMask } -/* - * GetTrace is a helper function to locate a trace segment having an end point at aPosition - * on aLayerMask starting at aStartTrace and end at aEndTrace. - * The segments of track that are flagged as deleted or busy are ignored. - * To speed up the search, this search is made: - * first on the previous and next neightbour (NEIGHTBOUR_COUNT_MAX size) - * of this. - * After, only if no track found, on aStartTrace to aEndTrace - * Because tracks are grouped when entered in list, most of time the first search - * find the connection. - * The speedup is *very* large - */ TRACK* TRACK::GetTrace( TRACK* aStartTrace, TRACK* aEndTrace, int aEndPoint ) { const int NEIGHTBOUR_COUNT_MAX = 50; diff --git a/pcbnew/class_zone.cpp b/pcbnew/class_zone.cpp index 63044837f8..2b2c4748d2 100644 --- a/pcbnew/class_zone.cpp +++ b/pcbnew/class_zone.cpp @@ -1,3 +1,28 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2006 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2011 Wayne Stambaugh + * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + /** * @file class_zone.cpp * @brief Implementation of class to handle copper zones. @@ -46,12 +71,7 @@ ZONE_CONTAINER::~ZONE_CONTAINER() m_Poly = NULL; } -/** - * Function UnFill - * Removes the zone filling - * @return true if a previous filling is removed, false if no change - * (when no filling found) - */ + bool ZONE_CONTAINER::UnFill() { bool change = ( m_FilledPolysList.size() > 0 ) || ( m_FillSegmList.size() > 0 ); @@ -63,10 +83,7 @@ bool ZONE_CONTAINER::UnFill() return change; } -/** - * Function GetPosition (virtual) - * @return a wxPoint, position of the first point of the outline - */ + wxPoint& ZONE_CONTAINER::GetPosition() { static wxPoint pos; @@ -82,23 +99,18 @@ wxPoint& ZONE_CONTAINER::GetPosition() } -/** - * Set the netcode and the netname - * if netcode >= 0, set the netname - * if netcode < 0: keep old netname (used to set an necode error flag) - */ -void ZONE_CONTAINER::SetNet( int anet_code ) +void ZONE_CONTAINER::SetNet( int aNetCode ) { - m_NetCode = anet_code; + m_NetCode = aNetCode; - if( anet_code < 0 ) + if( aNetCode < 0 ) return; BOARD* board = GetBoard(); if( board ) { - NETINFO_ITEM* net = board->FindNet( anet_code ); + NETINFO_ITEM* net = board->FindNet( aNetCode ); if( net ) m_Netname = net->GetNetname(); @@ -541,7 +553,7 @@ void ZONE_CONTAINER::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode, const } } - if( aDrawMode & GR_SURBRILL ) + if( aDrawMode & GR_HIGHLIGHT ) { if( aDrawMode & GR_AND ) color &= ~HIGHLIGHT_FLAG; @@ -597,14 +609,6 @@ void ZONE_CONTAINER::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode, const } -/** - * Function DrawDrawFilledArea - * Draws the filled areas for this zone (polygon list .m_FilledPolysList) - * @param panel = current Draw Panel - * @param DC = current Device Context - * @param offset = Draw offset (usually wxPoint(0,0)) - * @param aDrawMode = GR_OR, GR_XOR, GR_COPY .. - */ void ZONE_CONTAINER::DrawFilledArea( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode, const wxPoint& offset ) { @@ -642,7 +646,7 @@ void ZONE_CONTAINER::DrawFilledArea( EDA_DRAW_PANEL* panel, } } - if( aDrawMode & GR_SURBRILL ) + if( aDrawMode & GR_HIGHLIGHT ) { if( aDrawMode & GR_AND ) color &= ~HIGHLIGHT_FLAG; @@ -763,16 +767,6 @@ EDA_RECT ZONE_CONTAINER::GetBoundingBox() const } -/** - * Function DrawWhileCreateOutline - * Draws the zone outline when ir is created. - * The moving edges (last segment and the closing edge segment) are in XOR graphic mode, - * old segment in OR graphic mode - * The closing edge has its own shape - * @param panel = current Draw Panel - * @param DC = current Device Context - * @param draw_mode = draw mode: OR, XOR .. - */ void ZONE_CONTAINER::DrawWhileCreateOutline( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode ) { int current_gr_mode = draw_mode; @@ -838,13 +832,6 @@ void ZONE_CONTAINER::DrawWhileCreateOutline( EDA_DRAW_PANEL* panel, wxDC* DC, in } -/** - * Function HitTest - * tests if the given wxPoint is within the bounds of this object. - * @param refPos A wxPoint to test - * @return bool - true if a hit, else false - * return true if refPos is near a corner or an edge - */ bool ZONE_CONTAINER::HitTest( const wxPoint& refPos ) { if( HitTestForCorner( refPos ) ) @@ -857,20 +844,13 @@ bool ZONE_CONTAINER::HitTest( const wxPoint& refPos ) } -/** - * Function HitTestForCorner - * tests if the given wxPoint near a corner, or near the segment define by 2 corners. - * Choose the nearest corner - * "near" means grid size (or CORNER_MIN_DIST if grid is not known) - * Set m_CornerSelection to corner index in .m_Poly->corner or -1 if no corner found - * @return true if a corner found - * @param refPos : A wxPoint to test - */ bool ZONE_CONTAINER::HitTestForCorner( const wxPoint& refPos ) { m_CornerSelection = -1; // Set to not found - #define CORNER_MIN_DIST 100 // distance (in internal units) to detect a corner in a zone outline + // distance (in internal units) to detect a corner in a zone outline. + #define CORNER_MIN_DIST 100 + int min_dist = CORNER_MIN_DIST + 1; if( GetBoard() && GetBoard()->m_PcbFrame ) @@ -901,16 +881,6 @@ bool ZONE_CONTAINER::HitTestForCorner( const wxPoint& refPos ) } -/** - * Function HitTestForEdge - * tests if the given wxPoint near a corner, or near the segment define by 2 corners. - * choose the nearest segment - * "near" means grid size (or EDGE_MIN_DIST if grid is not known) - * Set m_CornerSelection to -1 if nothing found, or index of the starting corner of edge - * in .m_Poly->corner - * @return true if found - * @param refPos : A wxPoint to test - */ bool ZONE_CONTAINER::HitTestForEdge( const wxPoint& refPos ) { unsigned lim = m_Poly->corner.size(); @@ -963,12 +933,6 @@ bool ZONE_CONTAINER::HitTestForEdge( const wxPoint& refPos ) } -/** - * Function HitTest (overlayed) - * tests if the given EDA_RECT contains the bounds of this object. - * @param refArea : the given EDA_RECT - * @return bool - true if a hit, else false - */ bool ZONE_CONTAINER::HitTest( EDA_RECT& refArea ) { bool is_out_of_box = false; @@ -1018,12 +982,6 @@ int ZONE_CONTAINER::GetClearance( BOARD_CONNECTED_ITEM* aItem ) const } -/** - * Function HitTestFilledArea - * tests if the given wxPoint is within the bounds of a filled area of this zone. - * @param aRefPos A wxPoint to test - * @return bool - true if a hit, else false - */ bool ZONE_CONTAINER::HitTestFilledArea( const wxPoint& aRefPos ) { unsigned indexstart = 0, indexend; @@ -1124,11 +1082,6 @@ void ZONE_CONTAINER::DisplayInfo( EDA_DRAW_FRAME* frame ) /* Geometric transforms: */ -/** - * Function Move - * Move the outlines - * @param offset = moving vector - */ void ZONE_CONTAINER::Move( const wxPoint& offset ) { /* move outlines */ @@ -1155,11 +1108,6 @@ void ZONE_CONTAINER::Move( const wxPoint& offset ) } -/** - * Function MoveEdge - * Move the outline Edge. m_CornerSelection is the start point of the outline edge - * @param offset = moving vector - */ void ZONE_CONTAINER::MoveEdge( const wxPoint& offset ) { int ii = m_CornerSelection; @@ -1184,12 +1132,6 @@ void ZONE_CONTAINER::MoveEdge( const wxPoint& offset ) } -/** - * Function Rotate - * Move the outlines - * @param centre = rot centre - * @param angle = in 0.1 degree - */ void ZONE_CONTAINER::Rotate( const wxPoint& centre, int angle ) { wxPoint pos; @@ -1224,12 +1166,6 @@ void ZONE_CONTAINER::Rotate( const wxPoint& centre, int angle ) } -/** - * Function Flip - * Flip this object, i.e. change the board side for this object - * (like Mirror() but changes layer) - * @param aCentre - the rotation point. - */ void ZONE_CONTAINER::Flip( const wxPoint& aCentre ) { Mirror( aCentre ); @@ -1237,11 +1173,6 @@ void ZONE_CONTAINER::Flip( const wxPoint& aCentre ) } -/** - * Function Mirror - * flip the outlines , relative to a given horizontal axis - * @param mirror_ref = vertical axis position - */ void ZONE_CONTAINER::Mirror( const wxPoint& mirror_ref ) { for( unsigned ii = 0; ii < m_Poly->corner.size(); ii++ ) @@ -1274,11 +1205,6 @@ void ZONE_CONTAINER::Mirror( const wxPoint& mirror_ref ) } -/** - * Function copy - * copy useful data from the source. - * flags and linked list pointers are NOT copied - */ void ZONE_CONTAINER::Copy( ZONE_CONTAINER* src ) { m_Parent = src->m_Parent; @@ -1304,11 +1230,6 @@ void ZONE_CONTAINER::Copy( ZONE_CONTAINER* src ) } -/** - * Function SetNetNameFromNetCode - * Find the net name corresponding to the net code. - * @return bool - true if net found, else false - */ bool ZONE_CONTAINER::SetNetNameFromNetCode( void ) { NETINFO_ITEM* net; diff --git a/pcbnew/class_zone.h b/pcbnew/class_zone.h index 675111bc2b..114c22be55 100644 --- a/pcbnew/class_zone.h +++ b/pcbnew/class_zone.h @@ -202,7 +202,15 @@ public: return ( GetLayer() < FIRST_NO_COPPER_LAYER ) ? true : false; } - virtual void SetNet( int anet_code ); + /** + * Functio SetNet + * set the netcode and the netname. + * + * @param aNetCode The net code of the zone container if greater than or equal to + * zero. Otherwise the current net code is kept and set the net + * code error flag. + */ + virtual void SetNet( int aNetCode ); /** * Function SetNetNameFromNetCode diff --git a/pcbnew/deltrack.cpp b/pcbnew/deltrack.cpp index dd812b1094..1e35528b71 100644 --- a/pcbnew/deltrack.cpp +++ b/pcbnew/deltrack.cpp @@ -1,7 +1,31 @@ -/******************************************/ -/* Edit Track: Erase Routines */ -/* Delete segments, tracks, and net areas */ -/******************************************/ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2011 Wayne Stambaugh + * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/** + * @file deltrack.cpp + */ #include "fctsys.h" #include "class_drawpanel.h" @@ -17,11 +41,6 @@ #include "protos.h" -/* Removes 1 segment of track. - * 2 cases: - * If There is evidence of new track: delete new segment. - * Otherwise, delete segment under the cursor. - */ TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack ) { int current_net_code; @@ -84,7 +103,7 @@ TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack ) DrawPanel->SetMouseCapture( NULL, NULL ); if( GetBoard()->IsHighLightNetON() ) - High_Light( DC ); + HighLight( DC ); SetCurItem( NULL ); return NULL; @@ -170,10 +189,6 @@ void PCB_EDIT_FRAME::Delete_net( wxDC* DC, TRACK* aTrack ) } -/* Remove 1 track: - * The leading segment is removed and all adjacent segments - * until a pad or a junction point of more than 2 segments is found - */ void PCB_EDIT_FRAME::Remove_One_Track( wxDC* DC, TRACK* pt_segm ) { int segments_to_delete_count; diff --git a/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths_fbp.cpp b/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths_fbp.cpp index b53981f25b..d80c686a7f 100644 --- a/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths_fbp.cpp +++ b/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths_fbp.cpp @@ -1,165 +1,166 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 16 2008) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "dialog_pcbnew_config_libs_and_paths_fbp.h" - -/////////////////////////////////////////////////////////////////////////// - -DIALOG_PCBNEW_CONFIG_LIBS_FBP::DIALOG_PCBNEW_CONFIG_LIBS_FBP( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* bMainSizer; - bMainSizer = new wxBoxSizer( wxVERTICAL ); - - wxStaticBoxSizer* sbLibsChoiceSizer; - sbLibsChoiceSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Footprint library files") ), wxHORIZONTAL ); - - wxBoxSizer* bLibsButtonsSizer; - bLibsButtonsSizer = new wxBoxSizer( wxHORIZONTAL ); - - sbLibsChoiceSizer->Add( bLibsButtonsSizer, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_ListLibr = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_EXTENDED|wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE ); - m_ListLibr->SetToolTip( _("List of active library files.\nOnly library files in this list are loaded by Pcbnew.\nThe order of this list is important:\nPcbnew searchs for a given footprint using this list order priority.") ); - m_ListLibr->SetMinSize( wxSize( 400,90 ) ); - - sbLibsChoiceSizer->Add( m_ListLibr, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - wxBoxSizer* bRightSizer; - bRightSizer = new wxBoxSizer( wxVERTICAL ); - - m_buttonAddLib = new wxButton( this, ID_ADD_LIB, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonAddLib->SetToolTip( _("Add a new library after the selected library, and load it") ); - - bRightSizer->Add( m_buttonAddLib, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); - - m_buttonIns = new wxButton( this, wxID_ANY, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonIns->SetToolTip( _("Add a new library before the selected library, and load it") ); - - bRightSizer->Add( m_buttonIns, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_buttonRemoveLib = new wxButton( this, ID_REMOVE_LIB, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonRemoveLib->SetToolTip( _("Unload the selected library") ); - - bRightSizer->Add( m_buttonRemoveLib, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_buttonUp = new wxButton( this, wxID_ANY, _("Up"), wxDefaultPosition, wxDefaultSize, 0 ); - bRightSizer->Add( m_buttonUp, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_buttonDown = new wxButton( this, wxID_ANY, _("Down"), wxDefaultPosition, wxDefaultSize, 0 ); - bRightSizer->Add( m_buttonDown, 0, wxALL, 5 ); - - sbLibsChoiceSizer->Add( bRightSizer, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - bMainSizer->Add( sbLibsChoiceSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - wxStaticBoxSizer* sbModulesDocSizer; - sbModulesDocSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Footprint documentation file") ), wxHORIZONTAL ); - - m_TextHelpModulesFileName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - sbModulesDocSizer->Add( m_TextHelpModulesFileName, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - m_buttonModDoc = new wxButton( this, wxID_BROWSE_MOD_DOC, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); - sbModulesDocSizer->Add( m_buttonModDoc, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 10 ); - - bMainSizer->Add( sbModulesDocSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - wxStaticBoxSizer* sbSizer4; - sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User defined search paths") ), wxHORIZONTAL ); - - sbSizer4->SetMinSize( wxSize( 400,70 ) ); - wxBoxSizer* bUserListSizer; - bUserListSizer = new wxBoxSizer( wxVERTICAL ); - - m_listUserPaths = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - m_listUserPaths->SetToolTip( _("Additional paths used in this project. The priority is highter than default Kicad paths.") ); - - bUserListSizer->Add( m_listUserPaths, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - sbSizer4->Add( bUserListSizer, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - wxBoxSizer* bUserPathsButtonsSizer; - bUserPathsButtonsSizer = new wxBoxSizer( wxVERTICAL ); - - m_buttonAddPath = new wxButton( this, ID_LIB_PATH_SEL, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); - bUserPathsButtonsSizer->Add( m_buttonAddPath, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_buttonInsPath = new wxButton( this, wxID_INSERT_PATH, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); - bUserPathsButtonsSizer->Add( m_buttonInsPath, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); - - m_buttonRemovePath = new wxButton( this, wxID_REMOVE_PATH, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); - bUserPathsButtonsSizer->Add( m_buttonRemovePath, 0, wxALL|wxBOTTOM, 5 ); - - sbSizer4->Add( bUserPathsButtonsSizer, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 ); - - bMainSizer->Add( sbSizer4, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - wxStaticBoxSizer* sbLibPathSizer; - sbLibPathSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Current search path list") ), wxVERTICAL ); - - wxBoxSizer* bUserLibPathSizer; - bUserLibPathSizer = new wxBoxSizer( wxHORIZONTAL ); - - sbLibPathSizer->Add( bUserLibPathSizer, 1, wxEXPAND, 5 ); - - m_DefaultLibraryPathslistBox = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_NEEDED_SB ); - m_DefaultLibraryPathslistBox->SetToolTip( _("Paths (system paths and user paths) used to search and load libraries files and component doc files.\nSorted by decreasing priority order.") ); - m_DefaultLibraryPathslistBox->SetMinSize( wxSize( -1,70 ) ); - - sbLibPathSizer->Add( m_DefaultLibraryPathslistBox, 0, wxALL|wxEXPAND, 5 ); - - bMainSizer->Add( sbLibPathSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bMainSizer->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_sdbSizer1 = new wxStdDialogButtonSizer(); - m_sdbSizer1OK = new wxButton( this, wxID_OK ); - m_sdbSizer1->AddButton( m_sdbSizer1OK ); - m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); - m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); - m_sdbSizer1->Realize(); - bMainSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 5 ); - - this->SetSizer( bMainSizer ); - this->Layout(); - bMainSizer->Fit( this ); - - this->Centre( wxBOTH ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnCloseWindow ) ); - m_buttonAddLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertLibClick ), NULL, this ); - m_buttonIns->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertLibClick ), NULL, this ); - m_buttonRemoveLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnRemoveLibClick ), NULL, this ); - m_buttonUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnButtonUpClick ), NULL, this ); - m_buttonDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnButtonDownClick ), NULL, this ); - m_buttonModDoc->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnBrowseModDocFile ), NULL, this ); - m_buttonAddPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertPath ), NULL, this ); - m_buttonInsPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertPath ), NULL, this ); - m_buttonRemovePath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnRemoveUserPath ), NULL, this ); - m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnCancelClick ), NULL, this ); - m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnOkClick ), NULL, this ); -} - -DIALOG_PCBNEW_CONFIG_LIBS_FBP::~DIALOG_PCBNEW_CONFIG_LIBS_FBP() -{ - // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnCloseWindow ) ); - m_buttonAddLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertLibClick ), NULL, this ); - m_buttonIns->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertLibClick ), NULL, this ); - m_buttonRemoveLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnRemoveLibClick ), NULL, this ); - m_buttonUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnButtonUpClick ), NULL, this ); - m_buttonDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnButtonDownClick ), NULL, this ); - m_buttonModDoc->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnBrowseModDocFile ), NULL, this ); - m_buttonAddPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertPath ), NULL, this ); - m_buttonInsPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertPath ), NULL, this ); - m_buttonRemovePath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnRemoveUserPath ), NULL, this ); - m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnCancelClick ), NULL, this ); - m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnOkClick ), NULL, this ); -} +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Sep 8 2010) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_pcbnew_config_libs_and_paths_fbp.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_PCBNEW_CONFIG_LIBS_FBP::DIALOG_PCBNEW_CONFIG_LIBS_FBP( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bMainSizer; + bMainSizer = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sbLibsChoiceSizer; + sbLibsChoiceSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Footprint library files") ), wxHORIZONTAL ); + + wxBoxSizer* bLibsButtonsSizer; + bLibsButtonsSizer = new wxBoxSizer( wxHORIZONTAL ); + + sbLibsChoiceSizer->Add( bLibsButtonsSizer, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_ListLibr = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_EXTENDED|wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE ); + m_ListLibr->SetToolTip( _("List of active library files.\nOnly library files in this list are loaded by Pcbnew.\nThe order of this list is important:\nPcbnew searchs for a given footprint using this list order priority.") ); + m_ListLibr->SetMinSize( wxSize( 400,90 ) ); + + sbLibsChoiceSizer->Add( m_ListLibr, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + wxBoxSizer* bRightSizer; + bRightSizer = new wxBoxSizer( wxVERTICAL ); + + m_buttonAddLib = new wxButton( this, ID_ADD_LIB, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonAddLib->SetToolTip( _("Add a new library after the selected library, and load it") ); + + bRightSizer->Add( m_buttonAddLib, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); + + m_buttonIns = new wxButton( this, wxID_ANY, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonIns->SetToolTip( _("Add a new library before the selected library, and load it") ); + + bRightSizer->Add( m_buttonIns, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_buttonRemoveLib = new wxButton( this, ID_REMOVE_LIB, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonRemoveLib->SetToolTip( _("Unload the selected library") ); + + bRightSizer->Add( m_buttonRemoveLib, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_buttonUp = new wxButton( this, wxID_ANY, _("Up"), wxDefaultPosition, wxDefaultSize, 0 ); + bRightSizer->Add( m_buttonUp, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_buttonDown = new wxButton( this, wxID_ANY, _("Down"), wxDefaultPosition, wxDefaultSize, 0 ); + bRightSizer->Add( m_buttonDown, 0, wxALL, 5 ); + + sbLibsChoiceSizer->Add( bRightSizer, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + bMainSizer->Add( sbLibsChoiceSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + wxStaticBoxSizer* sbModulesDocSizer; + sbModulesDocSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Footprint documentation file") ), wxHORIZONTAL ); + + m_TextHelpModulesFileName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + sbModulesDocSizer->Add( m_TextHelpModulesFileName, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + m_buttonModDoc = new wxButton( this, wxID_BROWSE_MOD_DOC, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); + sbModulesDocSizer->Add( m_buttonModDoc, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 10 ); + + bMainSizer->Add( sbModulesDocSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + wxStaticBoxSizer* sbSizer4; + sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User defined search paths") ), wxHORIZONTAL ); + + sbSizer4->SetMinSize( wxSize( 400,70 ) ); + wxBoxSizer* bUserListSizer; + bUserListSizer = new wxBoxSizer( wxVERTICAL ); + + m_listUserPaths = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + m_listUserPaths->SetToolTip( _("Additional paths used in this project. The priority is higher than default KiCad paths.") ); + + bUserListSizer->Add( m_listUserPaths, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + sbSizer4->Add( bUserListSizer, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + wxBoxSizer* bUserPathsButtonsSizer; + bUserPathsButtonsSizer = new wxBoxSizer( wxVERTICAL ); + + m_buttonAddPath = new wxButton( this, ID_LIB_PATH_SEL, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); + bUserPathsButtonsSizer->Add( m_buttonAddPath, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_buttonInsPath = new wxButton( this, wxID_INSERT_PATH, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); + bUserPathsButtonsSizer->Add( m_buttonInsPath, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); + + m_buttonRemovePath = new wxButton( this, wxID_REMOVE_PATH, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); + bUserPathsButtonsSizer->Add( m_buttonRemovePath, 0, wxALL|wxBOTTOM, 5 ); + + sbSizer4->Add( bUserPathsButtonsSizer, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 ); + + bMainSizer->Add( sbSizer4, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + wxStaticBoxSizer* sbLibPathSizer; + sbLibPathSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Current search path list") ), wxVERTICAL ); + + wxBoxSizer* bUserLibPathSizer; + bUserLibPathSizer = new wxBoxSizer( wxHORIZONTAL ); + + sbLibPathSizer->Add( bUserLibPathSizer, 1, wxEXPAND, 5 ); + + m_DefaultLibraryPathslistBox = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_NEEDED_SB ); + m_DefaultLibraryPathslistBox->SetToolTip( _("System and user paths used to search and load library files and component doc files.\nSorted by decreasing priority order.") ); + m_DefaultLibraryPathslistBox->SetMinSize( wxSize( -1,70 ) ); + + sbLibPathSizer->Add( m_DefaultLibraryPathslistBox, 0, wxALL|wxEXPAND, 5 ); + + bMainSizer->Add( sbLibPathSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bMainSizer->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_sdbSizer1 = new wxStdDialogButtonSizer(); + m_sdbSizer1OK = new wxButton( this, wxID_OK ); + m_sdbSizer1->AddButton( m_sdbSizer1OK ); + m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); + m_sdbSizer1->Realize(); + bMainSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 5 ); + + this->SetSizer( bMainSizer ); + this->Layout(); + bMainSizer->Fit( this ); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnCloseWindow ) ); + m_buttonAddLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertLibClick ), NULL, this ); + m_buttonIns->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertLibClick ), NULL, this ); + m_buttonRemoveLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnRemoveLibClick ), NULL, this ); + m_buttonUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnButtonUpClick ), NULL, this ); + m_buttonDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnButtonDownClick ), NULL, this ); + m_buttonModDoc->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnBrowseModDocFile ), NULL, this ); + m_buttonAddPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertPath ), NULL, this ); + m_buttonInsPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertPath ), NULL, this ); + m_buttonRemovePath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnRemoveUserPath ), NULL, this ); + m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnCancelClick ), NULL, this ); + m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnOkClick ), NULL, this ); +} + +DIALOG_PCBNEW_CONFIG_LIBS_FBP::~DIALOG_PCBNEW_CONFIG_LIBS_FBP() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnCloseWindow ) ); + m_buttonAddLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertLibClick ), NULL, this ); + m_buttonIns->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertLibClick ), NULL, this ); + m_buttonRemoveLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnRemoveLibClick ), NULL, this ); + m_buttonUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnButtonUpClick ), NULL, this ); + m_buttonDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnButtonDownClick ), NULL, this ); + m_buttonModDoc->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnBrowseModDocFile ), NULL, this ); + m_buttonAddPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertPath ), NULL, this ); + m_buttonInsPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnAddOrInsertPath ), NULL, this ); + m_buttonRemovePath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnRemoveUserPath ), NULL, this ); + m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnCancelClick ), NULL, this ); + m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCBNEW_CONFIG_LIBS_FBP::OnOkClick ), NULL, this ); + +} diff --git a/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths_fbp.fbp b/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths_fbp.fbp index 7bcce8a00a..d44c0053c0 100644 --- a/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths_fbp.fbp +++ b/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths_fbp.fbp @@ -2,9 +2,11 @@ - + C++ 1 + source_name + 0 UTF-8 connect dialog_pcbnew_config_libs_and_paths_fbp @@ -12,66 +14,73 @@ none 1 dialog_pcbnew_config_libs_and_paths_fbp - + . - + 1 + 1 1 0 - + wxBOTH - + + 1 1 - - - + impl_virtual + + + 0 wxID_ANY - - + + DIALOG_PCBNEW_CONFIG_LIBS_FBP - + -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - - - - - - - - - + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + OnCloseWindow - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + bMainSizer wxVERTICAL none @@ -82,17 +91,17 @@ wxID_ANY Footprint library files - + sbLibsChoiceSizer wxHORIZONTAL none - + 5 wxALIGN_CENTER_HORIZONTAL 0 - + bLibsButtonsSizer wxHORIZONTAL none @@ -103,51 +112,56 @@ wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 1 - - - + + + + 1 1 - - + + 0 wxID_ANY - + 400,90 m_ListLibr protected - - + + wxLB_EXTENDED|wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE - + List of active library files. Only library files in this list are loaded by Pcbnew. The order of this list is important: Pcbnew searchs for a given footprint using this list order priority. - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -155,7 +169,7 @@ wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 - + bRightSizer wxVERTICAL none @@ -164,51 +178,56 @@ wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT 0 - - + + + 1 0 1 - - + + 0 ID_ADD_LIB Add - - + + m_buttonAddLib protected - - - - + + + + Add a new library after the selected library, and load it - - - + + wxFILTER_NONE + wxDefaultValidator + + + + OnAddOrInsertLibClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -216,51 +235,56 @@ wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT 0 - - + + + 1 0 1 - - + + 0 wxID_ANY Insert - - + + m_buttonIns protected - - - - + + + + Add a new library before the selected library, and load it - - - + + wxFILTER_NONE + wxDefaultValidator + + + + OnAddOrInsertLibClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -268,51 +292,56 @@ wxALL|wxALIGN_CENTER_HORIZONTAL 0 - - + + + 1 0 1 - - + + 0 ID_REMOVE_LIB Remove - - + + m_buttonRemoveLib protected - - - - + + + + Unload the selected library - - - + + wxFILTER_NONE + wxDefaultValidator + + + + OnRemoveLibClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -320,51 +349,56 @@ wxTOP|wxRIGHT|wxLEFT 0 - - + + + 1 0 1 - - + + 0 wxID_ANY Up - - + + m_buttonUp protected - - - - - - - - + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + OnButtonUpClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -372,51 +406,56 @@ wxALL 0 - - + + + 1 0 1 - - + + 0 wxID_ANY Down - - + + m_buttonDown protected - - - - - - - - + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + OnButtonDownClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -430,64 +469,69 @@ wxID_ANY Footprint documentation file - + sbModulesDocSizer wxHORIZONTAL none - + 5 wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 1 - - + + + 1 1 - - + + 0 wxID_ANY - + 0 - + m_TextHelpModulesFileName protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -495,51 +539,56 @@ wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT 0 - - + + + 1 0 1 - - + + 0 wxID_BROWSE_MOD_DOC Browse - - + + m_buttonModDoc protected - - - - - - - - + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + OnBrowseModDocFile - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -555,13 +604,13 @@ sbSizer4 wxHORIZONTAL none - + 5 wxALIGN_CENTER_VERTICAL|wxEXPAND 1 - + bUserListSizer wxVERTICAL none @@ -570,51 +619,56 @@ wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 1 - - - + + + + 1 1 - - + + 0 wxID_ANY - - + + m_listUserPaths protected - - - - - Additional paths used in this project. The priority is highter than default Kicad paths. - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Additional paths used in this project. The priority is higher than default KiCad paths. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -624,7 +678,7 @@ wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 - + bUserPathsButtonsSizer wxVERTICAL none @@ -633,51 +687,56 @@ wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT 0 - - + + + 1 0 1 - - + + 0 ID_LIB_PATH_SEL Add - - + + m_buttonAddPath protected - - - - - - - - + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + OnAddOrInsertPath - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -685,51 +744,56 @@ wxLEFT|wxRIGHT|wxTOP 0 - - + + + 1 0 1 - - + + 0 wxID_INSERT_PATH Insert - - + + m_buttonInsPath protected - - - - - - - - + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + OnAddOrInsertPath - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -737,51 +801,56 @@ wxALL|wxBOTTOM 0 - - + + + 1 0 1 - - + + 0 wxID_REMOVE_PATH Remove - - + + m_buttonRemovePath protected - - - - - - - - + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + OnRemoveUserPath - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -795,17 +864,17 @@ wxID_ANY Current search path list - + sbLibPathSizer wxVERTICAL none - + 5 wxEXPAND 1 - + bUserLibPathSizer wxHORIZONTAL none @@ -816,51 +885,56 @@ wxALL|wxEXPAND 0 - - - + + + + 1 1 - - + + 0 wxID_ANY - + -1,70 m_DefaultLibraryPathslistBox protected - - + + wxLB_NEEDED_SB - - Paths (system paths and user paths) used to search and load libraries files and component doc files. Sorted by decreasing priority order. - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + System and user paths used to search and load library files and component doc files. Sorted by decreasing priority order. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -870,48 +944,53 @@ wxEXPAND|wxTOP|wxRIGHT|wxLEFT 0 - - + + + 1 1 - - + + 0 wxID_ANY - - + + m_staticline1 protected - - + + wxLI_HORIZONTAL - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -927,17 +1006,17 @@ 1 0 0 - + m_sdbSizer1 protected - + OnCancelClick - - - + + + OnOkClick - - + + diff --git a/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths_fbp.h b/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths_fbp.h index 70b8a0f1d8..9716749cf6 100644 --- a/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths_fbp.h +++ b/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths_fbp.h @@ -1,83 +1,84 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 16 2008) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#ifndef __dialog_pcbnew_config_libs_and_paths_fbp__ -#define __dialog_pcbnew_config_libs_and_paths_fbp__ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_PCBNEW_CONFIG_LIBS_FBP -/////////////////////////////////////////////////////////////////////////////// -class DIALOG_PCBNEW_CONFIG_LIBS_FBP : public wxDialog -{ - private: - - protected: - enum - { - ID_ADD_LIB = 1000, - ID_REMOVE_LIB, - wxID_BROWSE_MOD_DOC, - ID_LIB_PATH_SEL, - wxID_INSERT_PATH, - wxID_REMOVE_PATH, - }; - - wxListBox* m_ListLibr; - wxButton* m_buttonAddLib; - wxButton* m_buttonIns; - wxButton* m_buttonRemoveLib; - wxButton* m_buttonUp; - wxButton* m_buttonDown; - wxTextCtrl* m_TextHelpModulesFileName; - wxButton* m_buttonModDoc; - wxListBox* m_listUserPaths; - wxButton* m_buttonAddPath; - wxButton* m_buttonInsPath; - wxButton* m_buttonRemovePath; - wxListBox* m_DefaultLibraryPathslistBox; - wxStaticLine* m_staticline1; - wxStdDialogButtonSizer* m_sdbSizer1; - wxButton* m_sdbSizer1OK; - wxButton* m_sdbSizer1Cancel; - - // Virtual event handlers, overide them in your derived class - virtual void OnCloseWindow( wxCloseEvent& event ){ event.Skip(); } - virtual void OnAddOrInsertLibClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnRemoveLibClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnButtonUpClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnButtonDownClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnBrowseModDocFile( wxCommandEvent& event ){ event.Skip(); } - virtual void OnAddOrInsertPath( wxCommandEvent& event ){ event.Skip(); } - virtual void OnRemoveUserPath( wxCommandEvent& event ){ event.Skip(); } - virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); } - - - public: - DIALOG_PCBNEW_CONFIG_LIBS_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DIALOG_PCBNEW_CONFIG_LIBS_FBP(); - -}; - -#endif //__dialog_pcbnew_config_libs_and_paths_fbp__ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Sep 8 2010) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __dialog_pcbnew_config_libs_and_paths_fbp__ +#define __dialog_pcbnew_config_libs_and_paths_fbp__ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_PCBNEW_CONFIG_LIBS_FBP +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_PCBNEW_CONFIG_LIBS_FBP : public wxDialog +{ + private: + + protected: + enum + { + ID_ADD_LIB = 1000, + ID_REMOVE_LIB, + wxID_BROWSE_MOD_DOC, + ID_LIB_PATH_SEL, + wxID_INSERT_PATH, + wxID_REMOVE_PATH, + }; + + wxListBox* m_ListLibr; + wxButton* m_buttonAddLib; + wxButton* m_buttonIns; + wxButton* m_buttonRemoveLib; + wxButton* m_buttonUp; + wxButton* m_buttonDown; + wxTextCtrl* m_TextHelpModulesFileName; + wxButton* m_buttonModDoc; + wxListBox* m_listUserPaths; + wxButton* m_buttonAddPath; + wxButton* m_buttonInsPath; + wxButton* m_buttonRemovePath; + wxListBox* m_DefaultLibraryPathslistBox; + wxStaticLine* m_staticline1; + wxStdDialogButtonSizer* m_sdbSizer1; + wxButton* m_sdbSizer1OK; + wxButton* m_sdbSizer1Cancel; + + // Virtual event handlers, overide them in your derived class + virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); } + virtual void OnAddOrInsertLibClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnRemoveLibClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnButtonUpClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnButtonDownClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnBrowseModDocFile( wxCommandEvent& event ) { event.Skip(); } + virtual void OnAddOrInsertPath( wxCommandEvent& event ) { event.Skip(); } + virtual void OnRemoveUserPath( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } + + + public: + + DIALOG_PCBNEW_CONFIG_LIBS_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_PCBNEW_CONFIG_LIBS_FBP(); + +}; + +#endif //__dialog_pcbnew_config_libs_and_paths_fbp__ diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index aa273f52eb..397070936d 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -1,3 +1,28 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2007 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2011 Wayne Stambaugh + * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + /** * @file edit.cpp * @brief Edit PCB implementation. @@ -1296,7 +1321,7 @@ void PCB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent ) DisplayInfoMessage( this, _( "Warning: zone display is OFF!!!" ) ); if( !GetBoard()->IsHighLightNetON() && (GetBoard()->GetHighLightNetCode() > 0 ) ) - High_Light( &dc ); + HighLight( &dc ); break; diff --git a/pcbnew/editrack-part2.cpp b/pcbnew/editrack-part2.cpp index 9dbe5b3b84..9ad6a9fced 100644 --- a/pcbnew/editrack-part2.cpp +++ b/pcbnew/editrack-part2.cpp @@ -1,6 +1,32 @@ -/************************/ -/* Edit tracks */ -/************************/ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2006 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2011 Wayne Stambaugh + * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/** + * @file editrack-part2.cpp + */ + #include "fctsys.h" #include "gr_basic.h" @@ -309,7 +335,7 @@ void PCB_EDIT_FRAME::HighlightUnconnectedPads( wxDC* DC ) if( (net->m_Status & CH_ACTIF) == 0 ) continue; - net->m_PadStart->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL ); - net->m_PadEnd->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL ); + net->m_PadStart->Draw( DrawPanel, DC, GR_OR | GR_HIGHLIGHT ); + net->m_PadEnd->Draw( DrawPanel, DC, GR_OR | GR_HIGHLIGHT ); } } diff --git a/pcbnew/editrack.cpp b/pcbnew/editrack.cpp index 424b559944..851b06fbab 100644 --- a/pcbnew/editrack.cpp +++ b/pcbnew/editrack.cpp @@ -1,3 +1,28 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2011 Wayne Stambaugh + * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + /** * @file editrack.cpp */ @@ -42,7 +67,7 @@ static void Abort_Create_Track( EDA_DRAW_PANEL* Panel, wxDC* DC ) ShowNewTrackWhenMovingCursor( Panel, DC, wxDefaultPosition, false ); if( pcb->IsHighLightNetON() ) - frame->High_Light( DC ); + frame->HighLight( DC ); pcb->PopHighLight(); @@ -83,7 +108,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC ) // erase old highlight if( GetBoard()->IsHighLightNetON() ) - High_Light( aDC ); + HighLight( aDC ); g_CurrentTrackList.PushBack( new TRACK( GetBoard() ) ); g_CurrentTrackSegment->m_Flags = IS_NEW; @@ -496,7 +521,7 @@ bool PCB_EDIT_FRAME::End_Route( TRACK* aTrack, wxDC* aDC ) wxASSERT( g_CurrentTrackList.GetCount() == 0 ); if( GetBoard()->IsHighLightNetON() ) - High_Light( aDC ); + HighLight( aDC ); GetBoard()->PopHighLight(); diff --git a/pcbnew/surbrill.cpp b/pcbnew/highlight.cpp similarity index 73% rename from pcbnew/surbrill.cpp rename to pcbnew/highlight.cpp index ea2d05ec70..fa0cbdf6d9 100644 --- a/pcbnew/surbrill.cpp +++ b/pcbnew/highlight.cpp @@ -1,5 +1,29 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2007 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + /** - * @file surbrill.cpp + * @file highlight.cpp * @brief Highlight nets. */ @@ -21,12 +45,6 @@ #define Pad_fill ( Pad_Fill_Item.State == RUN ) -/** - * Function ListNetsAndSelect - * called by a command event - * displays the sorted list of nets in a dialog frame - * If a net is selected, it is highlighted - */ void PCB_EDIT_FRAME::ListNetsAndSelect( wxCommandEvent& event ) { NETINFO_ITEM* net; @@ -86,23 +104,20 @@ void PCB_EDIT_FRAME::ListNetsAndSelect( wxCommandEvent& event ) INSTALL_UNBUFFERED_DC( dc, DrawPanel ); if( GetBoard()->IsHighLightNetON() ) - High_Light( &dc ); + HighLight( &dc ); GetBoard()->SetHighLightNet( netcode ); - High_Light( &dc ); + HighLight( &dc ); } } -/* Locate track or pad and highlight the corresponding net - * Returns the Netcode, or -1 if no net located. - */ -int PCB_EDIT_FRAME::Select_High_Light( wxDC* DC ) +int PCB_EDIT_FRAME::SelectHighLight( wxDC* DC ) { int netcode = -1; if( GetBoard()->IsHighLightNetON() ) - High_Light( DC ); + HighLight( DC ); // use this scheme because a pad is a higher priority than a track in the // search, and finding a pad, instead of a track on a pad, @@ -147,7 +162,7 @@ int PCB_EDIT_FRAME::Select_High_Light( wxDC* DC ) if( netcode >= 0 ) { GetBoard()->SetHighLightNet( netcode ); - High_Light( DC ); + HighLight( DC ); } @@ -155,12 +170,7 @@ int PCB_EDIT_FRAME::Select_High_Light( wxDC* DC ) } -/* - * Highlight command. - * - * Show or removes the net at the current cursor position. - */ -void PCB_EDIT_FRAME::High_Light( wxDC* DC ) +void PCB_EDIT_FRAME::HighLight( wxDC* DC ) { if( GetBoard()->IsHighLightNetON() ) GetBoard()->HighLightOFF(); diff --git a/pcbnew/move_or_drag_track.cpp b/pcbnew/move_or_drag_track.cpp index fc878faadf..5ab0f7184c 100644 --- a/pcbnew/move_or_drag_track.cpp +++ b/pcbnew/move_or_drag_track.cpp @@ -1,3 +1,28 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2006 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2011 Wayne Stambaugh + * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + /** * @file move_or_drag_track.cpp * @brief Track editing routines to move and drag track segments or node. @@ -143,7 +168,7 @@ static void Show_MoveNode( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPo TRACK* Track; BASE_SCREEN* screen = aPanel->GetScreen(); int track_fill_copy = DisplayOpt.DisplayPcbTrackFill; - int draw_mode = GR_XOR | GR_SURBRILL; + int draw_mode = GR_XOR | GR_HIGHLIGHT; DisplayOpt.DisplayPcbTrackFill = false; @@ -286,7 +311,7 @@ static void Show_Drag_Track_Segment_With_Cte_Slope( EDA_DRAW_PANEL* aPanel, wxDC } } - int draw_mode = GR_XOR | GR_SURBRILL; + int draw_mode = GR_XOR | GR_HIGHLIGHT; /* Undraw the current moved track segments before modification*/ @@ -664,7 +689,7 @@ void PCB_EDIT_FRAME::StartMoveOneNodeOrSegment( TRACK* aTrack, wxDC* aDC, int aC GetBoard()->PushHighLight(); if( GetBoard()->IsHighLightNetON() ) - High_Light( aDC ); + HighLight( aDC ); PosInit = GetScreen()->GetCrossHairPosition(); @@ -895,7 +920,7 @@ void PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC GetBoard()->PushHighLight(); if( GetBoard()->IsHighLightNetON() ) - High_Light( DC ); + HighLight( DC ); EraseDragList(); @@ -988,7 +1013,7 @@ bool PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC ) } } - int draw_mode = GR_OR | GR_SURBRILL; + int draw_mode = GR_OR | GR_HIGHLIGHT; // DRC Ok: place track segments Track->m_Flags = 0; @@ -1028,7 +1053,7 @@ bool PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC ) s_ItemsListPicker.ClearItemsList(); // s_ItemsListPicker is no more owner of picked items if( GetBoard()->IsHighLightNetON() ) - High_Light( DC ); + HighLight( DC ); GetBoard()->PopHighLight(); diff --git a/pcbnew/onleftclick.cpp b/pcbnew/onleftclick.cpp index bcfbcef820..c73dad502a 100644 --- a/pcbnew/onleftclick.cpp +++ b/pcbnew/onleftclick.cpp @@ -1,3 +1,28 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2007 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2011 Wayne Stambaugh + * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + /** * @file pcbnew/onleftclick.cpp * @brief Functions called when the left button is clicked or double clicked. @@ -156,12 +181,14 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) case ID_PCB_HIGHLIGHT_BUTT: { - int netcode = Select_High_Light( aDC ); + int netcode = SelectHighLight( aDC ); + if( netcode < 0 ) GetBoard()->DisplayInfo( this ); else { NETINFO_ITEM* net = GetBoard()->FindNet( netcode ); + if( net ) net->DisplayInfo( this ); } @@ -174,6 +201,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) if( DrawStruct ) SendMessageToEESCHEMA( DrawStruct ); + break; case ID_PCB_MIRE_BUTT: diff --git a/pcbnew/solve.cpp b/pcbnew/solve.cpp index 73bdf7fe74..ca8429f7df 100644 --- a/pcbnew/solve.cpp +++ b/pcbnew/solve.cpp @@ -1,3 +1,28 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2006 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2011 Wayne Stambaugh + * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + /** * @file solve.cpp */ @@ -301,8 +326,8 @@ int PCB_EDIT_FRAME::Solve( wxDC* DC, int two_sides ) segm_fY, 0, WHITE | GR_XOR ); - pt_cur_ch->m_PadStart->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL ); - pt_cur_ch->m_PadEnd->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL ); + pt_cur_ch->m_PadStart->Draw( DrawPanel, DC, GR_OR | GR_HIGHLIGHT ); + pt_cur_ch->m_PadEnd->Draw( DrawPanel, DC, GR_OR | GR_HIGHLIGHT ); success = Autoroute_One_Track( this, DC, diff --git a/pcbnew/tr_modif.cpp b/pcbnew/tr_modif.cpp index 1f652b9154..4780f94b67 100644 --- a/pcbnew/tr_modif.cpp +++ b/pcbnew/tr_modif.cpp @@ -1,3 +1,28 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2006 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2011 Wayne Stambaugh + * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + /** * @file tr_modif.cpp * @brief Trace editing. @@ -213,7 +238,7 @@ int PCB_EDIT_FRAME::EraseRedundantTrack( wxDC* aDC, /* Marked track can be erased. */ TRACK* NextS; - DrawTraces( DrawPanel, aDC, pt_del, nb_segm, GR_XOR | GR_SURBRILL ); + DrawTraces( DrawPanel, aDC, pt_del, nb_segm, GR_XOR | GR_HIGHLIGHT ); for( jj = 0; jj < nb_segm; jj++, pt_del = NextS ) { diff --git a/pcbnew/tracepcb.cpp b/pcbnew/tracepcb.cpp index 0e3aac639f..5fbba937d5 100644 --- a/pcbnew/tracepcb.cpp +++ b/pcbnew/tracepcb.cpp @@ -1,3 +1,28 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2006 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2011 Wayne Stambaugh + * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + /** * @file tracepcb.cpp * @brief Functions to redraw the current board. @@ -89,7 +114,7 @@ void PCB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) DrawGeneralRatsnest( DC ); #ifdef USE_WX_OVERLAY - if(IsShown()) + if( IsShown() ) { DrawPanel->m_overlay.Reset(); wxDCOverlay overlaydc( DrawPanel->m_overlay, (wxWindowDC*)DC ); @@ -212,9 +237,9 @@ void BOARD::DrawHighLight( EDA_DRAW_PANEL* aDrawPanel, wxDC* DC, int aNetCode ) int draw_mode; if( IsHighLightNetON() ) - draw_mode = GR_SURBRILL | GR_OR; + draw_mode = GR_HIGHLIGHT | GR_OR; else - draw_mode = GR_AND | GR_SURBRILL; + draw_mode = GR_AND | GR_HIGHLIGHT; // Redraw ZONE_CONTAINERS BOARD::ZONE_CONTAINERS& zones = m_ZoneDescriptorList; diff --git a/pcbnew/zones_by_polygon.cpp b/pcbnew/zones_by_polygon.cpp index 35bf1a3a0e..fcd367fc91 100644 --- a/pcbnew/zones_by_polygon.cpp +++ b/pcbnew/zones_by_polygon.cpp @@ -1,3 +1,28 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2007 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2011 Wayne Stambaugh + * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + /** * @file zones_by_polygon.cpp */ @@ -35,7 +60,7 @@ static void Show_Zone_Corner_Or_Outline_While_Move_Mouse( EDA_DRAW_PANEL* aPanel /* Local variables */ static wxPoint s_CornerInitialPosition; // Used to abort a move corner command static bool s_CornerIsNew; // Used to abort a move corner command (if it is a new corner, it must be deleted) -static bool s_AddCutoutToCurrentZone; // if true, the next outline will be addes to s_CurrentZone +static bool s_AddCutoutToCurrentZone; // if true, the next outline will be added to s_CurrentZone static ZONE_CONTAINER* s_CurrentZone; // if != NULL, these ZONE_CONTAINER params will be used for the next zone static wxPoint s_CursorLastPosition; // in move zone outline, last cursor position. Used to calculate the move vector static PICKED_ITEMS_LIST s_PickedList; // a picked list to save zones for undo/redo command @@ -44,17 +69,11 @@ static PICKED_ITEMS_LIST _AuxiliaryList; // a picked list to store zo #include "dialog_copper_zones.h" -/** - * Function Add_Similar_Zone - * Add a zone to a given zone outline. - * if the zones are overlappeing they will be merged - * @param DC = current Device Context - * @param zone_container = parent zone outline - */ void PCB_EDIT_FRAME::Add_Similar_Zone( wxDC* DC, ZONE_CONTAINER* zone_container ) { if ( zone_container == NULL ) return; + s_AddCutoutToCurrentZone = false; s_CurrentZone = zone_container; @@ -68,12 +87,6 @@ void PCB_EDIT_FRAME::Add_Similar_Zone( wxDC* DC, ZONE_CONTAINER* zone_container } -/** - * Function Add_Zone_Cutout - * Add a cutout zone to a given zone outline - * @param DC = current Device Context - * @param zone_container = parent zone outline - */ void PCB_EDIT_FRAME::Add_Zone_Cutout( wxDC* DC, ZONE_CONTAINER* zone_container ) { if ( zone_container == NULL ) @@ -92,11 +105,6 @@ void PCB_EDIT_FRAME::Add_Zone_Cutout( wxDC* DC, ZONE_CONTAINER* zone_container ) } -/** Used **only** while creating a new zone outline - * Remove and delete the current outline segment in progress - * @return 0 if no corner in list, or corner number - * if no corner in list, close the outline creation - */ int PCB_EDIT_FRAME::Delete_LastCreatedCorner( wxDC* DC ) { ZONE_CONTAINER* zone = GetBoard()->m_CurrentZoneContour; @@ -151,11 +159,6 @@ static void Abort_Zone_Create_Outline( EDA_DRAW_PANEL* Panel, wxDC* DC ) } -/** - * Function Start_Move_Zone_Corner - * Initialise parametres to move an existing corner of a zone. - * if IsNewCorner is true, the Abort_Zone_Move_Corner_Or_Outlines will remove this corner, if called - */ void PCB_EDIT_FRAME::Start_Move_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_container, int corner_id, bool IsNewCorner ) { @@ -163,14 +166,14 @@ void PCB_EDIT_FRAME::Start_Move_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_cont { if( GetBoard()->IsHighLightNetON() && DC ) { - High_Light( DC ); // Remove old hightlight selection + HighLight( DC ); // Remove old highlight selection } g_Zone_Default_Setting.m_NetcodeSelection = zone_container->GetNet(); GetBoard()->SetHighLightNet( zone_container->GetNet() ); if( DC ) - High_Light( DC ); + HighLight( DC ); } @@ -201,10 +204,6 @@ void PCB_EDIT_FRAME::Start_Move_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_cont } -/** - * Function Start_Move_Zone_Drag_Outline_Edge - * Prepares a drag edge for an existing zone outline, - */ void PCB_EDIT_FRAME::Start_Move_Zone_Drag_Outline_Edge( wxDC* DC, ZONE_CONTAINER* zone_container, int corner_id ) @@ -224,10 +223,6 @@ void PCB_EDIT_FRAME::Start_Move_Zone_Drag_Outline_Edge( wxDC* DC, } -/** - * Function Start_Move_Zone_Outlines - * Initialise parametres to move an existing zone outlines. - */ void PCB_EDIT_FRAME::Start_Move_Zone_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container ) { /* Show the Net */ @@ -235,12 +230,12 @@ void PCB_EDIT_FRAME::Start_Move_Zone_Outlines( wxDC* DC, ZONE_CONTAINER* zone_co { if( GetBoard()->IsHighLightNetON() ) { - High_Light( DC ); // Remove old hightlight selection + HighLight( DC ); // Remove old highlight selection } g_Zone_Default_Setting.m_NetcodeSelection = zone_container->GetNet(); GetBoard()->SetHighLightNet( zone_container->GetNet() ); - High_Light( DC ); + HighLight( DC ); } s_PickedList.ClearListAndDeleteItems(); @@ -258,12 +253,6 @@ void PCB_EDIT_FRAME::Start_Move_Zone_Outlines( wxDC* DC, ZONE_CONTAINER* zone_co } -/** - * Function End_Move_Zone_Corner_Or_Outlines - * Terminates a move corner in a zone outline, or a move zone outlines - * @param DC = current Device Context (can be NULL) - * @param zone_container: the given zone - */ void PCB_EDIT_FRAME::End_Move_Zone_Corner_Or_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container ) { zone_container->m_Flags = 0; @@ -302,14 +291,6 @@ void PCB_EDIT_FRAME::End_Move_Zone_Corner_Or_Outlines( wxDC* DC, ZONE_CONTAINER* } -/** - * Function Remove_Zone_Corner - * Remove the currently selected corner in a zone outline - * the .m_CornerSelection is used as corner selection - * @param DC = Current device context (can be NULL ) - * @param zone_container = the zone that contains the selected corner - * the member .m_CornerSelection is used as selected corner - */ void PCB_EDIT_FRAME::Remove_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_container ) { OnModify(); @@ -358,7 +339,7 @@ void PCB_EDIT_FRAME::Remove_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_containe int ii = GetBoard()->GetAreaIndex( zone_container ); // test if zone_container exists if( ii < 0 ) - zone_container = NULL; // zone_container does not exist anymaore, after combining zones + zone_container = NULL; // zone_container does not exist anymore, after combining zones int error_count = GetBoard()->Test_Drc_Areas_Outlines_To_Areas_Outlines( zone_container, true ); @@ -453,15 +434,7 @@ void Show_Zone_Corner_Or_Outline_While_Move_Mouse( EDA_DRAW_PANEL* aPanel, wxDC* } -/** - * Function Begin_Zone - * either initializes the first segment of a new zone, or adds an - * intermediate segment. - * A new zone can be: - * created from scratch: the user will be prompted to define parameters (layer, clearence ...) - * created from a similar zone (s_CurrentZone is used): parameters are copied from s_CurrentZone - * created as a cutout (an hole) inside s_CurrentZone - */ + int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC ) { // verify if s_CurrentZone exists (could be deleted since last selection) : @@ -479,7 +452,7 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC ) s_CurrentZone = NULL; } - // If no zone contour in progress, a new zone is beeing created: + // If no zone contour in progress, a new zone is being created: if( GetBoard()->m_CurrentZoneContour == NULL ) GetBoard()->m_CurrentZoneContour = new ZONE_CONTAINER( GetBoard() ); @@ -490,7 +463,7 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC ) if( s_CurrentZone == NULL ) // A new outline is created, from scratch { int diag; - // Init zone params to reasonnable values + // Init zone params to reasonable values zone->SetLayer( getActiveLayer() ); // Prompt user for parameters: @@ -528,7 +501,7 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC ) if( diag == ZONE_ABORT ) return 0; - // Switch active layer to the selectec zonz layer + // Switch active layer to the selected zone layer setActiveLayer( g_Zone_Default_Setting.m_CurrentZone_Layer ); } else // Start a new contour: init zone params (net and layer) from an existing @@ -546,11 +519,11 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC ) if( GetBoard()->IsHighLightNetON() ) { - High_Light( DC ); // Remove old hightlight selection + HighLight( DC ); // Remove old highlight selection } GetBoard()->SetHighLightNet( g_Zone_Default_Setting.m_NetcodeSelection ); - High_Light( DC ); + HighLight( DC ); } if( !s_AddCutoutToCurrentZone ) @@ -605,14 +578,6 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC ) } -/** - * Function End_Zone - * Terminates a zone outline creation - * terminates (if no DRC error ) the zone edge creation process - * @param DC = current Device Context - * @return true if Ok, false if DRC error - * if ok, put it in the main list GetBoard()->m_ZoneDescriptorList (a vector) - */ bool PCB_EDIT_FRAME::End_Zone( wxDC* DC ) { ZONE_CONTAINER* zone = GetBoard()->m_CurrentZoneContour; @@ -684,7 +649,7 @@ bool PCB_EDIT_FRAME::End_Zone( wxDC* DC ) s_AddCutoutToCurrentZone = false; s_CurrentZone = NULL; - GetScreen()->SetCurItem( NULL ); // This outine can be deleted when merging outlines + GetScreen()->SetCurItem( NULL ); // This outline can be deleted when merging outlines // Combine zones if possible : GetBoard()->AreaPolygonModified( &_AuxiliaryList, zone, true, s_Verbose ); @@ -736,7 +701,7 @@ static void Show_New_Edge_While_Move_Mouse( EDA_DRAW_PANEL* aPanel, wxDC* aDC, zone->DrawWhileCreateOutline( aPanel, aDC ); } - /* Redraw the curent edge in its new position */ + /* Redraw the current edge in its new position */ if( g_Zone_45_Only ) { // calculate the new position as allowed @@ -750,10 +715,6 @@ static void Show_New_Edge_While_Move_Mouse( EDA_DRAW_PANEL* aPanel, wxDC* aDC, } -/** - * Function Edit_Zone_Params - * Edit params (layer, clearance, ...) for a zone outline - */ void PCB_EDIT_FRAME::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container ) { int diag; @@ -823,16 +784,6 @@ void PCB_EDIT_FRAME::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container } -/** - * Function Delete_Zone_Contour - * Remove the zone which include the segment aZone, or the zone which have the given time stamp. - * A zone is a group of segments which have the same TimeStamp - * @param DC = current Device Context (can be NULL) - * @param zone_container = zone to modify - * the member .m_CornerSelection is used to find the outline to remove. - * if the outline is the main outline, all the zone_container is removed (deleted) - * otherwise, the hole is deleted - */ void PCB_EDIT_FRAME::Delete_Zone_Contour( wxDC* DC, ZONE_CONTAINER* zone_container ) { int ncont = zone_container->m_Poly->GetContour( zone_container->m_CornerSelection );