KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_sym_lib_table_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
9#include "widgets/wx_grid.h"
10
12
14
15PANEL_SYM_LIB_TABLE_BASE::PANEL_SYM_LIB_TABLE_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
16{
17 wxBoxSizer* bMainSizer;
18 bMainSizer = new wxBoxSizer( wxVERTICAL );
19
20 m_notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
21 m_global_panel = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
22 wxBoxSizer* m_global_sizer;
23 m_global_sizer = new wxBoxSizer( wxVERTICAL );
24
25 m_global_grid = new WX_GRID( m_global_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
26
27 // Grid
28 m_global_grid->CreateGrid( 1, 7 );
29 m_global_grid->EnableEditing( true );
30 m_global_grid->EnableGridLines( true );
31 m_global_grid->EnableDragGridSize( false );
32 m_global_grid->SetMargins( 0, 0 );
33
34 // Columns
35 m_global_grid->SetColSize( 0, 48 );
36 m_global_grid->SetColSize( 1, 48 );
37 m_global_grid->SetColSize( 2, 100 );
38 m_global_grid->SetColSize( 3, 240 );
39 m_global_grid->SetColSize( 4, 100 );
40 m_global_grid->SetColSize( 5, 80 );
41 m_global_grid->SetColSize( 6, 240 );
42 m_global_grid->EnableDragColMove( false );
43 m_global_grid->EnableDragColSize( true );
44 m_global_grid->SetColLabelValue( 0, _("Active") );
45 m_global_grid->SetColLabelValue( 1, _("Visible") );
46 m_global_grid->SetColLabelValue( 2, _("Nickname") );
47 m_global_grid->SetColLabelValue( 3, _("Library Path") );
48 m_global_grid->SetColLabelValue( 4, _("Library Format") );
49 m_global_grid->SetColLabelValue( 5, _("Options") );
50 m_global_grid->SetColLabelValue( 6, _("Description") );
52 m_global_grid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
53
54 // Rows
55 m_global_grid->AutoSizeRows();
56 m_global_grid->EnableDragRowSize( false );
57 m_global_grid->SetRowLabelSize( 0 );
58 m_global_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
59
60 // Label Appearance
61
62 // Cell Defaults
63 m_global_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
64 m_global_sizer->Add( m_global_grid, 5, wxALL|wxEXPAND, 5 );
65
66
67 m_global_panel->SetSizer( m_global_sizer );
68 m_global_panel->Layout();
69 m_global_sizer->Fit( m_global_panel );
70 m_notebook->AddPage( m_global_panel, _("Global Libraries"), true );
71 m_project_panel = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
72 wxBoxSizer* m_project_sizer;
73 m_project_sizer = new wxBoxSizer( wxVERTICAL );
74
75 m_project_grid = new WX_GRID( m_project_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
76
77 // Grid
78 m_project_grid->CreateGrid( 1, 7 );
79 m_project_grid->EnableEditing( true );
80 m_project_grid->EnableGridLines( true );
81 m_project_grid->EnableDragGridSize( false );
82 m_project_grid->SetMargins( 0, 0 );
83
84 // Columns
85 m_project_grid->SetColSize( 0, 48 );
86 m_project_grid->SetColSize( 1, 48 );
87 m_project_grid->SetColSize( 2, 100 );
88 m_project_grid->SetColSize( 3, 240 );
89 m_project_grid->SetColSize( 4, 100 );
90 m_project_grid->SetColSize( 5, 80 );
91 m_project_grid->SetColSize( 6, 240 );
92 m_project_grid->EnableDragColMove( false );
93 m_project_grid->EnableDragColSize( true );
94 m_project_grid->SetColLabelValue( 0, _("Active") );
95 m_project_grid->SetColLabelValue( 1, _("Visible") );
96 m_project_grid->SetColLabelValue( 2, _("Nickname") );
97 m_project_grid->SetColLabelValue( 3, _("Library Path") );
98 m_project_grid->SetColLabelValue( 4, _("Library Format") );
99 m_project_grid->SetColLabelValue( 5, _("Options") );
100 m_project_grid->SetColLabelValue( 6, _("Description") );
102 m_project_grid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
103
104 // Rows
105 m_project_grid->EnableDragRowSize( false );
106 m_project_grid->SetRowLabelSize( 0 );
107 m_project_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
108
109 // Label Appearance
110
111 // Cell Defaults
112 m_project_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
113 m_project_grid->SetMinSize( wxSize( 600,-1 ) );
114
115 m_project_sizer->Add( m_project_grid, 2, wxALL|wxEXPAND, 5 );
116
117
118 m_project_panel->SetSizer( m_project_sizer );
119 m_project_panel->Layout();
120 m_project_sizer->Fit( m_project_panel );
121 m_notebook->AddPage( m_project_panel, _("Project Specific Libraries"), false );
122
123 bMainSizer->Add( m_notebook, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
124
125 wxBoxSizer* bButtonsSizer;
126 bButtonsSizer = new wxBoxSizer( wxHORIZONTAL );
127
128 m_append_button = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
129 m_append_button->SetToolTip( _("Add empty row to table") );
130
131 bButtonsSizer->Add( m_append_button, 0, wxALL, 5 );
132
133 m_browse_button = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
134 m_browse_button->SetToolTip( _("Add existing library to table") );
135
136 bButtonsSizer->Add( m_browse_button, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
137
138 m_move_up_button = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
139 m_move_up_button->SetToolTip( _("Move up") );
140
141 bButtonsSizer->Add( m_move_up_button, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
142
143 m_move_down_button = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
144 m_move_down_button->SetToolTip( _("Move down") );
145
146 bButtonsSizer->Add( m_move_down_button, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
147
148
149 bButtonsSizer->Add( 20, 0, 0, wxEXPAND, 5 );
150
151 m_delete_button = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
152 m_delete_button->SetToolTip( _("Remove library from table") );
153
154 bButtonsSizer->Add( m_delete_button, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
155
156
157 bButtonsSizer->Add( 0, 0, 1, wxEXPAND, 5 );
158
159 m_convertLegacy = new wxButton( this, wxID_ANY, _("Migrate Libraries"), wxDefaultPosition, wxDefaultSize, 0 );
160 bButtonsSizer->Add( m_convertLegacy, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
161
162
163 bMainSizer->Add( bButtonsSizer, 0, wxEXPAND|wxALL, 3 );
164
165
166 bMainSizer->Add( 0, 5, 0, wxEXPAND, 5 );
167
168 wxStaticText* stPathsLabel;
169 stPathsLabel = new wxStaticText( this, wxID_ANY, _("Available path substitutions:"), wxDefaultPosition, wxDefaultSize, 0 );
170 stPathsLabel->Wrap( -1 );
171 bMainSizer->Add( stPathsLabel, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 8 );
172
173
174 bMainSizer->Add( 0, 2, 0, wxEXPAND, 5 );
175
176 m_path_subs_grid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
177
178 // Grid
179 m_path_subs_grid->CreateGrid( 1, 2 );
180 m_path_subs_grid->EnableEditing( false );
181 m_path_subs_grid->EnableGridLines( true );
182 m_path_subs_grid->EnableDragGridSize( false );
183 m_path_subs_grid->SetMargins( 0, 0 );
184
185 // Columns
186 m_path_subs_grid->SetColSize( 0, 150 );
187 m_path_subs_grid->SetColSize( 1, 500 );
188 m_path_subs_grid->AutoSizeColumns();
189 m_path_subs_grid->EnableDragColMove( false );
190 m_path_subs_grid->EnableDragColSize( true );
192 m_path_subs_grid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
193
194 // Rows
195 m_path_subs_grid->EnableDragRowSize( true );
196 m_path_subs_grid->SetRowLabelSize( 0 );
197 m_path_subs_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
198
199 // Label Appearance
200
201 // Cell Defaults
202 m_path_subs_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
203 m_path_subs_grid->SetToolTip( _("This is a read-only table which shows pertinent environment variables.") );
204
205 bMainSizer->Add( m_path_subs_grid, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
206
207
208 this->SetSizer( bMainSizer );
209 this->Layout();
210 bMainSizer->Fit( this );
211
212 // Connect Events
213 this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_SYM_LIB_TABLE_BASE::OnUpdateUI ) );
214 m_append_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SYM_LIB_TABLE_BASE::appendRowHandler ), NULL, this );
215 m_browse_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SYM_LIB_TABLE_BASE::browseLibrariesHandler ), NULL, this );
216 m_move_up_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SYM_LIB_TABLE_BASE::moveUpHandler ), NULL, this );
217 m_move_down_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SYM_LIB_TABLE_BASE::moveDownHandler ), NULL, this );
218 m_delete_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SYM_LIB_TABLE_BASE::deleteRowHandler ), NULL, this );
219 m_convertLegacy->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SYM_LIB_TABLE_BASE::onConvertLegacyLibraries ), NULL, this );
220 m_path_subs_grid->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_SYM_LIB_TABLE_BASE::onSizeGrid ), NULL, this );
221}
222
224{
225 // Disconnect Events
226 this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_SYM_LIB_TABLE_BASE::OnUpdateUI ) );
227 m_append_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SYM_LIB_TABLE_BASE::appendRowHandler ), NULL, this );
228 m_browse_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SYM_LIB_TABLE_BASE::browseLibrariesHandler ), NULL, this );
229 m_move_up_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SYM_LIB_TABLE_BASE::moveUpHandler ), NULL, this );
230 m_move_down_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SYM_LIB_TABLE_BASE::moveDownHandler ), NULL, this );
231 m_delete_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SYM_LIB_TABLE_BASE::deleteRowHandler ), NULL, this );
232 m_convertLegacy->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SYM_LIB_TABLE_BASE::onConvertLegacyLibraries ), NULL, this );
233 m_path_subs_grid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_SYM_LIB_TABLE_BASE::onSizeGrid ), NULL, this );
234
235}
const char * name
Definition: DXF_plotter.cpp:57
PANEL_SYM_LIB_TABLE_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)
STD_BITMAP_BUTTON * m_browse_button
virtual void onSizeGrid(wxSizeEvent &event)
STD_BITMAP_BUTTON * m_move_up_button
virtual void appendRowHandler(wxCommandEvent &event)
virtual void browseLibrariesHandler(wxCommandEvent &event)
virtual void OnUpdateUI(wxUpdateUIEvent &event)
STD_BITMAP_BUTTON * m_delete_button
virtual void moveUpHandler(wxCommandEvent &event)
virtual void moveDownHandler(wxCommandEvent &event)
virtual void onConvertLegacyLibraries(wxCommandEvent &event)
virtual void deleteRowHandler(wxCommandEvent &event)
STD_BITMAP_BUTTON * m_move_down_button
STD_BITMAP_BUTTON * m_append_button
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:211
#define _(s)