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 #include <pcbnew_settings.h>
33 
34 // The name (for wxWidgets) of the footprint viewer frame
35 #define FOOTPRINTVIEWER_FRAME_NAME wxT( "FootprintViewerFrame" )
36 
37 
43 {
44 public:
45  DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aParent );
46  ~DISPLAY_FOOTPRINTS_FRAME() override;
47 
48  void OnCloseWindow( wxCloseEvent& Event ) override;
49 
50  void ReCreateHToolbar() override;
51  void ReCreateVToolbar() override;
52  void ReCreateOptToolbar() override;
53 
60  void InitDisplay();
61 
63  BOARD_ITEM_CONTAINER* GetModel() const override;
64 
68  void updateView();
69 
70  void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
71  void SaveSettings( APP_SETTINGS_BASE* aCfg ) override;
72 
74 
76 
79 
81  void UpdateMsgPanel() override;
82 
83  COLOR_SETTINGS* GetColorSettings() override;
84 
89  COLOR4D GetGridColor() override;
90 
91  MODULE* Get_Module( const wxString& CmpName );
92 
93  /* SaveCopyInUndoList() virtual
94  * currently: do nothing in CvPcb.
95  * but but be defined because it is a pure virtual in PCB_BASE_FRAME
96  */
97  void SaveCopyInUndoList( BOARD_ITEM* aItemToCopy, UNDO_REDO_T aTypeCommand = UR_UNSPECIFIED,
98  const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) override
99  {
100  }
101 
102 
112  void SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList, UNDO_REDO_T aTypeCommand,
113  const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) override
114  {
115  // currently: do nothing in CvPcb.
116  }
117 
118  void SyncToolbars() override;
119 
125  void SetAutoZoom( bool aAutoZoom ) override;
126 
132  bool GetAutoZoom() override;
133 
134  DECLARE_EVENT_TABLE()
135 };
136 
137 #endif // DISPLAY_FOOTPRINTS_FRAME_H
void SetAutoZoom(bool aAutoZoom) override
Set if the canvas should automatically zoom to the footprint on load.
COLOR4D GetGridColor() override
Function GetGridColor() , virtual.
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
MAGNETIC_SETTINGS * GetMagneticItemsSettings() override
COLOR_SETTINGS * GetColorSettings() override
Helper to retrieve the current color settings.
UNDO_REDO_T
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...
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 ...)
DISPLAY_FOOTPRINTS_FRAME is used to display footprints.
void OnCloseWindow(wxCloseEvent &Event) override
Classes used in Pcbnew, CvPcb and GerbView.
BOARD_ITEM_CONTAINER * GetModel() const override
Stores the common settings that are saved and loaded for each window / frame.
Definition: app_settings.h:52
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:73
WINDOW_SETTINGS * GetWindowSettings(APP_SETTINGS_BASE *aCfg) override
Returns a pointer to the window settings for this frame.
bool GetAutoZoom() override
Get if the canvas should automatically zoom to the footprint on load.
void SaveCopyInUndoList(const PICKED_ITEMS_LIST &aItemsList, UNDO_REDO_T aTypeCommand, const wxPoint &aTransformPoint=wxPoint(0, 0)) override
Function SaveCopyInUndoList (overloaded).
KIWAY is a minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the s...
Definition: kiway.h:273
void SyncToolbars() override
Update the toolbars (mostly settings/check buttons/checkboxes) with the current controller state.
PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
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...
Color settings are a bit different than most of the settings objects in that there can be more than o...
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
Abstract interface for BOARD_ITEMs capable of storing other items inside.
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.
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:40