KiCad PCB EDA Suite
panel_fp_editor_defaults_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version Oct 26 2018)
3 // http://www.wxformbuilder.org/
4 //
5 // PLEASE DO *NOT* EDIT THIS FILE!
7 
8 #include "widgets/wx_grid.h"
9 
11 
13 
14 PANEL_FP_EDITOR_DEFAULTS_BASE::PANEL_FP_EDITOR_DEFAULTS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
15 {
16  wxBoxSizer* bSizerMain;
17  bSizerMain = new wxBoxSizer( wxVERTICAL );
18 
19  wxBoxSizer* bSizerMargins;
20  bSizerMargins = new wxBoxSizer( wxVERTICAL );
21 
22  defaultTextItemsLabel = new wxStaticText( this, wxID_ANY, _("Default text items for new footprints:"), wxDefaultPosition, wxDefaultSize, 0 );
23  defaultTextItemsLabel->Wrap( -1 );
24  bSizerMargins->Add( defaultTextItemsLabel, 0, wxTOP|wxLEFT, 5 );
25 
26  wxBoxSizer* defaultTextItemsSizer;
27  defaultTextItemsSizer = new wxBoxSizer( wxVERTICAL );
28 
29  m_textItemsGrid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxBORDER_SIMPLE|wxTAB_TRAVERSAL );
30 
31  // Grid
32  m_textItemsGrid->CreateGrid( 2, 3 );
33  m_textItemsGrid->EnableEditing( true );
34  m_textItemsGrid->EnableGridLines( true );
35  m_textItemsGrid->EnableDragGridSize( false );
36  m_textItemsGrid->SetMargins( 0, 0 );
37 
38  // Columns
39  m_textItemsGrid->SetColSize( 0, 268 );
40  m_textItemsGrid->SetColSize( 1, 60 );
41  m_textItemsGrid->SetColSize( 2, 120 );
42  m_textItemsGrid->EnableDragColMove( false );
43  m_textItemsGrid->EnableDragColSize( true );
45  m_textItemsGrid->SetColLabelValue( 0, _("Text Items") );
46  m_textItemsGrid->SetColLabelValue( 1, _("Show") );
47  m_textItemsGrid->SetColLabelValue( 2, _("Layer") );
48  m_textItemsGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
49 
50  // Rows
51  m_textItemsGrid->EnableDragRowSize( false );
52  m_textItemsGrid->SetRowLabelSize( 160 );
53  m_textItemsGrid->SetRowLabelValue( 0, _("Reference designator") );
54  m_textItemsGrid->SetRowLabelValue( 1, _("Value") );
55  m_textItemsGrid->SetRowLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
56 
57  // Label Appearance
58 
59  // Cell Defaults
60  m_textItemsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
61  m_textItemsGrid->SetMinSize( wxSize( -1,140 ) );
62 
63  defaultTextItemsSizer->Add( m_textItemsGrid, 1, wxALL|wxBOTTOM|wxEXPAND, 5 );
64 
65  wxBoxSizer* bButtonSize;
66  bButtonSize = new wxBoxSizer( wxHORIZONTAL );
67 
68  m_bpAdd = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
69  m_bpAdd->SetMinSize( wxSize( 30,29 ) );
70 
71  bButtonSize->Add( m_bpAdd, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 );
72 
73 
74  bButtonSize->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
75 
76  m_bpDelete = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
77  m_bpDelete->SetMinSize( wxSize( 30,29 ) );
78 
79  bButtonSize->Add( m_bpDelete, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 );
80 
81 
82  bButtonSize->Add( 0, 0, 1, wxEXPAND, 5 );
83 
84  m_staticTextInfo = new wxStaticText( this, wxID_ANY, _("Note: a blank reference designator or value will use the footprint name."), wxDefaultPosition, wxDefaultSize, 0 );
85  m_staticTextInfo->Wrap( -1 );
86  bButtonSize->Add( m_staticTextInfo, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
87 
88 
89  defaultTextItemsSizer->Add( bButtonSize, 0, wxEXPAND, 5 );
90 
91 
92  bSizerMargins->Add( defaultTextItemsSizer, 1, wxEXPAND|wxLEFT, 20 );
93 
94 
95  bSizerMargins->Add( 0, 0, 0, wxEXPAND|wxTOP|wxBOTTOM, 10 );
96 
97  wxBoxSizer* defaultPropertiesSizer;
98  defaultPropertiesSizer = new wxBoxSizer( wxVERTICAL );
99 
100  wxStaticText* defaultPropertiesLabel;
101  defaultPropertiesLabel = new wxStaticText( this, wxID_ANY, _("Default properties for new graphic items:"), wxDefaultPosition, wxDefaultSize, 0 );
102  defaultPropertiesLabel->Wrap( -1 );
103  defaultPropertiesSizer->Add( defaultPropertiesLabel, 0, wxBOTTOM|wxRIGHT, 5 );
104 
105  m_graphicsGrid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SIMPLE|wxTAB_TRAVERSAL );
106 
107  // Grid
108  m_graphicsGrid->CreateGrid( 6, 5 );
109  m_graphicsGrid->EnableEditing( true );
110  m_graphicsGrid->EnableGridLines( true );
111  m_graphicsGrid->EnableDragGridSize( false );
112  m_graphicsGrid->SetMargins( 0, 0 );
113 
114  // Columns
115  m_graphicsGrid->SetColSize( 0, 110 );
116  m_graphicsGrid->SetColSize( 1, 100 );
117  m_graphicsGrid->SetColSize( 2, 100 );
118  m_graphicsGrid->SetColSize( 3, 100 );
119  m_graphicsGrid->SetColSize( 4, 60 );
120  m_graphicsGrid->EnableDragColMove( false );
121  m_graphicsGrid->EnableDragColSize( true );
123  m_graphicsGrid->SetColLabelValue( 0, _("Line Thickness") );
124  m_graphicsGrid->SetColLabelValue( 1, _("Text Width") );
125  m_graphicsGrid->SetColLabelValue( 2, _("Text Height") );
126  m_graphicsGrid->SetColLabelValue( 3, _("Text Thickness") );
127  m_graphicsGrid->SetColLabelValue( 4, _("Italic") );
128  m_graphicsGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
129 
130  // Rows
131  m_graphicsGrid->EnableDragRowSize( false );
132  m_graphicsGrid->SetRowLabelSize( 125 );
133  m_graphicsGrid->SetRowLabelValue( 0, _("Silk Layers") );
134  m_graphicsGrid->SetRowLabelValue( 1, _("Copper Layers") );
135  m_graphicsGrid->SetRowLabelValue( 2, _("Edge Cuts") );
136  m_graphicsGrid->SetRowLabelValue( 3, _("Courtyards") );
137  m_graphicsGrid->SetRowLabelValue( 4, _("Fab Layers") );
138  m_graphicsGrid->SetRowLabelValue( 5, _("Other Layers") );
139  m_graphicsGrid->SetRowLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
140 
141  // Label Appearance
142 
143  // Cell Defaults
144  m_graphicsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
145  defaultPropertiesSizer->Add( m_graphicsGrid, 1, wxBOTTOM|wxLEFT, 20 );
146 
147 
148  bSizerMargins->Add( defaultPropertiesSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
149 
150 
151  bSizerMain->Add( bSizerMargins, 1, wxRIGHT|wxLEFT, 5 );
152 
153 
154  this->SetSizer( bSizerMain );
155  this->Layout();
156  bSizerMain->Fit( this );
157 
158  // Connect Events
159  m_textItemsGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_FP_EDITOR_DEFAULTS_BASE::OnGridSize ), NULL, this );
160  m_bpAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_EDITOR_DEFAULTS_BASE::OnAddTextItem ), NULL, this );
161  m_bpDelete->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_EDITOR_DEFAULTS_BASE::OnDeleteTextItem ), NULL, this );
162 }
163 
165 {
166  // Disconnect Events
167  m_textItemsGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_FP_EDITOR_DEFAULTS_BASE::OnGridSize ), NULL, this );
168  m_bpAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_EDITOR_DEFAULTS_BASE::OnAddTextItem ), NULL, this );
169  m_bpDelete->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_EDITOR_DEFAULTS_BASE::OnDeleteTextItem ), NULL, this );
170 
171 }
virtual void OnGridSize(wxSizeEvent &event)
#define _(s)
const char * name
Definition: DXF_plotter.cpp:56
virtual void OnAddTextItem(wxCommandEvent &event)
void SetColLabelSize(int aHeight)
Hide wxGrid's SetColLabelSize() method with one which makes sure the size is tall enough for the syst...
Definition: wx_grid.cpp:53
virtual void OnDeleteTextItem(wxCommandEvent &event)
PANEL_FP_EDITOR_DEFAULTS_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)