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...
 
bool Show (bool show) override
 

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 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 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 36 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 374 of file panel_pcbnew_color_settings.cpp.

376  : PANEL_COLOR_SETTINGS( aParent ),
377  m_frame( aFrame ),
378  m_preview( nullptr ),
379  m_page( nullptr ),
380  m_titleBlock( nullptr )
381 {
382  m_colorNamespace = "board";
383 
385  PCBNEW_SETTINGS* app_settings = mgr->GetAppSettings<PCBNEW_SETTINGS>();
386  COLOR_SETTINGS* current = mgr->GetColorSettings( app_settings->m_ColorTheme );
387 
388  // Saved theme doesn't exist? Reset to default
389  if( current->GetFilename() != app_settings->m_ColorTheme )
390  app_settings->m_ColorTheme = current->GetFilename();
391 
392  createThemeList( app_settings->m_ColorTheme );
393 
394  // Currently this only applies to eeschema
395  m_optOverrideColors->Hide();
396 
397  m_currentSettings = new COLOR_SETTINGS( *current );
398 
399  for( int id = GAL_LAYER_ID_START; id < GAL_LAYER_ID_BITMASK_END; id++ )
400  {
401  if( g_excludedLayers.count( id ) )
402  continue;
403 
404  m_validLayers.push_back( id );
405  }
406 
407  // NOTE: Main board layers are added by createSwatches()
408 
410 
411  m_colorsMainSizer->Insert( 0, 10, 0, 0, wxEXPAND, 5 );
412 
413  createSwatches();
414 
416  m_preview->GetGAL()->SetAxesEnabled( false );
417 
418  m_colorsMainSizer->Add( 10, 0, 0, wxEXPAND, 5 );
419  m_colorsMainSizer->Add( m_preview, 1, wxALL | wxEXPAND, 5 );
420  m_colorsMainSizer->Add( 10, 0, 0, wxEXPAND, 5 );
421 
423  updatePreview();
424  zoomFitPreview();
425 }
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:53
SETTINGS_MANAGER * GetSettingsManager() const
std::string m_colorNamespace
A namespace that will be passed to SETTINGS_MANAGER::SaveColorSettings.
This is the end of the layers used for visibility bit masks in Pcbnew.
Definition: layer_ids.h:222
void createThemeList(const wxString &aCurrent)
Builds the theme listbox and sets the selection to the current theme.
COLOR_SETTINGS * m_currentSettings
T * GetAppSettings(bool aLoadNow=true)
Returns a handle to the a given settings by type If the settings have already been loaded,...
static FOOTPRINT_PREVIEW_PANEL * New(KIWAY *aKiway, wxWindow *aParent)
KIGFX::GAL * GetGAL() const
Return a pointer to the GAL instance used in the panel.
PANEL_COLOR_SETTINGS(wxWindow *aParent)
void SetAxesEnabled(bool aAxesEnabled)
Enable 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.
std::set< int > g_excludedLayers
PCB background color.
Definition: layer_ids.h:216
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:184

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(), EDA_BASE_FRAME::GetSettingsManager(), 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(), KIGFX::GAL::SetAxesEnabled(), updatePreview(), and zoomFitPreview().

◆ ~PANEL_PCBNEW_COLOR_SETTINGS()

PANEL_PCBNEW_COLOR_SETTINGS::~PANEL_PCBNEW_COLOR_SETTINGS ( )
override

Definition at line 428 of file panel_pcbnew_color_settings.cpp.

429 {
430  delete m_page;
431  delete m_titleBlock;
432  delete m_currentSettings;
433 }
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 491 of file panel_pcbnew_color_settings.cpp.

492 {
495  m_titleBlock->SetTitle( _( "Color Preview" ) );
496  m_titleBlock->SetDate( wxDateTime::Now().FormatDate() );
497 
498  m_page->SetHeightMils( 5000 );
499  m_page->SetWidthMils( 6000 );
500 
501  STRING_LINE_READER reader( g_previewBoard, "preview" );
502  PCB_IO pi;
503 
504  try
505  {
506  pi.DoLoad( reader, m_preview->GetBoard(), nullptr, nullptr, 0 );
507  }
508  catch( const IO_ERROR& )
509  {
510  return;
511  }
512 
515 
516  DS_PROXY_VIEW_ITEM* drawingSheet = new DS_PROXY_VIEW_ITEM( (int) IU_PER_MILS, m_page, nullptr,
517  m_titleBlock );
518  drawingSheet->SetColorLayer( LAYER_DRAWINGSHEET );
519  m_preview->SetDrawingSheet( drawingSheet );
520 
521  zoomFitPreview();
522 }
A PLUGIN derivation for saving and loading Pcbnew s-expression formatted files.
void SetColorLayer(int aLayerId)
Can be used to override which layer ID is used for drawing sheet item colors.
std::string g_previewBoard
void SetDate(const wxString &aDate)
Set the date field, and defaults to the current time and date.
Definition: title_block.h:71
static const wxChar Custom[]
"User" defined page type
Definition: page_info.h:77
Hold the information shown in the lower right corner of a plot, printout, or editing view.
Definition: title_block.h:40
void DisplayBoard(BOARD *aBoard)
Add all items from the current board to the VIEW, so they can be displayed by GAL.
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:53
#define _(s)
drawingsheet frame and titleblock
Definition: layer_ids.h:213
void SetTitle(const wxString &aTitle)
Definition: title_block.h:58
void SetHeightMils(int aHeightInMils)
Definition: page_info.cpp:257
void UpdateColors()
Update the color settings in the painter and GAL.
void SetWidthMils(int aWidthInMils)
Definition: page_info.cpp:243
#define IU_PER_MILS
Definition: plotter.cpp:136
BOARD * DoLoad(LINE_READER &aReader, BOARD *aAppendToMe, const PROPERTIES *aProperties, PROGRESS_REPORTER *aProgressReporter, unsigned aLineCount)
FOOTPRINT_PREVIEW_PANEL * m_preview
Is a LINE_READER that reads from a multiline 8 bit wide std::string.
Definition: richio.h:240
void SetDrawingSheet(DS_PROXY_VIEW_ITEM *aDrawingSheet)
Sets (or updates) drawing-sheet used by the draw panel.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:75

References _, PAGE_INFO::Custom, PCB_DRAW_PANEL_GAL::DisplayBoard(), PCB_IO::DoLoad(), g_previewBoard, FOOTPRINT_PREVIEW_PANEL::GetBoard(), IU_PER_MILS, LAYER_DRAWINGSHEET, m_page, m_preview, m_titleBlock, DS_PROXY_VIEW_ITEM::SetColorLayer(), TITLE_BLOCK::SetDate(), PCB_DRAW_PANEL_GAL::SetDrawingSheet(), PAGE_INFO::SetHeightMils(), TITLE_BLOCK::SetTitle(), PAGE_INFO::SetWidthMils(), 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 232 of file panel_color_settings.cpp.

233 {
234  wxStaticText* label = new wxStaticText( m_colorsListWindow, wxID_ANY, aName );
235 
236  // The previously selected theme can be deleted and cannot be selected.
237  // so select the default theme (first theme of the list)
238  if( m_cbTheme->GetSelection() < 0 )
239  {
240  m_cbTheme->SetSelection( 0 );
242  }
243 
244  void* clientData = m_cbTheme->GetClientData( m_cbTheme->GetSelection() );
245  COLOR_SETTINGS* selected = static_cast<COLOR_SETTINGS*>( clientData );
246 
247  int id = FIRST_BUTTON_ID + aLayer;
248  COLOR4D defaultColor = selected->GetDefaultColor( aLayer );
250  COLOR4D backgroundColor = m_currentSettings->GetColor( m_backgroundLayer );
251 
252  COLOR_SWATCH* swatch = new COLOR_SWATCH( m_colorsListWindow, color, id, backgroundColor,
253  defaultColor, SWATCH_MEDIUM );
254  swatch->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
255 
256  m_colorsGridSizer->Add( label, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxLEFT, 5 );
257  m_colorsGridSizer->Add( swatch, 0, wxALIGN_CENTER_VERTICAL | wxALL, 3 );
258 
259  m_labels[aLayer] = label;
260  m_swatches[aLayer] = swatch;
261 
262  swatch->Bind( wxEVT_RIGHT_DOWN,
263  [&, aLayer]( wxMouseEvent& aEvent )
264  {
265  ShowColorContextMenu( aEvent, aLayer );
266  } );
267 
268  swatch->Bind( COLOR_SWATCH_CHANGED, &PANEL_COLOR_SETTINGS::OnColorChanged, this );
269 }
int color
Definition: DXF_plotter.cpp:57
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
A simple color swatch of the kind used to set layer colors.
Definition: color_swatch.h:56
Color settings are a bit different than most of the settings objects in that there can be more than o...
void OnColorChanged(wxCommandEvent &aEvent)
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

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_FP_EDITOR_COLOR_SETTINGS::createSwatches(), createSwatches(), and PANEL_EESCHEMA_COLOR_SETTINGS::createSwatches().

◆ createSwatches()

void PANEL_PCBNEW_COLOR_SETTINGS::createSwatches ( )
private

Definition at line 453 of file panel_pcbnew_color_settings.cpp.

454 {
455  std::sort( m_validLayers.begin(), m_validLayers.end(),
456  []( int a, int b )
457  {
458  return LayerName( a ) < LayerName( b );
459  } );
460 
461  // Don't sort board layers by name
462  for( int i = PCBNEW_LAYER_ID_START; i <= User_9; ++i )
463  m_validLayers.insert( m_validLayers.begin() + i, i );
464 
465  BOARD* board = m_frame->GetBoard();
466 
467  for( int layer : m_validLayers )
468  {
469  wxString name = LayerName( layer );
470 
471  if( board && layer >= PCBNEW_LAYER_ID_START && layer < PCB_LAYER_ID_COUNT )
472  name = board->GetLayerName( static_cast<PCB_LAYER_ID>( layer ) );
473 
474  createSwatch( layer, name );
475  }
476 
477  // Give a minimal width to m_colorsListWindow, in order to always having
478  // a full row shown
479  int min_width = m_colorsGridSizer->GetMinSize().x;
480  const int margin = 20; // A margin around the sizer
481  m_colorsListWindow->SetMinSize( wxSize( min_width + margin, -1 ) );
482 }
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition: board.cpp:362
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
Definition: layer_id.cpp:27
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:56
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:190
BOARD * GetBoard() const
void createSwatch(int aLayer, const wxString &aName)

References PANEL_COLOR_SETTINGS::createSwatch(), 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, PCBNEW_LAYER_ID_START, and User_9.

Referenced by PANEL_PCBNEW_COLOR_SETTINGS().

◆ createThemeList()

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

Builds the theme listbox and sets the selection to the current theme.

Parameters
aCurrentis the filename of the current color theme (no extension)

Definition at line 199 of file panel_color_settings.cpp.

200 {
201  int width = 0;
202  int height = 0;
203 
204  m_cbTheme->GetTextExtent( _( "New Theme..." ), &width, &height );
205  int minwidth = width;
206 
207  m_cbTheme->Clear();
208 
209  for( COLOR_SETTINGS* settings : Pgm().GetSettingsManager().GetColorSettingsList() )
210  {
211  wxString name = settings->GetName();
212 
213  if( settings->IsReadOnly() )
214  name += wxS( " " ) + _( "(read-only)" );
215 
216  int pos = m_cbTheme->Append( name, static_cast<void*>( settings ) );
217 
218  if( settings->GetFilename() == aCurrent )
219  m_cbTheme->SetSelection( pos );
220 
221  m_cbTheme->GetTextExtent( name, &width, &height );
222  minwidth = std::max( minwidth, width );
223  }
224 
225  m_cbTheme->Append( wxT( "---" ) );
226  m_cbTheme->Append( _( "New Theme..." ) );
227 
228  m_cbTheme->SetMinSize( wxSize( minwidth + 50, -1 ) );
229 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:106
#define _(s)
SETTINGS_MANAGER * GetSettingsManager()
const char * name
Definition: DXF_plotter.cpp:56
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, name, and Pgm().

Referenced by PANEL_COLOR_SETTINGS::OnLeftDownTheme(), PANEL_EESCHEMA_COLOR_SETTINGS::PANEL_EESCHEMA_COLOR_SETTINGS(), PANEL_FP_EDITOR_COLOR_SETTINGS::PANEL_FP_EDITOR_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)

References _.

◆ OnBtnOpenThemeFolderClicked()

void PANEL_COLOR_SETTINGS::OnBtnOpenThemeFolderClicked ( wxCommandEvent &  event)
overrideprotectedvirtualinherited

Reimplemented from PANEL_COLOR_SETTINGS_BASE.

Definition at line 59 of file panel_color_settings.cpp.

60 {
62  LaunchExternal( dir );
63 }
static wxString GetColorSettingsPath()
Returns the path where color scheme files are stored; creating it if missing (normally .
void LaunchExternal(const wxString &aPath)
Launches the given file or folder in the host OS.
Definition: launch_ext.cpp:25

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 525 of file panel_pcbnew_color_settings.cpp.

References updatePreview().

◆ OnColorChanged()

void PANEL_COLOR_SETTINGS::OnColorChanged ( wxCommandEvent &  aEvent)
protectedinherited

Definition at line 317 of file panel_color_settings.cpp.

318 {
319  COLOR_SWATCH* swatch = static_cast<COLOR_SWATCH*>( aEvent.GetEventObject() );
320  COLOR4D newColor = swatch->GetSwatchColor();
321  LAYER_NUM layer = static_cast<SCH_LAYER_ID>( swatch->GetId() - FIRST_BUTTON_ID );
322 
323  updateColor( layer, newColor );
324 }
KIGFX::COLOR4D GetSwatchColor() const
int LAYER_NUM
This can be replaced with int and removed.
Definition: layer_ids.h:41
void updateColor(int aLayer, const KIGFX::COLOR4D &aColor)
constexpr int FIRST_BUTTON_ID
A simple color swatch of the kind used to set layer colors.
Definition: color_swatch.h:56
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

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 103 of file panel_color_settings.cpp.

104 {
105  // Lazy rebuild of theme menu to catch any colour theme changes made in other panels
107 
108  event.Skip();
109 }
wxString GetFilename() const
Definition: json_settings.h:72
void createThemeList(const wxString &aCurrent)
Builds the theme listbox and sets the selection to the current theme.
COLOR_SETTINGS * m_currentSettings

References PANEL_COLOR_SETTINGS::createThemeList(), JSON_SETTINGS::GetFilename(), and PANEL_COLOR_SETTINGS::m_currentSettings.

◆ 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 485 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 577 of file panel_pcbnew_color_settings.cpp.

578 {
579  zoomFitPreview();
580  aEvent.Skip();
581 }

References zoomFitPreview().

◆ OnThemeChanged()

void PANEL_COLOR_SETTINGS::OnThemeChanged ( wxCommandEvent &  aEvent)
overrideprotectedvirtualinherited

Reimplemented from PANEL_COLOR_SETTINGS_BASE.

Definition at line 112 of file panel_color_settings.cpp.

113 {
114  int idx = m_cbTheme->GetSelection();
115 
116  if( idx == static_cast<int>( m_cbTheme->GetCount() ) - 2 )
117  {
118  // separator; re-select active theme
119  m_cbTheme->SetStringSelection( m_currentSettings->GetName() );
120  return;
121  }
122 
123  if( idx == (int)m_cbTheme->GetCount() - 1 )
124  {
125  // New Theme...
126 
127  if( !saveCurrentTheme( false ) )
128  return;
129 
130  FOOTPRINT_NAME_VALIDATOR themeNameValidator;
131  wxTextEntryDialog dlg( this, _( "New theme name:" ), _( "Add Color Theme" ) );
132  dlg.SetTextValidator( themeNameValidator );
133 
134  if( dlg.ShowModal() != wxID_OK )
135  return;
136 
137  wxString themeName = dlg.GetValue();
138  wxFileName fn( themeName + wxT( ".json" ) );
140 
141  if( fn.Exists() )
142  {
143  wxMessageBox( _( "Theme already exists!" ) );
144  return;
145  }
146 
147  SETTINGS_MANAGER& settingsMgr = Pgm().GetSettingsManager();
148  COLOR_SETTINGS* newSettings = settingsMgr.AddNewColorSettings( themeName );
149  newSettings->SetName( themeName );
150  newSettings->SetReadOnly( false );
151 
152  for( auto layer : m_validLayers )
153  newSettings->SetColor( layer, m_currentSettings->GetColor( layer ) );
154 
155  newSettings->SaveToFile( settingsMgr.GetPathForSettingsFile( newSettings ) );
156 
157  idx = m_cbTheme->Insert( themeName, idx - 1, static_cast<void*>( newSettings ) );
158  m_cbTheme->SetSelection( idx );
159 
160  m_optOverrideColors->SetValue( newSettings->GetOverrideSchItemColors() );
161 
162  *m_currentSettings = *newSettings;
163  updateSwatches();
165  }
166  else
167  {
168  COLOR_SETTINGS* selected = static_cast<COLOR_SETTINGS*>( m_cbTheme->GetClientData( idx ) );
169 
170  if( selected->GetFilename() != m_currentSettings->GetFilename() )
171  {
172  if( !saveCurrentTheme( false ) )
173  return;
174 
175  m_optOverrideColors->SetValue( selected->GetOverrideSchItemColors() );
176 
177  *m_currentSettings = *selected;
179  updateSwatches();
180  }
181  }
182 }
virtual bool saveCurrentTheme(bool aValidate)
void SetReadOnly(bool aReadOnly)
Definition: json_settings.h:83
wxString GetFilename() const
Definition: json_settings.h:72
virtual void onNewThemeSelected()
Event fired when a new theme is selected that can be overridden in children.
void SetColor(int aLayer, const COLOR4D &aColor)
const wxString & GetName() const
COLOR_SETTINGS * AddNewColorSettings(const wxString &aFilename)
Registers a new color settings object with the given filename.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:106
This class provides a custom wxValidator object for limiting the allowable characters when defining f...
Definition: validators.h:63
virtual bool SaveToFile(const wxString &aDirectory="", bool aForce=false)
COLOR_SETTINGS * m_currentSettings
#define _(s)
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; creating it if missing (normally .
COLOR4D GetColor(int aLayer) const
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.

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

◆ ResetPanel()

void PANEL_PCBNEW_COLOR_SETTINGS::ResetPanel ( )
overridevirtual

Reset the contents of this panel.

Reimplemented from PANEL_COLOR_SETTINGS.

Definition at line 531 of file panel_pcbnew_color_settings.cpp.

532 {
534  updatePreview();
535 }
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 350 of file panel_color_settings.cpp.

351 {
353  return true;
354 
355  if( aValidate && !validateSave() )
356  return false;
357 
358  SETTINGS_MANAGER& settingsMgr = Pgm().GetSettingsManager();
359  COLOR_SETTINGS* selected = settingsMgr.GetColorSettings( m_currentSettings->GetFilename() );
360 
361  selected->SetOverrideSchItemColors( m_optOverrideColors->GetValue() );
362 
363  for( auto layer : m_validLayers )
364  selected->SetColor( layer, m_currentSettings->GetColor( layer ) );
365 
366  settingsMgr.SaveColorSettings( selected, m_colorNamespace );
367 
368  return true;
369 }
wxString GetFilename() const
Definition: json_settings.h:72
void SetColor(int aLayer, const COLOR4D &aColor)
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:106
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.
bool IsReadOnly() const
Definition: json_settings.h:82
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.

References COLOR_SETTINGS::GetColor(), SETTINGS_MANAGER::GetColorSettings(), JSON_SETTINGS::GetFilename(), JSON_SETTINGS::IsReadOnly(), 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(), and PANEL_COLOR_SETTINGS::updateColor().

◆ Show()

bool PANEL_COLOR_SETTINGS::Show ( bool  show)
overrideinherited

Definition at line 84 of file panel_color_settings.cpp.

85 {
86  if( show )
87  {
88  // In case changes have been made to the current theme in another panel:
89  int idx = m_cbTheme->GetSelection();
90  COLOR_SETTINGS* settings = static_cast<COLOR_SETTINGS*>( m_cbTheme->GetClientData( idx ) );
91 
92  if( settings )
93  *m_currentSettings = *settings;
94 
97  }
98 
99  return PANEL_COLOR_SETTINGS_BASE::Show( show );
100 }
virtual void onNewThemeSelected()
Event fired when a new theme is selected that can be overridden in children.
COLOR_SETTINGS * m_currentSettings
Color settings are a bit different than most of the settings objects in that there can be more than o...

References PANEL_COLOR_SETTINGS_BASE::m_cbTheme, PANEL_COLOR_SETTINGS::m_currentSettings, PANEL_COLOR_SETTINGS::onNewThemeSelected(), and PANEL_COLOR_SETTINGS::updateSwatches().

◆ ShowColorContextMenu()

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

Definition at line 272 of file panel_color_settings.cpp.

273 {
274  auto selected =
275  static_cast<COLOR_SETTINGS*>( m_cbTheme->GetClientData( m_cbTheme->GetSelection() ) );
276 
277  COLOR4D current = m_currentSettings->GetColor( aLayer );
278  COLOR4D saved = selected->GetColor( aLayer );
279  bool readOnly = m_currentSettings->IsReadOnly();
280 
281  wxMenu menu;
282 
283  AddMenuItem( &menu, ID_COPY, _( "Copy color" ), KiBitmap( BITMAPS::copy ) );
284 
285  if( !readOnly && m_copied != COLOR4D::UNSPECIFIED )
286  AddMenuItem( &menu, ID_PASTE, _( "Paste color" ), KiBitmap( BITMAPS::paste ) );
287 
288  if( !readOnly && current != saved )
289  AddMenuItem( &menu, ID_REVERT, _( "Revert to saved color" ), KiBitmap( BITMAPS::undo ) );
290 
291  menu.Bind( wxEVT_COMMAND_MENU_SELECTED,
292  [&]( wxCommandEvent& aCmd )
293  {
294  switch( aCmd.GetId() )
295  {
296  case ID_COPY:
297  m_copied = current;
298  break;
299 
300  case ID_PASTE:
301  updateColor( aLayer, m_copied );
302  break;
303 
304  case ID_REVERT:
305  updateColor( aLayer, saved );
306  break;
307 
308  default:
309  aCmd.Skip();
310  }
311  } );
312 
313  PopupMenu( &menu );
314 }
wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmap &aImage, wxItemKind aType=wxITEM_NORMAL)
Create and insert a menu item with an icon into aMenu.
Definition: bitmap.cpp:257
void updateColor(int aLayer, const KIGFX::COLOR4D &aColor)
COLOR_SETTINGS * m_currentSettings
#define _(s)
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:105
COLOR4D GetColor(int aLayer) const
bool IsReadOnly() const
Definition: json_settings.h:82
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References _, AddMenuItem(), copy, COLOR_SETTINGS::GetColor(), PANEL_COLOR_SETTINGS::ID_COPY, PANEL_COLOR_SETTINGS::ID_PASTE, PANEL_COLOR_SETTINGS::ID_REVERT, JSON_SETTINGS::IsReadOnly(), KiBitmap(), PANEL_COLOR_SETTINGS_BASE::m_cbTheme, PANEL_COLOR_SETTINGS::m_copied, PANEL_COLOR_SETTINGS::m_currentSettings, paste, undo, and PANEL_COLOR_SETTINGS::updateColor().

Referenced by PANEL_COLOR_SETTINGS::createSwatch().

◆ TransferDataFromWindow()

bool PANEL_PCBNEW_COLOR_SETTINGS::TransferDataFromWindow ( )
overrideprotected

Definition at line 436 of file panel_pcbnew_color_settings.cpp.

437 {
438  SETTINGS_MANAGER* settingsMgr = m_frame->GetSettingsManager();
439  PCBNEW_SETTINGS* app_settings = settingsMgr->GetAppSettings<PCBNEW_SETTINGS>();
440  app_settings->m_ColorTheme = m_currentSettings->GetFilename();
441 
442  return true;
443 }
SETTINGS_MANAGER * GetSettingsManager() const
wxString GetFilename() const
Definition: json_settings.h:72
COLOR_SETTINGS * m_currentSettings
T * GetAppSettings(bool aLoadNow=true)
Returns a handle to the a given settings by type If the settings have already been loaded,...
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:184

References SETTINGS_MANAGER::GetAppSettings(), JSON_SETTINGS::GetFilename(), EDA_BASE_FRAME::GetSettingsManager(), APP_SETTINGS_BASE::m_ColorTheme, PANEL_COLOR_SETTINGS::m_currentSettings, and m_frame.

◆ TransferDataToWindow()

bool PANEL_PCBNEW_COLOR_SETTINGS::TransferDataToWindow ( )
overrideprotected

Definition at line 446 of file panel_pcbnew_color_settings.cpp.

447 {
448  zoomFitPreview();
449  return true;
450 }

References zoomFitPreview().

◆ updateColor()

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

Definition at line 327 of file panel_color_settings.cpp.

328 {
329  if( m_currentSettings )
330  m_currentSettings->SetColor( aLayer, aColor );
331 
332  // Colors must be persisted when edited because multiple PANEL_COLOR_SETTINGS could be
333  // referring to the same theme.
334  saveCurrentTheme( false );
335 
336  m_swatches[aLayer]->SetSwatchColor( aColor, false );
337 
338  if( m_currentSettings && aLayer == m_backgroundLayer )
339  {
341 
342  for( std::pair<int, COLOR_SWATCH*> pair : m_swatches )
343  pair.second->SetSwatchBackground( background );
344  }
345 
346  onColorChanged();
347 }
virtual bool saveCurrentTheme(bool aValidate)
void SetColor(int aLayer, const COLOR4D &aColor)
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
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References COLOR_SETTINGS::GetColor(), PANEL_COLOR_SETTINGS::m_backgroundLayer, PANEL_COLOR_SETTINGS::m_currentSettings, PANEL_COLOR_SETTINGS::m_swatches, PANEL_COLOR_SETTINGS::onColorChanged(), PANEL_COLOR_SETTINGS::saveCurrentTheme(), 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 538 of file panel_pcbnew_color_settings.cpp.

539 {
540  if( !m_preview )
541  return;
542 
543  KIGFX::VIEW* view = m_preview->GetView();
544  auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() );
545  settings->LoadColors( m_currentSettings );
546 
547  m_preview->GetGAL()->SetClearColor( settings->GetBackgroundColor() );
548 
549  view->UpdateAllItems( KIGFX::COLOR );
550  auto rect = m_preview->GetScreenRect();
551  m_preview->Refresh( true, &rect );
552 }
void SetClearColor(const COLOR4D &aColor)
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
Definition: view.cpp:1424
Color has changed.
Definition: view_item.h:48
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:208
COLOR_SETTINGS * m_currentSettings
KIGFX::GAL * GetGAL() const
Return a pointer to the GAL instance used in the panel.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
FOOTPRINT_PREVIEW_PANEL * m_preview
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68

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().

◆ updateSwatches()

void PANEL_COLOR_SETTINGS::updateSwatches ( )
protectedinherited

Definition at line 185 of file panel_color_settings.cpp.

186 {
187  bool isReadOnly = m_currentSettings->IsReadOnly();
189 
190  for( std::pair<int, COLOR_SWATCH*> pair : m_swatches )
191  {
192  pair.second->SetSwatchBackground( background );
193  pair.second->SetSwatchColor( m_currentSettings->GetColor( pair.first ), false );
194  pair.second->SetReadOnly( isReadOnly );
195  }
196 }
std::map< int, COLOR_SWATCH * > m_swatches
COLOR_SETTINGS * m_currentSettings
COLOR4D GetColor(int aLayer) const
bool IsReadOnly() const
Definition: json_settings.h:82
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References COLOR_SETTINGS::GetColor(), JSON_SETTINGS::IsReadOnly(), PANEL_COLOR_SETTINGS::m_backgroundLayer, PANEL_COLOR_SETTINGS::m_currentSettings, and PANEL_COLOR_SETTINGS::m_swatches.

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

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

85  {
86  return true;
87  }

Referenced by PANEL_COLOR_SETTINGS::saveCurrentTheme().

◆ zoomFitPreview()

void PANEL_PCBNEW_COLOR_SETTINGS::zoomFitPreview ( )
private

Definition at line 555 of file panel_pcbnew_color_settings.cpp.

556 {
557  KIGFX::VIEW* view = m_preview->GetView();
558  BOX2I bBox = m_preview->GetBoard()->GetBoundingBox();
559  BOX2I defaultBox = m_preview->GetDefaultViewBBox();
560 
561  view->SetScale( 1.0 );
562  VECTOR2D screenSize = view->ToWorld( m_preview->GetClientSize(), false );
563 
564  if( bBox.GetWidth() == 0 || bBox.GetHeight() == 0 )
565  bBox = defaultBox;
566 
567  VECTOR2D vsize = bBox.GetSize();
568  double scale = view->GetScale() / std::max( fabs( vsize.x / screenSize.x ),
569  fabs( vsize.y / screenSize.y ) );
570 
571  view->SetScale( scale / 1.1 );
572  view->SetCenter( bBox.Centre() );
574 }
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: board.h:723
void ForceRefresh()
Force a redraw.
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Converts a screen space point/vector to a point/vector in world space coordinates.
Definition: view.cpp:447
void SetCenter(const VECTOR2D &aCenter)
Set the center point of the VIEW (i.e.
Definition: view.cpp:576
coord_type GetWidth() const
Definition: box2.h:180
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
BOX2I GetDefaultViewBBox() const override
Return the bounding box of the view that should be used if model is not valid.
virtual void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 })
Set the scaling factor, zooming around a given anchor point.
Definition: view.cpp:550
const int scale
Vec Centre() const
Definition: box2.h:63
coord_type GetHeight() const
Definition: box2.h:181
const Vec & GetSize() const
Definition: box2.h:172
FOOTPRINT_PREVIEW_PANEL * m_preview
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68
double GetScale() const
Definition: view.h:264

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

◆ m_colorsGridSizer

◆ m_colorsListWindow

◆ m_colorsMainSizer

◆ m_copied

KIGFX::COLOR4D PANEL_COLOR_SETTINGS::m_copied
protectedinherited

Definition at line 104 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 114 of file panel_color_settings.h.

Referenced by PANEL_FP_EDITOR_COLOR_SETTINGS::createSwatches(), createSwatches(), PANEL_COLOR_SETTINGS::OnThemeChanged(), PANEL_EESCHEMA_COLOR_SETTINGS::PANEL_EESCHEMA_COLOR_SETTINGS(), PANEL_FP_EDITOR_COLOR_SETTINGS::PANEL_FP_EDITOR_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: