Browse Source
Add Manage Symbol and Footprint Library tables to project frame.
Add Manage Symbol and Footprint Library tables to project frame.
Fixes: lp:1780604 * https://bugs.launchpad.net/kicad/+bug/1780604pull/17/head
20 changed files with 338 additions and 213 deletions
-
1common/CMakeLists.txt
-
85common/dialogs/dialog_edit_library_tables.cpp
-
4cvpcb/menubar.cpp
-
6eeschema/menubar_libedit.cpp
-
46include/dialog_edit_library_tables.h
-
18include/dialog_shim.h
-
8include/eda_base_frame.h
-
2include/id.h
-
2include/lib_table_base.h
-
5kicad/kicad.h
-
59kicad/mainframe.cpp
-
18kicad/menubar.cpp
-
115pcbnew/dialogs/dialog_fp_lib_table.cpp
-
19pcbnew/dialogs/dialog_fp_lib_table.h
-
61pcbnew/dialogs/dialog_fp_lib_table_base.cpp
-
61pcbnew/dialogs/dialog_fp_lib_table_base.fbp
-
28pcbnew/dialogs/dialog_fp_lib_table_base.h
-
4pcbnew/menubar_footprint_editor.cpp
-
4pcbnew/menubar_pcb_editor.cpp
-
5pcbnew/pcb_edit_frame.h
@ -0,0 +1,85 @@ |
|||||
|
/*
|
||||
|
* This program source code file is part of KiCad, a free EDA CAD application. |
||||
|
* |
||||
|
* Copyright (C) 2018 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
#include <wx/statline.h>
|
||||
|
|
||||
|
#include "dialog_edit_library_tables.h"
|
||||
|
|
||||
|
|
||||
|
DIALOG_EDIT_LIBRARY_TABLES::DIALOG_EDIT_LIBRARY_TABLES( wxWindow* aParent, |
||||
|
const wxString& aTitle ) : |
||||
|
DIALOG_SHIM( aParent, wxID_ANY, aTitle, wxDefaultPosition, wxDefaultSize, |
||||
|
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ), |
||||
|
m_GlobalTableChanged( false ), |
||||
|
m_ProjectTableChanged( false ) |
||||
|
{ |
||||
|
// Construction delayed until after panel is installed
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
void DIALOG_EDIT_LIBRARY_TABLES::InstallPanel( wxPanel* aPanel ) |
||||
|
{ |
||||
|
m_contentPanel = aPanel; |
||||
|
|
||||
|
// Now perform the body of the constructor
|
||||
|
auto mainSizer = new wxBoxSizer( wxVERTICAL ); |
||||
|
SetSizer( mainSizer ); |
||||
|
|
||||
|
mainSizer->Add( m_contentPanel, 1, wxEXPAND|wxALL, 5 ); |
||||
|
m_contentPanel->SetMinSize( wxSize( 1000, 600 ) ); |
||||
|
|
||||
|
auto line = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); |
||||
|
mainSizer->Add( line, 0, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 10 ); |
||||
|
|
||||
|
auto sdbSizer = new wxStdDialogButtonSizer(); |
||||
|
auto sdbSizerOK = new wxButton( this, wxID_OK ); |
||||
|
sdbSizer->AddButton( sdbSizerOK ); |
||||
|
auto sdbSizerCancel = new wxButton( this, wxID_CANCEL ); |
||||
|
sdbSizer->AddButton( sdbSizerCancel ); |
||||
|
sdbSizer->Realize(); |
||||
|
|
||||
|
mainSizer->Add( sdbSizer, 0, wxALL|wxEXPAND, 5 ); |
||||
|
|
||||
|
sdbSizerOK->SetDefault(); |
||||
|
|
||||
|
FinishDialogSettings(); |
||||
|
|
||||
|
// On some windows manager (Unity, XFCE), this dialog is not always raised, depending
|
||||
|
// on how the dialog is run.
|
||||
|
Raise(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
bool DIALOG_EDIT_LIBRARY_TABLES::TransferDataToWindow() |
||||
|
{ |
||||
|
if( !DIALOG_SHIM::TransferDataToWindow() ) |
||||
|
return false; |
||||
|
|
||||
|
return m_contentPanel->TransferDataToWindow(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
bool DIALOG_EDIT_LIBRARY_TABLES::TransferDataFromWindow() |
||||
|
{ |
||||
|
if( !DIALOG_SHIM::TransferDataFromWindow() ) |
||||
|
return false; |
||||
|
|
||||
|
return m_contentPanel->TransferDataFromWindow(); |
||||
|
} |
||||
|
|
@ -0,0 +1,46 @@ |
|||||
|
/* |
||||
|
* This program source code file is part of KiCad, a free EDA CAD application. |
||||
|
* |
||||
|
* Copyright (C) 2018 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 3 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, see <http://www.gnu.org/licenses/>. |
||||
|
*/ |
||||
|
|
||||
|
|
||||
|
#ifndef DIALOG_EDIT_LIBRARY_TABLES_H |
||||
|
#define DIALOG_EDIT_LIBRARY_TABLES_H |
||||
|
|
||||
|
#include <dialog_shim.h> |
||||
|
|
||||
|
|
||||
|
class DIALOG_EDIT_LIBRARY_TABLES : public DIALOG_SHIM |
||||
|
{ |
||||
|
public: |
||||
|
bool m_GlobalTableChanged; |
||||
|
bool m_ProjectTableChanged; |
||||
|
|
||||
|
public: |
||||
|
DIALOG_EDIT_LIBRARY_TABLES( wxWindow* aParent, const wxString& aTitle ); |
||||
|
|
||||
|
void InstallPanel( wxPanel* aPanel ); |
||||
|
|
||||
|
bool TransferDataToWindow() override; |
||||
|
bool TransferDataFromWindow() override; |
||||
|
|
||||
|
protected: |
||||
|
wxPanel* m_contentPanel; |
||||
|
}; |
||||
|
|
||||
|
|
||||
|
#endif //DIALOG_EDIT_LIBRARY_TABLES_H |
Write
Preview
Loading…
Cancel
Save
Reference in new issue