KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_fp_lib_table_base.cpp
Go to the documentation of this file.
1
2// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf0)
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_LIB_TABLE_BASE::PANEL_FP_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->EnableDragRowSize( false );
56 m_global_grid->SetRowLabelSize( 0 );
57 m_global_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
58
59 // Label Appearance
60
61 // Cell Defaults
62 m_global_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
63 m_global_sizer->Add( m_global_grid, 1, wxALL|wxEXPAND, 5 );
64
65
66 m_global_panel->SetSizer( m_global_sizer );
67 m_global_panel->Layout();
68 m_global_sizer->Fit( m_global_panel );
69 m_notebook->AddPage( m_global_panel, _("Global Libraries"), true );
70 m_project_panel = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
71 wxBoxSizer* m_project_sizer;
72 m_project_sizer = new wxBoxSizer( wxVERTICAL );
73
74 m_project_grid = new WX_GRID( m_project_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
75
76 // Grid
77 m_project_grid->CreateGrid( 1, 7 );
78 m_project_grid->EnableEditing( true );
79 m_project_grid->EnableGridLines( true );
80 m_project_grid->EnableDragGridSize( false );
81 m_project_grid->SetMargins( 0, 0 );
82
83 // Columns
84 m_project_grid->SetColSize( 0, 48 );
85 m_project_grid->SetColSize( 1, 48 );
86 m_project_grid->SetColSize( 2, 100 );
87 m_project_grid->SetColSize( 3, 240 );
88 m_project_grid->SetColSize( 4, 100 );
89 m_project_grid->SetColSize( 5, 80 );
90 m_project_grid->SetColSize( 6, 240 );
91 m_project_grid->EnableDragColMove( false );
92 m_project_grid->EnableDragColSize( true );
93 m_project_grid->SetColLabelValue( 0, _("Active") );
94 m_project_grid->SetColLabelValue( 1, _("Visible") );
95 m_project_grid->SetColLabelValue( 2, _("Nickname") );
96 m_project_grid->SetColLabelValue( 3, _("Library Path") );
97 m_project_grid->SetColLabelValue( 4, _("LIbrary Format") );
98 m_project_grid->SetColLabelValue( 5, _("Options") );
99 m_project_grid->SetColLabelValue( 6, _("Description") );
101 m_project_grid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
102
103 // Rows
104 m_project_grid->EnableDragRowSize( false );
105 m_project_grid->SetRowLabelSize( 0 );
106 m_project_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
107
108 // Label Appearance
109
110 // Cell Defaults
111 m_project_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
112 m_project_sizer->Add( m_project_grid, 1, wxALL|wxEXPAND, 5 );
113
114
115 m_project_panel->SetSizer( m_project_sizer );
116 m_project_panel->Layout();
117 m_project_sizer->Fit( m_project_panel );
118 m_notebook->AddPage( m_project_panel, _("Project Specific Libraries"), false );
119
120 bMainSizer->Add( m_notebook, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
121
122 wxBoxSizer* bButtonsSizer;
123 bButtonsSizer = new wxBoxSizer( wxHORIZONTAL );
124
125 m_append_button = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
126 m_append_button->SetToolTip( _("Add empty row to table") );
127
128 bButtonsSizer->Add( m_append_button, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
129
130 m_browseButton = new SPLIT_BUTTON( this, wxID_ANY, _( "Add Existing" ), wxDefaultPosition );
131 m_browseButton->SetToolTip( _("Add Existing") );
132
133 bButtonsSizer->Add( m_browseButton, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
134
135 m_move_up_button = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
136 m_move_up_button->SetToolTip( _("Move up") );
137
138 bButtonsSizer->Add( m_move_up_button, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
139
140 m_move_down_button = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
141 m_move_down_button->SetToolTip( _("Move down") );
142
143 bButtonsSizer->Add( m_move_down_button, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
144
145
146 bButtonsSizer->Add( 20, 0, 0, wxEXPAND, 5 );
147
148 m_delete_button = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
149 m_delete_button->SetToolTip( _("Remove library from table") );
150
151 bButtonsSizer->Add( m_delete_button, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
152
153
154 bButtonsSizer->Add( 20, 0, 1, wxEXPAND, 5 );
155
156 m_resetGlobal = new wxButton( this, wxID_ANY, _("Reset Libraries"), wxDefaultPosition, wxDefaultSize, 0 );
157 bButtonsSizer->Add( m_resetGlobal, 0, wxALL, 5 );
158
159
160 bButtonsSizer->Add( 0, 0, 0, wxEXPAND, 5 );
161
162 m_migrate_libs_button = new wxButton( this, wxID_ANY, _("Migrate Libraries"), wxDefaultPosition, wxDefaultSize, 0 );
163 bButtonsSizer->Add( m_migrate_libs_button, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
164
165
166 bMainSizer->Add( bButtonsSizer, 0, wxEXPAND|wxALL, 8 );
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, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 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_FP_LIB_TABLE_BASE::OnUpdateUI ) );
214 m_notebook->Connect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( PANEL_FP_LIB_TABLE_BASE::onPageChange ), NULL, this );
215 m_append_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::appendRowHandler ), NULL, this );
216 m_move_up_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::moveUpHandler ), NULL, this );
217 m_move_down_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::moveDownHandler ), NULL, this );
218 m_delete_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::deleteRowHandler ), NULL, this );
219 m_resetGlobal->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::onReset ), NULL, this );
220 m_migrate_libs_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::onMigrateLibraries ), NULL, this );
221 m_path_subs_grid->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_FP_LIB_TABLE_BASE::onSizeGrid ), NULL, this );
222}
223
225{
226 // Disconnect Events
227 this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_FP_LIB_TABLE_BASE::OnUpdateUI ) );
228 m_notebook->Disconnect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( PANEL_FP_LIB_TABLE_BASE::onPageChange ), NULL, this );
229 m_append_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::appendRowHandler ), NULL, this );
230 m_move_up_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::moveUpHandler ), NULL, this );
231 m_move_down_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::moveDownHandler ), NULL, this );
232 m_delete_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::deleteRowHandler ), NULL, this );
233 m_resetGlobal->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::onReset ), NULL, this );
234 m_migrate_libs_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::onMigrateLibraries ), NULL, this );
235 m_path_subs_grid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_FP_LIB_TABLE_BASE::onSizeGrid ), NULL, this );
236
237}
const char * name
Definition: DXF_plotter.cpp:57
STD_BITMAP_BUTTON * m_move_up_button
virtual void deleteRowHandler(wxCommandEvent &event)
virtual void appendRowHandler(wxCommandEvent &event)
virtual void onSizeGrid(wxSizeEvent &event)
STD_BITMAP_BUTTON * m_append_button
virtual void onPageChange(wxNotebookEvent &event)
STD_BITMAP_BUTTON * m_move_down_button
STD_BITMAP_BUTTON * m_delete_button
virtual void OnUpdateUI(wxUpdateUIEvent &event)
virtual void moveUpHandler(wxCommandEvent &event)
virtual void onMigrateLibraries(wxCommandEvent &event)
PANEL_FP_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)
virtual void onReset(wxCommandEvent &event)
virtual void moveDownHandler(wxCommandEvent &event)
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)