KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_color_settings_base.cpp
Go to the documentation of this file.
1
2// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
3// http://www.wxformbuilder.org/
4//
5// PLEASE DO *NOT* EDIT THIS FILE!
7
8#include "widgets/wx_panel.h"
9
11
13
14PANEL_COLOR_SETTINGS_BASE::PANEL_COLOR_SETTINGS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : RESETTABLE_PANEL( parent, id, pos, size, style, name )
15{
16 m_mainSizer = new wxBoxSizer( wxVERTICAL );
17
18 wxBoxSizer* bControlSizer;
19 bControlSizer = new wxBoxSizer( wxHORIZONTAL );
20
21 m_staticText9 = new wxStaticText( this, wxID_ANY, _("Theme:"), wxDefaultPosition, wxDefaultSize, 0 );
22 m_staticText9->Wrap( -1 );
23 bControlSizer->Add( m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
24
25 wxArrayString m_cbThemeChoices;
26 m_cbTheme = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_cbThemeChoices, 0 );
27 m_cbTheme->SetSelection( 0 );
28 m_cbTheme->SetMinSize( wxSize( 150,-1 ) );
29
30 bControlSizer->Add( m_cbTheme, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxTOP, 5 );
31
32
33 bControlSizer->Add( 0, 0, 1, wxEXPAND, 5 );
34
35 m_optOverrideColors = new wxCheckBox( this, wxID_ANY, _("Override individual item colors"), wxDefaultPosition, wxDefaultSize, 0 );
36 m_optOverrideColors->SetToolTip( _("Show all items in their default color even if they have specific colors set in their properties.") );
37
38 bControlSizer->Add( m_optOverrideColors, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
39
40
41 bControlSizer->Add( 0, 0, 1, wxEXPAND, 5 );
42
43 m_btnOpenFolder = new wxButton( this, wxID_ANY, _("Open Theme Folder"), wxDefaultPosition, wxDefaultSize, 0 );
44 m_btnOpenFolder->SetToolTip( _("Open the folder containing color themes") );
45
46 bControlSizer->Add( m_btnOpenFolder, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
47
48
49 m_mainSizer->Add( bControlSizer, 0, wxEXPAND|wxALL, 5 );
50
51 m_panel1 = new WX_PANEL( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
52 m_colorsMainSizer = new wxBoxSizer( wxHORIZONTAL );
53
54 m_colorsListWindow = new wxScrolledWindow( m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL );
55 m_colorsListWindow->SetScrollRate( 5, 5 );
56 m_colorsListWindow->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
57 m_colorsListWindow->SetMinSize( wxSize( 240,240 ) );
58
59 m_colorsGridSizer = new wxFlexGridSizer( 0, 2, 0, 0 );
60 m_colorsGridSizer->AddGrowableCol( 0 );
61 m_colorsGridSizer->SetFlexibleDirection( wxHORIZONTAL );
62 m_colorsGridSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_NONE );
63
64 m_colorsGridSizer->SetMinSize( wxSize( 100,-1 ) );
65
67 m_colorsListWindow->Layout();
69 m_colorsMainSizer->Add( m_colorsListWindow, 0, wxEXPAND, 5 );
70
71 m_previewPanelSizer = new wxBoxSizer( wxVERTICAL );
72
73
74 m_colorsMainSizer->Add( m_previewPanelSizer, 1, wxEXPAND, 5 );
75
76
77 m_panel1->SetSizer( m_colorsMainSizer );
78 m_panel1->Layout();
80 m_mainSizer->Add( m_panel1, 1, wxEXPAND, 5 );
81
82
83 this->SetSizer( m_mainSizer );
84 this->Layout();
85 m_mainSizer->Fit( this );
86
87 // Connect Events
88 this->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_COLOR_SETTINGS_BASE::OnSize ) );
89 m_cbTheme->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnThemeChanged ), NULL, this );
90 m_cbTheme->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( PANEL_COLOR_SETTINGS_BASE::OnLeftDownTheme ), NULL, this );
91 m_optOverrideColors->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnOverrideItemColorsClicked ), NULL, this );
92 m_btnOpenFolder->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnBtnOpenThemeFolderClicked ), NULL, this );
93}
94
96{
97 // Disconnect Events
98 this->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_COLOR_SETTINGS_BASE::OnSize ) );
99 m_cbTheme->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnThemeChanged ), NULL, this );
100 m_cbTheme->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( PANEL_COLOR_SETTINGS_BASE::OnLeftDownTheme ), NULL, this );
101 m_optOverrideColors->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnOverrideItemColorsClicked ), NULL, this );
102 m_btnOpenFolder->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_COLOR_SETTINGS_BASE::OnBtnOpenThemeFolderClicked ), NULL, this );
103
104}
const char * name
Definition: DXF_plotter.cpp:57
virtual void OnSize(wxSizeEvent &event)
virtual void OnOverrideItemColorsClicked(wxCommandEvent &event)
virtual void OnLeftDownTheme(wxMouseEvent &event)
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)
virtual void OnBtnOpenThemeFolderClicked(wxCommandEvent &event)
virtual void OnThemeChanged(wxCommandEvent &event)
A wxPanel that is designed to be reset in a standard manner.
#define _(s)