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-2021 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 class REPORTER;
35 
36 // The name (for wxWidgets) of the footprint viewer frame
37 #define FOOTPRINTVIEWER_FRAME_NAME wxT( "FootprintViewerFrame" )
38 
39 
44 {
45 public:
46  DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aParent );
47  ~DISPLAY_FOOTPRINTS_FRAME() override;
48 
49  void doCloseWindow() override;
50 
51  void ReCreateHToolbar() override;
52  void ReCreateVToolbar() override;
53  void ReCreateOptToolbar() override;
54  void UpdateToolbarControlSizes() override;
55 
61  void InitDisplay();
62 
64  BOARD_ITEM_CONTAINER* GetModel() const override;
65 
69  void updateView();
70 
71  void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
72  void SaveSettings( APP_SETTINGS_BASE* aCfg ) override;
73 
75 
77 
79  void UpdateMsgPanel() override;
80 
81  COLOR_SETTINGS* GetColorSettings() const override;
82 
86  COLOR4D GetGridColor() override;
87 
88  FOOTPRINT* GetFootprint( const wxString& aFootprintName, REPORTER& aReporter );
89 
93  void SaveCopyInUndoList( EDA_ITEM* aItemToCopy, UNDO_REDO aTypeCommand = UNDO_REDO::UNSPECIFIED ) override
94  {
95  }
96 
97 
106  void SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList, UNDO_REDO aTypeCommand ) override
107  {
108  // currently: do nothing in CvPcb.
109  }
110 
116  void SetAutoZoom( bool aAutoZoom ) override;
117 
123  bool GetAutoZoom() override;
124 
125  SELECTION& GetCurrentSelection() override;
126 
127  DECLARE_EVENT_TABLE()
128 
129 protected:
130  void setupUIConditions() override;
131 };
132 
133 #endif // DISPLAY_FOOTPRINTS_FRAME_H
void setupUIConditions() override
Setup the UI conditions for the various actions and their controls in this frame.
void SetAutoZoom(bool aAutoZoom) override
Set if the canvas should automatically zoom to the footprint on load.
MAGNETIC_SETTINGS * GetMagneticItemsSettings() override
Redraw the message panel.
SELECTION & GetCurrentSelection() override
Get the current selection from the canvas area.
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:64
void SaveCopyInUndoList(const PICKED_ITEMS_LIST &aItemsList, UNDO_REDO aTypeCommand) override
Create a new entry in undo list of commands.
DISPLAY_FOOTPRINTS_FRAME(KIWAY *aKiway, wxWindow *aParent)
UNDO_REDO
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...
void updateView()
Update the gal canvas (view, colors ...).
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:81
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:99
WINDOW_SETTINGS * GetWindowSettings(APP_SETTINGS_BASE *aCfg) override
Return a pointer to the window settings for this frame.
bool GetAutoZoom() override
Get if the canvas should automatically zoom to the footprint on load.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:260
A holder to handle information on schematic or board items.
COLOR_SETTINGS * GetColorSettings() const override
Helper to retrieve the current color settings.
FOOTPRINT * GetFootprint(const wxString &aFootprintName, REPORTER &aReporter)
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
void InitDisplay()
Refresh the full display for this frame: Set the title, the status line and redraw the canvas Must be...
void UpdateToolbarControlSizes() override
Update the sizes of any controls in the toolbars of the frame.
void SaveCopyInUndoList(EDA_ITEM *aItemToCopy, UNDO_REDO aTypeCommand=UNDO_REDO::UNSPECIFIED) override
Does nothing in CvPcb but defined because it is a pure virtual in PCB_BASE_FRAME.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:150
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.
void UpdateMsgPanel() override
Redraw the message panel.
Abstract interface for BOARD_ITEMs capable of storing other items inside.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:98