2018-05-14 17:34:18 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2021-03-21 17:31:23 +00:00
|
|
|
* Copyright (C) 2017-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
2018-05-14 17:34:18 +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 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 PANEL_EESCHEMA_DEFUALT_FIELDS_H
|
|
|
|
#define PANEL_EESCHEMA_DEFUALT_FIELDS_H
|
|
|
|
|
|
|
|
#include <template_fieldnames.h>
|
2021-08-29 23:33:08 +00:00
|
|
|
#include "panel_template_fieldnames_base.h"
|
2018-05-14 17:34:18 +00:00
|
|
|
|
|
|
|
class SCH_EDIT_FRAME;
|
|
|
|
|
|
|
|
|
2021-08-29 23:33:08 +00:00
|
|
|
class PANEL_TEMPLATE_FIELDNAMES : public PANEL_TEMPLATE_FIELDNAMES_BASE
|
2018-05-14 17:34:18 +00:00
|
|
|
{
|
2021-03-21 17:31:23 +00:00
|
|
|
public:
|
2021-08-29 23:33:08 +00:00
|
|
|
PANEL_TEMPLATE_FIELDNAMES( wxWindow* aWindow, TEMPLATES* aProjectTemplateMgr );
|
|
|
|
~PANEL_TEMPLATE_FIELDNAMES() override;
|
2018-05-14 17:34:18 +00:00
|
|
|
|
2021-03-21 17:31:23 +00:00
|
|
|
void ImportSettingsFrom( TEMPLATES* templateMgr );
|
2018-05-14 17:34:18 +00:00
|
|
|
|
2021-03-21 17:31:23 +00:00
|
|
|
protected:
|
2018-05-14 17:34:18 +00:00
|
|
|
/**
|
2021-03-21 17:31:23 +00:00
|
|
|
* Adds a new template fieldname (with default values) to the template fieldnames data.
|
|
|
|
*
|
2021-06-09 19:32:58 +00:00
|
|
|
* Process the wxWidgets @a event produced when the user presses the Add button for the
|
2021-03-21 17:31:23 +00:00
|
|
|
* template fieldnames control.
|
2018-05-14 17:34:18 +00:00
|
|
|
*
|
|
|
|
* @param event The wxWidgets produced event information
|
|
|
|
*/
|
|
|
|
void OnAddButtonClick( wxCommandEvent& event ) override;
|
|
|
|
|
|
|
|
/**
|
2021-03-21 17:31:23 +00:00
|
|
|
* Deletes the selected template fieldname from the template fieldnames data.
|
|
|
|
*
|
2018-05-14 17:34:18 +00:00
|
|
|
* Process the wxWidgets @a event produced when the user presses the Delete button for the
|
2021-03-21 17:31:23 +00:00
|
|
|
* template fieldnames control.
|
2018-05-14 17:34:18 +00:00
|
|
|
*
|
|
|
|
* @param event The wxWidgets produced event information
|
|
|
|
*/
|
|
|
|
void OnDeleteButtonClick( wxCommandEvent& event ) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void AdjustGridColumns( int aWidth );
|
|
|
|
|
|
|
|
void OnSizeGrid( wxSizeEvent& event ) override;
|
|
|
|
|
|
|
|
bool TransferDataToWindow() override;
|
|
|
|
bool TransferDataFromWindow() override;
|
|
|
|
|
|
|
|
bool TransferDataToGrid();
|
|
|
|
bool TransferDataFromGrid();
|
2021-03-21 17:31:23 +00:00
|
|
|
|
|
|
|
protected:
|
2021-08-29 23:33:08 +00:00
|
|
|
TEMPLATES* m_templateMgr;
|
2021-03-21 17:31:23 +00:00
|
|
|
TEMPLATE_FIELDNAMES m_fields;
|
2021-08-29 23:33:08 +00:00
|
|
|
bool m_global; // Editing global (vs. project) fieldname templates
|
2021-03-21 17:31:23 +00:00
|
|
|
|
|
|
|
int m_checkboxColWidth;
|
2021-08-29 23:33:08 +00:00
|
|
|
TEMPLATES m_templateMgrInstance;
|
2018-05-14 17:34:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //PANEL_EESCHEMA_DEFUALT_FIELDS_H
|