KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PANEL_COLOR_SETTINGS Class Referenceabstract

#include <panel_color_settings.h>

Inheritance diagram for PANEL_COLOR_SETTINGS:
PANEL_COLOR_SETTINGS_BASE RESETTABLE_PANEL PANEL_EESCHEMA_COLOR_SETTINGS PANEL_FP_EDITOR_COLOR_SETTINGS PANEL_GERBVIEW_COLOR_SETTINGS PANEL_PCBNEW_COLOR_SETTINGS

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.
 
virtual wxString GetResetTooltip () const override
 Get the tooltip the reset button should display when showing this panel.
 
bool Show (bool show) override
 
wxString GetHelpTextAtPoint (const wxPoint &aPt, wxHelpEvent::Origin aOrigin) const override
 Overridden to supply the reset button tooltip when queried with { -INT_MAX, INT_MAX }.
 

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)
 
virtual void createSwatches ()=0
 
void updateSwatches ()
 
void createThemeList (const wxString &aCurrent)
 Builds the theme listbox and sets the selection to the current theme.
 
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.
 
virtual void onNewThemeSelected ()
 Event fired when a new theme is selected that can be overridden in children.
 
virtual void onColorChanged ()
 Event fired when the user changes any color.
 
wxString GetSettingsDropdownName (COLOR_SETTINGS *aSettings)
 Retrieves the drop down name to be displayed for a color setting.
 
virtual void OnSize (wxSizeEvent &event)
 
virtual void OnOverrideItemColorsClicked (wxCommandEvent &event)
 

Protected Attributes

COLOR_SETTINGSm_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.
 
int m_backgroundLayer
 
std::string m_colorNamespace
 A namespace that will be passed to SETTINGS_MANAGER::SaveColorSettings.
 
wxBoxSizer * m_mainSizer
 
wxStaticText * m_staticText9
 
wxChoice * m_cbTheme
 
wxButton * m_btnOpenFolder
 
WX_PANELm_panel1
 
wxBoxSizer * m_colorsMainSizer
 
wxScrolledWindow * m_colorsListWindow
 
wxFlexGridSizer * m_colorsGridSizer
 
wxBoxSizer * m_previewPanelSizer
 

Detailed Description

Definition at line 32 of file panel_color_settings.h.

Member Enumeration Documentation

◆ COLOR_CONTEXT_ID

Enumerator
ID_COPY 
ID_PASTE 
ID_REVERT 

Definition at line 39 of file panel_color_settings.h.

Constructor & Destructor Documentation

◆ PANEL_COLOR_SETTINGS()

◆ ~PANEL_COLOR_SETTINGS()

PANEL_COLOR_SETTINGS::~PANEL_COLOR_SETTINGS ( )
default

Member Function Documentation

◆ createSwatch()

◆ createSwatches()

virtual void PANEL_COLOR_SETTINGS::createSwatches ( )
protectedpure virtual

◆ createThemeList()

void PANEL_COLOR_SETTINGS::createThemeList ( const wxString &  aCurrent)
protected

◆ GetHelpTextAtPoint()

wxString RESETTABLE_PANEL::GetHelpTextAtPoint ( const wxPoint &  aPt,
wxHelpEvent::Origin  aOrigin 
) const
inlineoverrideinherited

Overridden to supply the reset button tooltip when queried with { -INT_MAX, INT_MAX }.

Definition at line 72 of file resettable_panel.h.

References RESETTABLE_PANEL::GetResetTooltip().

◆ GetResetTooltip()

virtual wxString PANEL_COLOR_SETTINGS::GetResetTooltip ( ) const
inlineoverridevirtual

Get the tooltip the reset button should display when showing this panel.

Returns
the tooltip

Reimplemented from RESETTABLE_PANEL.

Definition at line 48 of file panel_color_settings.h.

References _.

◆ GetSettingsDropdownName()

wxString PANEL_COLOR_SETTINGS::GetSettingsDropdownName ( COLOR_SETTINGS aSettings)
protected

Retrieves the drop down name to be displayed for a color setting.

Definition at line 389 of file panel_color_settings.cpp.

References _, COLOR_SETTINGS::GetName(), JSON_SETTINGS::IsReadOnly(), and name.

Referenced by createThemeList(), and OnThemeChanged().

◆ OnBtnOpenThemeFolderClicked()

void PANEL_COLOR_SETTINGS::OnBtnOpenThemeFolderClicked ( wxCommandEvent &  event)
overrideprotectedvirtual

◆ onColorChanged()

virtual void PANEL_COLOR_SETTINGS::onColorChanged ( )
inlineprotectedvirtual

Event fired when the user changes any color.

Reimplemented in PANEL_EESCHEMA_COLOR_SETTINGS, and PANEL_PCBNEW_COLOR_SETTINGS.

Definition at line 98 of file panel_color_settings.h.

Referenced by updateColor().

◆ OnColorChanged()

void PANEL_COLOR_SETTINGS::OnColorChanged ( wxCommandEvent &  aEvent)
protected

Definition at line 334 of file panel_color_settings.cpp.

References FIRST_BUTTON_ID, COLOR_SWATCH::GetSwatchColor(), and updateColor().

Referenced by createSwatch().

◆ OnLeftDownTheme()

void PANEL_COLOR_SETTINGS::OnLeftDownTheme ( wxMouseEvent &  event)
overrideprotectedvirtual

◆ onNewThemeSelected()

virtual void PANEL_COLOR_SETTINGS::onNewThemeSelected ( )
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 93 of file panel_color_settings.h.

Referenced by createSwatch(), OnThemeChanged(), and Show().

◆ OnOverrideItemColorsClicked()

virtual void PANEL_COLOR_SETTINGS_BASE::OnOverrideItemColorsClicked ( wxCommandEvent &  event)
inlineprotectedvirtualinherited

◆ OnSize()

virtual void PANEL_COLOR_SETTINGS_BASE::OnSize ( wxSizeEvent &  event)
inlineprotectedvirtualinherited

◆ OnThemeChanged()

◆ ResetPanel()

◆ saveCurrentTheme()

◆ Show()

bool PANEL_COLOR_SETTINGS::Show ( bool  show)
override

◆ ShowColorContextMenu()

void PANEL_COLOR_SETTINGS::ShowColorContextMenu ( wxMouseEvent &  aEvent,
int  aLayer 
)
protected

◆ updateColor()

void PANEL_COLOR_SETTINGS::updateColor ( int  aLayer,
const KIGFX::COLOR4D aColor 
)
protected

◆ updateSwatches()

void PANEL_COLOR_SETTINGS::updateSwatches ( )
protected

◆ validateSave()

virtual bool PANEL_COLOR_SETTINGS::validateSave ( bool  aQuiet = false)
inlineprotectedvirtual

Performs a pre-save validation of the current color theme.

Parameters
aQuietwill suppress any warning output (prompt dialogs)
Returns
true if save is allowed

Reimplemented in PANEL_EESCHEMA_COLOR_SETTINGS.

Definition at line 85 of file panel_color_settings.h.

Referenced by saveCurrentTheme().

Member Data Documentation

◆ m_backgroundLayer

◆ m_btnOpenFolder

wxButton* PANEL_COLOR_SETTINGS_BASE::m_btnOpenFolder
protectedinherited

◆ m_cbTheme

◆ m_colorNamespace

std::string PANEL_COLOR_SETTINGS::m_colorNamespace
protected

◆ m_colorsGridSizer

◆ m_colorsListWindow

◆ m_colorsMainSizer

wxBoxSizer* PANEL_COLOR_SETTINGS_BASE::m_colorsMainSizer
protectedinherited

◆ m_copied

KIGFX::COLOR4D PANEL_COLOR_SETTINGS::m_copied
protected

Definition at line 110 of file panel_color_settings.h.

Referenced by ShowColorContextMenu().

◆ m_currentSettings

◆ m_labels

std::map<int, wxStaticText*> PANEL_COLOR_SETTINGS::m_labels
protected

◆ m_mainSizer

wxBoxSizer* PANEL_COLOR_SETTINGS_BASE::m_mainSizer
protectedinherited

◆ m_optOverrideColors

◆ m_panel1

◆ m_previewPanelSizer

wxBoxSizer* PANEL_COLOR_SETTINGS_BASE::m_previewPanelSizer
protectedinherited

◆ m_staticText9

wxStaticText* PANEL_COLOR_SETTINGS_BASE::m_staticText9
protectedinherited

◆ m_swatches

std::map<int, COLOR_SWATCH*> PANEL_COLOR_SETTINGS::m_swatches
protected

◆ m_validLayers

std::vector<int> PANEL_COLOR_SETTINGS::m_validLayers
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 120 of file panel_color_settings.h.

Referenced by PANEL_GERBVIEW_COLOR_SETTINGS::createSwatches(), 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_GERBVIEW_COLOR_SETTINGS::PANEL_GERBVIEW_COLOR_SETTINGS(), PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS(), saveCurrentTheme(), and PANEL_EESCHEMA_COLOR_SETTINGS::saveCurrentTheme().


The documentation for this class was generated from the following files: