KiCad PCB EDA Suite
display_footprints_frame.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2018 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
5  * Copyright (C) 2007-2018 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
28 #ifndef DISPLAY_FOOTPRINTS_FRAME_H
29 #define DISPLAY_FOOTPRINTS_FRAME_H
30 
31 #include <pcb_base_frame.h>
32 
33 // The name (for wxWidgets) of the footprint viewer frame
34 #define FOOTPRINTVIEWER_FRAME_NAME wxT( "FootprintViewerFrame" )
35 
36 class CVPCB_MAINFRAME;
37 
38 
44 {
45  bool m_autoZoom;
46  double m_lastZoom;
47 
48 public:
49  DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aParent );
50  ~DISPLAY_FOOTPRINTS_FRAME() override;
51 
52  void OnCloseWindow( wxCloseEvent& Event ) override;
53 
56  void OnUIToolSelection( wxUpdateUIEvent& aEvent );
57 
58  /*
59  * Draws the current highlighted footprint.
60  */
61  void RedrawActiveWindow( wxDC* DC, bool EraseBg ) override;
62 
63  void ReCreateHToolbar() override;
64  void ReCreateVToolbar() override;
65  void ReCreateOptToolbar() override;
66 
73  void InitDisplay();
74 
78  void updateView();
79 
80  void LoadSettings( wxConfigBase* aCfg ) override;
81  void SaveSettings( wxConfigBase* aCfg ) override;
82 
85 
87  void UpdateMsgPanel() override;
88 
89  bool GetAutoZoom() const { return m_autoZoom; }
90  void SetAutoZoom( bool aEnable ) { m_autoZoom = aEnable; }
91 
96  bool IsGridVisible() const override;
97 
104  void SetGridVisibility( bool aVisible ) override;
109  COLOR4D GetGridColor() override;
110 
111  void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) override;
112  void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) override;
113  bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) override;
114  bool GeneralControl( wxDC* DC, const wxPoint& aPosition, EDA_KEY aHotKey = 0 ) override;
115  void InstallOptionsDisplay( wxCommandEvent& event );
116  MODULE* Get_Module( const wxString& CmpName );
117 
119  EDA_HOTKEY* GetHotKeyDescription( int aCommand ) const override { return NULL; }
120 
124  void Show3D_Frame( wxCommandEvent& event ) override;
125 
126  /* SaveCopyInUndoList() virtual
127  * currently: do nothing in CvPcb.
128  * but but be defined because it is a pure virtual in PCB_BASE_FRAME
129  */
130  void SaveCopyInUndoList( BOARD_ITEM* aItemToCopy, UNDO_REDO_T aTypeCommand = UR_UNSPECIFIED,
131  const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) override
132  {
133  }
134 
135 
145  void SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList, UNDO_REDO_T aTypeCommand,
146  const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) override
147  {
148  // currently: do nothing in CvPcb.
149  }
150 
151 
152  DECLARE_EVENT_TABLE()
153 };
154 
155 #endif // DISPLAY_FOOTPRINTS_FRAME_H
COLOR4D GetGridColor() override
Function GetGridColor() , virtual.
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
void InstallOptionsDisplay(wxCommandEvent &event)
UNDO_REDO_T
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...
bool OnRightClick(const wxPoint &MousePos, wxMenu *PopMenu) override
void ApplyDisplaySettingsToGAL()
Updates the GAL with display settings changes.
MODULE * Get_Module(const wxString &CmpName)
DISPLAY_FOOTPRINTS_FRAME(KIWAY *aKiway, wxWindow *aParent)
void updateView()
update the gal canvas (view, colors ...)
Class DISPLAY_FOOTPRINTS_FRAME is used to display footprints.
void OnCloseWindow(wxCloseEvent &Event) override
void OnLeftClick(wxDC *DC, const wxPoint &MousePos) override
Classes used in Pcbnew, CvPcb and GerbView.
EDA_HOTKEY * GetHotKeyDescription(int aCommand) const override
>
void OnUIToolSelection(wxUpdateUIEvent &aEvent)
UI events:
bool IsGridVisible() const override
Function IsGridVisible() , virtual.
void SaveCopyInUndoList(const PICKED_ITEMS_LIST &aItemsList, UNDO_REDO_T aTypeCommand, const wxPoint &aTransformPoint=wxPoint(0, 0)) override
Function SaveCopyInUndoList (overloaded).
void LoadSettings(wxConfigBase *aCfg) override
Function LoadSettings loads common frame parameters from a configuration file.
Class KIWAY is a minimalistic software bus for communications between various DLLs/DSOs (DSOs) within...
Definition: kiway.h:258
void RedrawActiveWindow(wxDC *DC, bool EraseBg) override
uint32_t EDA_KEY
Definition: common.h:73
Class PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
void OnLeftDClick(wxDC *DC, const wxPoint &MousePos) override
void SaveSettings(wxConfigBase *aCfg) override
Function SaveSettings saves common frame parameters to a configuration data file. ...
void InitDisplay()
Function InitDisplay Refresh the full display for this frame: Set the title, the status line and redr...
class EDA_HOTKEY is a class to handle hot key commands.
Definition: hotkeys_basic.h:59
void SetGridVisibility(bool aVisible) override
Function SetGridVisibility() , virtual It may be overloaded by derived classes if you want to store/r...
void Show3D_Frame(wxCommandEvent &event) override
Display 3D frame of current footprint selection.
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...
void SaveCopyInUndoList(BOARD_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand=UR_UNSPECIFIED, const wxPoint &aTransformPoint=wxPoint(0, 0)) override
Function SaveCopyInUndoList (virtual pure) Creates a new entry in undo list of commands.
The CvPcb application main window.
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
bool GeneralControl(wxDC *DC, const wxPoint &aPosition, EDA_KEY aHotKey=0) override
Perform application specific control using aDC at aPosition in logical units.