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_GERBVIEW_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(-1,-1), 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 () const
 Get the tooltip the reset button should display when showing this panel. More...
 
wxString GetHelpTextAtPoint (const wxPoint &aPt, wxHelpEvent::Origin aOrigin) const override
 Overridden to supply the reset button tooltip when queried with { -INT_MAX, INT_MAX }. 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
 
wxBoxSizer * m_previewPanelSizer
 

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( -1,-1 ),
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|wxLEFT|wxRIGHT, 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|wxBOTTOM|wxRIGHT|wxTOP, 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, wxALIGN_CENTER_VERTICAL|wxLEFT, 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|wxRIGHT, 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 m_previewPanelSizer = new wxBoxSizer( wxVERTICAL );
78
79
80 m_colorsMainSizer->Add( m_previewPanelSizer, 1, wxEXPAND, 5 );
81
82
83 m_mainSizer->Add( m_colorsMainSizer, 1, wxEXPAND|wxLEFT, 5 );
84
85
86 this->SetSizer( m_mainSizer );
87 this->Layout();
88 m_mainSizer->Fit( this );
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_btnOpenFolder->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnBtnOpenThemeFolderClicked ), NULL, this );
96}
const char * name
Definition: DXF_plotter.cpp:56
virtual void OnSize(wxSizeEvent &event)
virtual void OnOverrideItemColorsClicked(wxCommandEvent &event)
virtual void OnLeftDownTheme(wxMouseEvent &event)
virtual void OnBtnOpenThemeFolderClicked(wxCommandEvent &event)
virtual void OnThemeChanged(wxCommandEvent &event)
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)
#define _(s)

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

◆ ~PANEL_COLOR_SETTINGS_BASE()

PANEL_COLOR_SETTINGS_BASE::~PANEL_COLOR_SETTINGS_BASE ( )

Definition at line 98 of file panel_color_settings_base.cpp.

99{
100 // Disconnect Events
101 this->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_COLOR_SETTINGS_BASE::OnSize ) );
102 m_cbTheme->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnThemeChanged ), NULL, this );
103 m_cbTheme->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( PANEL_COLOR_SETTINGS_BASE::OnLeftDownTheme ), NULL, this );
104 m_optOverrideColors->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnOverrideItemColorsClicked ), NULL, this );
105 m_btnOpenFolder->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnBtnOpenThemeFolderClicked ), NULL, this );
106
107}

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

Member Function Documentation

◆ GetHelpTextAtPoint()

wxString RESETTABLE_PANEL::GetHelpTextAtPoint ( const wxPoint &  aPt,
wxHelpEvent::Origin  aOrigin 
) const
inlineoverrideinherited

Overridden to supply the reset button tooltip when queried with { -INT_MAX, INT_MAX }.

Definition at line 72 of file resettable_panel.h.

73 {
74 if( aPt == wxPoint( -INT_MAX, INT_MAX ) )
75 return GetResetTooltip();
76 else
77 return wxPanel::GetHelpTextAtPoint( aPt, aOrigin );
78 }
virtual wxString GetResetTooltip() const
Get the tooltip the reset button should display when showing this panel.

References RESETTABLE_PANEL::GetResetTooltip().

◆ GetResetTooltip()

virtual wxString RESETTABLE_PANEL::GetResetTooltip ( ) const
inlinevirtualinherited

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

Returns
the tooltip

Reimplemented in PANEL_COLOR_SETTINGS, and PANEL_HOTKEYS_EDITOR.

Definition at line 64 of file resettable_panel.h.

65 {
66 return _( "Reset all settings on this page to their default" );
67 }

References _.

Referenced by RESETTABLE_PANEL::GetHelpTextAtPoint().

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

◆ OnLeftDownTheme()

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

Reimplemented in PANEL_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().

◆ OnOverrideItemColorsClicked()

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

Reimplemented in PANEL_EESCHEMA_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().

◆ 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 52 of file panel_color_settings_base.h.

52{ 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 53 of file panel_color_settings_base.h.

53{ event.Skip(); }

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

◆ ResetPanel()

Member Data Documentation

◆ m_btnOpenFolder

wxButton* PANEL_COLOR_SETTINGS_BASE::m_btnOpenFolder
protected

◆ m_cbTheme

◆ m_colorsGridSizer

◆ m_colorsListWindow

◆ m_colorsMainSizer

wxBoxSizer* PANEL_COLOR_SETTINGS_BASE::m_colorsMainSizer
protected

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

wxBoxSizer* PANEL_COLOR_SETTINGS_BASE::m_previewPanelSizer
protected

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