2017-04-02 12:09:01 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2017 Oliver Walters
|
2021-03-21 17:31:23 +00:00
|
|
|
* Copyright (C) 2017-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
2017-04-02 12:09:01 +00:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
2021-07-03 20:43:30 +00:00
|
|
|
#ifndef DIALOG_SYMBOL_FIELDS_TABLE_H
|
|
|
|
#define DIALOG_SYMBOL_FIELDS_TABLE_H
|
2017-04-02 12:09:01 +00:00
|
|
|
|
|
|
|
|
2021-07-03 20:43:30 +00:00
|
|
|
#include <dialog_symbol_fields_table_base.h>
|
2017-04-02 12:09:01 +00:00
|
|
|
#include <sch_reference_list.h>
|
|
|
|
|
2018-04-17 10:34:48 +00:00
|
|
|
|
|
|
|
class SCH_EDIT_FRAME;
|
|
|
|
class FIELDS_EDITOR_GRID_DATA_MODEL;
|
|
|
|
|
2017-04-02 12:09:01 +00:00
|
|
|
|
2021-07-03 20:43:30 +00:00
|
|
|
class DIALOG_SYMBOL_FIELDS_TABLE : public DIALOG_SYMBOL_FIELDS_TABLE_BASE
|
2017-04-02 12:09:01 +00:00
|
|
|
{
|
|
|
|
public:
|
2021-07-03 20:43:30 +00:00
|
|
|
DIALOG_SYMBOL_FIELDS_TABLE( SCH_EDIT_FRAME* parent );
|
|
|
|
virtual ~DIALOG_SYMBOL_FIELDS_TABLE();
|
2017-04-02 12:09:01 +00:00
|
|
|
|
2020-01-09 00:57:39 +00:00
|
|
|
bool TransferDataToWindow() override;
|
2018-04-17 10:34:48 +00:00
|
|
|
bool TransferDataFromWindow() override;
|
|
|
|
|
2017-04-02 12:09:01 +00:00
|
|
|
private:
|
2020-10-19 17:35:22 +00:00
|
|
|
void AddField( const wxString& displayName, const wxString& aCanonicalName, bool defaultShow,
|
|
|
|
bool defaultSortBy );
|
2021-07-16 20:13:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Construct the rows of m_fieldsCtrl and the columns of m_dataModel from a union of all
|
|
|
|
* field names in use.
|
|
|
|
*/
|
2018-04-17 10:34:48 +00:00
|
|
|
void LoadFieldNames();
|
2017-04-02 12:09:01 +00:00
|
|
|
|
2018-04-17 10:34:48 +00:00
|
|
|
void OnColSort( wxGridEvent& aEvent );
|
2017-04-18 09:25:02 +00:00
|
|
|
|
2018-04-19 22:13:19 +00:00
|
|
|
void OnColumnItemToggled( wxDataViewEvent& event ) override;
|
2020-11-15 16:08:31 +00:00
|
|
|
void OnGroupSymbolsToggled( wxCommandEvent& event ) override;
|
|
|
|
void OnRegroupSymbols( wxCommandEvent& aEvent ) override;
|
2018-04-19 22:13:19 +00:00
|
|
|
void OnTableValueChanged( wxGridEvent& event ) override;
|
2018-05-12 22:04:11 +00:00
|
|
|
void OnTableCellClick( wxGridEvent& event ) override;
|
2018-04-19 22:13:19 +00:00
|
|
|
void OnTableItemContextMenu( wxGridEvent& event ) override;
|
2020-04-21 15:15:04 +00:00
|
|
|
void OnTableColSize( wxGridSizeEvent& event ) override;
|
2018-04-19 22:13:19 +00:00
|
|
|
void OnSizeFieldList( wxSizeEvent& event ) override;
|
2018-05-23 12:12:01 +00:00
|
|
|
void OnAddField( wxCommandEvent& event ) override;
|
2022-04-12 20:13:26 +00:00
|
|
|
void OnRemoveField( wxCommandEvent& event ) override;
|
2022-05-09 13:41:00 +00:00
|
|
|
void OnExport( wxCommandEvent& aEvent ) override;
|
2018-04-19 22:13:19 +00:00
|
|
|
void OnSaveAndContinue( wxCommandEvent& aEvent ) override;
|
2022-04-17 19:02:05 +00:00
|
|
|
void OnCancel( wxCommandEvent& aEvent ) override;
|
|
|
|
void OnClose( wxCloseEvent& aEvent ) override;
|
|
|
|
void OnFilterText( wxCommandEvent& aEvent ) override;
|
|
|
|
void OnFilterMouseMoved( wxMouseEvent& event ) override;
|
2021-03-21 17:31:23 +00:00
|
|
|
|
|
|
|
SCH_EDIT_FRAME* m_parent;
|
|
|
|
int m_showColWidth;
|
|
|
|
int m_groupByColWidth;
|
|
|
|
|
|
|
|
SCH_REFERENCE_LIST m_symbolsList;
|
|
|
|
FIELDS_EDITOR_GRID_DATA_MODEL* m_dataModel;
|
2017-04-02 12:09:01 +00:00
|
|
|
};
|
|
|
|
|
2021-07-03 20:43:30 +00:00
|
|
|
#endif /* DIALOG_SYMBOL_FIELDS_TABLE_H */
|