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>
|
|
|
|
#include "panel_eeschema_template_fieldnames_base.h"
|
|
|
|
|
|
|
|
class SCH_EDIT_FRAME;
|
|
|
|
|
|
|
|
|
|
|
|
class PANEL_EESCHEMA_TEMPLATE_FIELDNAMES : public PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE
|
|
|
|
{
|
2021-03-21 17:31:23 +00:00
|
|
|
public:
|
|
|
|
PANEL_EESCHEMA_TEMPLATE_FIELDNAMES( SCH_EDIT_FRAME* aFrame, wxWindow* aWindow, bool aGlobal );
|
|
|
|
~PANEL_EESCHEMA_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.
|
|
|
|
*
|
2018-05-14 17:34:18 +00:00
|
|
|
* Process the wxWidgets @a event produced when the user presses the Add buton 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:
|
|
|
|
SCH_EDIT_FRAME* m_frame;
|
|
|
|
TEMPLATE_FIELDNAMES m_fields;
|
|
|
|
bool m_global; // Editing global (vs. project) fieldname templates
|
|
|
|
|
|
|
|
int m_checkboxColWidth;
|
2018-05-14 17:34:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //PANEL_EESCHEMA_DEFUALT_FIELDS_H
|