KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_fp_editor_field_defaults_base.cpp
Go to the documentation of this file.
1
2// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
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_EDITOR_FIELD_DEFAULTS_BASE::PANEL_FP_EDITOR_FIELD_DEFAULTS_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 defaultFieldPropertiesLabel = new wxStaticText( this, wxID_ANY, _("Default field properties for new footprints:"), wxDefaultPosition, wxDefaultSize, 0 );
25 bSizerMargins->Add( defaultFieldPropertiesLabel, 0, wxTOP|wxRIGHT|wxLEFT, 8 );
26
27
28 bSizerMargins->Add( 0, 4, 0, wxEXPAND, 5 );
29
30 wxBoxSizer* defaultFieldPropertiesSizer;
31 defaultFieldPropertiesSizer = new wxBoxSizer( wxVERTICAL );
32
33 m_fieldPropsGrid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxTAB_TRAVERSAL );
34
35 // Grid
36 m_fieldPropsGrid->CreateGrid( 2, 3 );
37 m_fieldPropsGrid->EnableEditing( true );
38 m_fieldPropsGrid->EnableGridLines( true );
39 m_fieldPropsGrid->EnableDragGridSize( false );
40 m_fieldPropsGrid->SetMargins( 0, 0 );
41
42 // Columns
43 m_fieldPropsGrid->SetColSize( 0, 240 );
44 m_fieldPropsGrid->SetColSize( 1, 60 );
45 m_fieldPropsGrid->SetColSize( 2, 120 );
46 m_fieldPropsGrid->EnableDragColMove( false );
47 m_fieldPropsGrid->EnableDragColSize( true );
48 m_fieldPropsGrid->SetColLabelValue( 0, _("Value") );
49 m_fieldPropsGrid->SetColLabelValue( 1, _("Show") );
50 m_fieldPropsGrid->SetColLabelValue( 2, _("Layer") );
51 m_fieldPropsGrid->SetColLabelSize( wxGRID_AUTOSIZE );
52 m_fieldPropsGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
53
54 // Rows
55 m_fieldPropsGrid->EnableDragRowSize( false );
56 m_fieldPropsGrid->SetRowLabelValue( 0, _("Reference designator") );
57 m_fieldPropsGrid->SetRowLabelValue( 1, _("Value") );
58 m_fieldPropsGrid->SetRowLabelSize( 160 );
59 m_fieldPropsGrid->SetRowLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
60
61 // Label Appearance
62
63 // Cell Defaults
64 m_fieldPropsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
65 defaultFieldPropertiesSizer->Add( m_fieldPropsGrid, 0, wxEXPAND, 5 );
66
67
68 bSizerMargins->Add( defaultFieldPropertiesSizer, 0, wxEXPAND, 5 );
69
70
71 bSizerMargins->Add( 5, 25, 0, wxEXPAND, 5 );
72
73 defaultTextItemsLabel = new wxStaticText( this, wxID_ANY, _("Default text items for new footprints:"), wxDefaultPosition, wxDefaultSize, 0 );
74 defaultTextItemsLabel->Wrap( -1 );
75 bSizerMargins->Add( defaultTextItemsLabel, 0, wxTOP|wxLEFT|wxEXPAND, 8 );
76
77
78 bSizerMargins->Add( 0, 4, 0, wxEXPAND, 5 );
79
80 wxBoxSizer* defaultTextItemsSizer;
81 defaultTextItemsSizer = new wxBoxSizer( wxVERTICAL );
82
83 m_textItemsGrid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxTAB_TRAVERSAL );
84
85 // Grid
86 m_textItemsGrid->CreateGrid( 0, 3 );
87 m_textItemsGrid->EnableEditing( true );
88 m_textItemsGrid->EnableGridLines( true );
89 m_textItemsGrid->EnableDragGridSize( false );
90 m_textItemsGrid->SetMargins( 0, 0 );
91
92 // Columns
93 m_textItemsGrid->SetColSize( 0, 400 );
94 m_textItemsGrid->SetColSize( 1, 60 );
95 m_textItemsGrid->SetColSize( 2, 120 );
96 m_textItemsGrid->EnableDragColMove( false );
97 m_textItemsGrid->EnableDragColSize( true );
98 m_textItemsGrid->SetColLabelValue( 0, _("Text Items") );
99 m_textItemsGrid->SetColLabelValue( 1, _("Show") );
100 m_textItemsGrid->SetColLabelValue( 2, _("Layer") );
101 m_textItemsGrid->SetColLabelSize( wxGRID_AUTOSIZE );
102 m_textItemsGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
103
104 // Rows
105 m_textItemsGrid->EnableDragRowSize( false );
106 m_textItemsGrid->SetRowLabelSize( 0 );
107 m_textItemsGrid->SetRowLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
108
109 // Label Appearance
110
111 // Cell Defaults
112 m_textItemsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
113 m_textItemsGrid->SetMinSize( wxSize( -1,140 ) );
114
115 defaultTextItemsSizer->Add( m_textItemsGrid, 1, wxEXPAND, 5 );
116
117 wxBoxSizer* bButtonSize;
118 bButtonSize = new wxBoxSizer( wxHORIZONTAL );
119
120 m_bpAdd = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
121 m_bpAdd->SetMinSize( wxSize( 30,29 ) );
122
123 bButtonSize->Add( m_bpAdd, 0, wxBOTTOM|wxLEFT|wxTOP, 5 );
124
125
126 bButtonSize->Add( 20, 0, 0, wxEXPAND, 5 );
127
128 m_bpDelete = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
129 m_bpDelete->SetMinSize( wxSize( 30,29 ) );
130
131 bButtonSize->Add( m_bpDelete, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxTOP, 5 );
132
133
134 bButtonSize->Add( 0, 0, 1, wxEXPAND, 5 );
135
136
137 defaultTextItemsSizer->Add( bButtonSize, 0, wxEXPAND, 5 );
138
139
140 bSizerMargins->Add( defaultTextItemsSizer, 1, wxEXPAND, 20 );
141
142
143 bSizerMain->Add( bSizerMargins, 1, wxEXPAND, 5 );
144
145
146 this->SetSizer( bSizerMain );
147 this->Layout();
148 bSizerMain->Fit( this );
149
150 // Connect Events
151 m_fieldPropsGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_FP_EDITOR_FIELD_DEFAULTS_BASE::OnGridSize ), NULL, this );
152 m_textItemsGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_FP_EDITOR_FIELD_DEFAULTS_BASE::OnGridSize ), NULL, this );
153 m_bpAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_EDITOR_FIELD_DEFAULTS_BASE::OnAddTextItem ), NULL, this );
154 m_bpDelete->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_EDITOR_FIELD_DEFAULTS_BASE::OnDeleteTextItem ), NULL, this );
155}
156
158{
159 // Disconnect Events
160 m_fieldPropsGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_FP_EDITOR_FIELD_DEFAULTS_BASE::OnGridSize ), NULL, this );
161 m_textItemsGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_FP_EDITOR_FIELD_DEFAULTS_BASE::OnGridSize ), NULL, this );
162 m_bpAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_EDITOR_FIELD_DEFAULTS_BASE::OnAddTextItem ), NULL, this );
163 m_bpDelete->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_EDITOR_FIELD_DEFAULTS_BASE::OnDeleteTextItem ), NULL, this );
164
165}
const char * name
Definition: DXF_plotter.cpp:57
PANEL_FP_EDITOR_FIELD_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)
virtual void OnAddTextItem(wxCommandEvent &event)
virtual void OnDeleteTextItem(wxCommandEvent &event)
A wxPanel that is designed to be reset in a standard manner.
A bitmap button widget that behaves like a standard dialog button except with an icon.
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:249
#define _(s)