KiCad PCB EDA Suite
panel_eeschema_color_settings.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) 2020 Jon Evans <jon@craftyjon.com>
5  * Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software: you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the
9  * Free Software Foundation, either version 3 of the License, or (at your
10  * option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef PANEL_EESCHEMA_COLOR_SETTINGS_H_
22 #define PANEL_EESCHEMA_COLOR_SETTINGS_H_
23 
24 #include <gal/color4d.h>
27 #include <panel_color_settings.h>
28 
29 class COLOR_SETTINGS;
30 class SCH_BASE_FRAME;
31 class PAGE_INFO;
32 class SCH_ITEM;
33 class SCH_PREVIEW_PANEL;
34 class TITLE_BLOCK;
35 
36 namespace KIGFX
37 {
38  class WS_PROXY_VIEW_ITEM;
39 }
40 
42 {
43 public:
44  PANEL_EESCHEMA_COLOR_SETTINGS( SCH_BASE_FRAME* aFrame, wxWindow* aParent );
45 
47 
48  void ResetPanel() override;
49 
50 protected:
51  bool TransferDataFromWindow() override;
52 
53  bool TransferDataToWindow() override;
54 
55  void OnOverrideItemColorsClicked( wxCommandEvent& aEvent ) override;
56  void OnSize( wxSizeEvent& aEvent ) override;
57  void onNewThemeSelected() override;
58  void onColorChanged() override;
59 
60  bool validateSave( bool aQuiet = false ) override;
61 
62  bool saveCurrentTheme( bool aValidate ) override;
63 
64 private:
66 
71  std::vector<EDA_ITEM*> m_previewItems;
72 
74 
75 private:
76  void createPreviewItems();
77  void createSwatches();
78 
79  void updatePreview();
80  void zoomFitPreview();
81 };
82 
83 
84 #endif
void ResetPanel() override
Reset the contents of this panel.
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: color4d.cpp:175
void OnSize(wxSizeEvent &aEvent) override
bool validateSave(bool aQuiet=false) override
Performs a pre-save validation of the current color theme.
TITLE_BLOCK holds the information shown in the lower right corner of a plot, printout,...
Definition: title_block.h:40
bool saveCurrentTheme(bool aValidate) override
void onNewThemeSelected() override
Event fired when a new theme is selected that can be overridden in children.
void onColorChanged() override
Event fired when the user changes any color.
PANEL_EESCHEMA_COLOR_SETTINGS(SCH_BASE_FRAME *aFrame, wxWindow *aParent)
PAGE_INFO describes the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:54
void OnOverrideItemColorsClicked(wxCommandEvent &aEvent) override
Board layer functions and definitions.
Color settings are a bit different than most of the settings objects in that there can be more than o...
KIGFX::GAL_DISPLAY_OPTIONS m_galDisplayOptions
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194