KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PANEL_EESCHEMA_COLOR_SETTINGS Class Reference

#include <panel_eeschema_color_settings.h>

Inheritance diagram for PANEL_EESCHEMA_COLOR_SETTINGS:
PANEL_COLOR_SETTINGS PANEL_COLOR_SETTINGS_BASE RESETTABLE_PANEL

Public Types

enum  COLOR_CONTEXT_ID { ID_COPY = wxID_HIGHEST + 1 , ID_PASTE , ID_REVERT }
 

Public Member Functions

 PANEL_EESCHEMA_COLOR_SETTINGS (wxWindow *aParent)
 
 ~PANEL_EESCHEMA_COLOR_SETTINGS () override
 
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

bool TransferDataFromWindow () override
 
bool TransferDataToWindow () override
 
void OnOverrideItemColorsClicked (wxCommandEvent &aEvent) override
 
void OnSize (wxSizeEvent &aEvent) 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.
 
bool validateSave (bool aQuiet=false) override
 Performs a pre-save validation of the current color theme.
 
bool saveCurrentTheme (bool aValidate) override
 
void createSwatches () override
 
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.
 
void createSwatch (int aLayer, const wxString &aName)
 
void updateColor (int aLayer, const KIGFX::COLOR4D &aColor)
 
wxString GetSettingsDropdownName (COLOR_SETTINGS *aSettings)
 Retrieves the drop down name to be displayed for a color setting.
 

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
 

Private Member Functions

void createPreviewItems ()
 
void updatePreview ()
 
void updateAllowedSwatches ()
 
void zoomFitPreview ()
 

Private Attributes

SCH_PREVIEW_PANELm_preview
 
PAGE_INFOm_page
 
TITLE_BLOCKm_titleBlock
 
DS_PROXY_VIEW_ITEMm_drawingSheet
 
std::vector< EDA_ITEM * > m_previewItems
 
GAL_DISPLAY_OPTIONS_IMPL m_galDisplayOptions
 
EDA_DRAW_PANEL_GAL::GAL_TYPE m_galType
 

Detailed Description

Definition at line 36 of file panel_eeschema_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_EESCHEMA_COLOR_SETTINGS()

◆ ~PANEL_EESCHEMA_COLOR_SETTINGS()

PANEL_EESCHEMA_COLOR_SETTINGS::~PANEL_EESCHEMA_COLOR_SETTINGS ( )
override

Member Function Documentation

◆ createPreviewItems()

void PANEL_EESCHEMA_COLOR_SETTINGS::createPreviewItems ( )
private

Definition at line 241 of file panel_eeschema_color_settings.cpp.

References _, KIGFX::VIEW::Add(), LIB_SYMBOL::AddDrawItem(), SCH_SHAPE::AddPoint(), SCH_ITEM::AutoplaceFields(), SCH_SHEET::AutoplaceFields(), PAGE_INFO::Custom, SCH_ITEM::GetEndPoints(), SCH_SHEET::GetFields(), LIB_SYMBOL::GetReferenceField(), SCH_LINE::GetStroke(), LIB_SYMBOL::GetValueField(), EDA_DRAW_PANEL_GAL::GetView(), GR_TEXT_H_ALIGN_LEFT, SCH_ITEM::IsConnectable(), LAYER_BUS, LAYER_DEVICE, LAYER_NOTES, LAYER_SCHEMATIC_DRAWINGSHEET, LAYER_SCHEMATIC_PAGE_LIMITS, LAYER_WIRE, SPIN_STYLE::LEFT, m_drawingSheet, m_page, m_preview, m_previewItems, m_titleBlock, MILS_POINT, EDA_IU_SCALE::MilsToIU(), pin, PIN_END, SPIN_STYLE::RIGHT, schIUScale, SCH_ITEM::SetBodyStyle(), DS_PROXY_VIEW_ITEM::SetColorLayer(), TITLE_BLOCK::SetDate(), SCH_LINE::SetEndPoint(), EDA_SHAPE::SetFillMode(), PAGE_INFO::SetHeightMils(), EDA_TEXT::SetHorizJustify(), SCH_LABEL_BASE::SetIsDangling(), SCH_ITEM::SetLayer(), STROKE_PARAMS::SetLineStyle(), DS_PROXY_VIEW_ITEM::SetPageBorderColorLayer(), EDA_ITEM::SetParent(), SYMBOL::SetPinNameOffset(), SCH_BUS_ENTRY_BASE::SetPosition(), SCH_FIELD::SetPosition(), SCH_NO_CONNECT::SetPosition(), EDA_ITEM::SetSelected(), SYMBOL::SetShowPinNames(), SYMBOL::SetShowPinNumbers(), SCH_LABEL_BASE::SetSpinStyle(), SCH_GLOBALLABEL::SetSpinStyle(), SCH_HIERLABEL::SetSpinStyle(), SCH_LINE::SetStartPoint(), SCH_LINE::SetStroke(), SCH_SHAPE::SetStroke(), SCH_FIELD::SetText(), TITLE_BLOCK::SetTitle(), SCH_ITEM::SetUnit(), STROKE_PARAMS::SetWidth(), PAGE_INFO::SetWidthMils(), SHEETFILENAME, SHEETNAME, DANGLING_END_ITEM_HELPER::sort_dangling_end_items(), SCH_ITEM::UpdateDanglingState(), VECTOR2< T >::x, VECTOR2< T >::y, and zoomFitPreview().

Referenced by createSwatches().

◆ createSwatch()

◆ createSwatches()

◆ createThemeList()

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

◆ 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
inlineoverridevirtualinherited

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)
protectedinherited

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

Definition at line 387 of file panel_color_settings.cpp.

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

Referenced by PANEL_COLOR_SETTINGS::createThemeList(), and PANEL_COLOR_SETTINGS::OnThemeChanged().

◆ OnBtnOpenThemeFolderClicked()

void PANEL_COLOR_SETTINGS::OnBtnOpenThemeFolderClicked ( wxCommandEvent &  event)
overrideprotectedvirtualinherited

◆ onColorChanged()

void PANEL_EESCHEMA_COLOR_SETTINGS::onColorChanged ( )
overrideprotectedvirtual

Event fired when the user changes any color.

Reimplemented from PANEL_COLOR_SETTINGS.

Definition at line 475 of file panel_eeschema_color_settings.cpp.

References updatePreview().

◆ OnColorChanged()

void PANEL_COLOR_SETTINGS::OnColorChanged ( wxCommandEvent &  aEvent)
protectedinherited

◆ OnLeftDownTheme()

void PANEL_COLOR_SETTINGS::OnLeftDownTheme ( wxMouseEvent &  event)
overrideprotectedvirtualinherited

◆ onNewThemeSelected()

void PANEL_EESCHEMA_COLOR_SETTINGS::onNewThemeSelected ( )
overrideprotectedvirtual

Event fired when a new theme is selected that can be overridden in children.

Reimplemented from PANEL_COLOR_SETTINGS.

Definition at line 235 of file panel_eeschema_color_settings.cpp.

References updatePreview().

◆ OnOverrideItemColorsClicked()

void PANEL_EESCHEMA_COLOR_SETTINGS::OnOverrideItemColorsClicked ( wxCommandEvent &  aEvent)
overrideprotectedvirtual

◆ OnSize()

void PANEL_EESCHEMA_COLOR_SETTINGS::OnSize ( wxSizeEvent &  aEvent)
overrideprotectedvirtual

Reimplemented from PANEL_COLOR_SETTINGS_BASE.

Definition at line 525 of file panel_eeschema_color_settings.cpp.

References zoomFitPreview().

◆ OnThemeChanged()

◆ ResetPanel()

void PANEL_EESCHEMA_COLOR_SETTINGS::ResetPanel ( )
overridevirtual

Reset the contents of this panel.

Reimplemented from PANEL_COLOR_SETTINGS.

Definition at line 481 of file panel_eeschema_color_settings.cpp.

References PANEL_COLOR_SETTINGS::ResetPanel(), and updatePreview().

◆ saveCurrentTheme()

◆ Show()

◆ ShowColorContextMenu()

◆ TransferDataFromWindow()

◆ TransferDataToWindow()

bool PANEL_EESCHEMA_COLOR_SETTINGS::TransferDataToWindow ( )
overrideprotected

Definition at line 128 of file panel_eeschema_color_settings.cpp.

References zoomFitPreview().

◆ updateAllowedSwatches()

◆ updateColor()

◆ updatePreview()

◆ updateSwatches()

◆ validateSave()

bool PANEL_EESCHEMA_COLOR_SETTINGS::validateSave ( bool  aQuiet = false)
overrideprotectedvirtual

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 from PANEL_COLOR_SETTINGS.

Definition at line 135 of file panel_eeschema_color_settings.cpp.

References _, COLOR_SETTINGS::GetColor(), LAYER_SCHEMATIC_BACKGROUND, LAYER_SHEET_BACKGROUND, PANEL_COLOR_SETTINGS::m_currentSettings, SCH_LAYER_ID_END, and SCH_LAYER_ID_START.

◆ zoomFitPreview()

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
protectedinherited

◆ m_colorsGridSizer

wxFlexGridSizer* PANEL_COLOR_SETTINGS_BASE::m_colorsGridSizer
protectedinherited

◆ m_colorsListWindow

wxScrolledWindow* PANEL_COLOR_SETTINGS_BASE::m_colorsListWindow
protectedinherited

◆ m_colorsMainSizer

wxBoxSizer* PANEL_COLOR_SETTINGS_BASE::m_colorsMainSizer
protectedinherited

◆ m_copied

KIGFX::COLOR4D PANEL_COLOR_SETTINGS::m_copied
protectedinherited

Definition at line 110 of file panel_color_settings.h.

Referenced by PANEL_COLOR_SETTINGS::ShowColorContextMenu().

◆ m_currentSettings

◆ m_drawingSheet

DS_PROXY_VIEW_ITEM* PANEL_EESCHEMA_COLOR_SETTINGS::m_drawingSheet
private

◆ m_galDisplayOptions

GAL_DISPLAY_OPTIONS_IMPL PANEL_EESCHEMA_COLOR_SETTINGS::m_galDisplayOptions
private

◆ m_galType

EDA_DRAW_PANEL_GAL::GAL_TYPE PANEL_EESCHEMA_COLOR_SETTINGS::m_galType
private

◆ m_labels

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

◆ m_mainSizer

wxBoxSizer* PANEL_COLOR_SETTINGS_BASE::m_mainSizer
protectedinherited

◆ m_optOverrideColors

◆ m_page

PAGE_INFO* PANEL_EESCHEMA_COLOR_SETTINGS::m_page
private

◆ m_panel1

◆ m_preview

SCH_PREVIEW_PANEL* PANEL_EESCHEMA_COLOR_SETTINGS::m_preview
private

◆ m_previewItems

std::vector<EDA_ITEM*> PANEL_EESCHEMA_COLOR_SETTINGS::m_previewItems
private

◆ m_previewPanelSizer

wxBoxSizer* PANEL_COLOR_SETTINGS_BASE::m_previewPanelSizer
protectedinherited

◆ m_staticText9

wxStaticText* PANEL_COLOR_SETTINGS_BASE::m_staticText9
protectedinherited

◆ m_swatches

◆ m_titleBlock

TITLE_BLOCK* PANEL_EESCHEMA_COLOR_SETTINGS::m_titleBlock
private

◆ m_validLayers

std::vector<int> PANEL_COLOR_SETTINGS::m_validLayers
protectedinherited

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(), PANEL_COLOR_SETTINGS::OnThemeChanged(), 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(), PANEL_COLOR_SETTINGS::saveCurrentTheme(), and saveCurrentTheme().


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