KiCad PCB EDA Suite
PANEL_COLOR_SETTINGS_BASE Class Reference

Class PANEL_COLOR_SETTINGS_BASE. More...

#include <panel_color_settings_base.h>

Inheritance diagram for PANEL_COLOR_SETTINGS_BASE:
PANEL_COLOR_SETTINGS PANEL_EESCHEMA_COLOR_SETTINGS PANEL_MODEDIT_COLOR_SETTINGS PANEL_PCBNEW_COLOR_SETTINGS

Public Member Functions

 PANEL_COLOR_SETTINGS_BASE (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(826, 300), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
 
 ~PANEL_COLOR_SETTINGS_BASE ()
 

Public Attributes

wxCheckBox * m_optOverrideColors
 

Protected Member Functions

virtual void OnSize (wxSizeEvent &event)
 
virtual void OnThemeChanged (wxCommandEvent &event)
 
virtual void OnLeftDownTheme (wxMouseEvent &event)
 
virtual void OnOverrideItemColorsClicked (wxCommandEvent &event)
 
virtual void OnBtnResetClicked (wxCommandEvent &event)
 
virtual void OnBtnOpenThemeFolderClicked (wxCommandEvent &event)
 

Protected Attributes

wxBoxSizer * m_mainSizer
 
wxStaticText * m_staticText9
 
wxChoice * m_cbTheme
 
wxButton * m_btnReset
 
wxButton * m_btnOpenFolder
 
wxStaticLine * m_staticline2
 
wxBoxSizer * m_colorsMainSizer
 
wxScrolledWindow * m_colorsListWindow
 
wxFlexGridSizer * m_colorsGridSizer
 

Detailed Description

Class PANEL_COLOR_SETTINGS_BASE.

Definition at line 35 of file panel_color_settings_base.h.

Constructor & Destructor Documentation

◆ PANEL_COLOR_SETTINGS_BASE()

PANEL_COLOR_SETTINGS_BASE::PANEL_COLOR_SETTINGS_BASE ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxPoint pos = wxDefaultPosition,
const wxSize &  size = wxSize( 826,300 ),
long  style = wxTAB_TRAVERSAL,
const wxString &  name = wxEmptyString 
)

Definition at line 12 of file panel_color_settings_base.cpp.

12  : wxPanel( parent, id, pos, size, style, name )
13 {
14  m_mainSizer = new wxBoxSizer( wxVERTICAL );
15 
16  wxBoxSizer* bControlSizer;
17  bControlSizer = new wxBoxSizer( wxHORIZONTAL );
18 
19  m_staticText9 = new wxStaticText( this, wxID_ANY, _("Theme:"), wxDefaultPosition, wxDefaultSize, 0 );
20  m_staticText9->Wrap( -1 );
21  bControlSizer->Add( m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
22 
23  wxString m_cbThemeChoices[] = { _("User") };
24  int m_cbThemeNChoices = sizeof( m_cbThemeChoices ) / sizeof( wxString );
25  m_cbTheme = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_cbThemeNChoices, m_cbThemeChoices, 0 );
26  m_cbTheme->SetSelection( 0 );
27  m_cbTheme->SetMinSize( wxSize( 150,-1 ) );
28 
29  bControlSizer->Add( m_cbTheme, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
30 
31 
32  bControlSizer->Add( 0, 0, 1, wxEXPAND, 5 );
33 
34  m_optOverrideColors = new wxCheckBox( this, wxID_ANY, _("Override individual item colors"), wxDefaultPosition, wxDefaultSize, 0 );
35  m_optOverrideColors->SetToolTip( _("Show all items in their default color even if they have specific colors set in their properties.") );
36 
37  bControlSizer->Add( m_optOverrideColors, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
38 
39 
40  bControlSizer->Add( 0, 0, 1, wxEXPAND, 5 );
41 
42  m_btnReset = new wxButton( this, wxID_ANY, _("&Reset to Defaults"), wxDefaultPosition, wxDefaultSize, 0 );
43  m_btnReset->SetToolTip( _("Reset all colors in this theme to the KiCad defaults") );
44 
45  bControlSizer->Add( m_btnReset, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
46 
47  m_btnOpenFolder = new wxButton( this, wxID_ANY, _("Open Theme Folder"), wxDefaultPosition, wxDefaultSize, 0 );
48  m_btnOpenFolder->SetToolTip( _("Open the folder containing color themes") );
49 
50  bControlSizer->Add( m_btnOpenFolder, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
51 
52 
53  m_mainSizer->Add( bControlSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
54 
55  m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
56  m_mainSizer->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 );
57 
58  m_colorsMainSizer = new wxBoxSizer( wxHORIZONTAL );
59 
60  wxBoxSizer* bottomMargin;
61  bottomMargin = new wxBoxSizer( wxVERTICAL );
62 
63  m_colorsListWindow = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SIMPLE|wxVSCROLL );
64  m_colorsListWindow->SetScrollRate( 5, 5 );
65  m_colorsListWindow->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
66  m_colorsListWindow->SetMinSize( wxSize( 240,-1 ) );
67 
68  m_colorsGridSizer = new wxFlexGridSizer( 0, 2, 0, 0 );
69  m_colorsGridSizer->AddGrowableCol( 0 );
70  m_colorsGridSizer->SetFlexibleDirection( wxHORIZONTAL );
71  m_colorsGridSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_NONE );
72 
73  m_colorsGridSizer->SetMinSize( wxSize( 100,-1 ) );
74 
76  m_colorsListWindow->Layout();
78  bottomMargin->Add( m_colorsListWindow, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
79 
80 
81  m_colorsMainSizer->Add( bottomMargin, 0, wxEXPAND|wxBOTTOM, 3 );
82 
83 
84  m_mainSizer->Add( m_colorsMainSizer, 1, wxEXPAND|wxLEFT, 5 );
85 
86 
87  this->SetSizer( m_mainSizer );
88  this->Layout();
89 
90  // Connect Events
91  this->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_COLOR_SETTINGS_BASE::OnSize ) );
92  m_cbTheme->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnThemeChanged ), NULL, this );
93  m_cbTheme->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( PANEL_COLOR_SETTINGS_BASE::OnLeftDownTheme ), NULL, this );
94  m_optOverrideColors->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnOverrideItemColorsClicked ), NULL, this );
95  m_btnReset->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnBtnResetClicked ), NULL, this );
96  m_btnOpenFolder->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnBtnOpenThemeFolderClicked ), NULL, this );
97 }
virtual void OnThemeChanged(wxCommandEvent &event)
virtual void OnBtnResetClicked(wxCommandEvent &event)
#define NULL
virtual void OnSize(wxSizeEvent &event)
virtual void OnBtnOpenThemeFolderClicked(wxCommandEvent &event)
const char * name
Definition: DXF_plotter.cpp:60
#define _(s)
Definition: 3d_actions.cpp:33
virtual void OnLeftDownTheme(wxMouseEvent &event)
virtual void OnOverrideItemColorsClicked(wxCommandEvent &event)

References _, m_btnOpenFolder, m_btnReset, m_cbTheme, m_colorsGridSizer, m_colorsListWindow, m_colorsMainSizer, m_mainSizer, m_optOverrideColors, m_staticline2, m_staticText9, NULL, OnBtnOpenThemeFolderClicked(), OnBtnResetClicked(), OnLeftDownTheme(), OnOverrideItemColorsClicked(), OnSize(), and OnThemeChanged().

◆ ~PANEL_COLOR_SETTINGS_BASE()

PANEL_COLOR_SETTINGS_BASE::~PANEL_COLOR_SETTINGS_BASE ( )

Definition at line 99 of file panel_color_settings_base.cpp.

100 {
101  // Disconnect Events
102  this->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_COLOR_SETTINGS_BASE::OnSize ) );
103  m_cbTheme->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnThemeChanged ), NULL, this );
104  m_cbTheme->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( PANEL_COLOR_SETTINGS_BASE::OnLeftDownTheme ), NULL, this );
105  m_optOverrideColors->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnOverrideItemColorsClicked ), NULL, this );
106  m_btnReset->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnBtnResetClicked ), NULL, this );
107  m_btnOpenFolder->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnBtnOpenThemeFolderClicked ), NULL, this );
108 
109 }
virtual void OnThemeChanged(wxCommandEvent &event)
virtual void OnBtnResetClicked(wxCommandEvent &event)
#define NULL
virtual void OnSize(wxSizeEvent &event)
virtual void OnBtnOpenThemeFolderClicked(wxCommandEvent &event)
virtual void OnLeftDownTheme(wxMouseEvent &event)
virtual void OnOverrideItemColorsClicked(wxCommandEvent &event)

References m_btnOpenFolder, m_btnReset, m_cbTheme, m_optOverrideColors, NULL, OnBtnOpenThemeFolderClicked(), OnBtnResetClicked(), OnLeftDownTheme(), OnOverrideItemColorsClicked(), OnSize(), and OnThemeChanged().

Member Function Documentation

◆ OnBtnOpenThemeFolderClicked()

virtual void PANEL_COLOR_SETTINGS_BASE::OnBtnOpenThemeFolderClicked ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_COLOR_SETTINGS.

Definition at line 56 of file panel_color_settings_base.h.

56 { event.Skip(); }

Referenced by PANEL_COLOR_SETTINGS_BASE(), and ~PANEL_COLOR_SETTINGS_BASE().

◆ OnBtnResetClicked()

virtual void PANEL_COLOR_SETTINGS_BASE::OnBtnResetClicked ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_EESCHEMA_COLOR_SETTINGS, and PANEL_COLOR_SETTINGS.

Definition at line 55 of file panel_color_settings_base.h.

55 { event.Skip(); }

Referenced by PANEL_COLOR_SETTINGS_BASE(), and ~PANEL_COLOR_SETTINGS_BASE().

◆ OnLeftDownTheme()

virtual void PANEL_COLOR_SETTINGS_BASE::OnLeftDownTheme ( wxMouseEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_COLOR_SETTINGS.

Definition at line 53 of file panel_color_settings_base.h.

53 { event.Skip(); }

Referenced by PANEL_COLOR_SETTINGS_BASE(), and ~PANEL_COLOR_SETTINGS_BASE().

◆ OnOverrideItemColorsClicked()

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

Reimplemented in PANEL_EESCHEMA_COLOR_SETTINGS.

Definition at line 54 of file panel_color_settings_base.h.

54 { event.Skip(); }

Referenced by PANEL_COLOR_SETTINGS_BASE(), and ~PANEL_COLOR_SETTINGS_BASE().

◆ OnSize()

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

Reimplemented in PANEL_EESCHEMA_COLOR_SETTINGS.

Definition at line 51 of file panel_color_settings_base.h.

51 { event.Skip(); }

Referenced by PANEL_COLOR_SETTINGS_BASE(), and ~PANEL_COLOR_SETTINGS_BASE().

◆ OnThemeChanged()

virtual void PANEL_COLOR_SETTINGS_BASE::OnThemeChanged ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_COLOR_SETTINGS.

Definition at line 52 of file panel_color_settings_base.h.

52 { event.Skip(); }

Referenced by PANEL_COLOR_SETTINGS_BASE(), and ~PANEL_COLOR_SETTINGS_BASE().

Member Data Documentation

◆ m_btnOpenFolder

wxButton* PANEL_COLOR_SETTINGS_BASE::m_btnOpenFolder
protected

◆ m_btnReset

wxButton* PANEL_COLOR_SETTINGS_BASE::m_btnReset
protected

◆ m_cbTheme

◆ m_colorsGridSizer

◆ m_colorsListWindow

◆ m_colorsMainSizer

◆ m_mainSizer

wxBoxSizer* PANEL_COLOR_SETTINGS_BASE::m_mainSizer
protected

Definition at line 40 of file panel_color_settings_base.h.

Referenced by PANEL_COLOR_SETTINGS_BASE().

◆ m_optOverrideColors

◆ m_staticline2

wxStaticLine* PANEL_COLOR_SETTINGS_BASE::m_staticline2
protected

Definition at line 45 of file panel_color_settings_base.h.

Referenced by PANEL_COLOR_SETTINGS_BASE().

◆ m_staticText9

wxStaticText* PANEL_COLOR_SETTINGS_BASE::m_staticText9
protected

Definition at line 41 of file panel_color_settings_base.h.

Referenced by PANEL_COLOR_SETTINGS_BASE().


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