2011-10-17 20:01:27 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2013-01-06 13:31:49 +00:00
|
|
|
* Copyright (C) 2013 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
|
|
|
|
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@verizon.net>
|
|
|
|
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
|
2011-10-17 20:01:27 +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
|
|
|
|
*/
|
|
|
|
|
2011-09-23 13:57:12 +00:00
|
|
|
/**
|
|
|
|
* @file gerbview_frame.h
|
|
|
|
*/
|
2009-07-29 13:10:36 +00:00
|
|
|
|
|
|
|
#ifndef WX_GERBER_STRUCT_H
|
|
|
|
#define WX_GERBER_STRUCT_H
|
|
|
|
|
2009-09-22 12:27:57 +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
|
|
|
#include <config_params.h>
|
|
|
|
#include <draw_frame.h>
|
2011-03-02 15:24:39 +00:00
|
|
|
|
2012-09-12 17:28:55 +00:00
|
|
|
#include <gerbview.h>
|
2012-05-04 17:44:42 +00:00
|
|
|
#include <class_gbr_layout.h>
|
2012-04-25 19:33:24 +00:00
|
|
|
#include <class_gbr_screen.h>
|
2014-12-23 13:01:59 +00:00
|
|
|
#include <class_page_info.h>
|
2011-03-02 15:24:39 +00:00
|
|
|
|
2013-03-31 13:27:46 +00:00
|
|
|
#define NO_AVAILABLE_LAYERS UNDEFINED_LAYER
|
2011-03-02 15:24:39 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
class DCODE_SELECTION_BOX;
|
2011-09-23 13:57:12 +00:00
|
|
|
class GERBER_LAYER_WIDGET;
|
2012-05-04 17:44:42 +00:00
|
|
|
class GBR_LAYER_BOX_SELECTOR;
|
2011-09-23 13:57:12 +00:00
|
|
|
class GERBER_DRAW_ITEM;
|
|
|
|
|
|
|
|
|
2012-05-04 17:44:42 +00:00
|
|
|
/**
|
|
|
|
* Class GBR_DISPLAY_OPTIONS
|
|
|
|
* A helper class to handle display options.
|
|
|
|
*/
|
|
|
|
class GBR_DISPLAY_OPTIONS
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool m_DisplayFlashedItemsFill;
|
|
|
|
bool m_DisplayLinesFill;
|
|
|
|
bool m_DisplayPolygonsFill;
|
|
|
|
bool m_DisplayPolarCood;
|
|
|
|
bool m_DisplayDCodes;
|
2013-01-06 13:31:49 +00:00
|
|
|
bool m_DisplayNegativeObjects;
|
2012-05-04 17:44:42 +00:00
|
|
|
bool m_IsPrinting;
|
2013-01-06 13:31:49 +00:00
|
|
|
|
2012-05-04 17:44:42 +00:00
|
|
|
public:
|
|
|
|
GBR_DISPLAY_OPTIONS()
|
|
|
|
{
|
|
|
|
m_DisplayFlashedItemsFill = true;
|
|
|
|
m_DisplayLinesFill = true;
|
|
|
|
m_DisplayPolygonsFill = true;
|
|
|
|
m_DisplayPolarCood = false;
|
|
|
|
m_DisplayDCodes = true;
|
|
|
|
m_IsPrinting = false;
|
2015-02-26 10:33:15 +00:00
|
|
|
m_DisplayNegativeObjects = false;
|
2012-05-04 17:44:42 +00:00
|
|
|
}
|
|
|
|
};
|
2010-12-17 20:34:29 +00:00
|
|
|
|
2011-03-02 15:24:39 +00:00
|
|
|
|
2011-09-23 13:57:12 +00:00
|
|
|
/**
|
|
|
|
* Class GERBVIEW_FRAME
|
2011-09-30 18:15:37 +00:00
|
|
|
* is the main window used in GerbView.
|
2011-09-23 13:57:12 +00:00
|
|
|
*/
|
2009-07-29 13:10:36 +00:00
|
|
|
|
2015-03-02 17:29:18 +00:00
|
|
|
#define GERBVIEW_FRAME_NAME wxT( "GerberFrame" )
|
|
|
|
|
2012-05-04 17:44:42 +00:00
|
|
|
class GERBVIEW_FRAME : public EDA_DRAW_FRAME // PCB_BASE_FRAME
|
2009-07-29 13:10:36 +00:00
|
|
|
{
|
2013-08-03 05:15:23 +00:00
|
|
|
GBR_LAYOUT* m_gerberLayout;
|
|
|
|
wxPoint m_grid_origin;
|
2014-12-23 13:01:59 +00:00
|
|
|
PAGE_INFO m_paper; // used only to show paper limits to screen
|
2013-08-03 05:15:23 +00:00
|
|
|
|
2012-05-04 17:44:42 +00:00
|
|
|
public:
|
|
|
|
GBR_DISPLAY_OPTIONS m_DisplayOptions;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetLayout
|
2013-06-27 19:12:01 +00:00
|
|
|
* sets the m_gerberLayout member in such as way as to ensure deleting any previous
|
2012-05-04 17:44:42 +00:00
|
|
|
* GBR_LAYOUT.
|
|
|
|
* @param aLayout The GBR_LAYOUT to put into the frame.
|
|
|
|
*/
|
|
|
|
void SetLayout( GBR_LAYOUT* aLayout )
|
|
|
|
{
|
2013-06-27 19:12:01 +00:00
|
|
|
delete m_gerberLayout;
|
|
|
|
m_gerberLayout = aLayout;
|
2012-05-04 17:44:42 +00:00
|
|
|
}
|
|
|
|
|
2013-06-27 19:12:01 +00:00
|
|
|
GBR_LAYOUT* GetGerberLayout() const
|
2012-05-04 17:44:42 +00:00
|
|
|
{
|
2013-06-27 19:12:01 +00:00
|
|
|
wxASSERT( m_gerberLayout );
|
|
|
|
return m_gerberLayout;
|
2012-05-04 17:44:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetItemsList
|
|
|
|
* @return the first GERBER_DRAW_ITEM * item of the items list
|
|
|
|
*/
|
|
|
|
GERBER_DRAW_ITEM* GetItemsList()
|
|
|
|
{
|
2013-06-27 19:12:01 +00:00
|
|
|
GERBER_DRAW_ITEM* item = GetGerberLayout()->m_Drawings;
|
2012-05-04 17:44:42 +00:00
|
|
|
|
|
|
|
return (GERBER_DRAW_ITEM*) item;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2013-06-27 19:12:01 +00:00
|
|
|
* Function GetGerberLayoutBoundingBox
|
2012-05-04 17:44:42 +00:00
|
|
|
* calculates the bounding box containing all gerber items.
|
|
|
|
* @return EDA_RECT - the items bounding box
|
|
|
|
*/
|
2013-06-27 19:12:01 +00:00
|
|
|
EDA_RECT GetGerberLayoutBoundingBox();
|
2012-05-04 17:44:42 +00:00
|
|
|
|
|
|
|
void SetPageSettings( const PAGE_INFO& aPageSettings ); // overload
|
|
|
|
const PAGE_INFO& GetPageSettings() const; // overload
|
|
|
|
const wxSize GetPageSizeIU() const; // overload
|
|
|
|
|
2013-08-03 05:15:23 +00:00
|
|
|
const wxPoint& GetAuxOrigin() const; // overload
|
|
|
|
void SetAuxOrigin( const wxPoint& aPoint ); // overload
|
|
|
|
|
|
|
|
const wxPoint& GetGridOrigin() const { return m_grid_origin; } // overload
|
|
|
|
void SetGridOrigin( const wxPoint& aPoint ) // overload
|
|
|
|
{
|
|
|
|
m_grid_origin = aPoint;
|
|
|
|
}
|
2012-05-04 17:44:42 +00:00
|
|
|
|
|
|
|
const TITLE_BLOCK& GetTitleBlock() const; // overload
|
|
|
|
void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ); // overload
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetCurItem
|
|
|
|
* sets the currently selected item and displays it in the MsgPanel.
|
|
|
|
* If the given item is NULL then the MsgPanel is erased and there is no
|
|
|
|
* currently selected item. This function is intended to make the process
|
|
|
|
* of "selecting" an item more formal, and to indivisibly tie the operation
|
|
|
|
* of selecting an item to displaying it using GERBER_DRAW_ITEM::Display_Infos().
|
|
|
|
* @param aItem The GERBER_DRAW_ITEM to make the selected item or NULL if none.
|
|
|
|
* @param aDisplayInfo = true to display item info, false if not (default = true)
|
|
|
|
*/
|
|
|
|
void SetCurItem( GERBER_DRAW_ITEM* aItem, bool aDisplayInfo = true );
|
|
|
|
|
|
|
|
/** Install the dialog box for layer selection
|
2013-03-31 13:27:46 +00:00
|
|
|
* @param aDefaultLayer = Preselection (NB_PCB_LAYERS for "(Deselect)" layer)
|
2012-05-04 17:44:42 +00:00
|
|
|
* @param aCopperLayerCount = number of copper layers
|
|
|
|
* @param aShowDeselectOption = display a "(Deselect)" radiobutton (when set to true)
|
2013-03-31 13:27:46 +00:00
|
|
|
* @return new layer value (NB_PCB_LAYERS when "(Deselect)" radiobutton selected),
|
2012-05-04 17:44:42 +00:00
|
|
|
* or -1 if canceled
|
|
|
|
*
|
|
|
|
* Providing the option to also display a "(Deselect)" radiobutton makes the
|
|
|
|
* GerbView's "Export to Pcbnew" command) more "user friendly",
|
|
|
|
* by permitting any layer to be "deselected" immediately after its
|
|
|
|
* corresponding radiobutton has been clicked on. (It would otherwise be
|
|
|
|
* necessary to first cancel the "Select Layer:" dialog box (invoked after a
|
|
|
|
* different radiobutton is clicked on) prior to then clicking on the "Deselect"
|
|
|
|
* button provided within the "Layer selection:" dialog box).
|
|
|
|
*/
|
2014-06-27 17:07:42 +00:00
|
|
|
int SelectPCBLayer( int aDefaultLayer, int aOpperLayerCount, bool aNullLayer = false );
|
2010-02-03 14:05:17 +00:00
|
|
|
|
|
|
|
protected:
|
2012-05-04 17:44:42 +00:00
|
|
|
GERBER_LAYER_WIDGET* m_LayersManager;
|
2011-09-23 13:57:12 +00:00
|
|
|
|
|
|
|
// Auxiliary file history used to store drill files history.
|
2012-05-04 17:44:42 +00:00
|
|
|
wxFileHistory m_drillFileHistory;
|
2012-08-29 16:59:50 +00:00
|
|
|
/// The last filename chosen to be proposed to the user
|
|
|
|
wxString m_lastFileName;
|
2009-07-29 13:10:36 +00:00
|
|
|
public:
|
2012-05-04 17:44:42 +00:00
|
|
|
GBR_LAYER_BOX_SELECTOR* m_SelLayerBox;
|
|
|
|
DCODE_SELECTION_BOX* m_DCodeSelector; // a list box to select the dcode Id to highlight.
|
|
|
|
wxTextCtrl* m_TextInfo; // a wxTextCtrl used to display some info about
|
|
|
|
// gerber data (format..)
|
|
|
|
wxArrayString m_DCodesList; // an array string containing all decodes Id (10 to 999)
|
2010-02-03 14:05:17 +00:00
|
|
|
private:
|
2011-09-23 13:57:12 +00:00
|
|
|
// list of PARAM_CFG_xxx to read/write parameters saved in config
|
2012-05-04 17:44:42 +00:00
|
|
|
PARAM_CFG_ARRAY m_configSettings;
|
|
|
|
COLORS_DESIGN_SETTINGS* m_colorsSettings;
|
2011-09-23 13:57:12 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
int m_displayMode; // Gerber images ("layers" in Gerbview) can be drawn:
|
2012-05-04 17:44:42 +00:00
|
|
|
// - in fast mode (write mode) but if there are negative
|
2011-03-02 15:24:39 +00:00
|
|
|
// items only the last image is correctly drawn (no
|
|
|
|
// problem to see only one image or when no negative items)
|
2012-05-04 17:44:42 +00:00
|
|
|
// - in "exact" mode (but slower) in write mode:
|
|
|
|
// last image covers previous images
|
|
|
|
// - in "exact" mode (also slower) in OR mode
|
|
|
|
// (transparency mode)
|
2010-12-17 20:34:29 +00:00
|
|
|
// m_displayMode = 0, 1 or 2
|
2011-09-23 13:57:12 +00:00
|
|
|
|
2012-05-04 17:44:42 +00:00
|
|
|
bool m_show_layer_manager_tools;
|
2010-02-03 14:05:17 +00:00
|
|
|
|
2012-05-04 17:44:42 +00:00
|
|
|
// An array sting to store warning messages when reaging a gerber file.
|
|
|
|
wxArrayString m_Messages;
|
2009-07-29 13:10:36 +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
|
|
|
public:
|
|
|
|
GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent );
|
2011-03-12 09:50:21 +00:00
|
|
|
~GERBVIEW_FRAME();
|
2009-07-29 13:10:36 +00:00
|
|
|
|
2012-05-04 17:44:42 +00:00
|
|
|
void OnCloseWindow( wxCloseEvent& Event );
|
2010-02-03 14:05:17 +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
|
|
|
bool OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl ); // overload KIWAY_PLAYER
|
|
|
|
|
2011-03-14 21:19:13 +00:00
|
|
|
// Virtual basic functions:
|
2012-05-04 17:44:42 +00:00
|
|
|
void RedrawActiveWindow( wxDC* DC, bool EraseBg );
|
|
|
|
void ReCreateHToolbar();
|
2011-10-17 20:01:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function ReCreateVToolbar
|
|
|
|
* creates or updates the right vertical toolbar.
|
|
|
|
*
|
|
|
|
* @note This is currently not used.
|
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
void ReCreateVToolbar();
|
2011-10-17 20:01:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create or update the left vertical toolbar (option toolbar
|
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
void ReCreateOptToolbar();
|
2011-10-17 20:01:27 +00:00
|
|
|
|
2012-05-04 17:44:42 +00:00
|
|
|
void ReCreateMenuBar();
|
|
|
|
void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
|
|
|
|
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
|
|
|
|
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
|
|
|
|
double BestZoom();
|
|
|
|
void UpdateStatusBar();
|
2011-03-14 21:19:13 +00:00
|
|
|
|
2015-01-06 07:38:58 +00:00
|
|
|
/**
|
|
|
|
* Function GetZoomLevelIndicator
|
|
|
|
* returns a human readable value which can be displayed as zoom
|
|
|
|
* level indicator in dialogs.
|
|
|
|
* Virtual from the base class
|
|
|
|
*/
|
|
|
|
const wxString GetZoomLevelIndicator() const;
|
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function ReportMessage
|
2010-10-05 11:44:34 +00:00
|
|
|
* Add a message (a string) in message list
|
|
|
|
* for instance when reading a Gerber file
|
2011-02-21 13:54:29 +00:00
|
|
|
* @param aMessage = the string to add in list
|
2010-10-05 11:44:34 +00:00
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
void ReportMessage( const wxString aMessage )
|
2010-10-05 11:44:34 +00:00
|
|
|
{
|
|
|
|
m_Messages.Add( aMessage );
|
|
|
|
}
|
2010-12-17 20:34:29 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function ClearMessageList
|
2010-10-05 11:44:34 +00:00
|
|
|
* Clear the message list
|
|
|
|
* Call it before reading a Gerber file
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
void ClearMessageList()
|
2010-10-05 11:44:34 +00:00
|
|
|
{
|
2010-12-17 20:34:29 +00:00
|
|
|
m_Messages.Clear();
|
2010-10-05 11:44:34 +00:00
|
|
|
}
|
|
|
|
|
2010-12-15 20:15:24 +00:00
|
|
|
/**
|
|
|
|
* Function GetDisplayMode
|
|
|
|
* @return 0 for fast mode (not fully compatible with negative objects)
|
|
|
|
* 1 for exact mode, write mode
|
|
|
|
* 2 for exact mode, OR mode (transparency mode)
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
int GetDisplayMode() { return m_displayMode; }
|
2010-12-15 20:15:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetDisplayMode
|
|
|
|
* @param aMode = 0 for fast mode
|
|
|
|
* 1 for exact mode, write mode
|
|
|
|
* 2 for exact mode, OR mode (transparency mode)
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
void SetDisplayMode( int aMode ) { m_displayMode = aMode; }
|
2010-12-15 20:15:24 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2012-05-04 17:44:42 +00:00
|
|
|
* Function IsElementVisible
|
|
|
|
* tests whether a given element category is visible. Keep this as an
|
|
|
|
* inline function.
|
2012-09-12 17:28:55 +00:00
|
|
|
* @param aItemIdVisible is an item id from the enum GERBER_VISIBLE_ID
|
2012-05-04 17:44:42 +00:00
|
|
|
* @return bool - true if the element is visible.
|
2010-02-03 14:05:17 +00:00
|
|
|
*/
|
2013-01-06 13:31:49 +00:00
|
|
|
bool IsElementVisible( GERBER_VISIBLE_ID aItemIdVisible ) const;
|
2010-02-03 14:05:17 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2012-05-04 17:44:42 +00:00
|
|
|
* Function SetElementVisibility
|
|
|
|
* changes the visibility of an element category
|
2012-09-12 17:28:55 +00:00
|
|
|
* @param aItemIdVisible is an item id from the enum GERBER_VISIBLE_ID
|
2012-05-04 17:44:42 +00:00
|
|
|
* @param aNewState = The new visibility state of the element category
|
2012-09-12 17:28:55 +00:00
|
|
|
* (see enum PCB_VISIBLE)
|
2012-05-04 17:44:42 +00:00
|
|
|
*/
|
2012-09-12 17:28:55 +00:00
|
|
|
void SetElementVisibility( GERBER_VISIBLE_ID aItemIdVisible, bool aNewState );
|
2012-05-04 17:44:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetVisibleAlls
|
|
|
|
* Set the status of all visible element categories and layers to VISIBLE
|
|
|
|
*/
|
|
|
|
void SetVisibleAlls();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetGridVisibility(), virtual from EDA_DRAW_FRAME
|
2010-02-03 14:05:17 +00:00
|
|
|
* It may be overloaded by derived classes
|
|
|
|
* @param aVisible = true if the grid must be shown
|
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
void SetGridVisibility( bool aVisible );
|
2010-02-03 14:05:17 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2012-05-04 17:44:42 +00:00
|
|
|
* Function GetVisibleLayers
|
|
|
|
* is a proxy function that calls the correspondent function in m_BoardSettings
|
|
|
|
* Returns a bit-mask of all the layers that are visible
|
2014-06-27 17:07:42 +00:00
|
|
|
* @return long - the visible layers in bit-mapped form.
|
2010-02-03 14:05:17 +00:00
|
|
|
*/
|
2014-06-27 17:07:42 +00:00
|
|
|
long GetVisibleLayers() const;
|
2010-02-03 14:05:17 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2012-05-04 17:44:42 +00:00
|
|
|
* Function SetVisibleLayers
|
|
|
|
* is a proxy function that calls the correspondent function in m_BoardSettings
|
|
|
|
* changes the bit-mask of visible layers
|
|
|
|
* @param aLayerMask = The new bit-mask of visible layers
|
2010-02-03 14:05:17 +00:00
|
|
|
*/
|
2014-06-27 17:07:42 +00:00
|
|
|
void SetVisibleLayers( long aLayerMask );
|
2010-02-03 14:05:17 +00:00
|
|
|
|
|
|
|
/**
|
2012-05-04 17:44:42 +00:00
|
|
|
* Function IsLayerVisible
|
|
|
|
* tests whether a given layer is visible
|
2013-04-09 16:00:46 +00:00
|
|
|
* @param aLayer = The layer to be tested
|
2012-05-04 17:44:42 +00:00
|
|
|
* @return bool - true if the layer is visible.
|
|
|
|
*/
|
2014-06-27 17:07:42 +00:00
|
|
|
bool IsLayerVisible( int aLayer ) const;
|
2012-05-04 17:44:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetVisibleElementColor
|
2012-09-12 17:28:55 +00:00
|
|
|
* returns the color of a gerber visible element.
|
2010-02-03 14:05:17 +00:00
|
|
|
*/
|
2013-01-06 13:31:49 +00:00
|
|
|
EDA_COLOR_T GetVisibleElementColor( GERBER_VISIBLE_ID aItemIdVisible ) const;
|
2010-02-03 14:05:17 +00:00
|
|
|
|
2012-09-12 17:28:55 +00:00
|
|
|
void SetVisibleElementColor( GERBER_VISIBLE_ID aItemIdVisible, EDA_COLOR_T aColor );
|
2010-12-17 20:34:29 +00:00
|
|
|
|
2010-02-03 14:05:17 +00:00
|
|
|
/**
|
2012-05-04 17:44:42 +00:00
|
|
|
* Function GetLayerColor
|
2013-01-06 13:31:49 +00:00
|
|
|
* gets a layer color for any valid layer.
|
2010-02-03 14:05:17 +00:00
|
|
|
*/
|
2014-06-27 17:07:42 +00:00
|
|
|
EDA_COLOR_T GetLayerColor( int aLayer ) const;
|
2010-02-03 14:05:17 +00:00
|
|
|
|
|
|
|
/**
|
2012-05-04 17:44:42 +00:00
|
|
|
* Function SetLayerColor
|
2013-01-06 13:31:49 +00:00
|
|
|
* changes a layer color for any valid layer.
|
2010-02-03 14:05:17 +00:00
|
|
|
*/
|
2014-06-27 17:07:42 +00:00
|
|
|
void SetLayerColor( int aLayer, EDA_COLOR_T aColor );
|
2010-02-03 14:05:17 +00:00
|
|
|
|
2013-01-06 13:31:49 +00:00
|
|
|
/**
|
|
|
|
* Function GetNegativeItemsColor
|
|
|
|
* @return the color of negative items.
|
|
|
|
* This is usually the background color, but can be an other color
|
|
|
|
* in order to see negative objects
|
|
|
|
*/
|
|
|
|
EDA_COLOR_T GetNegativeItemsColor() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function DisplayLinesSolidMode
|
|
|
|
* @return true to draw gerber lines in solid (filled) mode,
|
|
|
|
* false to draw gerber lines in sketch mode
|
|
|
|
*/
|
|
|
|
bool DisplayLinesSolidMode()
|
|
|
|
{
|
|
|
|
return m_DisplayOptions.m_DisplayLinesFill;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function DisplayPolygonsSolidMode
|
|
|
|
* @return true to draw polygon in solid (filled) mode,
|
|
|
|
* false to draw polygon outlines only
|
|
|
|
*/
|
|
|
|
bool DisplayPolygonsSolidMode()
|
|
|
|
{
|
|
|
|
return m_DisplayOptions.m_DisplayPolygonsFill;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function DisplayFlashedItemsSolidMode
|
|
|
|
* @return true to draw flashed items in solid (filled) mode,
|
|
|
|
* false to draw draw flashed in sketch mode
|
|
|
|
*/
|
|
|
|
bool DisplayFlashedItemsSolidMode()
|
|
|
|
{
|
|
|
|
return m_DisplayOptions.m_DisplayFlashedItemsFill;
|
|
|
|
}
|
|
|
|
|
2010-02-03 14:05:17 +00:00
|
|
|
/**
|
|
|
|
* Function ReFillLayerWidget
|
|
|
|
* changes out all the layers in m_Layers and may be called upon
|
2013-06-28 10:49:43 +00:00
|
|
|
* loading new gerber files.
|
2010-02-03 14:05:17 +00:00
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
void ReFillLayerWidget();
|
2010-02-03 14:05:17 +00:00
|
|
|
|
2010-02-04 09:08:08 +00:00
|
|
|
/**
|
|
|
|
* Function setActiveLayer
|
|
|
|
* will change the currently active layer to \a aLayer and also
|
2013-06-28 10:49:43 +00:00
|
|
|
* update the GERBER_LAYER_WIDGET.
|
2010-02-04 09:08:08 +00:00
|
|
|
*/
|
2014-06-27 17:07:42 +00:00
|
|
|
void setActiveLayer( int aLayer, bool doLayerWidgetUpdate = true );
|
2010-12-17 20:34:29 +00:00
|
|
|
|
2010-02-04 09:08:08 +00:00
|
|
|
/**
|
|
|
|
* Function getActiveLayer
|
|
|
|
* returns the active layer
|
|
|
|
*/
|
2014-06-27 17:07:42 +00:00
|
|
|
int getActiveLayer();
|
2010-12-17 20:34:29 +00:00
|
|
|
|
2011-03-02 15:24:39 +00:00
|
|
|
/**
|
|
|
|
* Function getNextAvailableLayer
|
|
|
|
* finds the next empty layer starting at \a aLayer and returns it to the caller. If no
|
|
|
|
* empty layers are found, NO_AVAILABLE_LAYERS is return.
|
|
|
|
* @param aLayer The first layer to search.
|
|
|
|
* @return The first empty layer found or NO_AVAILABLE_LAYERS.
|
|
|
|
*/
|
2014-06-27 17:07:42 +00:00
|
|
|
int getNextAvailableLayer( int aLayer = 0 ) const;
|
2011-03-02 15:24:39 +00:00
|
|
|
|
2012-05-04 17:44:42 +00:00
|
|
|
bool hasAvailableLayers() const
|
|
|
|
{
|
|
|
|
return getNextAvailableLayer() != NO_AVAILABLE_LAYERS;
|
|
|
|
}
|
2011-03-02 15:24:39 +00:00
|
|
|
|
2010-02-04 09:08:08 +00:00
|
|
|
/**
|
|
|
|
* Function syncLayerWidget
|
2013-06-28 10:49:43 +00:00
|
|
|
* updates the currently "selected" layer within the GERBER_LAYER_WIDGET.
|
2010-02-04 09:08:08 +00:00
|
|
|
* The currently active layer is defined by the return value of getActiveLayer().
|
|
|
|
* <p>
|
|
|
|
* This function cannot be inline without including layer_widget.h in
|
|
|
|
* here and we do not want to do that.
|
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
void syncLayerWidget();
|
2010-02-04 09:08:08 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function syncLayerBox
|
|
|
|
* updates the currently "selected" layer within m_SelLayerBox
|
|
|
|
* The currently active layer, as defined by the return value of
|
|
|
|
* getActiveLayer(). And updates the colored icon in the toolbar.
|
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
void syncLayerBox();
|
2010-02-04 09:08:08 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function UpdateTitleAndInfo
|
2010-10-06 17:28:07 +00:00
|
|
|
* displays the short filename (if exists) of the selected layer
|
2011-09-30 18:15:37 +00:00
|
|
|
* on the caption of the main GerbView window
|
2010-10-06 17:28:07 +00:00
|
|
|
* and some other parameters
|
2010-12-14 15:56:30 +00:00
|
|
|
* Name of the layer (found in the gerber file: LN <name> command) in the status bar
|
|
|
|
* Name of the Image (found in the gerber file: IN <name> command) in the status bar
|
2010-10-06 17:28:07 +00:00
|
|
|
* and other data in toolbar
|
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
void UpdateTitleAndInfo();
|
2010-10-06 17:28:07 +00:00
|
|
|
|
2011-03-12 09:50:21 +00:00
|
|
|
/**
|
|
|
|
* Function GetConfigurationSettings
|
2011-09-30 18:15:37 +00:00
|
|
|
* Populates the GerbView applications settings list.
|
|
|
|
* (list of parameters that must be saved in GerbView parameters)
|
2011-10-17 20:01:27 +00:00
|
|
|
* Currently, only the settings that are needed at start up by the main window are
|
|
|
|
* defined here. There are other locally used settings scattered throughout the
|
|
|
|
* GerbView source code (mainly in dialogs). If you need to define a configuration
|
|
|
|
* setting that need to be loaded at run time, this is the place to define it.
|
2011-03-12 09:50:21 +00:00
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
PARAM_CFG_ARRAY& GetConfigurationSettings( void );
|
2011-03-12 09:50:21 +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 ); // override virtual
|
2009-11-22 20: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
|
|
|
void SaveSettings( wxConfigBase* aCfg ); // override virtual
|
2009-11-22 20:55:05 +00:00
|
|
|
|
Modular-Kicad milestone B), major portions:
*) Rework the set language support, simplify it by using KIWAY. Now any major
frame with a "change language" menu can change the language for all KIWAY_PLAYERs
in the whole KIWAY. Multiple KIWAYs are not supported yet.
*) Simplify "modal wxFrame" support, and add that support exclusively to
KIWAY_PLAYER where it is inherited by all derivatives. The function
KIWAY_PLAYER::ShowModal() is in the vtable and so is cross module capable.
*) Remove the requirements and assumptions that the wxFrame hierarchy always
had PCB_EDIT_FRAME and SCH_EDIT_FRAME as immediate parents of their viewers
and editors. This is no longer the case, nor required.
*) Use KIWAY::Player() everywhere to make KIWAY_PLAYERs, this registers the
KIWAY_PLAYER within the KIWAY and makes it very easy to find an open frame
quickly. It also gives control to the KIWAY as to frame hierarchical
relationships.
*) Change single_top to use the KIWAY for loading a KIFACE and instantiating
the single KIWAY_PLAYER, see bullet immediately above.
*) Add KIWAY::OnKiwayEnd() and call it from PGM_BASE at program termination, this
gives the KIFACEs a chance to save their final configuration dope to disk.
*) Add dedicated FRAME_T's for the modal frames, so m_Ident can be tested and
these modal frames are distinctly different than their non-modal equivalents.
KIWAY_PLAYER::IsModal() is !not! a valid test during the wxFrame's constructor,
so this is another important reason for having a dedicated FRAME_T for each
modal wxFrame.
On balance, more lines were deleted than were added to achieve all this.
2014-05-03 17:40:19 +00:00
|
|
|
void ShowChangedLanguage(); // override EDA_BASE_FRAME virtual
|
2010-12-17 20:34:29 +00:00
|
|
|
|
2012-05-04 17:44:42 +00:00
|
|
|
void Process_Special_Functions( wxCommandEvent& event );
|
|
|
|
void OnSelectOptionToolbar( wxCommandEvent& event );
|
2010-12-17 20:34:29 +00:00
|
|
|
|
2011-03-16 10:47:15 +00:00
|
|
|
/**
|
|
|
|
* Function OnSelectActiveDCode
|
|
|
|
* Selects the active DCode for the current active layer.
|
2011-10-17 20:01:27 +00:00
|
|
|
* Items using this DCode are highlighted.
|
2011-03-16 10:47:15 +00:00
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
void OnSelectActiveDCode( wxCommandEvent& event );
|
2011-03-16 10:47:15 +00:00
|
|
|
|
2011-03-14 21:19:13 +00:00
|
|
|
/**
|
|
|
|
* Function OnSelectActiveLayer
|
|
|
|
* Selects the active layer:
|
|
|
|
* - if a file is loaded, it is loaded in this layer
|
|
|
|
* _ this layer is displayed on top of other layers
|
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
void OnSelectActiveLayer( wxCommandEvent& event );
|
2011-03-14 21:19:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnShowGerberSourceFile
|
|
|
|
* Call the preferred editor to show (and edit) the gerber source file
|
|
|
|
* loaded in the active layer
|
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
void OnShowGerberSourceFile( wxCommandEvent& event );
|
2011-03-14 21:19:13 +00:00
|
|
|
|
2010-12-15 20:15:24 +00:00
|
|
|
/**
|
|
|
|
* Function OnSelectDisplayMode
|
|
|
|
* called on a display mode selection
|
|
|
|
* Mode selection can be fast display,
|
|
|
|
* or exact mode with stacked images or with transparency
|
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
void OnSelectDisplayMode( wxCommandEvent& event );
|
2011-03-14 21:19:13 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
/**
|
|
|
|
* Function OnQuit
|
|
|
|
* called on request of application quit
|
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
void OnQuit( wxCommandEvent& event );
|
2011-04-06 13:52:47 +00:00
|
|
|
|
2015-05-05 18:39:42 +00:00
|
|
|
///> @copydoc EDA_DRAW_FRAME::GetHotKeyDescription()
|
|
|
|
EDA_HOTKEY* GetHotKeyDescription( int aCommand ) const;
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
/**
|
2012-05-19 19:04:03 +00:00
|
|
|
* Function OnHotKey.
|
|
|
|
* ** Commands are case insensitive **
|
|
|
|
* Some commands are relatives to the item under the mouse cursor
|
|
|
|
* @param aDC = current device context
|
|
|
|
* @param aHotkeyCode = hotkey code (ascii or wxWidget code for special keys)
|
|
|
|
* @param aPosition The cursor position in logical (drawing) units.
|
|
|
|
* @param aItem = NULL or pointer on a EDA_ITEM under the mouse cursor
|
2011-04-06 13:52:47 +00:00
|
|
|
*/
|
2014-08-29 20:23:40 +00:00
|
|
|
bool OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosition, EDA_ITEM* aItem = NULL );
|
2009-07-29 13:10:36 +00:00
|
|
|
|
2012-05-04 17:44:42 +00:00
|
|
|
GERBER_DRAW_ITEM* GerberGeneralLocateAndDisplay();
|
|
|
|
GERBER_DRAW_ITEM* Locate( const wxPoint& aPosition, int typeloc );
|
2009-07-29 13:10:36 +00:00
|
|
|
|
2012-05-04 17:44:42 +00:00
|
|
|
void Process_Settings( wxCommandEvent& event );
|
|
|
|
void Process_Config( wxCommandEvent& event );
|
|
|
|
void InstallGerberOptionsDialog( wxCommandEvent& event );
|
2011-03-02 15:24:39 +00:00
|
|
|
|
2012-05-04 17:44:42 +00:00
|
|
|
void OnUpdateDrawMode( wxUpdateUIEvent& aEvent );
|
|
|
|
void OnUpdateCoordType( wxUpdateUIEvent& aEvent );
|
|
|
|
void OnUpdateFlashedItemsDrawMode( wxUpdateUIEvent& aEvent );
|
|
|
|
void OnUpdateLinesDrawMode( wxUpdateUIEvent& aEvent );
|
|
|
|
void OnUpdatePolygonsDrawMode( wxUpdateUIEvent& aEvent );
|
|
|
|
void OnUpdateShowDCodes( wxUpdateUIEvent& aEvent );
|
2013-01-06 13:31:49 +00:00
|
|
|
void OnUpdateShowNegativeItems( wxUpdateUIEvent& aEvent );
|
2012-05-04 17:44:42 +00:00
|
|
|
void OnUpdateShowLayerManager( wxUpdateUIEvent& aEvent );
|
|
|
|
void OnUpdateSelectDCode( wxUpdateUIEvent& aEvent );
|
|
|
|
void OnUpdateLayerSelectBox( wxUpdateUIEvent& aEvent );
|
2011-02-21 13:54:29 +00:00
|
|
|
|
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 key );
|
2011-11-10 15:55:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function HandleBlockPlace
|
|
|
|
* handles the block place command.
|
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
virtual void HandleBlockPlace( wxDC* DC );
|
2009-07-29 13:10:36 +00:00
|
|
|
|
2011-11-10 15:55:05 +00:00
|
|
|
/**
|
|
|
|
* Function HandleBlockEnd( )
|
|
|
|
* handles the end of a block command,
|
|
|
|
* It is called at the end of the definition of the area of a block.
|
|
|
|
* Depending on the current block command, this command is executed
|
|
|
|
* or parameters are initialized to prepare a call to HandleBlockPlace
|
|
|
|
* in GetScreen()->m_BlockLocate
|
|
|
|
*
|
|
|
|
* @return false if no item selected, or command finished,
|
|
|
|
* true if some items found and HandleBlockPlace must be called later.
|
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
virtual bool HandleBlockEnd( wxDC* DC );
|
2009-09-22 12:27:57 +00:00
|
|
|
|
2009-07-31 05:33:11 +00:00
|
|
|
/**
|
|
|
|
* Function Block_Move
|
|
|
|
* moves all tracks and segments within the selected block.
|
2009-09-22 12:27:57 +00:00
|
|
|
* New location is determined by the current offset from the selected
|
|
|
|
* block's original location.
|
2011-09-30 18:15:37 +00:00
|
|
|
* Defined separately in Pcbnew and GerbView
|
2009-07-31 05:33:11 +00:00
|
|
|
*
|
|
|
|
* @param DC A device context to draw on.
|
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
void Block_Move( wxDC* DC );
|
2009-07-31 05:33:11 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function ToPlotter
|
2010-01-01 13:30:39 +00:00
|
|
|
* Open a dialog frame to create plot and drill files
|
|
|
|
* relative to the current board
|
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
void ToPlotter( wxCommandEvent& event );
|
2010-01-01 13:30:39 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function ToPrinter
|
2010-01-01 13:30:39 +00:00
|
|
|
* Open a dialog frame to print layers
|
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
void ToPrinter( wxCommandEvent& event );
|
|
|
|
|
|
|
|
void Files_io( wxCommandEvent& event );
|
2011-09-26 20:32:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnGbrFileHistory
|
|
|
|
* deletes the current data and loads a Gerber file selected from history list on
|
|
|
|
* current layer.
|
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
void OnGbrFileHistory( wxCommandEvent& event );
|
2011-09-26 20:32:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnDrlFileHistory
|
|
|
|
* deletes the current data and load a drill file in Excellon format selected from
|
|
|
|
* history list on current layer.
|
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
void OnDrlFileHistory( wxCommandEvent& event );
|
2010-05-17 20:35:46 +00:00
|
|
|
|
|
|
|
/**
|
2010-12-15 20:15:24 +00:00
|
|
|
* function LoadGerberFiles
|
|
|
|
* Load a photoplot (Gerber) file or many files.
|
2011-03-02 15:24:39 +00:00
|
|
|
* @param aFileName - void string or file name with full path to open or empty string to
|
|
|
|
* open a new file. In this case one one file is loaded
|
2010-12-15 20:15:24 +00:00
|
|
|
* if void string: user will be prompted for filename(s)
|
|
|
|
* @return true if file was opened successfully.
|
2010-05-17 20:35:46 +00:00
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
bool LoadGerberFiles( const wxString& aFileName );
|
|
|
|
int ReadGerberFile( FILE* File, bool Append );
|
|
|
|
bool Read_GERBER_File( const wxString& GERBER_FullFileName,
|
|
|
|
const wxString& D_Code_FullFileName );
|
2009-07-29 13:10:36 +00:00
|
|
|
|
2011-03-16 20:51:20 +00:00
|
|
|
/**
|
|
|
|
* function LoadDrllFiles
|
|
|
|
* Load a drill (EXCELLON) file or many files.
|
|
|
|
* @param aFileName - void string or file name with full path to open or empty string to
|
|
|
|
* open a new file. In this case one one file is loaded
|
|
|
|
* if void string: user will be prompted for filename(s)
|
|
|
|
* @return true if file was opened successfully.
|
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
bool LoadExcellonFiles( const wxString& aFileName );
|
|
|
|
bool Read_EXCELLON_File( const wxString& aFullFileName );
|
2011-03-16 20:51:20 +00:00
|
|
|
|
2014-08-29 20:23:40 +00:00
|
|
|
bool GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey = 0 );
|
2009-07-29 13:10:36 +00:00
|
|
|
|
2011-10-17 20:01:27 +00:00
|
|
|
/**
|
|
|
|
* Set Size Items (Lines, Flashes) from DCodes List
|
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
void CopyDCodesSizeToItems();
|
|
|
|
void Liste_D_Codes();
|
2009-07-29 13:10:36 +00:00
|
|
|
|
|
|
|
// PCB handling
|
2014-07-14 18:59:41 +00:00
|
|
|
bool Clear_DrawLayers( bool query );
|
|
|
|
void Erase_Current_DrawLayer( bool query );
|
2009-07-29 13:10:36 +00:00
|
|
|
|
|
|
|
// Conversion function
|
2012-05-04 17:44:42 +00:00
|
|
|
void ExportDataInPcbnewFormat( wxCommandEvent& event );
|
2009-07-29 13:10:36 +00:00
|
|
|
|
|
|
|
/* SaveCopyInUndoList() virtual
|
2011-09-30 18:15:37 +00:00
|
|
|
* currently: do nothing in GerbView.
|
2009-07-29 13:10:36 +00:00
|
|
|
*/
|
2012-05-04 17:44:42 +00:00
|
|
|
void SaveCopyInUndoList( GERBER_DRAW_ITEM* aItemToCopy,
|
|
|
|
UNDO_REDO_T aTypeCommand = UR_UNSPECIFIED,
|
|
|
|
const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) { }
|
2009-09-22 12:27:57 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function SaveCopyInUndoList (overloaded).
|
2009-08-03 18:54:48 +00:00
|
|
|
* Creates a new entry in undo list of commands.
|
|
|
|
* add a list of pickers to handle a list of items
|
|
|
|
* @param aItemsList = the list of items modified by the command to undo
|
2011-04-05 14:46:51 +00:00
|
|
|
* @param aTypeCommand = command type (see enum UNDO_REDO_T)
|
2009-09-22 12:27:57 +00:00
|
|
|
* @param aTransformPoint = the reference point of the transformation,
|
|
|
|
* for commands like move
|
2009-08-03 18:54:48 +00:00
|
|
|
*/
|
2013-12-18 12:27:18 +00:00
|
|
|
void SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList,
|
2012-05-04 17:44:42 +00:00
|
|
|
UNDO_REDO_T aTypeCommand,
|
|
|
|
const wxPoint& aTransformPoint = wxPoint( 0, 0 ) )
|
2009-08-03 18:54:48 +00:00
|
|
|
{
|
2011-09-30 18:15:37 +00:00
|
|
|
// currently: do nothing in GerbView.
|
2009-08-03 18:54:48 +00:00
|
|
|
}
|
2009-07-29 13:10:36 +00:00
|
|
|
|
2010-03-18 20:35:29 +00:00
|
|
|
/** Virtual function PrintPage
|
|
|
|
* used to print a page
|
|
|
|
* @param aDC = wxDC given by the calling print function
|
2010-10-16 14:51:22 +00:00
|
|
|
* @param aPrintMasklayer = a 32 bits mask: bit n = 1 -> layer n is printed
|
2010-03-18 20:35:29 +00:00
|
|
|
* @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)
|
|
|
|
*/
|
2014-06-24 16:17:18 +00:00
|
|
|
virtual void PrintPage( wxDC* aDC, LSET aPrintMasklayer, bool aPrintMirrorMode,
|
2012-05-04 17:44:42 +00:00
|
|
|
void* aData = NULL );
|
2009-07-29 13:10:36 +00:00
|
|
|
|
2010-12-15 20:15:24 +00:00
|
|
|
/**
|
|
|
|
* Function DrawItemsDCodeID
|
|
|
|
* Draw the DCode value (if exists) corresponding to gerber item
|
|
|
|
* (polygons do not have a DCode)
|
2011-10-17 20:01:27 +00:00
|
|
|
* @param aDC = the current device context
|
2010-12-15 20:15:24 +00:00
|
|
|
* @param aDrawMode = GR_COPY, GR_OR ...
|
|
|
|
*/
|
2012-09-01 13:38:27 +00:00
|
|
|
void DrawItemsDCodeID( wxDC* aDC, GR_DRAWMODE aDrawMode );
|
2010-10-06 17:28:07 +00:00
|
|
|
|
2009-07-29 13:10:36 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
2012-05-04 17:44:42 +00:00
|
|
|
#endif /* WX_GERBER_STRUCT_H */
|