KiCad PCB EDA Suite
panel_fp_lib_table_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_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 )
15 {
16  wxBoxSizer* bMainSizer;
17  bMainSizer = new wxBoxSizer( wxVERTICAL );
18 
19  wxStaticBoxSizer* m_top_sizer;
20  m_top_sizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Libraries by Scope") ), wxVERTICAL );
21 
22  m_notebook = new wxNotebook( m_top_sizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
23  m_global_panel = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
24  wxBoxSizer* m_global_sizer;
25  m_global_sizer = new wxBoxSizer( wxVERTICAL );
26 
27  m_global_grid = new WX_GRID( m_global_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
28 
29  // Grid
30  m_global_grid->CreateGrid( 1, 5 );
31  m_global_grid->EnableEditing( true );
32  m_global_grid->EnableGridLines( true );
33  m_global_grid->EnableDragGridSize( false );
34  m_global_grid->SetMargins( 0, 0 );
35 
36  // Columns
37  m_global_grid->AutoSizeColumns();
38  m_global_grid->EnableDragColMove( false );
39  m_global_grid->EnableDragColSize( true );
41  m_global_grid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
42 
43  // Rows
44  m_global_grid->EnableDragRowSize( false );
45  m_global_grid->SetRowLabelSize( 0 );
46  m_global_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
47 
48  // Label Appearance
49 
50  // Cell Defaults
51  m_global_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
52  m_global_sizer->Add( m_global_grid, 1, wxALL|wxEXPAND, 5 );
53 
54 
55  m_global_panel->SetSizer( m_global_sizer );
56  m_global_panel->Layout();
57  m_global_sizer->Fit( m_global_panel );
58  m_notebook->AddPage( m_global_panel, _("Global Libraries"), true );
59  m_project_panel = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
60  wxBoxSizer* m_project_sizer;
61  m_project_sizer = new wxBoxSizer( wxVERTICAL );
62 
63  m_project_grid = new WX_GRID( m_project_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
64 
65  // Grid
66  m_project_grid->CreateGrid( 1, 5 );
67  m_project_grid->EnableEditing( true );
68  m_project_grid->EnableGridLines( true );
69  m_project_grid->EnableDragGridSize( false );
70  m_project_grid->SetMargins( 0, 0 );
71 
72  // Columns
73  m_project_grid->AutoSizeColumns();
74  m_project_grid->EnableDragColMove( false );
75  m_project_grid->EnableDragColSize( true );
77  m_project_grid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
78 
79  // Rows
80  m_project_grid->EnableDragRowSize( false );
81  m_project_grid->SetRowLabelSize( 0 );
82  m_project_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
83 
84  // Label Appearance
85 
86  // Cell Defaults
87  m_project_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
88  m_project_sizer->Add( m_project_grid, 1, wxALL|wxEXPAND, 5 );
89 
90 
91  m_project_panel->SetSizer( m_project_sizer );
92  m_project_panel->Layout();
93  m_project_sizer->Fit( m_project_panel );
94  m_notebook->AddPage( m_project_panel, _("Project Specific Libraries"), false );
95 
96  m_top_sizer->Add( m_notebook, 1, wxEXPAND|wxBOTTOM, 5 );
97 
98  m_buttonsPanel = new wxPanel( m_top_sizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
99  wxBoxSizer* bButtonsSizer;
100  bButtonsSizer = new wxBoxSizer( wxHORIZONTAL );
101 
102  m_append_button = new wxBitmapButton( m_buttonsPanel, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
103  m_append_button->SetToolTip( _("Add empty row to table") );
104 
105  bButtonsSizer->Add( m_append_button, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 );
106 
107  m_browseButton = new SPLIT_BUTTON( m_buttonsPanel, wxID_ANY, _( "Add Existing" ), wxDefaultPosition );
108  bButtonsSizer->Add( m_browseButton, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 );
109 
110  m_move_up_button = new wxBitmapButton( m_buttonsPanel, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
111  m_move_up_button->SetToolTip( _("Move up") );
112 
113  bButtonsSizer->Add( m_move_up_button, 0, wxBOTTOM|wxRIGHT, 5 );
114 
115  m_move_down_button = new wxBitmapButton( m_buttonsPanel, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
116  m_move_down_button->SetToolTip( _("Move down") );
117 
118  bButtonsSizer->Add( m_move_down_button, 0, wxBOTTOM|wxRIGHT, 5 );
119 
120 
121  bButtonsSizer->Add( 20, 0, 0, wxEXPAND, 5 );
122 
123  m_delete_button = new wxBitmapButton( m_buttonsPanel, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
124  m_delete_button->SetToolTip( _("Remove library from table") );
125 
126  bButtonsSizer->Add( m_delete_button, 0, wxBOTTOM|wxRIGHT, 5 );
127 
128 
129  m_buttonsPanel->SetSizer( bButtonsSizer );
130  m_buttonsPanel->Layout();
131  bButtonsSizer->Fit( m_buttonsPanel );
132  m_top_sizer->Add( m_buttonsPanel, 0, 0, 5 );
133 
134 
135  bMainSizer->Add( m_top_sizer, 1, wxEXPAND|wxALL, 5 );
136 
137  wxStaticBoxSizer* sbSizer1;
138  sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Path Substitutions") ), wxVERTICAL );
139 
140  m_path_subs_grid = new WX_GRID( sbSizer1->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
141 
142  // Grid
143  m_path_subs_grid->CreateGrid( 1, 2 );
144  m_path_subs_grid->EnableEditing( false );
145  m_path_subs_grid->EnableGridLines( true );
146  m_path_subs_grid->EnableDragGridSize( false );
147  m_path_subs_grid->SetMargins( 0, 0 );
148 
149  // Columns
150  m_path_subs_grid->SetColSize( 0, 150 );
151  m_path_subs_grid->SetColSize( 1, 500 );
152  m_path_subs_grid->AutoSizeColumns();
153  m_path_subs_grid->EnableDragColMove( false );
154  m_path_subs_grid->EnableDragColSize( true );
156  m_path_subs_grid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
157 
158  // Rows
159  m_path_subs_grid->EnableDragRowSize( true );
160  m_path_subs_grid->SetRowLabelSize( 0 );
161  m_path_subs_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
162 
163  // Label Appearance
164 
165  // Cell Defaults
166  m_path_subs_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
167  m_path_subs_grid->SetToolTip( _("This is a read-only table which shows pertinent environment variables.") );
168 
169  sbSizer1->Add( m_path_subs_grid, 1, wxALL|wxEXPAND, 5 );
170 
171 
172  bMainSizer->Add( sbSizer1, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
173 
174 
175  this->SetSizer( bMainSizer );
176  this->Layout();
177  bMainSizer->Fit( this );
178 
179  // Connect Events
180  this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_FP_LIB_TABLE_BASE::OnUpdateUI ) );
181  m_append_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::appendRowHandler ), NULL, this );
182  m_move_up_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::moveUpHandler ), NULL, this );
183  m_move_down_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::moveDownHandler ), NULL, this );
184  m_delete_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::deleteRowHandler ), NULL, this );
185  m_path_subs_grid->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_FP_LIB_TABLE_BASE::onSizeGrid ), NULL, this );
186 }
187 
189 {
190  // Disconnect Events
191  this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_FP_LIB_TABLE_BASE::OnUpdateUI ) );
192  m_append_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::appendRowHandler ), NULL, this );
193  m_move_up_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::moveUpHandler ), NULL, this );
194  m_move_down_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::moveDownHandler ), NULL, this );
195  m_delete_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::deleteRowHandler ), NULL, this );
196  m_path_subs_grid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_FP_LIB_TABLE_BASE::onSizeGrid ), NULL, this );
197 
198 }
virtual void onSizeGrid(wxSizeEvent &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)
#define _(s)
virtual void moveDownHandler(wxCommandEvent &event)
virtual void OnUpdateUI(wxUpdateUIEvent &event)
virtual void appendRowHandler(wxCommandEvent &event)
virtual void moveUpHandler(wxCommandEvent &event)
const char * name
Definition: DXF_plotter.cpp:56
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 deleteRowHandler(wxCommandEvent &event)