2011-10-28 13:43:37 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
|
|
|
* Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net>
|
|
|
|
* Copyright (C) 2004-2011 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
|
|
|
|
*/
|
|
|
|
|
2011-10-07 14:41:30 +00:00
|
|
|
/**
|
|
|
|
* @file libeditframe.h
|
|
|
|
* @brief Definition of class LIB_EDIT_FRAME
|
|
|
|
*/
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2012-01-09 17:24:01 +00:00
|
|
|
#ifndef LIBEDITFRM_H_
|
|
|
|
#define LIBEDITFRM_H_
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2012-01-09 17:24:01 +00:00
|
|
|
#include <sch_base_frame.h>
|
|
|
|
#include <class_sch_screen.h>
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2012-01-09 17:24:01 +00:00
|
|
|
#include <lib_draw_item.h>
|
|
|
|
#include <lib_collectors.h>
|
2010-10-22 12:11:52 +00:00
|
|
|
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2010-12-08 20:12:46 +00:00
|
|
|
class SCH_EDIT_FRAME;
|
2010-02-04 17:46:12 +00:00
|
|
|
class CMP_LIBRARY;
|
|
|
|
class LIB_COMPONENT;
|
|
|
|
class LIB_ALIAS;
|
2010-11-10 15:30:12 +00:00
|
|
|
class LIB_FIELD;
|
2010-11-17 21:47:27 +00:00
|
|
|
class DIALOG_LIB_EDIT_TEXT;
|
2010-02-04 17:46:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The component library editor main window.
|
|
|
|
*/
|
2012-01-09 17:24:01 +00:00
|
|
|
class LIB_EDIT_FRAME : public SCH_BASE_FRAME
|
2010-02-04 17:46:12 +00:00
|
|
|
{
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
LIB_COMPONENT* m_tempCopyComponent; ///< Temporary copy of current component during edit.
|
|
|
|
LIB_COLLECTOR m_collectedItems; ///< Used for hit testing.
|
|
|
|
wxComboBox* m_partSelectBox; ///< a Box to select a part to edit (if any)
|
|
|
|
wxComboBox* m_aliasSelectBox; ///< a box to select the alias to edit (if any)
|
2011-04-27 19:44:32 +00:00
|
|
|
|
2011-12-09 16:37:11 +00:00
|
|
|
wxString m_configPath;
|
|
|
|
wxString m_lastLibImportPath;
|
|
|
|
wxString m_lastLibExportPath;
|
2010-10-20 20:24:26 +00:00
|
|
|
|
2011-12-09 16:37:11 +00:00
|
|
|
/** Convert of the item currently being drawn. */
|
|
|
|
bool m_drawSpecificConvert;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Specify which component parts the current draw item applies to.
|
|
|
|
*
|
|
|
|
* If true, the item being drawn or edited applies only to the selected
|
|
|
|
* part. Otherwise it applies to all parts in the component.
|
|
|
|
*/
|
|
|
|
bool m_drawSpecificUnit;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set to true to not synchronize pins at the same position when editing
|
|
|
|
* components with multiple parts or multiple body styles. Setting this
|
|
|
|
* to false allows editing each pin per part or body style individually.
|
|
|
|
* This requires the user to open each part or body style to make changes
|
|
|
|
* to the pin at the same location.
|
|
|
|
*/
|
|
|
|
bool m_editPinsPerPartOrConvert;
|
|
|
|
|
|
|
|
/** The current draw or edit graphic item fill style. */
|
|
|
|
static FILL_T m_drawFillStyle;
|
|
|
|
|
|
|
|
/** Default line width for drawing or editing graphic items. */
|
|
|
|
static int m_drawLineWidth;
|
|
|
|
|
|
|
|
/** The current active library. NULL if no active library is selected. */
|
|
|
|
static CMP_LIBRARY* m_library;
|
|
|
|
/** The current component being edited. NULL if no component is selected. */
|
|
|
|
static LIB_COMPONENT* m_component;
|
|
|
|
|
|
|
|
static LIB_ITEM* m_lastDrawItem;
|
|
|
|
static LIB_ITEM* m_drawItem;
|
|
|
|
static wxString m_aliasName;
|
|
|
|
|
|
|
|
// The unit number to edit and show
|
|
|
|
static int m_unit;
|
|
|
|
|
|
|
|
// Show the normal shape ( m_convert <= 1 ) or the converted shape
|
|
|
|
// ( m_convert > 1 )
|
|
|
|
static int m_convert;
|
|
|
|
|
|
|
|
// true to force DeMorgan/normal tools selection enabled.
|
|
|
|
// They are enabled when the loaded component has
|
|
|
|
// Graphic items for converted shape
|
|
|
|
// But under some circumstances (New component created)
|
|
|
|
// these tools must left enable
|
|
|
|
static bool m_showDeMorgan;
|
|
|
|
|
|
|
|
/// The current text size setting.
|
|
|
|
static int m_textSize;
|
|
|
|
|
|
|
|
/// Current text orientation setting.
|
|
|
|
static int m_textOrientation;
|
|
|
|
|
|
|
|
static wxSize m_clientSize;
|
|
|
|
|
|
|
|
friend class DIALOG_LIB_EDIT_TEXT;
|
|
|
|
|
|
|
|
LIB_ITEM* locateItem( const wxPoint& aPosition, const KICAD_T aFilterList[] );
|
2010-02-04 17:46:12 +00:00
|
|
|
|
|
|
|
public:
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
|
2014-05-05 15:15:54 +00:00
|
|
|
LIB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent );
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2010-11-19 16:28:46 +00:00
|
|
|
~LIB_EDIT_FRAME();
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2012-09-12 09:53:11 +00:00
|
|
|
/**
|
|
|
|
* Function GetLibEditFrameName (static)
|
|
|
|
* @return the frame name used when creating the frame
|
|
|
|
* used to get a reference to this frame, if exists
|
|
|
|
*/
|
|
|
|
static const wxChar* GetLibEditFrameName();
|
|
|
|
|
2011-10-07 14:41:30 +00:00
|
|
|
void ReCreateMenuBar();
|
2010-03-18 20:35:29 +00:00
|
|
|
|
2010-07-23 14:12:37 +00:00
|
|
|
/**
|
|
|
|
* Function EnsureActiveLibExists
|
|
|
|
* must be called after the libraries are reloaded
|
2010-02-04 17:46:12 +00:00
|
|
|
* (for instance after loading a schematic project)
|
|
|
|
*/
|
|
|
|
static void EnsureActiveLibExists();
|
|
|
|
|
2011-10-07 14:41:30 +00:00
|
|
|
void InstallConfigFrame( wxCommandEvent& event );
|
|
|
|
void InstallDimensionsDialog( wxCommandEvent& event );
|
|
|
|
void OnColorConfig( wxCommandEvent& aEvent );
|
|
|
|
void Process_Config( wxCommandEvent& event );
|
|
|
|
|
2011-10-28 13:43:37 +00:00
|
|
|
/**
|
|
|
|
* Function SycnronizePins
|
|
|
|
* @return True if the edit pins per part or convert is false and the current
|
|
|
|
* component has multiple parts or body styles. Otherwise false is
|
|
|
|
* returned.
|
|
|
|
*/
|
|
|
|
bool SynchronizePins() const;
|
|
|
|
|
2011-10-07 14:41:30 +00:00
|
|
|
/**
|
|
|
|
* Function OnPlotCurrentComponent
|
|
|
|
* plot the current component in SVG or PNG format.
|
|
|
|
*/
|
|
|
|
void OnPlotCurrentComponent( wxCommandEvent& event );
|
|
|
|
void Process_Special_Functions( wxCommandEvent& event );
|
|
|
|
void OnSelectTool( wxCommandEvent& aEvent );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Routine to read one part.
|
|
|
|
* The format is that of libraries, but it loads only 1 component.
|
|
|
|
* Or 1 component if there are several.
|
|
|
|
* If the first component is an alias, it will load the corresponding root.
|
|
|
|
*/
|
|
|
|
void OnImportPart( wxCommandEvent& event );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnExportPart
|
|
|
|
* creates a new library and backup the current component in this library or export
|
|
|
|
* the component of the current library.
|
|
|
|
*/
|
|
|
|
void OnExportPart( wxCommandEvent& event );
|
|
|
|
void OnSelectAlias( wxCommandEvent& event );
|
|
|
|
void OnSelectPart( wxCommandEvent& event );
|
2011-08-12 17:43:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function DeleteOnePart
|
|
|
|
* is the command event handler to delete an entry from the current library.
|
|
|
|
*
|
|
|
|
* The deleted entry can be an alias or a component. If the entry is an alias,
|
|
|
|
* it is removed from the component and the list of alias is updated. If the
|
|
|
|
* entry is a component and the list of aliases is empty, the component and all
|
|
|
|
* it drawable items are deleted. Otherwise the first alias in the alias list
|
|
|
|
* becomes the new component name and the other aliases become dependent on
|
|
|
|
* renamed component.
|
|
|
|
*
|
|
|
|
* @note This only deletes the entry in memory. The file does not change.
|
|
|
|
*/
|
|
|
|
void DeleteOnePart( wxCommandEvent& event );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function CreateNewLibraryPart
|
|
|
|
* is the command event handler to create a new library component.
|
|
|
|
*
|
|
|
|
* If an old component is currently in edit, it is deleted.
|
|
|
|
*/
|
|
|
|
void CreateNewLibraryPart( wxCommandEvent& event );
|
|
|
|
|
2011-10-07 14:41:30 +00:00
|
|
|
void OnCreateNewPartFromExisting( wxCommandEvent& event );
|
|
|
|
void OnEditComponentProperties( wxCommandEvent& event );
|
|
|
|
void InstallFieldsEditorDialog( wxCommandEvent& event );
|
2011-08-12 17:43:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function LoadOneLibraryPart
|
|
|
|
* loads a library component from the currently selected library.
|
|
|
|
*
|
|
|
|
* If a library is already selected, the user is prompted for the component name
|
|
|
|
* to load. If there is no current selected library, the user is prompted to select
|
|
|
|
* a library name and then select component to load.
|
|
|
|
*/
|
|
|
|
void LoadOneLibraryPart( wxCommandEvent& event );
|
|
|
|
|
2011-10-07 14:41:30 +00:00
|
|
|
void OnViewEntryDoc( wxCommandEvent& event );
|
|
|
|
void OnCheckComponent( wxCommandEvent& event );
|
|
|
|
void OnSelectBodyStyle( wxCommandEvent& event );
|
|
|
|
void OnEditPin( wxCommandEvent& event );
|
2011-04-27 19:44:32 +00:00
|
|
|
void OnSelectItem( wxCommandEvent& aEvent );
|
2010-11-13 11:02:24 +00:00
|
|
|
|
2011-10-07 14:41:30 +00:00
|
|
|
void OnUpdateSelectTool( wxUpdateUIEvent& aEvent );
|
|
|
|
void OnUpdateEditingPart( wxUpdateUIEvent& event );
|
|
|
|
void OnUpdateNotEditingPart( wxUpdateUIEvent& event );
|
|
|
|
void OnUpdateUndo( wxUpdateUIEvent& event );
|
|
|
|
void OnUpdateRedo( wxUpdateUIEvent& event );
|
|
|
|
void OnUpdateSaveCurrentLib( wxUpdateUIEvent& event );
|
|
|
|
void OnUpdateViewDoc( wxUpdateUIEvent& event );
|
|
|
|
void OnUpdatePinByPin( wxUpdateUIEvent& event );
|
|
|
|
void OnUpdatePartNumber( wxUpdateUIEvent& event );
|
|
|
|
void OnUpdateDeMorganNormal( wxUpdateUIEvent& event );
|
|
|
|
void OnUpdateDeMorganConvert( wxUpdateUIEvent& event );
|
|
|
|
void OnUpdateSelectAlias( wxUpdateUIEvent& event );
|
|
|
|
|
|
|
|
void UpdateAliasSelectList();
|
|
|
|
void UpdatePartSelectList();
|
2011-08-12 17:43:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function DisplayLibInfos
|
|
|
|
* updates the main window title bar with the current library name and read only status
|
|
|
|
* of the library.
|
|
|
|
*/
|
|
|
|
void DisplayLibInfos();
|
|
|
|
|
2012-03-06 14:08:59 +00:00
|
|
|
/**
|
|
|
|
* Function RedrawComponent
|
|
|
|
* Redraw the current component loaded in library editor
|
|
|
|
* Display reference like in schematic (a reference U is shown U? or U?A)
|
|
|
|
* accordint to the current selected unit and De Morgan selection
|
|
|
|
* although it is stored without ? and part id.
|
|
|
|
* @param aDC = the current device context
|
2013-05-13 17:30:27 +00:00
|
|
|
* @param aOffset = a draw offset. usually 0,0 to draw on the screen, but
|
2012-03-06 14:08:59 +00:00
|
|
|
* can be set to page size / 2 to draw or print in SVG format.
|
|
|
|
*/
|
|
|
|
void RedrawComponent( wxDC* aDC, wxPoint aOffset );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function RedrawActiveWindow
|
|
|
|
* Redraw the current component loaded in library editor, an axes
|
|
|
|
* Display reference like in schematic (a reference U is shown U? or U?A)
|
|
|
|
* update status bar and info shown in the bottom of the window
|
|
|
|
*/
|
2011-10-07 14:41:30 +00:00
|
|
|
void RedrawActiveWindow( wxDC* DC, bool EraseBg );
|
2012-03-06 14:08:59 +00:00
|
|
|
|
2011-10-07 14:41:30 +00:00
|
|
|
void OnCloseWindow( wxCloseEvent& Event );
|
|
|
|
void ReCreateHToolbar();
|
|
|
|
void ReCreateVToolbar();
|
|
|
|
void CreateOptionToolbar();
|
|
|
|
void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
|
|
|
|
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
|
|
|
|
double BestZoom(); // Returns the best zoom
|
|
|
|
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2011-02-02 19:01:21 +00:00
|
|
|
void OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, EDA_ITEM* aItem = NULL );
|
|
|
|
|
2011-02-22 16:43:03 +00:00
|
|
|
void GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey = 0 );
|
2010-02-04 17:46:12 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
void LoadSettings( wxConfigBase* aCfg );
|
2011-08-12 17:43:16 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
void SaveSettings( wxConfigBase* aCfg );
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2010-07-23 14:12:37 +00:00
|
|
|
/**
|
2010-11-12 16:59:16 +00:00
|
|
|
* Function CloseWindow
|
2010-07-23 14:12:37 +00:00
|
|
|
* triggers the wxCloseEvent, which is handled by the function given
|
|
|
|
* to EVT_CLOSE() macro:
|
|
|
|
* <p>
|
2010-11-19 16:28:46 +00:00
|
|
|
* EVT_CLOSE( LIB_EDIT_FRAME::OnCloseWindow )
|
2010-07-23 14:12:37 +00:00
|
|
|
*/
|
2010-12-14 21:39:31 +00:00
|
|
|
void CloseWindow( wxCommandEvent& event )
|
2010-07-23 14:12:37 +00:00
|
|
|
{
|
|
|
|
// Generate a wxCloseEvent
|
|
|
|
Close( false );
|
|
|
|
}
|
|
|
|
|
2010-11-13 11:02:24 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2010-11-12 16:59:16 +00:00
|
|
|
* Function OnModify
|
2010-02-18 20:07:29 +00:00
|
|
|
* Must be called after a schematic change
|
|
|
|
* in order to set the "modify" flag of the current screen
|
|
|
|
*/
|
2010-11-13 11:02:24 +00:00
|
|
|
void OnModify()
|
2010-02-18 20:07:29 +00:00
|
|
|
{
|
|
|
|
GetScreen()->SetModify();
|
|
|
|
}
|
|
|
|
|
2010-11-13 11:02:24 +00:00
|
|
|
|
2010-02-04 17:46:12 +00:00
|
|
|
LIB_COMPONENT* GetComponent( void ) { return m_component; }
|
|
|
|
|
|
|
|
CMP_LIBRARY* GetLibrary( void ) { return m_library; }
|
|
|
|
|
|
|
|
wxString& GetAliasName( void ) { return m_aliasName; }
|
|
|
|
|
2011-10-07 14:41:30 +00:00
|
|
|
int GetUnit( void ) { return m_unit; }
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2011-10-07 14:41:30 +00:00
|
|
|
void SetUnit( int unit )
|
2010-02-04 17:46:12 +00:00
|
|
|
{
|
|
|
|
wxASSERT( unit >= 1 );
|
|
|
|
m_unit = unit;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-10-07 14:41:30 +00:00
|
|
|
int GetConvert( void ) { return m_convert; }
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2011-10-07 14:41:30 +00:00
|
|
|
void SetConvert( int convert )
|
2010-02-04 17:46:12 +00:00
|
|
|
{
|
|
|
|
wxASSERT( convert >= 0 );
|
|
|
|
m_convert = convert;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-04-27 19:44:32 +00:00
|
|
|
LIB_ITEM* GetLastDrawItem( void ) { return m_lastDrawItem; }
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2011-04-27 19:44:32 +00:00
|
|
|
void SetLastDrawItem( LIB_ITEM* drawItem )
|
2010-02-04 17:46:12 +00:00
|
|
|
{
|
|
|
|
m_lastDrawItem = drawItem;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-04-27 19:44:32 +00:00
|
|
|
LIB_ITEM* GetDrawItem( void ) { return m_drawItem; }
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2011-04-27 19:44:32 +00:00
|
|
|
void SetDrawItem( LIB_ITEM* drawItem );
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2011-10-07 14:41:30 +00:00
|
|
|
bool GetShowDeMorgan( void ) { return m_showDeMorgan; }
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2011-10-07 14:41:30 +00:00
|
|
|
void SetShowDeMorgan( bool show ) { m_showDeMorgan = show; }
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2011-10-07 14:41:30 +00:00
|
|
|
FILL_T GetFillStyle( void ) { return m_drawFillStyle; }
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function TempCopyComponent
|
2010-10-23 10:09:23 +00:00
|
|
|
* create a temporary copy of the current edited component
|
|
|
|
* Used to prepare an Undo ant/or abort command before editing the component
|
|
|
|
*/
|
2010-11-13 11:02:24 +00:00
|
|
|
void TempCopyComponent();
|
2010-10-23 10:09:23 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function RestoreComponent
|
2010-10-23 10:09:23 +00:00
|
|
|
* Restore the current edited component from its temporary copy.
|
|
|
|
* Used to abort a command
|
|
|
|
*/
|
2010-11-13 11:02:24 +00:00
|
|
|
void RestoreComponent();
|
2010-10-23 10:09:23 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function GetTempCopyComponent
|
2010-10-23 10:09:23 +00:00
|
|
|
* @return the temporary copy of the current component.
|
|
|
|
*/
|
|
|
|
LIB_COMPONENT* GetTempCopyComponent() { return m_tempCopyComponent; }
|
2010-10-20 20:24:26 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function ClearTempCopyComponent
|
2010-10-23 13:49:14 +00:00
|
|
|
* delete temporary copy of the current component and clear pointer
|
|
|
|
*/
|
|
|
|
void ClearTempCopyComponent();
|
|
|
|
|
2011-02-24 22:29:43 +00:00
|
|
|
bool IsEditingDrawItem() { return m_drawItem && m_drawItem->InEditMode(); }
|
2010-10-22 12:11:52 +00:00
|
|
|
|
2010-02-04 17:46:12 +00:00
|
|
|
private:
|
|
|
|
|
2010-07-23 14:12:37 +00:00
|
|
|
/**
|
|
|
|
* Function OnActivate
|
|
|
|
* is called when the frame is activated. Tests if the current library exists.
|
|
|
|
* The library list can be changed by the schematic editor after reloading a new schematic
|
|
|
|
* and the current m_library can point a non existent lib.
|
2010-02-04 17:46:12 +00:00
|
|
|
*/
|
2011-10-07 14:41:30 +00:00
|
|
|
virtual void OnActivate( wxActivateEvent& event );
|
2010-02-04 17:46:12 +00:00
|
|
|
|
|
|
|
// General:
|
2011-05-28 18:51:32 +00:00
|
|
|
|
|
|
|
/**
|
2011-08-12 17:43:16 +00:00
|
|
|
* Function SaveOnePartInMemory
|
|
|
|
* updates the current component being edited in the active library.
|
|
|
|
*
|
|
|
|
* Any changes are updated in memory only and NOT to a file. The old component is
|
|
|
|
* deleted from the library and/or any aliases before the edited component is updated
|
|
|
|
* in the library.
|
|
|
|
*/
|
|
|
|
void SaveOnePartInMemory();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SelectActiveLibrary
|
|
|
|
* sets the current active library to \a aLibrary.
|
|
|
|
*
|
|
|
|
* @param aLibrary A pointer to the CMP_LIBRARY object to select. If NULL, then display
|
|
|
|
* list of available libraries to select from.
|
2011-05-28 18:51:32 +00:00
|
|
|
*/
|
2011-08-12 17:43:16 +00:00
|
|
|
void SelectActiveLibrary( CMP_LIBRARY* aLibrary = NULL );
|
2011-05-28 18:51:32 +00:00
|
|
|
|
2011-08-12 17:43:16 +00:00
|
|
|
/**
|
2013-02-07 17:35:37 +00:00
|
|
|
* Function OnSaveActiveLibrary
|
2011-08-12 17:43:16 +00:00
|
|
|
* it the command event handler to save the changes to the current library.
|
|
|
|
*
|
|
|
|
* A backup file of the current library is saved with the .bak extension before the
|
|
|
|
* changes made to the library are saved.
|
|
|
|
*/
|
2013-02-07 17:35:37 +00:00
|
|
|
void OnSaveActiveLibrary( wxCommandEvent& event );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SaveActiveLibrary
|
|
|
|
* saves the changes to the current library.
|
|
|
|
*
|
|
|
|
* A backup file of the current library is saved with the .bak extension before the
|
|
|
|
* changes made to the library are saved.
|
|
|
|
* @param newFile Ask for a new file name to save the library.
|
|
|
|
* @return True if the library was successfully saved.
|
|
|
|
*/
|
|
|
|
bool SaveActiveLibrary( bool newFile );
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2011-05-28 18:51:32 +00:00
|
|
|
/**
|
2011-08-12 17:43:16 +00:00
|
|
|
* Function LoadComponentFromCurrentLib
|
|
|
|
* loads a component from the current active library.
|
|
|
|
* @param aLibEntry The component to load from \a aLibrary (can be an alias)
|
|
|
|
* @return true if \a aLibEntry loaded correctly.
|
2011-05-28 18:51:32 +00:00
|
|
|
*/
|
2011-08-12 17:43:16 +00:00
|
|
|
bool LoadComponentFromCurrentLib( LIB_ALIAS* aLibEntry );
|
2011-05-28 18:51:32 +00:00
|
|
|
|
2011-08-12 17:43:16 +00:00
|
|
|
/**
|
|
|
|
* Function LoadOneLibraryPartAux
|
|
|
|
* loads a copy of \a aLibEntry from \a aLibrary into memory.
|
|
|
|
*
|
|
|
|
* @param aLibEntry A pointer to the LIB_ALIAS object to load.
|
|
|
|
* @param aLibrary A pointer to the CMP_LIBRARY object to load \a aLibEntry from.
|
2011-09-01 12:54:34 +00:00
|
|
|
* @return True if a copy of \a aLibEntry was successfully loaded from \a aLibrary.
|
2011-08-12 17:43:16 +00:00
|
|
|
*/
|
|
|
|
bool LoadOneLibraryPartAux( LIB_ALIAS* aLibEntry, CMP_LIBRARY* aLibrary );
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2011-08-12 17:43:16 +00:00
|
|
|
/**
|
|
|
|
* Function DisplayCmpDoc
|
|
|
|
* displays the documentation of the selected component.
|
|
|
|
*/
|
|
|
|
void DisplayCmpDoc();
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2011-02-28 13:53:49 +00:00
|
|
|
/**
|
|
|
|
* Function OnRotateItem
|
|
|
|
* rotates the current item.
|
|
|
|
*/
|
|
|
|
void OnRotateItem( wxCommandEvent& aEvent );
|
|
|
|
|
2011-02-24 22:29:43 +00:00
|
|
|
/**
|
|
|
|
* Function deleteItem
|
|
|
|
* deletes the currently selected draw item.
|
|
|
|
* @param aDC The device context to draw upon when removing item.
|
|
|
|
*/
|
|
|
|
void deleteItem( wxDC* aDC );
|
|
|
|
|
2010-02-04 17:46:12 +00:00
|
|
|
// General editing
|
|
|
|
public:
|
2011-10-07 14:41:30 +00:00
|
|
|
void SaveCopyInUndoList( EDA_ITEM* ItemToCopy, int flag_type_command = 0 );
|
2010-02-04 17:46:12 +00:00
|
|
|
|
|
|
|
private:
|
2011-10-07 14:41:30 +00:00
|
|
|
void GetComponentFromUndoList( wxCommandEvent& event );
|
|
|
|
void GetComponentFromRedoList( wxCommandEvent& event );
|
2010-02-04 17:46:12 +00:00
|
|
|
|
|
|
|
// Editing pins
|
2011-10-07 14:41:30 +00:00
|
|
|
void CreatePin( wxDC* DC );
|
|
|
|
void StartMovePin( wxDC* DC );
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2011-10-28 13:43:37 +00:00
|
|
|
/**
|
|
|
|
* Function CreateImagePins
|
|
|
|
* adds copies of \a aPin for \a aUnit in components with multiple parts and
|
|
|
|
* \a aConvert for components that have multiple body styles.
|
|
|
|
*
|
|
|
|
* @param aPin The pin to copy.
|
|
|
|
* @param aUnit The unit to add a copy of \a aPin to.
|
|
|
|
* @param aConvert The alternate body style to add a copy of \a aPin to.
|
|
|
|
* @param aDeMorgan Flag to indicate if \a aPin should be created for the
|
|
|
|
* alternate body style.
|
|
|
|
*/
|
|
|
|
void CreateImagePins( LIB_PIN* aPin, int aUnit, int aConvert, bool aDeMorgan );
|
|
|
|
|
2011-10-07 14:41:30 +00:00
|
|
|
/**
|
|
|
|
* Function PlaceAnchor
|
|
|
|
* places an anchor reference coordinate for the current component.
|
|
|
|
* <p>
|
|
|
|
* All object coordinates are offset to the current cursor position.
|
|
|
|
* </p>
|
|
|
|
*/
|
|
|
|
void PlaceAnchor();
|
2010-02-04 17:46:12 +00:00
|
|
|
|
|
|
|
// Editing graphic items
|
2011-04-27 19:44:32 +00:00
|
|
|
LIB_ITEM* CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC );
|
2011-10-07 14:41:30 +00:00
|
|
|
void GraphicItemBeginDraw( wxDC* DC );
|
|
|
|
void StartMoveDrawSymbol( wxDC* DC );
|
|
|
|
void StartModifyDrawSymbol( wxDC* DC ); //<! Modify the item, adjust size etc.
|
|
|
|
void EndDrawGraphicItem( wxDC* DC );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function LoadOneSymbol
|
|
|
|
* read a component symbol file (*.sym ) and add graphic items to the current component.
|
|
|
|
* <p>
|
|
|
|
* A symbol file *.sym has the same format as a library, and contains only
|
|
|
|
* one symbol.
|
|
|
|
* </p>
|
|
|
|
*/
|
|
|
|
void LoadOneSymbol();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SaveOneSymbol
|
|
|
|
* saves the current component to a symbol file.
|
|
|
|
* <p>
|
|
|
|
* The symbol file format is similar to the standard component library file format, but
|
|
|
|
* there is only one symbol. Invisible pins are not saved.
|
|
|
|
*/
|
|
|
|
void SaveOneSymbol();
|
|
|
|
|
|
|
|
void EditGraphicSymbol( wxDC* DC, LIB_ITEM* DrawItem );
|
|
|
|
void EditSymbolText( wxDC* DC, LIB_ITEM* DrawItem );
|
2011-04-27 19:44:32 +00:00
|
|
|
LIB_ITEM* LocateItemUsingCursor( const wxPoint& aPosition,
|
|
|
|
const KICAD_T aFilterList[] = LIB_COLLECTOR::AllItems );
|
2012-02-21 17:47:30 +00:00
|
|
|
void EditField( LIB_FIELD* Field );
|
2010-02-04 17:46:12 +00:00
|
|
|
|
|
|
|
public:
|
2011-05-28 18:51:32 +00:00
|
|
|
/**
|
2011-08-12 17:43:16 +00:00
|
|
|
* Function LoadComponentAndSelectLib
|
|
|
|
* selects the current active library.
|
|
|
|
*
|
|
|
|
* @param aLibrary The CMP_LIBRARY to select
|
|
|
|
* @param aLibEntry The component to load from aLibrary (can be an alias).
|
|
|
|
* @return true if \a aLibEntry was loaded from \a aLibrary.
|
2011-05-28 18:51:32 +00:00
|
|
|
*/
|
2011-08-12 17:43:16 +00:00
|
|
|
bool LoadComponentAndSelectLib( LIB_ALIAS* aLibEntry, CMP_LIBRARY* aLibrary );
|
2011-05-28 18:51:32 +00:00
|
|
|
|
2010-02-04 17:46:12 +00:00
|
|
|
/* Block commands: */
|
2011-11-10 15:55:05 +00:00
|
|
|
|
|
|
|
/**
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
* Function BlockCommand
|
2011-11-10 15:55:05 +00:00
|
|
|
* returns the block command (BLOCK_MOVE, BLOCK_COPY...) corresponding to
|
|
|
|
* the \a aKey (ALT, SHIFT ALT ..)
|
|
|
|
*/
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
virtual int BlockCommand( int aKey );
|
2011-11-10 15:55:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function HandleBlockPlace
|
|
|
|
* handles the block place command.
|
|
|
|
*/
|
2011-10-07 14:41:30 +00:00
|
|
|
virtual void HandleBlockPlace( wxDC* DC );
|
2011-11-10 15:55:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function HandleBlockEnd
|
|
|
|
* performs a block end command.
|
|
|
|
* @return If command finished (zoom, delete ...) false is returned otherwise true
|
|
|
|
* is returned indicating more processing is required.
|
|
|
|
*/
|
2011-10-07 14:41:30 +00:00
|
|
|
virtual bool HandleBlockEnd( wxDC* DC );
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2013-02-06 11:54:51 +00:00
|
|
|
/**
|
|
|
|
* Function PlacePin
|
|
|
|
* Place at cursor location the pin currently moved (i.e. pin pointed by m_drawItem)
|
|
|
|
* (and the linked pins, if any)
|
|
|
|
*/
|
|
|
|
void PlacePin();
|
2013-01-01 20:52:37 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GlobalSetPins
|
|
|
|
* @param aMasterPin is the "template" pin
|
|
|
|
* @param aId is a param to select what should be mofified:
|
|
|
|
* - aId = ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNAMESIZE_ITEM:
|
|
|
|
* Change pins text name size
|
|
|
|
* - aId = ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNUMSIZE_ITEM:
|
|
|
|
* Change pins text num size
|
|
|
|
* - aId = ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM:
|
|
|
|
* Change pins length.
|
|
|
|
*
|
|
|
|
* If aMasterPin is selected ( .m_flag == IS_SELECTED ),
|
|
|
|
* only the other selected pins are modified
|
|
|
|
*/
|
|
|
|
void GlobalSetPins( LIB_PIN* aMasterPin, int aId );
|
2010-02-04 17:46:12 +00:00
|
|
|
|
|
|
|
// Automatic placement of pins
|
2011-10-28 13:43:37 +00:00
|
|
|
void RepeatPinItem( wxDC* DC, LIB_PIN* Pin );
|
2010-02-04 17:46:12 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function CreatePNGorJPEGFile
|
2011-10-07 14:41:30 +00:00
|
|
|
* creates an image (screenshot) of the current component in PNG or JPEG format.
|
2010-03-18 20:35:29 +00:00
|
|
|
* @param aFileName = the full filename
|
2011-10-28 13:43:37 +00:00
|
|
|
* @param aFmt_jpeg = true to use JPEG file format, false to use PNG file format
|
2010-03-18 20:35:29 +00:00
|
|
|
*/
|
2011-10-07 14:41:30 +00:00
|
|
|
void CreatePNGorJPEGFile( const wxString& aFileName, bool aFmt_jpeg );
|
2010-03-18 20:35:29 +00:00
|
|
|
|
2011-10-07 14:41:30 +00:00
|
|
|
/**
|
|
|
|
* Virtual function PrintPage
|
2010-03-18 20:35:29 +00:00
|
|
|
* used to print a page
|
|
|
|
* @param aDC = wxDC given by the calling print function
|
|
|
|
* @param aPrintMask = not used here
|
|
|
|
* @param aPrintMirrorMode = not used here (Set when printing in mirror mode)
|
|
|
|
* @param aData = a pointer on an auxiliary data (not always used, NULL if not used)
|
|
|
|
*/
|
2013-03-30 17:24:04 +00:00
|
|
|
virtual void PrintPage( wxDC* aDC, LAYER_MSK aPrintMask,
|
2010-11-13 11:02:24 +00:00
|
|
|
bool aPrintMirrorMode, void* aData = NULL );
|
2010-03-18 20:35:29 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2013-05-18 09:38:23 +00:00
|
|
|
* Function SVG_PlotComponent
|
2010-03-28 14:46:49 +00:00
|
|
|
* Creates the SVG print file for the current edited component.
|
2013-05-18 09:38:23 +00:00
|
|
|
* @param aFullFileName = the full filename
|
2011-08-12 17:43:16 +00:00
|
|
|
*/
|
2013-05-18 09:38:23 +00:00
|
|
|
void SVG_PlotComponent( const wxString& aFullFileName );
|
2010-03-28 14:46:49 +00:00
|
|
|
|
|
|
|
|
2010-02-04 17:46:12 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
2012-01-09 17:24:01 +00:00
|
|
|
#endif // LIBEDITFRM_H_
|