KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_fp_user_layer_names_base.cpp
Go to the documentation of this file.
1
2// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty)
3// http://www.wxformbuilder.org/
4//
5// PLEASE DO *NOT* EDIT THIS FILE!
7
9#include "widgets/wx_grid.h"
10
12
14
15PANEL_FP_USER_LAYER_NAMES_BASE::PANEL_FP_USER_LAYER_NAMES_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : RESETTABLE_PANEL( parent, id, pos, size, style, name )
16{
17 wxBoxSizer* bSizerMain;
18 bSizerMain = new wxBoxSizer( wxVERTICAL );
19
20 wxBoxSizer* bSizerMargins;
21 bSizerMargins = new wxBoxSizer( wxVERTICAL );
22
23 wxBoxSizer* bSizerUserLayerCount;
24 bSizerUserLayerCount = new wxBoxSizer( wxHORIZONTAL );
25
26 m_lblUserLayers = new wxStaticText( this, wxID_ANY, _("User layers:"), wxDefaultPosition, wxDefaultSize, 0 );
27 m_lblUserLayers->Wrap( -1 );
28 bSizerUserLayerCount->Add( m_lblUserLayers, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
29
30 wxString m_choiceUserLayersChoices[] = { _("0"), _("1"), _("2"), _("3"), _("4"), _("5"), _("6"), _("7"), _("8"), _("9") };
31 int m_choiceUserLayersNChoices = sizeof( m_choiceUserLayersChoices ) / sizeof( wxString );
32 m_choiceUserLayers = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUserLayersNChoices, m_choiceUserLayersChoices, 0 );
33 m_choiceUserLayers->SetSelection( 0 );
34 bSizerUserLayerCount->Add( m_choiceUserLayers, 0, wxALIGN_CENTER_VERTICAL, 5 );
35
36
37 bSizerUserLayerCount->Add( 0, 0, 1, wxEXPAND, 5 );
38
39
40 bSizerMargins->Add( bSizerUserLayerCount, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 8 );
41
42
43 bSizerMargins->Add( 0, 10, 0, wxEXPAND, 5 );
44
45 m_layerNamesLabel = new wxStaticText( this, wxID_ANY, _("User Layer Names"), wxDefaultPosition, wxDefaultSize, 0 );
46 m_layerNamesLabel->Wrap( -1 );
47 bSizerMargins->Add( m_layerNamesLabel, 0, wxTOP|wxLEFT|wxEXPAND, 8 );
48
49
50 bSizerMargins->Add( 0, 4, 0, wxEXPAND, 5 );
51
52 wxBoxSizer* layerNamesSizer;
53 layerNamesSizer = new wxBoxSizer( wxVERTICAL );
54
55 m_layerNamesGrid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxTAB_TRAVERSAL );
56
57 // Grid
58 m_layerNamesGrid->CreateGrid( 0, 2 );
59 m_layerNamesGrid->EnableEditing( true );
60 m_layerNamesGrid->EnableGridLines( true );
61 m_layerNamesGrid->EnableDragGridSize( false );
62 m_layerNamesGrid->SetMargins( 0, 0 );
63
64 // Columns
65 m_layerNamesGrid->SetColSize( 0, 200 );
66 m_layerNamesGrid->SetColSize( 1, 220 );
67 m_layerNamesGrid->EnableDragColMove( false );
68 m_layerNamesGrid->EnableDragColSize( true );
69 m_layerNamesGrid->SetColLabelValue( 0, _("Layer") );
70 m_layerNamesGrid->SetColLabelValue( 1, _("Name") );
71 m_layerNamesGrid->SetColLabelSize( wxGRID_AUTOSIZE );
72 m_layerNamesGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
73
74 // Rows
75 m_layerNamesGrid->EnableDragRowSize( false );
76 m_layerNamesGrid->SetRowLabelSize( 0 );
77 m_layerNamesGrid->SetRowLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
78
79 // Label Appearance
80
81 // Cell Defaults
82 m_layerNamesGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
83 m_layerNamesGrid->SetMinSize( wxSize( -1,140 ) );
84
85 layerNamesSizer->Add( m_layerNamesGrid, 1, wxEXPAND, 5 );
86
87 wxBoxSizer* bButtonSize;
88 bButtonSize = new wxBoxSizer( wxHORIZONTAL );
89
90 m_bpAdd = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
91 m_bpAdd->SetMinSize( wxSize( 30,29 ) );
92
93 bButtonSize->Add( m_bpAdd, 0, wxBOTTOM|wxLEFT|wxTOP, 5 );
94
95
96 bButtonSize->Add( 20, 0, 0, wxEXPAND, 5 );
97
98 m_bpDelete = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
99 m_bpDelete->SetMinSize( wxSize( 30,29 ) );
100
101 bButtonSize->Add( m_bpDelete, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxTOP, 5 );
102
103
104 bButtonSize->Add( 0, 0, 1, wxEXPAND, 5 );
105
106
107 layerNamesSizer->Add( bButtonSize, 0, wxEXPAND, 5 );
108
109
110 bSizerMargins->Add( layerNamesSizer, 1, wxEXPAND, 20 );
111
112
113 bSizerMain->Add( bSizerMargins, 1, wxEXPAND, 5 );
114
115
116 this->SetSizer( bSizerMain );
117 this->Layout();
118 bSizerMain->Fit( this );
119
120 // Connect Events
121 m_choiceUserLayers->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_FP_USER_LAYER_NAMES_BASE::onUserLayerCountChange ), NULL, this );
122 m_layerNamesGrid->Connect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( PANEL_FP_USER_LAYER_NAMES_BASE::onLayerChange ), NULL, this );
123 m_bpAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_USER_LAYER_NAMES_BASE::OnAddLayerItem ), NULL, this );
124 m_bpDelete->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_USER_LAYER_NAMES_BASE::OnDeleteLayerItem ), NULL, this );
125}
126
128{
129 // Disconnect Events
130 m_choiceUserLayers->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_FP_USER_LAYER_NAMES_BASE::onUserLayerCountChange ), NULL, this );
131 m_layerNamesGrid->Disconnect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( PANEL_FP_USER_LAYER_NAMES_BASE::onLayerChange ), NULL, this );
132 m_bpAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_USER_LAYER_NAMES_BASE::OnAddLayerItem ), NULL, this );
133 m_bpDelete->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_USER_LAYER_NAMES_BASE::OnDeleteLayerItem ), NULL, this );
134
135}
const char * name
virtual void OnDeleteLayerItem(wxCommandEvent &event)
virtual void onLayerChange(wxGridEvent &event)
virtual void OnAddLayerItem(wxCommandEvent &event)
virtual void onUserLayerCountChange(wxCommandEvent &event)
PANEL_FP_USER_LAYER_NAMES_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)
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)
A bitmap button widget that behaves like a standard dialog button except with an icon.
#define _(s)