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
|
|
|
|
* Copyright (C) 1992-2015 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
|
|
|
|
|
|
|
#ifndef __DIALOG_EDIT_MODULE_FOR_MODEDIT__
|
|
|
|
#define __DIALOG_EDIT_MODULE_FOR_MODEDIT__
|
|
|
|
|
|
|
|
// Include the wxFormBuider header base:
|
|
|
|
#include <vector>
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <dialog_edit_module_for_Modedit_base.h>
|
2015-12-08 07:31:57 +00:00
|
|
|
|
|
|
|
class PANEL_PREV_3D;
|
2016-07-19 17:35:25 +00:00
|
|
|
class MODULE;
|
2009-08-11 10:27:21 +00:00
|
|
|
|
|
|
|
class DIALOG_MODULE_MODULE_EDITOR : public DIALOG_MODULE_MODULE_EDITOR_BASE
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
2015-12-08 07:31:57 +00:00
|
|
|
FOOTPRINT_EDIT_FRAME* m_parent;
|
|
|
|
MODULE* m_currentModule;
|
|
|
|
TEXTE_MODULE* m_referenceCopy;
|
|
|
|
TEXTE_MODULE* m_valueCopy;
|
2016-07-19 17:35:25 +00:00
|
|
|
std::vector<S3D_INFO> 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
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
// Constructor and destructor
|
2011-08-26 17:01:17 +00:00
|
|
|
DIALOG_MODULE_MODULE_EDITOR( FOOTPRINT_EDIT_FRAME* aParent, MODULE* aModule );
|
2009-08-11 10:27:21 +00:00
|
|
|
~DIALOG_MODULE_MODULE_EDITOR();
|
|
|
|
|
|
|
|
private:
|
2014-08-24 07:05:07 +00:00
|
|
|
void BrowseAndAdd3DShapeFile();
|
2012-12-10 11:18:42 +00:00
|
|
|
void initModeditProperties();
|
2015-02-02 16:43:34 +00:00
|
|
|
void Edit3DShapeFileName();
|
2014-08-24 07:05:07 +00:00
|
|
|
|
|
|
|
// virtual event functions
|
2009-08-11 10:27:21 +00:00
|
|
|
void OnEditValue( wxCommandEvent& event );
|
|
|
|
void OnEditReference( wxCommandEvent& event );
|
|
|
|
void On3DShapeSelection( wxCommandEvent& event );
|
2012-01-23 04:33:36 +00:00
|
|
|
void On3DShapeNameSelected( wxCommandEvent& event );
|
2014-08-24 07:05:07 +00:00
|
|
|
void Add3DShape( wxCommandEvent& event )
|
|
|
|
{
|
|
|
|
BrowseAndAdd3DShapeFile();
|
|
|
|
}
|
2009-08-11 10:27:21 +00:00
|
|
|
void Remove3DShape( wxCommandEvent& event );
|
2015-02-02 16:43:34 +00:00
|
|
|
void Edit3DShapeFilename( wxCommandEvent& event )
|
|
|
|
{
|
|
|
|
Edit3DShapeFileName();
|
|
|
|
}
|
2009-08-11 10:27:21 +00:00
|
|
|
void OnCancelClick( wxCommandEvent& event );
|
|
|
|
void OnOkClick( wxCommandEvent& event );
|
2016-02-27 23:17:58 +00:00
|
|
|
void Cfg3DPath( wxCommandEvent& event );
|
2016-07-02 12:44:36 +00:00
|
|
|
|
|
|
|
void OnInitDlg( wxInitDialogEvent& event )
|
|
|
|
{
|
|
|
|
// 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();
|
|
|
|
}
|
2009-08-11 10:27:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // __DIALOG_EDIT_MODULE_FOR_MODEDIT__
|