![]() |
KiCad PCB EDA Suite
|
#include <panel_color_settings.h>
Public Types | |
enum | COLOR_CONTEXT_ID { ID_COPY = wxID_HIGHEST + 1, ID_PASTE, ID_REVERT } |
Public Member Functions | |
PANEL_COLOR_SETTINGS (wxWindow *aParent) | |
~PANEL_COLOR_SETTINGS ()=default | |
virtual void | ResetPanel () override |
Reset the contents of this panel. More... | |
virtual wxString | GetResetTooltip () override |
Get the tooltip the reset button should display when showing this panel. More... | |
bool | Show (bool show) override |
Public Attributes | |
wxCheckBox * | m_optOverrideColors |
Protected Member Functions | |
void | OnBtnOpenThemeFolderClicked (wxCommandEvent &event) override |
void | OnLeftDownTheme (wxMouseEvent &event) override |
void | OnThemeChanged (wxCommandEvent &aEvent) override |
void | ShowColorContextMenu (wxMouseEvent &aEvent, int aLayer) |
void | OnColorChanged (wxCommandEvent &aEvent) |
void | updateSwatches () |
void | createThemeList (const wxString &aCurrent) |
Builds the theme listbox and sets the selection to the current theme. More... | |
void | createSwatch (int aLayer, const wxString &aName) |
void | updateColor (int aLayer, const KIGFX::COLOR4D &aColor) |
virtual bool | saveCurrentTheme (bool aValidate) |
virtual bool | validateSave (bool aQuiet=false) |
Performs a pre-save validation of the current color theme. More... | |
virtual void | onNewThemeSelected () |
Event fired when a new theme is selected that can be overridden in children. More... | |
virtual void | onColorChanged () |
Event fired when the user changes any color. More... | |
virtual void | OnSize (wxSizeEvent &event) |
virtual void | OnOverrideItemColorsClicked (wxCommandEvent &event) |
Protected Attributes | |
COLOR_SETTINGS * | m_currentSettings |
std::map< int, wxStaticText * > | m_labels |
std::map< int, COLOR_SWATCH * > | m_swatches |
KIGFX::COLOR4D | m_copied |
std::vector< int > | m_validLayers |
A list of layer IDs that are valid for the current color settings dialog. More... | |
int | m_backgroundLayer |
std::string | m_colorNamespace |
A namespace that will be passed to SETTINGS_MANAGER::SaveColorSettings. More... | |
wxBoxSizer * | m_mainSizer |
wxStaticText * | m_staticText9 |
wxChoice * | m_cbTheme |
wxButton * | m_btnOpenFolder |
wxStaticLine * | m_staticline2 |
wxBoxSizer * | m_colorsMainSizer |
wxScrolledWindow * | m_colorsListWindow |
wxFlexGridSizer * | m_colorsGridSizer |
Definition at line 32 of file panel_color_settings.h.
PANEL_COLOR_SETTINGS::PANEL_COLOR_SETTINGS | ( | wxWindow * | aParent | ) |
Definition at line 41 of file panel_color_settings.cpp.
References _, PANEL_COLOR_SETTINGS_BASE::m_btnOpenFolder, PANEL_COLOR_SETTINGS_BASE::m_colorsListWindow, and UNSPECIFIED.
|
default |
|
protected |
Definition at line 232 of file panel_color_settings.cpp.
References color, FIRST_BUTTON_ID, COLOR_SETTINGS::GetColor(), COLOR_SETTINGS::GetDefaultColor(), m_backgroundLayer, PANEL_COLOR_SETTINGS_BASE::m_cbTheme, PANEL_COLOR_SETTINGS_BASE::m_colorsGridSizer, PANEL_COLOR_SETTINGS_BASE::m_colorsListWindow, m_currentSettings, m_labels, m_swatches, OnColorChanged(), onNewThemeSelected(), ShowColorContextMenu(), and SWATCH_MEDIUM.
Referenced by PANEL_FP_EDITOR_COLOR_SETTINGS::createSwatches(), PANEL_PCBNEW_COLOR_SETTINGS::createSwatches(), and PANEL_EESCHEMA_COLOR_SETTINGS::createSwatches().
|
protected |
Builds the theme listbox and sets the selection to the current theme.
aCurrent | is the filename of the current color theme (no extension) |
Definition at line 199 of file panel_color_settings.cpp.
References _, GetSettingsManager(), PANEL_COLOR_SETTINGS_BASE::m_cbTheme, name, and Pgm().
Referenced by OnLeftDownTheme(), PANEL_EESCHEMA_COLOR_SETTINGS::PANEL_EESCHEMA_COLOR_SETTINGS(), PANEL_FP_EDITOR_COLOR_SETTINGS::PANEL_FP_EDITOR_COLOR_SETTINGS(), and PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS().
|
inlineoverridevirtual |
Get the tooltip the reset button should display when showing this panel.
Reimplemented from RESETTABLE_PANEL.
Definition at line 48 of file panel_color_settings.h.
References _.
|
overrideprotectedvirtual |
Reimplemented from PANEL_COLOR_SETTINGS_BASE.
Definition at line 59 of file panel_color_settings.cpp.
References SETTINGS_MANAGER::GetColorSettingsPath(), and LaunchExternal().
|
protected |
Definition at line 317 of file panel_color_settings.cpp.
References FIRST_BUTTON_ID, COLOR_SWATCH::GetSwatchColor(), and updateColor().
Referenced by createSwatch().
|
inlineprotectedvirtual |
Event fired when the user changes any color.
Reimplemented in PANEL_EESCHEMA_COLOR_SETTINGS, and PANEL_PCBNEW_COLOR_SETTINGS.
Definition at line 97 of file panel_color_settings.h.
Referenced by updateColor().
|
overrideprotectedvirtual |
Reimplemented from PANEL_COLOR_SETTINGS_BASE.
Definition at line 103 of file panel_color_settings.cpp.
References createThemeList(), JSON_SETTINGS::GetFilename(), and m_currentSettings.
|
inlineprotectedvirtual |
Event fired when a new theme is selected that can be overridden in children.
Reimplemented in PANEL_EESCHEMA_COLOR_SETTINGS, and PANEL_PCBNEW_COLOR_SETTINGS.
Definition at line 92 of file panel_color_settings.h.
Referenced by createSwatch(), OnThemeChanged(), and Show().
|
inlineprotectedvirtualinherited |
Reimplemented in PANEL_EESCHEMA_COLOR_SETTINGS.
Definition at line 54 of file panel_color_settings_base.h.
Referenced by PANEL_COLOR_SETTINGS_BASE::PANEL_COLOR_SETTINGS_BASE(), and PANEL_COLOR_SETTINGS_BASE::~PANEL_COLOR_SETTINGS_BASE().
|
inlineprotectedvirtualinherited |
Reimplemented in PANEL_EESCHEMA_COLOR_SETTINGS, and PANEL_PCBNEW_COLOR_SETTINGS.
Definition at line 51 of file panel_color_settings_base.h.
Referenced by PANEL_COLOR_SETTINGS_BASE::PANEL_COLOR_SETTINGS_BASE(), and PANEL_COLOR_SETTINGS_BASE::~PANEL_COLOR_SETTINGS_BASE().
|
overrideprotectedvirtual |
Reimplemented from PANEL_COLOR_SETTINGS_BASE.
Definition at line 112 of file panel_color_settings.cpp.
References _, SETTINGS_MANAGER::AddNewColorSettings(), COLOR_SETTINGS::GetColor(), SETTINGS_MANAGER::GetColorSettingsPath(), JSON_SETTINGS::GetFilename(), COLOR_SETTINGS::GetName(), COLOR_SETTINGS::GetOverrideSchItemColors(), SETTINGS_MANAGER::GetPathForSettingsFile(), PANEL_COLOR_SETTINGS_BASE::m_cbTheme, m_currentSettings, PANEL_COLOR_SETTINGS_BASE::m_optOverrideColors, m_validLayers, onNewThemeSelected(), Pgm(), saveCurrentTheme(), JSON_SETTINGS::SaveToFile(), COLOR_SETTINGS::SetColor(), COLOR_SETTINGS::SetName(), JSON_SETTINGS::SetReadOnly(), and updateSwatches().
|
overridevirtual |
Reset the contents of this panel.
Implements RESETTABLE_PANEL.
Reimplemented in PANEL_EESCHEMA_COLOR_SETTINGS, and PANEL_PCBNEW_COLOR_SETTINGS.
Definition at line 66 of file panel_color_settings.cpp.
References COLOR_SETTINGS::GetDefaultColor(), JSON_SETTINGS::IsReadOnly(), m_currentSettings, m_swatches, COLOR_SETTINGS::SetColor(), and COLOR_SWATCH::SetSwatchColor().
Referenced by PANEL_PCBNEW_COLOR_SETTINGS::ResetPanel(), and PANEL_EESCHEMA_COLOR_SETTINGS::ResetPanel().
|
protectedvirtual |
Reimplemented in PANEL_EESCHEMA_COLOR_SETTINGS.
Definition at line 350 of file panel_color_settings.cpp.
References COLOR_SETTINGS::GetColor(), SETTINGS_MANAGER::GetColorSettings(), JSON_SETTINGS::GetFilename(), JSON_SETTINGS::IsReadOnly(), m_colorNamespace, m_currentSettings, PANEL_COLOR_SETTINGS_BASE::m_optOverrideColors, m_validLayers, Pgm(), SETTINGS_MANAGER::SaveColorSettings(), COLOR_SETTINGS::SetColor(), COLOR_SETTINGS::SetOverrideSchItemColors(), and validateSave().
Referenced by OnThemeChanged(), PANEL_EESCHEMA_COLOR_SETTINGS::saveCurrentTheme(), and updateColor().
|
override |
Definition at line 84 of file panel_color_settings.cpp.
References PANEL_COLOR_SETTINGS_BASE::m_cbTheme, m_currentSettings, onNewThemeSelected(), and updateSwatches().
|
protected |
Definition at line 272 of file panel_color_settings.cpp.
References _, AddMenuItem(), copy, COLOR_SETTINGS::GetColor(), ID_COPY, ID_PASTE, ID_REVERT, JSON_SETTINGS::IsReadOnly(), KiBitmap(), PANEL_COLOR_SETTINGS_BASE::m_cbTheme, m_copied, m_currentSettings, paste, undo, and updateColor().
Referenced by createSwatch().
|
protected |
Definition at line 327 of file panel_color_settings.cpp.
References COLOR_SETTINGS::GetColor(), m_backgroundLayer, m_currentSettings, m_swatches, onColorChanged(), saveCurrentTheme(), and COLOR_SETTINGS::SetColor().
Referenced by OnColorChanged(), and ShowColorContextMenu().
|
protected |
Definition at line 185 of file panel_color_settings.cpp.
References COLOR_SETTINGS::GetColor(), JSON_SETTINGS::IsReadOnly(), m_backgroundLayer, m_currentSettings, and m_swatches.
Referenced by OnThemeChanged(), and Show().
|
inlineprotectedvirtual |
Performs a pre-save validation of the current color theme.
aQuiet | will suppress any warning output (prompt dialogs) |
Reimplemented in PANEL_EESCHEMA_COLOR_SETTINGS.
Definition at line 84 of file panel_color_settings.h.
Referenced by saveCurrentTheme().
|
protected |
Definition at line 115 of file panel_color_settings.h.
Referenced by createSwatch(), PANEL_EESCHEMA_COLOR_SETTINGS::PANEL_EESCHEMA_COLOR_SETTINGS(), PANEL_FP_EDITOR_COLOR_SETTINGS::PANEL_FP_EDITOR_COLOR_SETTINGS(), PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS(), updateColor(), and updateSwatches().
|
protectedinherited |
Definition at line 44 of file panel_color_settings_base.h.
Referenced by PANEL_COLOR_SETTINGS(), PANEL_COLOR_SETTINGS_BASE::PANEL_COLOR_SETTINGS_BASE(), and PANEL_COLOR_SETTINGS_BASE::~PANEL_COLOR_SETTINGS_BASE().
|
protectedinherited |
Definition at line 43 of file panel_color_settings_base.h.
Referenced by createSwatch(), createThemeList(), OnThemeChanged(), PANEL_COLOR_SETTINGS_BASE::PANEL_COLOR_SETTINGS_BASE(), Show(), ShowColorContextMenu(), and PANEL_COLOR_SETTINGS_BASE::~PANEL_COLOR_SETTINGS_BASE().
|
protected |
A namespace that will be passed to SETTINGS_MANAGER::SaveColorSettings.
This should be set to the appropriate namespace in the application-specific constructor
Definition at line 122 of file panel_color_settings.h.
Referenced by PANEL_EESCHEMA_COLOR_SETTINGS::PANEL_EESCHEMA_COLOR_SETTINGS(), PANEL_FP_EDITOR_COLOR_SETTINGS::PANEL_FP_EDITOR_COLOR_SETTINGS(), PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS(), and saveCurrentTheme().
|
protectedinherited |
Definition at line 48 of file panel_color_settings_base.h.
Referenced by createSwatch(), PANEL_PCBNEW_COLOR_SETTINGS::createSwatches(), PANEL_EESCHEMA_COLOR_SETTINGS::createSwatches(), PANEL_EESCHEMA_COLOR_SETTINGS::OnOverrideItemColorsClicked(), and PANEL_COLOR_SETTINGS_BASE::PANEL_COLOR_SETTINGS_BASE().
|
protectedinherited |
Definition at line 47 of file panel_color_settings_base.h.
Referenced by createSwatch(), PANEL_PCBNEW_COLOR_SETTINGS::createSwatches(), PANEL_EESCHEMA_COLOR_SETTINGS::createSwatches(), PANEL_EESCHEMA_COLOR_SETTINGS::OnOverrideItemColorsClicked(), PANEL_COLOR_SETTINGS(), and PANEL_COLOR_SETTINGS_BASE::PANEL_COLOR_SETTINGS_BASE().
|
protectedinherited |
Definition at line 46 of file panel_color_settings_base.h.
Referenced by PANEL_COLOR_SETTINGS_BASE::PANEL_COLOR_SETTINGS_BASE(), PANEL_EESCHEMA_COLOR_SETTINGS::PANEL_EESCHEMA_COLOR_SETTINGS(), PANEL_FP_EDITOR_COLOR_SETTINGS::PANEL_FP_EDITOR_COLOR_SETTINGS(), and PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS().
|
protected |
Definition at line 104 of file panel_color_settings.h.
Referenced by ShowColorContextMenu().
|
protected |
Definition at line 99 of file panel_color_settings.h.
Referenced by createSwatch(), PANEL_FP_EDITOR_COLOR_SETTINGS::createSwatches(), OnLeftDownTheme(), PANEL_EESCHEMA_COLOR_SETTINGS::OnOverrideItemColorsClicked(), OnThemeChanged(), PANEL_EESCHEMA_COLOR_SETTINGS::PANEL_EESCHEMA_COLOR_SETTINGS(), PANEL_FP_EDITOR_COLOR_SETTINGS::PANEL_FP_EDITOR_COLOR_SETTINGS(), PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS(), ResetPanel(), PANEL_EESCHEMA_COLOR_SETTINGS::saveCurrentTheme(), saveCurrentTheme(), Show(), ShowColorContextMenu(), PANEL_FP_EDITOR_COLOR_SETTINGS::TransferDataFromWindow(), PANEL_PCBNEW_COLOR_SETTINGS::TransferDataFromWindow(), PANEL_EESCHEMA_COLOR_SETTINGS::TransferDataFromWindow(), updateColor(), PANEL_PCBNEW_COLOR_SETTINGS::updatePreview(), PANEL_EESCHEMA_COLOR_SETTINGS::updatePreview(), updateSwatches(), PANEL_EESCHEMA_COLOR_SETTINGS::validateSave(), PANEL_EESCHEMA_COLOR_SETTINGS::~PANEL_EESCHEMA_COLOR_SETTINGS(), PANEL_FP_EDITOR_COLOR_SETTINGS::~PANEL_FP_EDITOR_COLOR_SETTINGS(), and PANEL_PCBNEW_COLOR_SETTINGS::~PANEL_PCBNEW_COLOR_SETTINGS().
|
protected |
Definition at line 101 of file panel_color_settings.h.
Referenced by createSwatch(), and PANEL_EESCHEMA_COLOR_SETTINGS::OnOverrideItemColorsClicked().
|
protectedinherited |
Definition at line 41 of file panel_color_settings_base.h.
Referenced by PANEL_COLOR_SETTINGS_BASE::PANEL_COLOR_SETTINGS_BASE().
|
inherited |
Definition at line 59 of file panel_color_settings_base.h.
Referenced by PANEL_EESCHEMA_COLOR_SETTINGS::OnOverrideItemColorsClicked(), OnThemeChanged(), PANEL_COLOR_SETTINGS_BASE::PANEL_COLOR_SETTINGS_BASE(), PANEL_EESCHEMA_COLOR_SETTINGS::PANEL_EESCHEMA_COLOR_SETTINGS(), PANEL_FP_EDITOR_COLOR_SETTINGS::PANEL_FP_EDITOR_COLOR_SETTINGS(), PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS(), saveCurrentTheme(), PANEL_EESCHEMA_COLOR_SETTINGS::TransferDataFromWindow(), DIALOG_SHEET_PROPERTIES::TransferDataFromWindow(), and PANEL_COLOR_SETTINGS_BASE::~PANEL_COLOR_SETTINGS_BASE().
|
protectedinherited |
Definition at line 45 of file panel_color_settings_base.h.
Referenced by PANEL_COLOR_SETTINGS_BASE::PANEL_COLOR_SETTINGS_BASE().
|
protectedinherited |
Definition at line 42 of file panel_color_settings_base.h.
Referenced by PANEL_COLOR_SETTINGS_BASE::PANEL_COLOR_SETTINGS_BASE().
|
protected |
Definition at line 102 of file panel_color_settings.h.
Referenced by createSwatch(), PANEL_EESCHEMA_COLOR_SETTINGS::OnOverrideItemColorsClicked(), ResetPanel(), updateColor(), and updateSwatches().
|
protected |
A list of layer IDs that are valid for the current color settings dialog.
Valid colors will be shown for editing and are the set of colors that actions like resetting to defaults will apply to.
This list must be filled in the application-specific color settings panel constructors.
Definition at line 114 of file panel_color_settings.h.
Referenced by PANEL_FP_EDITOR_COLOR_SETTINGS::createSwatches(), PANEL_PCBNEW_COLOR_SETTINGS::createSwatches(), OnThemeChanged(), PANEL_EESCHEMA_COLOR_SETTINGS::PANEL_EESCHEMA_COLOR_SETTINGS(), PANEL_FP_EDITOR_COLOR_SETTINGS::PANEL_FP_EDITOR_COLOR_SETTINGS(), PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS(), PANEL_EESCHEMA_COLOR_SETTINGS::saveCurrentTheme(), and saveCurrentTheme().