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
|
2016-04-10 12:59:23 +00:00
|
|
|
* Copyright (C) 1992-2016 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
|
|
|
|
2018-02-16 16:52:19 +00:00
|
|
|
#ifndef DIALOG_EDIT_FOOTPRINT_FOR_BOARDEDITOR_H
|
|
|
|
#define DIALOG_EDIT_FOOTPRINT_FOR_BOARDEDITOR_H
|
2016-02-27 23:17:58 +00:00
|
|
|
|
|
|
|
|
2018-02-16 16:52:19 +00:00
|
|
|
#include <dialog_edit_footprint_for_BoardEditor_base.h>
|
2016-04-10 12:59:23 +00:00
|
|
|
#include <wx/valnum.h>
|
2015-12-08 07:31:57 +00:00
|
|
|
|
|
|
|
class PANEL_PREV_3D;
|
2009-08-11 10:27:21 +00:00
|
|
|
|
2018-02-16 19:26:55 +00:00
|
|
|
class DIALOG_FOOTPRINT_BOARD_EDITOR: public DIALOG_FOOTPRINT_BOARD_EDITOR_BASE
|
2009-08-11 10:27:21 +00:00
|
|
|
{
|
|
|
|
private:
|
2015-12-08 07:31:57 +00:00
|
|
|
PCB_EDIT_FRAME * m_Parent;
|
|
|
|
wxDC * m_DC;
|
|
|
|
MODULE* m_CurrentModule;
|
|
|
|
TEXTE_MODULE* m_ReferenceCopy;
|
|
|
|
TEXTE_MODULE* m_ValueCopy;
|
2017-10-27 14:25:20 +00:00
|
|
|
std::vector <MODULE_3D_SETTINGS> m_shapes3D_list;
|
2015-12-08 07:31:57 +00:00
|
|
|
int m_LastSelected3DShapeIndex;
|
|
|
|
static size_t m_page; // remember the last open page during session
|
|
|
|
PANEL_PREV_3D* m_PreviewPane;
|
2016-07-19 17:35:25 +00:00
|
|
|
MODULE* m_currentModuleCopy;
|
2009-08-11 10:27:21 +00:00
|
|
|
|
2016-04-10 12:59:23 +00:00
|
|
|
wxFloatingPointValidator<double> m_OrientValidator;
|
|
|
|
double m_OrientValue;
|
|
|
|
|
2009-08-11 10:27:21 +00:00
|
|
|
public:
|
2015-08-20 18:13:18 +00:00
|
|
|
// The dialog can be closed for several reasons.
|
|
|
|
// they are listed here:
|
|
|
|
enum FP_PRM_EDITOR_RETVALUE
|
|
|
|
{
|
|
|
|
PRM_EDITOR_ABORT,
|
2018-01-12 19:36:15 +00:00
|
|
|
PRM_EDITOR_WANT_UPDATE_FP,
|
2015-08-20 18:13:18 +00:00
|
|
|
PRM_EDITOR_WANT_EXCHANGE_FP,
|
|
|
|
PRM_EDITOR_EDIT_OK,
|
|
|
|
PRM_EDITOR_WANT_MODEDIT
|
|
|
|
};
|
2009-08-11 10:27:21 +00:00
|
|
|
|
2015-08-20 18:13:18 +00:00
|
|
|
public:
|
2009-08-11 10:27:21 +00:00
|
|
|
// Constructor and destructor
|
2018-02-16 19:26:55 +00:00
|
|
|
DIALOG_FOOTPRINT_BOARD_EDITOR( PCB_EDIT_FRAME* aParent, MODULE* aModule, wxDC* aDC );
|
|
|
|
~DIALOG_FOOTPRINT_BOARD_EDITOR();
|
2009-08-11 10:27:21 +00:00
|
|
|
|
|
|
|
private:
|
2014-08-24 07:05:07 +00:00
|
|
|
void BrowseAndAdd3DShapeFile();
|
2009-08-11 10:27:21 +00:00
|
|
|
void InitBoardProperties();
|
|
|
|
void InitModeditProperties();
|
2015-02-02 16:43:34 +00:00
|
|
|
void Edit3DShapeFileName();
|
2014-08-24 07:05:07 +00:00
|
|
|
|
|
|
|
// virtual event functions
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnEditValue( wxCommandEvent& event ) override;
|
|
|
|
void OnEditReference( wxCommandEvent& event ) override;
|
|
|
|
void On3DShapeNameSelected( wxCommandEvent& event ) override;
|
2016-09-25 17:06:49 +00:00
|
|
|
void Edit3DShapeFilename( wxCommandEvent& event ) override
|
2014-08-24 07:05:07 +00:00
|
|
|
{
|
2015-02-02 16:43:34 +00:00
|
|
|
Edit3DShapeFileName();
|
2014-08-24 07:05:07 +00:00
|
|
|
}
|
2016-09-24 18:53:15 +00:00
|
|
|
void Remove3DShape( wxCommandEvent& event ) override;
|
2016-09-25 17:06:49 +00:00
|
|
|
void Add3DShape( wxCommandEvent& event ) override
|
2015-02-02 16:43:34 +00:00
|
|
|
{
|
|
|
|
BrowseAndAdd3DShapeFile();
|
|
|
|
}
|
2016-09-24 18:53:15 +00:00
|
|
|
void GotoModuleEditor( wxCommandEvent& event ) override;
|
2018-01-12 19:36:15 +00:00
|
|
|
void UpdateModule( wxCommandEvent& event ) override;
|
2016-09-24 18:53:15 +00:00
|
|
|
void ExchangeModule( wxCommandEvent& event ) override;
|
|
|
|
void ModuleOrientEvent( wxCommandEvent& event ) override;
|
|
|
|
void Cfg3DPath( wxCommandEvent& event ) override;
|
2016-04-10 12:59:23 +00:00
|
|
|
|
2016-09-25 17:06:49 +00:00
|
|
|
void OnInitDlg( wxInitDialogEvent& event ) override
|
2016-07-02 12:44:36 +00:00
|
|
|
{
|
|
|
|
// Call the default wxDialog handler of a wxInitDialogEvent
|
2016-07-04 15:47:48 +00:00
|
|
|
TransferDataToWindow();
|
2016-07-02 12:44:36 +00:00
|
|
|
|
|
|
|
// Now all widgets have the size fixed, call FinishDialogSettings
|
|
|
|
FinishDialogSettings();
|
|
|
|
}
|
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
bool TransferDataToWindow() override;
|
|
|
|
bool TransferDataFromWindow() override;
|
2009-08-11 10:27:21 +00:00
|
|
|
};
|
|
|
|
|
2016-02-27 23:17:58 +00:00
|
|
|
|
2018-02-16 16:52:19 +00:00
|
|
|
#endif // DIALOG_EDIT_FOOTPRINT_FOR_BOARDEDITOR_H
|