KiCad PCB EDA Suite
class_DisplayFootprintsFrame.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) 2007 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
5  * Copyright (C) 2007-2011 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 
30 #include <wxBasePcbFrame.h>
31 
32 // The name (for wxWidgets) of the footprint viewer frame
33 #define FOOTPRINTVIEWER_FRAME_NAME wxT( "FootprintViewerFrame" )
34 
35 class CVPCB_MAINFRAME;
36 
37 
43 {
44 public:
45  DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, CVPCB_MAINFRAME* aParent );
47 
48  void OnCloseWindow( wxCloseEvent& Event ) override;
49 
50  /*
51  * Draws the current highlighted footprint.
52  */
53  void RedrawActiveWindow( wxDC* DC, bool EraseBg ) override;
54 
55  void ReCreateHToolbar() override;
56  void ReCreateVToolbar() override;
57  void ReCreateOptToolbar();
58  void RecreateMenuBar();
59 
60  void OnSelectOptionToolbar( wxCommandEvent& event );
61 
62  void OnUpdateTextDrawMode( wxUpdateUIEvent& aEvent );
63  void OnUpdateLineDrawMode( wxUpdateUIEvent& aEvent );
64 
71  void InitDisplay();
72 
77  virtual bool IsGridVisible() const override;
78 
85  virtual void SetGridVisibility( bool aVisible ) override;
90  virtual COLOR4D GetGridColor() override;
91 
92  void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) override;
93  void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) override;
94  bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) override;
95  bool GeneralControl( wxDC* DC, const wxPoint& aPosition, EDA_KEY aHotKey = 0 ) override;
96  void InstallOptionsDisplay( wxCommandEvent& event );
97  MODULE* Get_Module( const wxString& CmpName );
98 
100  EDA_HOTKEY* GetHotKeyDescription( int aCommand ) const override { return NULL; }
101 
102  void Process_Settings( wxCommandEvent& event );
103 
107  void Show3D_Frame( wxCommandEvent& event ) override;
108 
109  /* SaveCopyInUndoList() virtual
110  * currently: do nothing in CvPcb.
111  * but but be defined because it is a pure virtual in PCB_BASE_FRAME
112  */
113  virtual void SaveCopyInUndoList( BOARD_ITEM* aItemToCopy,
114  UNDO_REDO_T aTypeCommand = UR_UNSPECIFIED,
115  const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) override
116  {
117  }
118 
119 
129  virtual void SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList,
130  UNDO_REDO_T aTypeCommand,
131  const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) override
132  {
133  // currently: do nothing in CvPcb.
134  }
135 
136 
137  DECLARE_EVENT_TABLE()
138 };
virtual 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.
void OnUpdateTextDrawMode(wxUpdateUIEvent &aEvent)
virtual 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)
bool OnRightClick(const wxPoint &MousePos, wxMenu *PopMenu) override
MODULE * Get_Module(const wxString &CmpName)
void Process_Settings(wxCommandEvent &event)
Class DISPLAY_FOOTPRINTS_FRAME is used to display footprints.
void OnCloseWindow(wxCloseEvent &Event) override
void OnLeftClick(wxDC *DC, const wxPoint &MousePos) override
UNDO_REDO_T
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...
EDA_HOTKEY * GetHotKeyDescription(int aCommand) const override
>
Classes used in Pcbnew, CvPcb and GerbView.
virtual bool IsGridVisible() const override
Function IsGridVisible() , virtual.
Class KIWAY is a minimalistic software bus for communications between various DLLs/DSOs (DSOs) within...
Definition: kiway.h:257
void RedrawActiveWindow(wxDC *DC, bool EraseBg) override
uint32_t EDA_KEY
Definition: common.h:52
Class PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
void OnLeftDClick(wxDC *DC, const wxPoint &MousePos) override
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:57
DISPLAY_FOOTPRINTS_FRAME(KIWAY *aKiway, CVPCB_MAINFRAME *aParent)
void OnUpdateLineDrawMode(wxUpdateUIEvent &aEvent)
virtual void SetGridVisibility(bool aVisible) override
Function SetGridVisibility() , virtual It may be overloaded by derived classes if you want to store/r...
virtual void SaveCopyInUndoList(const PICKED_ITEMS_LIST &aItemsList, UNDO_REDO_T aTypeCommand, const wxPoint &aTransformPoint=wxPoint(0, 0)) override
Function SaveCopyInUndoList (overloaded).
void Show3D_Frame(wxCommandEvent &event) override
Display 3D frame of current footprint selection.
void OnSelectOptionToolbar(wxCommandEvent &event)
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...
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
Function GeneralControl performs application specific control using aDC at aPosition in logical units...