KiCad PCB EDA Suite
PANEL_PCBNEW_COLOR_SETTINGS Class Reference

#include <panel_pcbnew_color_settings.h>

Inheritance diagram for PANEL_PCBNEW_COLOR_SETTINGS:
PANEL_COLOR_SETTINGS PANEL_COLOR_SETTINGS_BASE RESETTABLE_PANEL

Public Member Functions

 PANEL_PCBNEW_COLOR_SETTINGS (PCB_EDIT_FRAME *aFrame, wxWindow *aParent)
 
 ~PANEL_PCBNEW_COLOR_SETTINGS () override
 
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...
 

Public Attributes

wxCheckBox * m_optOverrideColors
 

Protected Types

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

Protected Member Functions

bool TransferDataFromWindow () override
 
bool TransferDataToWindow () override
 
void OnSize (wxSizeEvent &aEvent) override
 
void onNewThemeSelected () override
 Event fired when a new theme is selected that can be overridden in children. More...
 
void onColorChanged () override
 Event fired when the user changes any color. More...
 
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 createThemeList (const wxString &aCurrent)
 
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 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. 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
 

Private Member Functions

void createPreviewItems ()
 
void createSwatches ()
 
void updatePreview ()
 
void zoomFitPreview ()
 

Private Attributes

PCB_EDIT_FRAMEm_frame
 
FOOTPRINT_PREVIEW_PANELm_preview
 
PAGE_INFOm_page
 
TITLE_BLOCKm_titleBlock
 

Detailed Description

Definition at line 39 of file panel_pcbnew_color_settings.h.

Member Enumeration Documentation

◆ COLOR_CONTEXT_ID

Constructor & Destructor Documentation

◆ PANEL_PCBNEW_COLOR_SETTINGS()

PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS ( PCB_EDIT_FRAME aFrame,
wxWindow *  aParent 
)

Definition at line 372 of file panel_pcbnew_color_settings.cpp.

374  : PANEL_COLOR_SETTINGS( aParent ),
375  m_frame( aFrame ),
376  m_preview( nullptr ),
377  m_page( nullptr ),
378  m_titleBlock( nullptr )
379 {
380  m_colorNamespace = "board";
381 
382  SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
383 
384  mgr.ReloadColorSettings();
385 
386  PCBNEW_SETTINGS* app_settings = mgr.GetAppSettings<PCBNEW_SETTINGS>();
387  COLOR_SETTINGS* current = mgr.GetColorSettings( app_settings->m_ColorTheme );
388 
389  createThemeList( app_settings->m_ColorTheme );
390 
391  // Currently this only applies to eeschema
392  m_optOverrideColors->Hide();
393 
394  m_currentSettings = new COLOR_SETTINGS( *current );
395 
396  for( int id = GAL_LAYER_ID_START; id < GAL_LAYER_ID_BITMASK_END; id++ )
397  {
398  if( g_excludedLayers.count( id ) )
399  continue;
400 
401  m_validLayers.push_back( id );
402  }
403 
404  // NOTE: Main board layers are added by createSwatches()
405 
407 
408  m_colorsMainSizer->Insert( 0, 10, 0, 0, wxEXPAND, 5 );
409 
410  createSwatches();
411 
413  m_preview->GetGAL()->SetAxesEnabled( false );
414 
415  m_colorsMainSizer->Add( 10, 0, 0, wxEXPAND, 5 );
416  m_colorsMainSizer->Add( m_preview, 1, wxALL | wxEXPAND, 5 );
417  m_colorsMainSizer->Add( 10, 0, 0, wxEXPAND, 5 );
418 
420  updatePreview();
421  zoomFitPreview();
422 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_holder.h:56
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
This is the end of the layers used for visibility bitmasks in Pcbnew There can be at most 32 layers a...
std::string m_colorNamespace
A namespace that will be passed to SETTINGS_MANAGER::SaveColorSettings.
void createThemeList(const wxString &aCurrent)
COLOR_SETTINGS * m_currentSettings
static FOOTPRINT_PREVIEW_PANEL * New(KIWAY *aKiway, wxWindow *aParent)
KIGFX::GAL * GetGAL() const
Function GetGAL() Returns a pointer to the GAL instance used in the panel.
AppSettings * GetAppSettings(bool aLoadNow=true)
Returns a handle to the a given settings by type If the settings have already been loaded,...
PANEL_COLOR_SETTINGS(wxWindow *aParent)
void SetAxesEnabled(bool aAxesEnabled)
Enables drawing the axes.
std::vector< int > m_validLayers
A list of layer IDs that are valid for the current color settings dialog.
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
void ReloadColorSettings()
Re-scans the color themes directory, reloading any changes it finds.
std::set< int > g_excludedLayers
Color settings are a bit different than most of the settings objects in that there can be more than o...
FOOTPRINT_PREVIEW_PANEL * m_preview
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:174

References createPreviewItems(), createSwatches(), PANEL_COLOR_SETTINGS::createThemeList(), g_excludedLayers, GAL_LAYER_ID_BITMASK_END, GAL_LAYER_ID_START, SETTINGS_MANAGER::GetAppSettings(), SETTINGS_MANAGER::GetColorSettings(), EDA_DRAW_PANEL_GAL::GetGAL(), KIWAY_HOLDER::Kiway(), LAYER_PCB_BACKGROUND, PANEL_COLOR_SETTINGS::m_backgroundLayer, PANEL_COLOR_SETTINGS::m_colorNamespace, PANEL_COLOR_SETTINGS_BASE::m_colorsMainSizer, APP_SETTINGS_BASE::m_ColorTheme, PANEL_COLOR_SETTINGS::m_currentSettings, m_frame, PANEL_COLOR_SETTINGS_BASE::m_optOverrideColors, m_preview, PANEL_COLOR_SETTINGS::m_validLayers, FOOTPRINT_PREVIEW_PANEL::New(), Pgm(), SETTINGS_MANAGER::ReloadColorSettings(), KIGFX::GAL::SetAxesEnabled(), updatePreview(), and zoomFitPreview().

◆ ~PANEL_PCBNEW_COLOR_SETTINGS()

PANEL_PCBNEW_COLOR_SETTINGS::~PANEL_PCBNEW_COLOR_SETTINGS ( )
override

Definition at line 425 of file panel_pcbnew_color_settings.cpp.

426 {
427  delete m_page;
428  delete m_titleBlock;
429  delete m_currentSettings;
430 }
COLOR_SETTINGS * m_currentSettings

References PANEL_COLOR_SETTINGS::m_currentSettings, m_page, and m_titleBlock.

Member Function Documentation

◆ createPreviewItems()

void PANEL_PCBNEW_COLOR_SETTINGS::createPreviewItems ( )
private

Definition at line 495 of file panel_pcbnew_color_settings.cpp.

496 {
499  m_titleBlock->SetTitle( _( "Color Preview" ) );
500  m_titleBlock->SetDate( wxDateTime::Now().FormatDate() );
501 
502  m_page->SetHeightMils( 5000 );
503  m_page->SetWidthMils( 6000 );
504 
505  STRING_LINE_READER reader( g_previewBoard, "preview" );
506  PCB_IO pi;
507 
508  try
509  {
510  pi.DoLoad( reader, m_preview->GetBoard(), nullptr );
511  }
512  catch( const IO_ERROR& ioe )
513  {
514  return;
515  }
516 
519 
520  auto worksheet = new KIGFX::WS_PROXY_VIEW_ITEM( (int) IU_PER_MILS, m_page, nullptr,
521  m_titleBlock );
522  worksheet->SetColorLayer( LAYER_WORKSHEET );
523  m_preview->SetWorksheet( worksheet );
524 
525  zoomFitPreview();
526 }
PCB_IO is a PLUGIN derivation for saving and loading Pcbnew s-expression formatted files.
std::string g_previewBoard
void SetDate(const wxString &aDate)
Function SetDate sets the date field, and defaults to the current time and date.
Definition: title_block.h:74
static const wxChar Custom[]
"User" defined page type
Definition: page_info.h:79
TITLE_BLOCK holds the information shown in the lower right corner of a plot, printout,...
Definition: title_block.h:40
void DisplayBoard(BOARD *aBoard)
Function DisplayBoard adds all items from the current board to the VIEW, so they can be displayed by ...
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 SetTitle(const wxString &aTitle)
Definition: title_block.h:60
void SetHeightMils(int aHeightInMils)
Definition: page_info.cpp:257
void UpdateColors()
Updates the color settings in the painter and GAL.
void SetWorksheet(KIGFX::WS_PROXY_VIEW_ITEM *aWorksheet)
Function SetWorksheet Sets (or updates) worksheet used by the draw panel.
#define _(s)
Definition: 3d_actions.cpp:33
void SetWidthMils(int aWidthInMils)
Definition: page_info.cpp:243
#define IU_PER_MILS
Definition: plotter.cpp:138
FOOTPRINT_PREVIEW_PANEL * m_preview
STRING_LINE_READER is a LINE_READER that reads from a multiline 8 bit wide std::string.
Definition: richio.h:254
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
BOARD * DoLoad(LINE_READER &aReader, BOARD *aAppendToMe, const PROPERTIES *aProperties)

References _, PAGE_INFO::Custom, PCB_DRAW_PANEL_GAL::DisplayBoard(), PCB_IO::DoLoad(), g_previewBoard, FOOTPRINT_PREVIEW_PANEL::GetBoard(), IU_PER_MILS, LAYER_WORKSHEET, m_page, m_preview, m_titleBlock, TITLE_BLOCK::SetDate(), PAGE_INFO::SetHeightMils(), TITLE_BLOCK::SetTitle(), PAGE_INFO::SetWidthMils(), PCB_DRAW_PANEL_GAL::SetWorksheet(), PCB_DRAW_PANEL_GAL::UpdateColors(), and zoomFitPreview().

Referenced by PANEL_PCBNEW_COLOR_SETTINGS().

◆ createSwatch()

void PANEL_COLOR_SETTINGS::createSwatch ( int  aLayer,
const wxString &  aName 
)
protectedinherited

Definition at line 197 of file panel_color_settings.cpp.

198 {
199  wxStaticText* label = new wxStaticText( m_colorsListWindow, wxID_ANY, aName );
200 
201  // The previously selected theme can be deleted and cannot be selected.
202  // so select the default theme (first theme of the list)
203  if( m_cbTheme->GetSelection() < 0 )
204  {
205  m_cbTheme->SetSelection( 0 );
207  }
208 
209  void* clientData = m_cbTheme->GetClientData( m_cbTheme->GetSelection() );
210  COLOR_SETTINGS* selected = static_cast<COLOR_SETTINGS*>( clientData );
211 
212  int id = FIRST_BUTTON_ID + aLayer;
213  COLOR4D defaultColor = selected->GetDefaultColor( aLayer );
215  COLOR4D backgroundColor = m_currentSettings->GetColor( m_backgroundLayer );
216 
217  COLOR_SWATCH* swatch = new COLOR_SWATCH( m_colorsListWindow, color, id, backgroundColor,
218  defaultColor, SWATCH_MEDIUM );
219  swatch->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
220 
221  m_colorsGridSizer->Add( label, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxLEFT, 5 );
222  m_colorsGridSizer->Add( swatch, 0, wxALIGN_CENTER_VERTICAL | wxALL, 3 );
223 
224  m_labels[aLayer] = label;
225  m_swatches[aLayer] = swatch;
226 
227  swatch->Bind( wxEVT_RIGHT_DOWN,
228  [&, aLayer]( wxMouseEvent& aEvent )
229  {
230  ShowColorContextMenu( aEvent, aLayer );
231  } );
232  swatch->Bind( COLOR_SWATCH_CHANGED, &PANEL_COLOR_SETTINGS::OnColorChanged, this );
233 }
int color
Definition: DXF_plotter.cpp:61
std::map< int, wxStaticText * > m_labels
virtual void onNewThemeSelected()
Event fired when a new theme is selected that can be overridden in children.
std::map< int, COLOR_SWATCH * > m_swatches
void ShowColorContextMenu(wxMouseEvent &aEvent, int aLayer)
COLOR_SETTINGS * m_currentSettings
COLOR4D GetDefaultColor(int aLayer)
constexpr int FIRST_BUTTON_ID
COLOR4D GetColor(int aLayer) const
Class representing a simple color swatch, of the kind used to set layer colors.
Definition: color_swatch.h:53
Color settings are a bit different than most of the settings objects in that there can be more than o...
void OnColorChanged(wxCommandEvent &aEvent)
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99

References color, FIRST_BUTTON_ID, COLOR_SETTINGS::GetColor(), COLOR_SETTINGS::GetDefaultColor(), PANEL_COLOR_SETTINGS::m_backgroundLayer, PANEL_COLOR_SETTINGS_BASE::m_cbTheme, PANEL_COLOR_SETTINGS_BASE::m_colorsGridSizer, PANEL_COLOR_SETTINGS_BASE::m_colorsListWindow, PANEL_COLOR_SETTINGS::m_currentSettings, PANEL_COLOR_SETTINGS::m_labels, PANEL_COLOR_SETTINGS::m_swatches, PANEL_COLOR_SETTINGS::OnColorChanged(), PANEL_COLOR_SETTINGS::onNewThemeSelected(), PANEL_COLOR_SETTINGS::ShowColorContextMenu(), and SWATCH_MEDIUM.

Referenced by PANEL_MODEDIT_COLOR_SETTINGS::createSwatches(), createSwatches(), and PANEL_EESCHEMA_COLOR_SETTINGS::createSwatches().

◆ createSwatches()

void PANEL_PCBNEW_COLOR_SETTINGS::createSwatches ( )
private

Definition at line 457 of file panel_pcbnew_color_settings.cpp.

458 {
459  std::sort( m_validLayers.begin(), m_validLayers.end(),
460  []( int a, int b )
461  {
462  return LayerName( a ) < LayerName( b );
463  } );
464 
465  // Don't sort board layers by name
466  for( int i = PCBNEW_LAYER_ID_START; i <= F_Fab; ++i )
467  m_validLayers.insert( m_validLayers.begin() + i, i );
468 
469  BOARD* board = m_frame->GetBoard();
470 
471  for( int layer : m_validLayers )
472  {
473  wxString name = LayerName( layer );
474 
475  if( board && layer >= PCBNEW_LAYER_ID_START && layer < PCB_LAYER_ID_COUNT )
476  name = board->GetLayerName( static_cast<PCB_LAYER_ID>( layer ) );
477 
478  createSwatch( layer, name );
479  }
480 
481  // Give a minimal width to m_colorsListWindow, in order to always having
482  // a full row shown
483  int min_width = m_colorsGridSizer->GetMinSize().x;
484  const int margin = 20; // A margin around the sizer
485  m_colorsListWindow->SetMinSize( wxSize( min_width + margin, -1 ) );
486 }
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer.
wxString LayerName(int aLayer)
Returns the string equivalent of a given layer.
Definition: layer_id.cpp:24
std::vector< int > m_validLayers
A list of layer IDs that are valid for the current color settings dialog.
const char * name
Definition: DXF_plotter.cpp:60
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:178
BOARD * GetBoard() const
void createSwatch(int aLayer, const wxString &aName)

References PANEL_COLOR_SETTINGS::createSwatch(), F_Fab, PCB_BASE_FRAME::GetBoard(), BOARD::GetLayerName(), LayerName(), PANEL_COLOR_SETTINGS_BASE::m_colorsGridSizer, PANEL_COLOR_SETTINGS_BASE::m_colorsListWindow, m_frame, PANEL_COLOR_SETTINGS::m_validLayers, name, PCB_LAYER_ID_COUNT, and PCBNEW_LAYER_ID_START.

Referenced by PANEL_PCBNEW_COLOR_SETTINGS().

◆ createThemeList()

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

Definition at line 169 of file panel_color_settings.cpp.

170 {
171  int width = 0;
172  int height = 0;
173 
174  m_cbTheme->GetTextExtent( _( "New Theme..." ), &width, &height );
175  int minwidth = width;
176 
177  m_cbTheme->Clear();
178 
179  for( COLOR_SETTINGS* settings : Pgm().GetSettingsManager().GetColorSettingsList() )
180  {
181  int pos = m_cbTheme->Append( settings->GetName(), static_cast<void*>( settings ) );
182 
183  if( settings->GetName() == aCurrent )
184  m_cbTheme->SetSelection( pos );
185 
186  m_cbTheme->GetTextExtent( settings->GetName(), &width, &height );
187  minwidth = std::max( minwidth, width );
188  }
189 
190  m_cbTheme->Append( wxT( "---" ) );
191  m_cbTheme->Append( _( "New Theme..." ) );
192 
193  m_cbTheme->SetMinSize( wxSize( minwidth + 50, -1 ) );
194 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
SETTINGS_MANAGER * GetSettingsManager()
#define _(s)
Definition: 3d_actions.cpp:33
Color settings are a bit different than most of the settings objects in that there can be more than o...

References _, GetSettingsManager(), PANEL_COLOR_SETTINGS_BASE::m_cbTheme, and Pgm().

Referenced by PANEL_COLOR_SETTINGS::OnLeftDownTheme(), PANEL_EESCHEMA_COLOR_SETTINGS::PANEL_EESCHEMA_COLOR_SETTINGS(), PANEL_MODEDIT_COLOR_SETTINGS::PANEL_MODEDIT_COLOR_SETTINGS(), and PANEL_PCBNEW_COLOR_SETTINGS().

◆ GetResetTooltip()

virtual wxString PANEL_COLOR_SETTINGS::GetResetTooltip ( )
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.

49  {
50  return _( "Reset all colors in this theme to the KiCad defaults" );
51  }
#define _(s)
Definition: 3d_actions.cpp:33

References _.

◆ OnBtnOpenThemeFolderClicked()

void PANEL_COLOR_SETTINGS::OnBtnOpenThemeFolderClicked ( wxCommandEvent &  event)
overrideprotectedvirtualinherited

Reimplemented from PANEL_COLOR_SETTINGS_BASE.

Definition at line 57 of file panel_color_settings.cpp.

58 {
60  LaunchExternal( dir );
61 }
static wxString GetColorSettingsPath()
Returns the path where color scheme files are stored (normally .
void LaunchExternal(const wxString &aPath)
Launches the given file or folder in the host OS.
Definition: launch_ext.cpp:26

References SETTINGS_MANAGER::GetColorSettingsPath(), and LaunchExternal().

◆ onColorChanged()

void PANEL_PCBNEW_COLOR_SETTINGS::onColorChanged ( )
overrideprotectedvirtual

Event fired when the user changes any color.

Reimplemented from PANEL_COLOR_SETTINGS.

Definition at line 529 of file panel_pcbnew_color_settings.cpp.

References updatePreview().

◆ OnColorChanged()

void PANEL_COLOR_SETTINGS::OnColorChanged ( wxCommandEvent &  aEvent)
protectedinherited

Definition at line 280 of file panel_color_settings.cpp.

281 {
282  COLOR_SWATCH* swatch = static_cast<COLOR_SWATCH*>( aEvent.GetEventObject() );
283  COLOR4D newColor = swatch->GetSwatchColor();
284  LAYER_NUM layer = static_cast<SCH_LAYER_ID>( swatch->GetId() - FIRST_BUTTON_ID );
285 
286  updateColor( layer, newColor );
287 }
KIGFX::COLOR4D GetSwatchColor() const
void updateColor(int aLayer, const KIGFX::COLOR4D &aColor)
constexpr int FIRST_BUTTON_ID
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
Class representing a simple color swatch, of the kind used to set layer colors.
Definition: color_swatch.h:53
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99

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

Referenced by PANEL_COLOR_SETTINGS::createSwatch().

◆ OnLeftDownTheme()

void PANEL_COLOR_SETTINGS::OnLeftDownTheme ( wxMouseEvent &  event)
overrideprotectedvirtualinherited

Reimplemented from PANEL_COLOR_SETTINGS_BASE.

Definition at line 82 of file panel_color_settings.cpp.

83 {
84  // Lazy rebuild of theme menu to catch any colour theme changes made in other panels
85  wxString sel = m_cbTheme->GetStringSelection();
86  createThemeList( sel );
87 
88  event.Skip();
89 }
void createThemeList(const wxString &aCurrent)

References PANEL_COLOR_SETTINGS::createThemeList(), and PANEL_COLOR_SETTINGS_BASE::m_cbTheme.

◆ onNewThemeSelected()

void PANEL_PCBNEW_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 489 of file panel_pcbnew_color_settings.cpp.

References updatePreview().

◆ OnOverrideItemColorsClicked()

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

◆ OnSize()

void PANEL_PCBNEW_COLOR_SETTINGS::OnSize ( wxSizeEvent &  aEvent)
overrideprotectedvirtual

Reimplemented from PANEL_COLOR_SETTINGS_BASE.

Definition at line 581 of file panel_pcbnew_color_settings.cpp.

582 {
583  zoomFitPreview();
584  aEvent.Skip();
585 }

References zoomFitPreview().

◆ OnThemeChanged()

void PANEL_COLOR_SETTINGS::OnThemeChanged ( wxCommandEvent &  aEvent)
overrideprotectedvirtualinherited

Reimplemented from PANEL_COLOR_SETTINGS_BASE.

Definition at line 91 of file panel_color_settings.cpp.

92 {
93  int idx = m_cbTheme->GetSelection();
94 
95  if( idx == static_cast<int>( m_cbTheme->GetCount() ) - 2 )
96  {
97  // separator; re-select active theme
98  m_cbTheme->SetStringSelection( m_currentSettings->GetName() );
99  return;
100  }
101 
102  if( idx == (int)m_cbTheme->GetCount() - 1 )
103  {
104  // New Theme...
105 
106  if( !saveCurrentTheme( false ) )
107  return;
108 
109  MODULE_NAME_CHAR_VALIDATOR themeNameValidator;
110  wxTextEntryDialog dlg( this, _( "New theme name:" ), _( "Add Color Theme" ) );
111  dlg.SetTextValidator( themeNameValidator );
112 
113  if( dlg.ShowModal() != wxID_OK )
114  return;
115 
116  wxString themeName = dlg.GetValue();
117  wxFileName fn( themeName + wxT( ".json" ) );
119 
120  if( fn.Exists() )
121  {
122  wxMessageBox( _( "Theme already exists!" ) );
123  return;
124  }
125 
126  SETTINGS_MANAGER& settingsMgr = Pgm().GetSettingsManager();
127  COLOR_SETTINGS* newSettings = settingsMgr.AddNewColorSettings( themeName );
128  newSettings->SetName( themeName );
129 
130  for( auto layer : m_validLayers )
131  newSettings->SetColor( layer, m_currentSettings->GetColor( layer ) );
132 
133  newSettings->SaveToFile( settingsMgr.GetPathForSettingsFile( newSettings ) );
134 
135  idx = m_cbTheme->Insert( themeName, idx - 1, static_cast<void*>( newSettings ) );
136  m_cbTheme->SetSelection( idx );
137 
138  m_optOverrideColors->SetValue( newSettings->GetOverrideSchItemColors() );
139 
140  *m_currentSettings = *newSettings;
142  }
143  else
144  {
145  COLOR_SETTINGS* selected = static_cast<COLOR_SETTINGS*>( m_cbTheme->GetClientData( idx ) );
146 
147  if( selected->GetFilename() != m_currentSettings->GetFilename() )
148  {
149  if( !saveCurrentTheme( false ) )
150  return;
151 
152  m_optOverrideColors->SetValue( selected->GetOverrideSchItemColors() );
153 
154  *m_currentSettings = *selected;
156 
158 
159  for( std::pair<int, COLOR_SWATCH*> pair : m_swatches )
160  {
161  pair.second->SetSwatchBackground( background );
162  pair.second->SetSwatchColor( m_currentSettings->GetColor( pair.first ), false );
163  }
164  }
165  }
166 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
virtual bool saveCurrentTheme(bool aValidate)
wxString GetFilename() const
Definition: json_settings.h:56
virtual void onNewThemeSelected()
Event fired when a new theme is selected that can be overridden in children.
std::map< int, COLOR_SWATCH * > m_swatches
const wxString & GetName() const
COLOR_SETTINGS * AddNewColorSettings(const wxString &aFilename)
Registers a new color settings object with the given filename.
virtual bool SaveToFile(const wxString &aDirectory="", bool aForce=false)
COLOR_SETTINGS * m_currentSettings
This class provides a custom wxValidator object for limiting the allowable characters when defining f...
Definition: validators.h:63
void SetName(const wxString &aName)
std::vector< int > m_validLayers
A list of layer IDs that are valid for the current color settings dialog.
static wxString GetColorSettingsPath()
Returns the path where color scheme files are stored (normally .
COLOR4D GetColor(int aLayer) const
#define _(s)
Definition: 3d_actions.cpp:33
Color settings are a bit different than most of the settings objects in that there can be more than o...
bool GetOverrideSchItemColors() const
wxString GetPathForSettingsFile(JSON_SETTINGS *aSettings)
Returns the path a given settings file should be loaded from / stored to.
void SetColor(int aLayer, COLOR4D aColor)
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99

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::m_backgroundLayer, PANEL_COLOR_SETTINGS_BASE::m_cbTheme, PANEL_COLOR_SETTINGS::m_currentSettings, PANEL_COLOR_SETTINGS_BASE::m_optOverrideColors, PANEL_COLOR_SETTINGS::m_swatches, PANEL_COLOR_SETTINGS::m_validLayers, PANEL_COLOR_SETTINGS::onNewThemeSelected(), Pgm(), PANEL_COLOR_SETTINGS::saveCurrentTheme(), JSON_SETTINGS::SaveToFile(), COLOR_SETTINGS::SetColor(), and COLOR_SETTINGS::SetName().

◆ ResetPanel()

void PANEL_PCBNEW_COLOR_SETTINGS::ResetPanel ( )
overridevirtual

Reset the contents of this panel.

Reimplemented from PANEL_COLOR_SETTINGS.

Definition at line 535 of file panel_pcbnew_color_settings.cpp.

536 {
538  updatePreview();
539 }
virtual void ResetPanel() override
Reset the contents of this panel.

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

◆ saveCurrentTheme()

bool PANEL_COLOR_SETTINGS::saveCurrentTheme ( bool  aValidate)
protectedvirtualinherited

Reimplemented in PANEL_EESCHEMA_COLOR_SETTINGS.

Definition at line 309 of file panel_color_settings.cpp.

310 {
311  if( aValidate && !validateSave() )
312  return false;
313 
314  SETTINGS_MANAGER& settingsMgr = Pgm().GetSettingsManager();
315  COLOR_SETTINGS* selected = settingsMgr.GetColorSettings( m_currentSettings->GetFilename() );
316 
317  selected->SetOverrideSchItemColors( m_optOverrideColors->GetValue() );
318 
319  for( auto layer : m_validLayers )
320  selected->SetColor( layer, m_currentSettings->GetColor( layer ) );
321 
322  settingsMgr.SaveColorSettings( selected, m_colorNamespace );
323 
324  return true;
325 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
wxString GetFilename() const
Definition: json_settings.h:56
std::string m_colorNamespace
A namespace that will be passed to SETTINGS_MANAGER::SaveColorSettings.
COLOR_SETTINGS * m_currentSettings
void SetOverrideSchItemColors(bool aFlag)
std::vector< int > m_validLayers
A list of layer IDs that are valid for the current color settings dialog.
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
COLOR4D GetColor(int aLayer) const
void SaveColorSettings(COLOR_SETTINGS *aSettings, const std::string &aNamespace="")
Safely saves a COLOR_SETTINGS to disk, preserving any changes outside the given namespace.
Color settings are a bit different than most of the settings objects in that there can be more than o...
virtual bool validateSave(bool aQuiet=false)
Performs a pre-save validation of the current color theme.
void SetColor(int aLayer, COLOR4D aColor)

References COLOR_SETTINGS::GetColor(), SETTINGS_MANAGER::GetColorSettings(), JSON_SETTINGS::GetFilename(), PANEL_COLOR_SETTINGS::m_colorNamespace, PANEL_COLOR_SETTINGS::m_currentSettings, PANEL_COLOR_SETTINGS_BASE::m_optOverrideColors, PANEL_COLOR_SETTINGS::m_validLayers, Pgm(), SETTINGS_MANAGER::SaveColorSettings(), COLOR_SETTINGS::SetColor(), COLOR_SETTINGS::SetOverrideSchItemColors(), and PANEL_COLOR_SETTINGS::validateSave().

Referenced by PANEL_COLOR_SETTINGS::OnThemeChanged(), PANEL_EESCHEMA_COLOR_SETTINGS::saveCurrentTheme(), PANEL_MODEDIT_COLOR_SETTINGS::TransferDataFromWindow(), and TransferDataFromWindow().

◆ ShowColorContextMenu()

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

Definition at line 236 of file panel_color_settings.cpp.

237 {
238  auto selected =
239  static_cast<COLOR_SETTINGS*>( m_cbTheme->GetClientData( m_cbTheme->GetSelection() ) );
240 
241  COLOR4D current = m_currentSettings->GetColor( aLayer );
242  COLOR4D saved = selected->GetColor( aLayer );
243 
244  wxMenu menu;
245 
246  AddMenuItem( &menu, ID_COPY, _( "Copy color" ), KiBitmap( copy_xpm ) );
247 
248  if( m_copied != COLOR4D::UNSPECIFIED )
249  AddMenuItem( &menu, ID_PASTE, _( "Paste color" ), KiBitmap( paste_xpm ) );
250 
251  if( current != saved )
252  AddMenuItem( &menu, ID_REVERT, _( "Revert to saved color" ), KiBitmap( undo_xpm ) );
253 
254  menu.Bind( wxEVT_COMMAND_MENU_SELECTED,
255  [&]( wxCommandEvent& aCmd )
256  {
257  switch( aCmd.GetId() )
258  {
259  case ID_COPY:
260  m_copied = current;
261  break;
262 
263  case ID_PASTE:
264  updateColor( aLayer, m_copied );
265  break;
266 
267  case ID_REVERT:
268  updateColor( aLayer, saved );
269  break;
270 
271  default:
272  aCmd.Skip();
273  }
274  } );
275 
276  PopupMenu( &menu );
277 }
wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmap &aImage, wxItemKind aType=wxITEM_NORMAL)
Function AddMenuItem is an inline helper function to create and insert a menu item with an icon into ...
Definition: bitmap.cpp:232
void updateColor(int aLayer, const KIGFX::COLOR4D &aColor)
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:80
COLOR_SETTINGS * m_currentSettings
const BITMAP_OPAQUE copy_xpm[1]
Definition: copy.cpp:67
const BITMAP_OPAQUE paste_xpm[1]
Definition: paste.cpp:69
COLOR4D GetColor(int aLayer) const
#define _(s)
Definition: 3d_actions.cpp:33
const BITMAP_OPAQUE undo_xpm[1]
Definition: undo.cpp:74
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99

References _, AddMenuItem(), copy_xpm, COLOR_SETTINGS::GetColor(), PANEL_COLOR_SETTINGS::ID_COPY, PANEL_COLOR_SETTINGS::ID_PASTE, PANEL_COLOR_SETTINGS::ID_REVERT, KiBitmap(), PANEL_COLOR_SETTINGS_BASE::m_cbTheme, PANEL_COLOR_SETTINGS::m_copied, PANEL_COLOR_SETTINGS::m_currentSettings, paste_xpm, undo_xpm, and PANEL_COLOR_SETTINGS::updateColor().

Referenced by PANEL_COLOR_SETTINGS::createSwatch().

◆ TransferDataFromWindow()

bool PANEL_PCBNEW_COLOR_SETTINGS::TransferDataFromWindow ( )
overrideprotected

Definition at line 433 of file panel_pcbnew_color_settings.cpp.

434 {
435  if( !saveCurrentTheme( true ) )
436  return false;
437 
439 
440  SETTINGS_MANAGER& settingsMgr = Pgm().GetSettingsManager();
441  PCBNEW_SETTINGS* app_settings = settingsMgr.GetAppSettings<PCBNEW_SETTINGS>();
442  app_settings->m_ColorTheme = m_currentSettings->GetFilename();
443 
445 
446  return true;
447 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
virtual bool saveCurrentTheme(bool aValidate)
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
wxString GetFilename() const
Definition: json_settings.h:56
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:199
COLOR_SETTINGS * m_currentSettings
AppSettings * GetAppSettings(bool aLoadNow=true)
Returns a handle to the a given settings by type If the settings have already been loaded,...
virtual KIGFX::PCB_VIEW * GetView() const override
Function GetView() Returns a pointer to the VIEW instance used in the panel.
virtual RENDER_SETTINGS * GetSettings()=0
Function GetAdapter Returns pointer to current settings that are going to be used when drawing items.
APPEARANCE_CONTROLS * GetAppearancePanel()
virtual void LoadColors(const COLOR_SETTINGS *aSettings)
void OnColorThemeChanged()
Updates the colors on all the widgets from the new chosen color theme
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:174

References PCB_EDIT_FRAME::GetAppearancePanel(), SETTINGS_MANAGER::GetAppSettings(), PCB_BASE_FRAME::GetCanvas(), JSON_SETTINGS::GetFilename(), KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), PCB_DRAW_PANEL_GAL::GetView(), KIGFX::RENDER_SETTINGS::LoadColors(), APP_SETTINGS_BASE::m_ColorTheme, PANEL_COLOR_SETTINGS::m_currentSettings, m_frame, APPEARANCE_CONTROLS::OnColorThemeChanged(), Pgm(), and PANEL_COLOR_SETTINGS::saveCurrentTheme().

◆ TransferDataToWindow()

bool PANEL_PCBNEW_COLOR_SETTINGS::TransferDataToWindow ( )
overrideprotected

Definition at line 450 of file panel_pcbnew_color_settings.cpp.

451 {
452  zoomFitPreview();
453  return true;
454 }

References zoomFitPreview().

◆ updateColor()

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

Definition at line 290 of file panel_color_settings.cpp.

291 {
292  if( m_currentSettings )
293  m_currentSettings->SetColor( aLayer, aColor );
294 
295  m_swatches[aLayer]->SetSwatchColor( aColor, false );
296 
297  if( m_currentSettings && aLayer == m_backgroundLayer )
298  {
300 
301  for( std::pair<int, COLOR_SWATCH*> pair : m_swatches )
302  pair.second->SetSwatchBackground( background );
303  }
304 
305  onColorChanged();
306 }
std::map< int, COLOR_SWATCH * > m_swatches
COLOR_SETTINGS * m_currentSettings
virtual void onColorChanged()
Event fired when the user changes any color.
COLOR4D GetColor(int aLayer) const
void SetColor(int aLayer, COLOR4D aColor)
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99

References COLOR_SETTINGS::GetColor(), PANEL_COLOR_SETTINGS::m_backgroundLayer, PANEL_COLOR_SETTINGS::m_currentSettings, PANEL_COLOR_SETTINGS::m_swatches, PANEL_COLOR_SETTINGS::onColorChanged(), and COLOR_SETTINGS::SetColor().

Referenced by PANEL_COLOR_SETTINGS::OnColorChanged(), and PANEL_COLOR_SETTINGS::ShowColorContextMenu().

◆ updatePreview()

void PANEL_PCBNEW_COLOR_SETTINGS::updatePreview ( )
private

Definition at line 542 of file panel_pcbnew_color_settings.cpp.

543 {
544  if( !m_preview )
545  return;
546 
547  KIGFX::VIEW* view = m_preview->GetView();
548  auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() );
549  settings->LoadColors( m_currentSettings );
550 
551  m_preview->GetGAL()->SetClearColor( settings->GetBackgroundColor() );
552 
553  view->UpdateAllItems( KIGFX::COLOR );
554  auto rect = m_preview->GetScreenRect();
555  m_preview->Refresh( true, &rect );
556 }
void SetClearColor(const COLOR4D &aColor)
void UpdateAllItems(int aUpdateFlags)
Updates all items in the view according to the given flags.
Definition: view.cpp:1435
Visibility flag has changed.
Definition: view_item.h:58
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:199
COLOR_SETTINGS * m_currentSettings
KIGFX::GAL * GetGAL() const
Function GetGAL() Returns a pointer to the GAL instance used in the panel.
virtual KIGFX::PCB_VIEW * GetView() const override
Function GetView() Returns a pointer to the VIEW instance used in the panel.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
virtual RENDER_SETTINGS * GetSettings()=0
Function GetAdapter Returns pointer to current settings that are going to be used when drawing items.
FOOTPRINT_PREVIEW_PANEL * m_preview
VIEW.
Definition: view.h:61

References KIGFX::COLOR, EDA_DRAW_PANEL_GAL::GetGAL(), KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), PCB_DRAW_PANEL_GAL::GetView(), PANEL_COLOR_SETTINGS::m_currentSettings, m_preview, EDA_DRAW_PANEL_GAL::Refresh(), KIGFX::GAL::SetClearColor(), and KIGFX::VIEW::UpdateAllItems().

Referenced by onColorChanged(), onNewThemeSelected(), PANEL_PCBNEW_COLOR_SETTINGS(), and ResetPanel().

◆ validateSave()

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

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 76 of file panel_color_settings.h.

77  {
78  return true;
79  }

Referenced by PANEL_COLOR_SETTINGS::saveCurrentTheme().

◆ zoomFitPreview()

void PANEL_PCBNEW_COLOR_SETTINGS::zoomFitPreview ( )
private

Definition at line 559 of file panel_pcbnew_color_settings.cpp.

560 {
561  KIGFX::VIEW* view = m_preview->GetView();
562  BOX2I bBox = m_preview->GetBoard()->GetBoundingBox();
563  BOX2I defaultBox = m_preview->GetDefaultViewBBox();
564 
565  view->SetScale( 1.0 );
566  VECTOR2D screenSize = view->ToWorld( m_preview->GetClientSize(), false );
567 
568  if( bBox.GetWidth() == 0 || bBox.GetHeight() == 0 )
569  bBox = defaultBox;
570 
571  VECTOR2D vsize = bBox.GetSize();
572  double scale = view->GetScale() / std::max( fabs( vsize.x / screenSize.x ),
573  fabs( vsize.y / screenSize.y ) );
574 
575  view->SetScale( scale / 1.1 );
576  view->SetCenter( bBox.Centre() );
578 }
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: class_board.h:760
void ForceRefresh()
Function ForceRefresh() Forces a redraw.
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Function ToWorld() Converts a screen space point/vector to a point/vector in world space coordinates.
Definition: view.cpp:474
void SetCenter(const VECTOR2D &aCenter)
Function SetCenter() Sets the center point of the VIEW (i.e.
Definition: view.cpp:603
coord_type GetWidth() const
Definition: box2.h:197
virtual KIGFX::PCB_VIEW * GetView() const override
Function GetView() Returns a pointer to the VIEW instance used in the panel.
BOX2I GetDefaultViewBBox() const override
virtual void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 })
Function SetScale() Sets the scaling factor, zooming around a given anchor point.
Definition: view.cpp:577
const int scale
Vec Centre() const
Definition: box2.h:79
coord_type GetHeight() const
Definition: box2.h:198
const Vec & GetSize() const
Definition: box2.h:189
FOOTPRINT_PREVIEW_PANEL * m_preview
VIEW.
Definition: view.h:61
double GetScale() const
Function GetScale()
Definition: view.h:257

References BOX2< Vec >::Centre(), EDA_DRAW_PANEL_GAL::ForceRefresh(), FOOTPRINT_PREVIEW_PANEL::GetBoard(), BOARD::GetBoundingBox(), PCB_DRAW_PANEL_GAL::GetDefaultViewBBox(), BOX2< Vec >::GetHeight(), KIGFX::VIEW::GetScale(), BOX2< Vec >::GetSize(), PCB_DRAW_PANEL_GAL::GetView(), BOX2< Vec >::GetWidth(), m_preview, scale, KIGFX::VIEW::SetCenter(), KIGFX::VIEW::SetScale(), KIGFX::VIEW::ToWorld(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by createPreviewItems(), OnSize(), PANEL_PCBNEW_COLOR_SETTINGS(), and TransferDataToWindow().

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

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 114 of file panel_color_settings.h.

Referenced by PANEL_EESCHEMA_COLOR_SETTINGS::PANEL_EESCHEMA_COLOR_SETTINGS(), PANEL_MODEDIT_COLOR_SETTINGS::PANEL_MODEDIT_COLOR_SETTINGS(), PANEL_PCBNEW_COLOR_SETTINGS(), and PANEL_COLOR_SETTINGS::saveCurrentTheme().

◆ m_colorsGridSizer

◆ m_colorsListWindow

◆ m_colorsMainSizer

◆ m_copied

KIGFX::COLOR4D PANEL_COLOR_SETTINGS::m_copied
protectedinherited

Definition at line 96 of file panel_color_settings.h.

Referenced by PANEL_COLOR_SETTINGS::ShowColorContextMenu().

◆ m_currentSettings

◆ m_frame

PCB_EDIT_FRAME* PANEL_PCBNEW_COLOR_SETTINGS::m_frame
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_PCBNEW_COLOR_SETTINGS::m_page
private

◆ m_preview

FOOTPRINT_PREVIEW_PANEL* PANEL_PCBNEW_COLOR_SETTINGS::m_preview
private

◆ m_staticline2

wxStaticLine* PANEL_COLOR_SETTINGS_BASE::m_staticline2
protectedinherited

◆ m_staticText9

wxStaticText* PANEL_COLOR_SETTINGS_BASE::m_staticText9
protectedinherited

◆ m_swatches

◆ m_titleBlock

TITLE_BLOCK* PANEL_PCBNEW_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 106 of file panel_color_settings.h.

Referenced by PANEL_MODEDIT_COLOR_SETTINGS::createSwatches(), createSwatches(), PANEL_COLOR_SETTINGS::OnThemeChanged(), PANEL_EESCHEMA_COLOR_SETTINGS::PANEL_EESCHEMA_COLOR_SETTINGS(), PANEL_MODEDIT_COLOR_SETTINGS::PANEL_MODEDIT_COLOR_SETTINGS(), PANEL_PCBNEW_COLOR_SETTINGS(), PANEL_EESCHEMA_COLOR_SETTINGS::saveCurrentTheme(), and PANEL_COLOR_SETTINGS::saveCurrentTheme().


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