2012-09-11 19:03:21 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012 Miguel Angel Ajo Pelayo, miguelangel@nbee.es
|
|
|
|
* Copyright (C) 2012 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
|
|
|
* Copyright (C) 2004-2012 KiCad Developers, see change_log.txt for contributors.
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file footprint_wizard_frame.h
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef FOOTPRINT_WIZARD_FRAME_H_
|
|
|
|
#define FOOTPRINT_WIZARD_FRAME_H_
|
|
|
|
|
|
|
|
|
|
|
|
#include <wx/gdicmn.h>
|
|
|
|
#include <class_footprint_wizard.h>
|
|
|
|
class wxSashLayoutWindow;
|
|
|
|
class wxListBox;
|
|
|
|
class wxSemaphore;
|
|
|
|
class wxGrid;
|
|
|
|
class wxGridEvent;
|
2012-09-12 09:53:11 +00:00
|
|
|
class FOOTPRINT_EDIT_FRAME;
|
2012-09-11 19:03:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Component library viewer main window.
|
|
|
|
*/
|
|
|
|
class FOOTPRINT_WIZARD_FRAME : public PCB_BASE_FRAME
|
|
|
|
{
|
|
|
|
private:
|
2014-01-29 17:01:42 +00:00
|
|
|
wxListBox* m_pageList; // < The list of pages
|
|
|
|
int m_pageListWidth; // < width of the window
|
|
|
|
wxGrid* m_parameterGrid; // < The list of parameters
|
|
|
|
int m_parameterGridWidth; // < size of the grid
|
2012-09-11 19:03:21 +00:00
|
|
|
|
|
|
|
// Flags
|
2014-01-29 17:01:42 +00:00
|
|
|
wxSemaphore* m_semaphore; // < != NULL if the frame must emulate a modal dialog
|
2013-03-16 03:27:48 +00:00
|
|
|
wxString m_configPath; // < subpath for configuration
|
2013-08-05 13:43:15 +00:00
|
|
|
bool m_exportRequest; // < true if the current footprint should be exported
|
|
|
|
|
2012-09-11 19:03:21 +00:00
|
|
|
protected:
|
2013-03-16 03:27:48 +00:00
|
|
|
wxString m_wizardName; // < name of the current wizard
|
|
|
|
wxString m_wizardDescription; // < description of the wizard
|
|
|
|
wxString m_wizardStatus; // < current wizard status
|
2013-08-05 13:43:15 +00:00
|
|
|
|
2012-09-11 19:03:21 +00:00
|
|
|
public:
|
2013-03-15 16:35:24 +00:00
|
|
|
FOOTPRINT_WIZARD_FRAME( FOOTPRINT_EDIT_FRAME* parent,
|
|
|
|
wxSemaphore* semaphore = NULL,
|
|
|
|
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
|
2012-09-11 19:03:21 +00:00
|
|
|
|
|
|
|
~FOOTPRINT_WIZARD_FRAME();
|
|
|
|
|
2013-03-16 03:27:48 +00:00
|
|
|
MODULE* GetBuiltFootprint( void );
|
2012-09-11 19:03:21 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2013-03-16 03:27:48 +00:00
|
|
|
void OnSize( wxSizeEvent& event );
|
2013-03-15 16:35:24 +00:00
|
|
|
|
2012-09-11 19:03:21 +00:00
|
|
|
/**
|
|
|
|
* Function ExportSelectedFootprint();
|
|
|
|
* will let the caller exit from the wait loop, and get the built footprint
|
|
|
|
*
|
|
|
|
*/
|
2013-03-16 03:27:48 +00:00
|
|
|
void ExportSelectedFootprint( wxCommandEvent& aEvent );
|
2012-09-11 19:03:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnSashDrag
|
|
|
|
* resizes the child windows when dragging a sash window border.
|
|
|
|
*/
|
|
|
|
|
2013-03-16 03:27:48 +00:00
|
|
|
void OnSashDrag( wxSashEvent& event );
|
2012-09-11 19:03:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function ReCreatePageList
|
|
|
|
* Creates or recreates the list of parameter pages for the current wizard.
|
|
|
|
* This list is sorted
|
|
|
|
*/
|
2013-03-16 03:27:48 +00:00
|
|
|
void ReCreatePageList();
|
2012-09-11 19:03:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function ReCreateParameterList
|
|
|
|
* Creates the list of parameters for the current page
|
|
|
|
*/
|
2013-03-16 03:27:48 +00:00
|
|
|
void ReCreateParameterList();
|
2012-09-11 19:03:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SelectFootprintWizard
|
|
|
|
* Shows the list of footprint wizards available into the system
|
|
|
|
*/
|
2013-03-16 03:27:48 +00:00
|
|
|
void SelectFootprintWizard();
|
2012-09-11 19:03:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function ReloadFootprint
|
|
|
|
* Reloads the current footprint
|
|
|
|
*/
|
2013-03-16 03:27:48 +00:00
|
|
|
void ReloadFootprint();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetMyWizard
|
|
|
|
* Reloads the wizard by name
|
|
|
|
*/
|
|
|
|
FOOTPRINT_WIZARD* GetMyWizard();
|
2012-09-11 19:03:21 +00:00
|
|
|
|
|
|
|
|
2013-03-16 03:27:48 +00:00
|
|
|
void Process_Special_Functions( wxCommandEvent& event );
|
2012-09-11 19:03:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function DisplayWizardInfos
|
|
|
|
* Shows all the details about the current wizard
|
|
|
|
*/
|
2013-03-16 03:27:48 +00:00
|
|
|
void DisplayWizardInfos();
|
2012-09-11 19:03:21 +00:00
|
|
|
|
|
|
|
|
2013-03-16 03:27:48 +00:00
|
|
|
void RedrawActiveWindow( wxDC* DC, bool EraseBg );
|
|
|
|
void OnCloseWindow( wxCloseEvent& Event );
|
|
|
|
void ReCreateHToolbar();
|
|
|
|
void ReCreateVToolbar();
|
|
|
|
void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
|
|
|
|
void ClickOnPageList( wxCommandEvent& event );
|
|
|
|
void OnSetRelativeOffset( wxCommandEvent& event );
|
2012-09-11 19:03:21 +00:00
|
|
|
|
2013-03-16 03:27:48 +00:00
|
|
|
void GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey = 0 );
|
2012-09-11 19:03:21 +00:00
|
|
|
|
2013-03-15 16:35:24 +00:00
|
|
|
/**
|
2012-09-11 19:03:21 +00:00
|
|
|
* Function LoadSettings
|
|
|
|
* loads the library viewer frame specific configuration settings.
|
|
|
|
*
|
|
|
|
* Don't forget to call this base method from any derived classes or the
|
|
|
|
* settings will not get loaded.
|
|
|
|
*/
|
2013-03-16 03:27:48 +00:00
|
|
|
void LoadSettings();
|
2012-09-11 19:03:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SaveSettings
|
|
|
|
* save library viewer frame specific configuration settings.
|
|
|
|
*
|
|
|
|
* Don't forget to call this base method from any derived classes or the
|
|
|
|
* settings will not get saved.
|
|
|
|
*/
|
2013-03-16 03:27:48 +00:00
|
|
|
void SaveSettings();
|
2012-09-11 19:03:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnActivate
|
|
|
|
* is called when the frame frame is activate to reload the libraries and component lists
|
|
|
|
* that can be changed by the schematic editor or the library editor.
|
|
|
|
*/
|
2013-03-16 03:27:48 +00:00
|
|
|
virtual void OnActivate( wxActivateEvent& event );
|
2012-09-11 19:03:21 +00:00
|
|
|
|
2013-03-16 03:27:48 +00:00
|
|
|
void SelectCurrentWizard( wxCommandEvent& event );
|
2012-09-11 19:03:21 +00:00
|
|
|
|
2013-03-16 03:27:48 +00:00
|
|
|
void ParametersUpdated( wxGridEvent& event );
|
2012-09-11 19:03:21 +00:00
|
|
|
|
|
|
|
|
2013-03-16 03:27:48 +00:00
|
|
|
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
|
2012-09-11 19:03:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function Show3D_Frame (virtual)
|
|
|
|
* displays 3D view of the footprint (module) being edited.
|
|
|
|
*/
|
2013-03-16 03:27:48 +00:00
|
|
|
void Show3D_Frame( wxCommandEvent& event );
|
2012-09-11 19:03:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function Update3D_Frame
|
|
|
|
* must be called after a footprint selection
|
|
|
|
* Updates the 3D view and 3D frame title.
|
|
|
|
* @param aForceReloadFootprint = true to reload data (default)
|
|
|
|
* = false to update title only -(aftre creating the 3D viewer)
|
|
|
|
*/
|
2013-03-16 03:27:48 +00:00
|
|
|
void Update3D_Frame( bool aForceReloadFootprint = true );
|
2012-09-11 19:03:21 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Virtual functions, not used here, but needed by PCB_BASE_FRAME
|
|
|
|
* (virtual pure functions )
|
|
|
|
*/
|
2013-03-15 16:35:24 +00:00
|
|
|
void OnLeftDClick( wxDC*, const wxPoint& ) {}
|
|
|
|
void SaveCopyInUndoList( BOARD_ITEM*, UNDO_REDO_T, const wxPoint& ) {}
|
|
|
|
void SaveCopyInUndoList( PICKED_ITEMS_LIST&, UNDO_REDO_T, const wxPoint& ) {}
|
2012-09-11 19:03:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
2013-03-15 16:35:24 +00:00
|
|
|
#endif // FOOTPRINT_WIZARD_FRM_H_
|