KiCad PCB EDA Suite
PANEL_COLOR_SETTINGS_BASE Class Referenceabstract

Class PANEL_COLOR_SETTINGS_BASE. More...

#include <panel_color_settings_base.h>

Inheritance diagram for PANEL_COLOR_SETTINGS_BASE:
RESETTABLE_PANEL PANEL_COLOR_SETTINGS PANEL_EESCHEMA_COLOR_SETTINGS PANEL_FP_EDITOR_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 ()
 
virtual void ResetPanel ()=0
 Reset the contents of this panel. More...
 
virtual wxString GetResetTooltip ()
 Get the tooltip the reset button should display when showing this panel. More...
 

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 OnBtnOpenThemeFolderClicked (wxCommandEvent &event)
 

Protected Attributes

wxBoxSizer * m_mainSizer
 
wxStaticText * m_staticText9
 
wxChoice * m_cbTheme
 
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 36 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  : RESETTABLE_PANEL( 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  wxArrayString m_cbThemeChoices;
24  m_cbTheme = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_cbThemeChoices, 0 );
25  m_cbTheme->SetSelection( 0 );
26  m_cbTheme->SetMinSize( wxSize( 150,-1 ) );
27 
28  bControlSizer->Add( m_cbTheme, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
29 
30 
31  bControlSizer->Add( 0, 0, 1, wxEXPAND, 5 );
32 
33  m_optOverrideColors = new wxCheckBox( this, wxID_ANY, _("Override individual item colors"), wxDefaultPosition, wxDefaultSize, 0 );
34  m_optOverrideColors->SetToolTip( _("Show all items in their default color even if they have specific colors set in their properties.") );
35 
36  bControlSizer->Add( m_optOverrideColors, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
37 
38 
39  bControlSizer->Add( 0, 0, 1, wxEXPAND, 5 );
40 
41  m_btnOpenFolder = new wxButton( this, wxID_ANY, _("Open Theme Folder"), wxDefaultPosition, wxDefaultSize, 0 );
42  m_btnOpenFolder->SetToolTip( _("Open the folder containing color themes") );
43 
44  bControlSizer->Add( m_btnOpenFolder, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
45 
46 
47  m_mainSizer->Add( bControlSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
48 
49  m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
50  m_mainSizer->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 );
51 
52  m_colorsMainSizer = new wxBoxSizer( wxHORIZONTAL );
53 
54  wxBoxSizer* bottomMargin;
55  bottomMargin = new wxBoxSizer( wxVERTICAL );
56 
57  m_colorsListWindow = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SIMPLE|wxVSCROLL );
58  m_colorsListWindow->SetScrollRate( 5, 5 );
59  m_colorsListWindow->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
60  m_colorsListWindow->SetMinSize( wxSize( 240,-1 ) );
61 
62  m_colorsGridSizer = new wxFlexGridSizer( 0, 2, 0, 0 );
63  m_colorsGridSizer->AddGrowableCol( 0 );
64  m_colorsGridSizer->SetFlexibleDirection( wxHORIZONTAL );
65  m_colorsGridSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_NONE );
66 
67  m_colorsGridSizer->SetMinSize( wxSize( 100,-1 ) );
68 
70  m_colorsListWindow->Layout();
72  bottomMargin->Add( m_colorsListWindow, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
73 
74 
75  m_colorsMainSizer->Add( bottomMargin, 0, wxEXPAND|wxBOTTOM, 3 );
76 
77 
78  m_mainSizer->Add( m_colorsMainSizer, 1, wxEXPAND|wxLEFT, 5 );
79 
80 
81  this->SetSizer( m_mainSizer );
82  this->Layout();
83 
84  // Connect Events
85  this->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_COLOR_SETTINGS_BASE::OnSize ) );
86  m_cbTheme->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnThemeChanged ), NULL, this );
87  m_cbTheme->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( PANEL_COLOR_SETTINGS_BASE::OnLeftDownTheme ), NULL, this );
88  m_optOverrideColors->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnOverrideItemColorsClicked ), NULL, this );
89  m_btnOpenFolder->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnBtnOpenThemeFolderClicked ), NULL, this );
90 }
RESETTABLE_PANEL(wxWindow *aParent, wxWindowID aId=wxID_ANY, const wxPoint &aPos=wxDefaultPosition, const wxSize &aSize=wxSize(-1,-1), long aStyle=wxTAB_TRAVERSAL, const wxString &aName=wxEmptyString)
virtual void OnThemeChanged(wxCommandEvent &event)
#define NULL
virtual void OnSize(wxSizeEvent &event)
virtual void OnBtnOpenThemeFolderClicked(wxCommandEvent &event)
const char * name
Definition: DXF_plotter.cpp:59
#define _(s)
Definition: 3d_actions.cpp:33
virtual void OnLeftDownTheme(wxMouseEvent &event)
virtual void OnOverrideItemColorsClicked(wxCommandEvent &event)

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

◆ ~PANEL_COLOR_SETTINGS_BASE()

PANEL_COLOR_SETTINGS_BASE::~PANEL_COLOR_SETTINGS_BASE ( )

Definition at line 92 of file panel_color_settings_base.cpp.

93 {
94  // Disconnect Events
95  this->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_COLOR_SETTINGS_BASE::OnSize ) );
96  m_cbTheme->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnThemeChanged ), NULL, this );
97  m_cbTheme->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( PANEL_COLOR_SETTINGS_BASE::OnLeftDownTheme ), NULL, this );
98  m_optOverrideColors->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnOverrideItemColorsClicked ), NULL, this );
99  m_btnOpenFolder->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnBtnOpenThemeFolderClicked ), NULL, this );
100 
101 }
virtual void OnThemeChanged(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_cbTheme, m_optOverrideColors, NULL, OnBtnOpenThemeFolderClicked(), OnLeftDownTheme(), OnOverrideItemColorsClicked(), OnSize(), and OnThemeChanged().

Member Function Documentation

◆ GetResetTooltip()

virtual wxString RESETTABLE_PANEL::GetResetTooltip ( )
inlinevirtualinherited

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

Returns
the tooltip

Reimplemented in PANEL_HOTKEYS_EDITOR, and PANEL_COLOR_SETTINGS.

Definition at line 52 of file resettable_panel.h.

53  {
54  return _( "Reset all settings on this page to their default" );
55  }
#define _(s)
Definition: 3d_actions.cpp:33

References _.

◆ OnBtnOpenThemeFolderClicked()

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

Reimplemented in 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, and PANEL_PCBNEW_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().

◆ ResetPanel()

virtual void RESETTABLE_PANEL::ResetPanel ( )
pure virtualinherited

Member Data Documentation

◆ m_btnOpenFolder

wxButton* PANEL_COLOR_SETTINGS_BASE::m_btnOpenFolder
protected

◆ m_cbTheme

◆ m_colorsGridSizer

◆ m_colorsListWindow

◆ m_colorsMainSizer

◆ m_mainSizer

wxBoxSizer* PANEL_COLOR_SETTINGS_BASE::m_mainSizer
protected

Definition at line 41 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 42 of file panel_color_settings_base.h.

Referenced by PANEL_COLOR_SETTINGS_BASE().


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