2014-10-27 14:14:39 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2015-02-02 16:43:34 +00:00
|
|
|
* Copyright (C) 2010-2015 Jean-Pierre Charras, jean-pierre.charras at wanadoo.fr
|
2022-10-11 23:38:01 +00:00
|
|
|
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
2014-10-27 14:14:39 +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
|
|
|
|
*/
|
2009-08-11 10:27:21 +00:00
|
|
|
|
2016-02-27 23:17:58 +00:00
|
|
|
|
2020-10-14 23:37:26 +00:00
|
|
|
#ifndef DIALOG_FOOTPRINT_PROPERTIES_H
|
|
|
|
#define DIALOG_FOOTPRINT_PROPERTIES_H
|
2016-02-27 23:17:58 +00:00
|
|
|
|
|
|
|
|
2020-10-14 23:37:26 +00:00
|
|
|
#include <dialog_footprint_properties_base.h>
|
2016-04-10 12:59:23 +00:00
|
|
|
#include <wx/valnum.h>
|
2024-05-06 14:59:44 +00:00
|
|
|
#include <pcb_fields_grid_table.h>
|
2020-11-12 20:19:22 +00:00
|
|
|
#include <footprint.h>
|
2018-03-28 17:14:04 +00:00
|
|
|
#include <widgets/unit_binder.h>
|
2015-12-08 07:31:57 +00:00
|
|
|
|
2018-10-15 14:28:53 +00:00
|
|
|
|
|
|
|
class PCB_EDIT_FRAME;
|
2021-07-28 19:54:20 +00:00
|
|
|
class PANEL_FP_PROPERTIES_3D_MODEL;
|
2018-10-15 14:28:53 +00:00
|
|
|
|
2020-10-14 23:37:26 +00:00
|
|
|
class DIALOG_FOOTPRINT_PROPERTIES: public DIALOG_FOOTPRINT_PROPERTIES_BASE
|
2009-08-11 10:27:21 +00:00
|
|
|
{
|
2020-12-07 17:28:06 +00:00
|
|
|
public:
|
|
|
|
// The dialog can be closed for several reasons.
|
|
|
|
enum FP_PROPS_RETVALUE
|
|
|
|
{
|
|
|
|
FP_PROPS_CANCEL,
|
|
|
|
FP_PROPS_UPDATE_FP,
|
|
|
|
FP_PROPS_CHANGE_FP,
|
|
|
|
FP_PROPS_OK,
|
|
|
|
FP_PROPS_EDIT_BOARD_FP,
|
|
|
|
FP_PROPS_EDIT_LIBRARY_FP
|
|
|
|
};
|
|
|
|
|
2020-11-13 15:15:52 +00:00
|
|
|
DIALOG_FOOTPRINT_PROPERTIES( PCB_EDIT_FRAME* aParent, FOOTPRINT* aFootprint );
|
2020-10-14 23:37:26 +00:00
|
|
|
~DIALOG_FOOTPRINT_PROPERTIES() override;
|
2009-08-11 10:27:21 +00:00
|
|
|
|
2018-03-28 17:14:04 +00:00
|
|
|
bool Validate() override;
|
2016-07-02 12:44:36 +00:00
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
bool TransferDataToWindow() override;
|
|
|
|
bool TransferDataFromWindow() override;
|
2018-03-28 17:14:04 +00:00
|
|
|
|
2021-06-04 16:21:48 +00:00
|
|
|
///< @return the value depending on the way the dialog was closed.
|
2020-12-07 17:28:06 +00:00
|
|
|
enum FP_PROPS_RETVALUE GetReturnValue() { return m_returnValue; }
|
|
|
|
|
2018-03-28 17:14:04 +00:00
|
|
|
private:
|
|
|
|
// virtual event functions
|
2018-10-15 14:28:53 +00:00
|
|
|
void EditFootprint( wxCommandEvent& ) override;
|
|
|
|
void EditLibraryFootprint( wxCommandEvent& ) override;
|
2020-10-14 23:37:26 +00:00
|
|
|
void UpdateFootprint( wxCommandEvent& ) override;
|
|
|
|
void ChangeFootprint( wxCommandEvent& ) override;
|
2018-03-28 17:14:04 +00:00
|
|
|
void OnGridSize( wxSizeEvent& aEvent ) override;
|
|
|
|
void OnAddField( wxCommandEvent& ) override;
|
|
|
|
void OnDeleteField( wxCommandEvent& ) override;
|
|
|
|
void OnUpdateUI( wxUpdateUIEvent& ) override;
|
2020-03-26 11:02:59 +00:00
|
|
|
void OnPageChange( wxNotebookEvent& event ) override;
|
2018-03-28 17:14:04 +00:00
|
|
|
|
2021-12-16 14:39:58 +00:00
|
|
|
void adjustGridColumns();
|
2019-03-07 16:21:49 +00:00
|
|
|
|
2021-06-19 17:28:45 +00:00
|
|
|
private:
|
2021-06-04 16:21:48 +00:00
|
|
|
PCB_EDIT_FRAME* m_frame;
|
|
|
|
FOOTPRINT* m_footprint;
|
|
|
|
|
|
|
|
static int m_page; // remember the last open page during session
|
|
|
|
|
2024-05-06 14:59:44 +00:00
|
|
|
PCB_FIELDS_GRID_TABLE* m_fields;
|
2021-06-04 16:21:48 +00:00
|
|
|
UNIT_BINDER m_posX;
|
|
|
|
UNIT_BINDER m_posY;
|
2021-12-05 21:56:55 +00:00
|
|
|
UNIT_BINDER m_orientation;
|
2021-06-04 16:21:48 +00:00
|
|
|
|
|
|
|
UNIT_BINDER m_netClearance;
|
|
|
|
UNIT_BINDER m_solderMask;
|
|
|
|
UNIT_BINDER m_solderPaste;
|
2021-08-06 14:26:08 +00:00
|
|
|
UNIT_BINDER m_solderPasteRatio;
|
2021-06-04 16:21:48 +00:00
|
|
|
|
|
|
|
wxString m_delayedErrorMessage;
|
|
|
|
wxGrid* m_delayedFocusGrid;
|
|
|
|
int m_delayedFocusRow;
|
|
|
|
int m_delayedFocusColumn;
|
|
|
|
bool m_initialFocus;
|
|
|
|
|
|
|
|
enum FP_PROPS_RETVALUE m_returnValue; // the option that closed the dialog
|
2021-07-28 19:54:20 +00:00
|
|
|
|
|
|
|
PANEL_FP_PROPERTIES_3D_MODEL* m_3dPanel;
|
2021-09-14 12:28:45 +00:00
|
|
|
|
|
|
|
bool m_initialized;
|
2022-10-11 23:38:01 +00:00
|
|
|
|
|
|
|
wxSize m_gridSize;
|
|
|
|
wxSize m_lastRequestedSize;
|
2009-08-11 10:27:21 +00:00
|
|
|
};
|
|
|
|
|
2016-02-27 23:17:58 +00:00
|
|
|
|
2020-10-14 23:37:26 +00:00
|
|
|
#endif // DIALOG_FOOTPRINT_PROPERTIES_H
|