KiCad PCB EDA Suite
PANEL_FP_LIB_TABLE_BASE Class Reference

Class PANEL_FP_LIB_TABLE_BASE. More...

#include <panel_fp_lib_table_base.h>

Inheritance diagram for PANEL_FP_LIB_TABLE_BASE:
PANEL_FP_LIB_TABLE

Public Member Functions

 PANEL_FP_LIB_TABLE_BASE (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(500, 300), long style=wxTAB_TRAVERSAL)
 
 ~PANEL_FP_LIB_TABLE_BASE ()
 

Protected Member Functions

virtual void pageChangedHandler (wxAuiNotebookEvent &event)
 
virtual void appendRowHandler (wxCommandEvent &event)
 
virtual void browseLibrariesHandler (wxCommandEvent &event)
 
virtual void moveUpHandler (wxCommandEvent &event)
 
virtual void moveDownHandler (wxCommandEvent &event)
 
virtual void deleteRowHandler (wxCommandEvent &event)
 
virtual void onSizeGrid (wxSizeEvent &event)
 

Protected Attributes

wxAuiNotebook * m_auinotebook
 
wxPanel * m_global_panel
 
wxStaticText * m_staticText3
 
wxStaticText * m_GblTableFilename
 
WX_GRIDm_global_grid
 
wxPanel * m_project_panel
 
wxStaticText * m_staticText4
 
wxStaticText * m_PrjTableFilename
 
WX_GRIDm_project_grid
 
wxBitmapButton * m_append_button
 
wxBitmapButton * m_browse_button
 
wxBitmapButton * m_move_up_button
 
wxBitmapButton * m_move_down_button
 
wxBitmapButton * m_delete_button
 
WX_GRIDm_path_subs_grid
 

Detailed Description

Class PANEL_FP_LIB_TABLE_BASE.

Definition at line 39 of file panel_fp_lib_table_base.h.

Constructor & Destructor Documentation

PANEL_FP_LIB_TABLE_BASE::PANEL_FP_LIB_TABLE_BASE ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxPoint pos = wxDefaultPosition,
const wxSize &  size = wxSize( 500,300 ),
long  style = wxTAB_TRAVERSAL 
)

Definition at line 14 of file panel_fp_lib_table_base.cpp.

References appendRowHandler(), browseLibrariesHandler(), deleteRowHandler(), m_append_button, m_auinotebook, m_browse_button, m_delete_button, m_GblTableFilename, m_global_grid, m_global_panel, m_move_down_button, m_move_up_button, m_path_subs_grid, m_PrjTableFilename, m_project_grid, m_project_panel, m_staticText3, m_staticText4, moveDownHandler(), moveUpHandler(), onSizeGrid(), and pageChangedHandler().

Referenced by onSizeGrid().

14  : wxPanel( parent, id, pos, size, style )
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_auinotebook = new wxAuiNotebook( m_top_sizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
23  m_auinotebook->SetMinSize( wxSize( 720,460 ) );
24 
25  m_global_panel = new wxPanel( m_auinotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
26  wxBoxSizer* m_global_sizer;
27  m_global_sizer = new wxBoxSizer( wxVERTICAL );
28 
29  wxFlexGridSizer* fgSizer1;
30  fgSizer1 = new wxFlexGridSizer( 1, 2, 0, 0 );
31  fgSizer1->SetFlexibleDirection( wxBOTH );
32  fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
33 
34  m_staticText3 = new wxStaticText( m_global_panel, wxID_ANY, _("File:"), wxDefaultPosition, wxDefaultSize, 0 );
35  m_staticText3->Wrap( -1 );
36  fgSizer1->Add( m_staticText3, 0, wxTOP|wxRIGHT|wxLEFT, 4 );
37 
38  m_GblTableFilename = new wxStaticText( m_global_panel, wxID_ANY, _("Table Name"), wxDefaultPosition, wxDefaultSize, 0 );
39  m_GblTableFilename->Wrap( -1 );
40  fgSizer1->Add( m_GblTableFilename, 0, wxTOP|wxRIGHT|wxLEFT, 4 );
41 
42 
43  m_global_sizer->Add( fgSizer1, 0, wxEXPAND, 5 );
44 
45  m_global_grid = new WX_GRID( m_global_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
46 
47  // Grid
48  m_global_grid->CreateGrid( 1, 5 );
49  m_global_grid->EnableEditing( true );
50  m_global_grid->EnableGridLines( true );
51  m_global_grid->EnableDragGridSize( false );
52  m_global_grid->SetMargins( 0, 0 );
53 
54  // Columns
55  m_global_grid->AutoSizeColumns();
56  m_global_grid->EnableDragColMove( false );
57  m_global_grid->EnableDragColSize( true );
58  m_global_grid->SetColLabelSize( 22 );
59  m_global_grid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
60 
61  // Rows
62  m_global_grid->EnableDragRowSize( false );
63  m_global_grid->SetRowLabelSize( 0 );
64  m_global_grid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
65 
66  // Label Appearance
67 
68  // Cell Defaults
69  m_global_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
70  m_global_sizer->Add( m_global_grid, 1, wxALL|wxEXPAND, 5 );
71 
72 
73  m_global_panel->SetSizer( m_global_sizer );
74  m_global_panel->Layout();
75  m_global_sizer->Fit( m_global_panel );
76  m_auinotebook->AddPage( m_global_panel, _("Global Libraries"), false, wxNullBitmap );
77  m_project_panel = new wxPanel( m_auinotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
78  wxBoxSizer* m_project_sizer;
79  m_project_sizer = new wxBoxSizer( wxVERTICAL );
80 
81  wxFlexGridSizer* fgSizer2;
82  fgSizer2 = new wxFlexGridSizer( 1, 2, 0, 0 );
83  fgSizer2->SetFlexibleDirection( wxBOTH );
84  fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
85 
86  m_staticText4 = new wxStaticText( m_project_panel, wxID_ANY, _("File:"), wxDefaultPosition, wxDefaultSize, 0 );
87  m_staticText4->Wrap( -1 );
88  fgSizer2->Add( m_staticText4, 0, wxLEFT|wxRIGHT|wxTOP, 4 );
89 
90  m_PrjTableFilename = new wxStaticText( m_project_panel, wxID_ANY, _("Table Name"), wxDefaultPosition, wxDefaultSize, 0 );
91  m_PrjTableFilename->Wrap( -1 );
92  fgSizer2->Add( m_PrjTableFilename, 0, wxLEFT|wxRIGHT|wxTOP, 4 );
93 
94 
95  m_project_sizer->Add( fgSizer2, 0, wxEXPAND, 5 );
96 
97  m_project_grid = new WX_GRID( m_project_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
98 
99  // Grid
100  m_project_grid->CreateGrid( 1, 5 );
101  m_project_grid->EnableEditing( true );
102  m_project_grid->EnableGridLines( true );
103  m_project_grid->EnableDragGridSize( false );
104  m_project_grid->SetMargins( 0, 0 );
105 
106  // Columns
107  m_project_grid->AutoSizeColumns();
108  m_project_grid->EnableDragColMove( false );
109  m_project_grid->EnableDragColSize( true );
110  m_project_grid->SetColLabelSize( 22 );
111  m_project_grid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
112 
113  // Rows
114  m_project_grid->EnableDragRowSize( false );
115  m_project_grid->SetRowLabelSize( 0 );
116  m_project_grid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
117 
118  // Label Appearance
119 
120  // Cell Defaults
121  m_project_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
122  m_project_sizer->Add( m_project_grid, 1, wxALL|wxEXPAND, 5 );
123 
124 
125  m_project_panel->SetSizer( m_project_sizer );
126  m_project_panel->Layout();
127  m_project_sizer->Fit( m_project_panel );
128  m_auinotebook->AddPage( m_project_panel, _("Project Specific Libraries"), true, wxNullBitmap );
129 
130  m_top_sizer->Add( m_auinotebook, 6, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
131 
132  wxBoxSizer* bButtonsSizer;
133  bButtonsSizer = new wxBoxSizer( wxHORIZONTAL );
134 
135  m_append_button = new wxBitmapButton( m_top_sizer->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 30,30 ), wxBU_AUTODRAW );
136  bButtonsSizer->Add( m_append_button, 0, wxRIGHT|wxLEFT, 5 );
137 
138  m_browse_button = new wxBitmapButton( m_top_sizer->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 30,30 ), wxBU_AUTODRAW );
139  bButtonsSizer->Add( m_browse_button, 0, wxRIGHT, 5 );
140 
141  m_move_up_button = new wxBitmapButton( m_top_sizer->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 30,30 ), wxBU_AUTODRAW );
142  bButtonsSizer->Add( m_move_up_button, 0, wxRIGHT, 5 );
143 
144  m_move_down_button = new wxBitmapButton( m_top_sizer->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 30,30 ), wxBU_AUTODRAW );
145  bButtonsSizer->Add( m_move_down_button, 0, wxRIGHT, 5 );
146 
147 
148  bButtonsSizer->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
149 
150  m_delete_button = new wxBitmapButton( m_top_sizer->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 30,30 ), wxBU_AUTODRAW );
151  bButtonsSizer->Add( m_delete_button, 0, wxRIGHT|wxLEFT, 5 );
152 
153 
154  m_top_sizer->Add( bButtonsSizer, 0, wxEXPAND, 5 );
155 
156 
157  bMainSizer->Add( m_top_sizer, 1, wxALL|wxEXPAND, 5 );
158 
159  wxStaticBoxSizer* sbSizer1;
160  sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Path Substitutions:") ), wxVERTICAL );
161 
162  m_path_subs_grid = new WX_GRID( sbSizer1->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
163 
164  // Grid
165  m_path_subs_grid->CreateGrid( 1, 2 );
166  m_path_subs_grid->EnableEditing( true );
167  m_path_subs_grid->EnableGridLines( true );
168  m_path_subs_grid->EnableDragGridSize( false );
169  m_path_subs_grid->SetMargins( 0, 0 );
170 
171  // Columns
172  m_path_subs_grid->SetColSize( 0, 150 );
173  m_path_subs_grid->SetColSize( 1, 500 );
174  m_path_subs_grid->AutoSizeColumns();
175  m_path_subs_grid->EnableDragColMove( false );
176  m_path_subs_grid->EnableDragColSize( true );
177  m_path_subs_grid->SetColLabelSize( 0 );
178  m_path_subs_grid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
179 
180  // Rows
181  m_path_subs_grid->EnableDragRowSize( true );
182  m_path_subs_grid->SetRowLabelSize( 0 );
183  m_path_subs_grid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
184 
185  // Label Appearance
186 
187  // Cell Defaults
188  m_path_subs_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
189  m_path_subs_grid->SetToolTip( _("This is a read-only table which shows pertinent environment variables.") );
190 
191  sbSizer1->Add( m_path_subs_grid, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
192 
193 
194  bMainSizer->Add( sbSizer1, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
195 
196 
197  this->SetSizer( bMainSizer );
198  this->Layout();
199 
200  // Connect Events
201  m_auinotebook->Connect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, wxAuiNotebookEventHandler( PANEL_FP_LIB_TABLE_BASE::pageChangedHandler ), NULL, this );
202  m_append_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::appendRowHandler ), NULL, this );
203  m_browse_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::browseLibrariesHandler ), NULL, this );
204  m_move_up_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::moveUpHandler ), NULL, this );
205  m_move_down_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::moveDownHandler ), NULL, this );
206  m_delete_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::deleteRowHandler ), NULL, this );
207  m_path_subs_grid->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_FP_LIB_TABLE_BASE::onSizeGrid ), NULL, this );
208 }
virtual void onSizeGrid(wxSizeEvent &event)
virtual void pageChangedHandler(wxAuiNotebookEvent &event)
virtual void browseLibrariesHandler(wxCommandEvent &event)
virtual void moveDownHandler(wxCommandEvent &event)
virtual void appendRowHandler(wxCommandEvent &event)
virtual void moveUpHandler(wxCommandEvent &event)
virtual void deleteRowHandler(wxCommandEvent &event)
PANEL_FP_LIB_TABLE_BASE::~PANEL_FP_LIB_TABLE_BASE ( )

Definition at line 210 of file panel_fp_lib_table_base.cpp.

References appendRowHandler(), browseLibrariesHandler(), deleteRowHandler(), m_append_button, m_auinotebook, m_browse_button, m_delete_button, m_move_down_button, m_move_up_button, m_path_subs_grid, moveDownHandler(), moveUpHandler(), onSizeGrid(), and pageChangedHandler().

Referenced by onSizeGrid().

211 {
212  // Disconnect Events
213  m_auinotebook->Disconnect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, wxAuiNotebookEventHandler( PANEL_FP_LIB_TABLE_BASE::pageChangedHandler ), NULL, this );
214  m_append_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::appendRowHandler ), NULL, this );
215  m_browse_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::browseLibrariesHandler ), NULL, this );
216  m_move_up_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::moveUpHandler ), NULL, this );
217  m_move_down_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::moveDownHandler ), NULL, this );
218  m_delete_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_LIB_TABLE_BASE::deleteRowHandler ), NULL, this );
219  m_path_subs_grid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_FP_LIB_TABLE_BASE::onSizeGrid ), NULL, this );
220 
221 }
virtual void onSizeGrid(wxSizeEvent &event)
virtual void pageChangedHandler(wxAuiNotebookEvent &event)
virtual void browseLibrariesHandler(wxCommandEvent &event)
virtual void moveDownHandler(wxCommandEvent &event)
virtual void appendRowHandler(wxCommandEvent &event)
virtual void moveUpHandler(wxCommandEvent &event)
virtual void deleteRowHandler(wxCommandEvent &event)

Member Function Documentation

virtual void PANEL_FP_LIB_TABLE_BASE::appendRowHandler ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_FP_LIB_TABLE.

Definition at line 62 of file panel_fp_lib_table_base.h.

Referenced by PANEL_FP_LIB_TABLE_BASE(), and ~PANEL_FP_LIB_TABLE_BASE().

62 { event.Skip(); }
virtual void PANEL_FP_LIB_TABLE_BASE::browseLibrariesHandler ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_FP_LIB_TABLE.

Definition at line 63 of file panel_fp_lib_table_base.h.

Referenced by PANEL_FP_LIB_TABLE_BASE(), and ~PANEL_FP_LIB_TABLE_BASE().

63 { event.Skip(); }
virtual void PANEL_FP_LIB_TABLE_BASE::deleteRowHandler ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_FP_LIB_TABLE.

Definition at line 66 of file panel_fp_lib_table_base.h.

Referenced by PANEL_FP_LIB_TABLE_BASE(), and ~PANEL_FP_LIB_TABLE_BASE().

66 { event.Skip(); }
virtual void PANEL_FP_LIB_TABLE_BASE::moveDownHandler ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_FP_LIB_TABLE.

Definition at line 65 of file panel_fp_lib_table_base.h.

Referenced by PANEL_FP_LIB_TABLE_BASE(), and ~PANEL_FP_LIB_TABLE_BASE().

65 { event.Skip(); }
virtual void PANEL_FP_LIB_TABLE_BASE::moveUpHandler ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_FP_LIB_TABLE.

Definition at line 64 of file panel_fp_lib_table_base.h.

Referenced by PANEL_FP_LIB_TABLE_BASE(), and ~PANEL_FP_LIB_TABLE_BASE().

64 { event.Skip(); }
virtual void PANEL_FP_LIB_TABLE_BASE::onSizeGrid ( wxSizeEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_FP_LIB_TABLE.

Definition at line 67 of file panel_fp_lib_table_base.h.

References PANEL_FP_LIB_TABLE_BASE(), and ~PANEL_FP_LIB_TABLE_BASE().

Referenced by PANEL_FP_LIB_TABLE_BASE(), and ~PANEL_FP_LIB_TABLE_BASE().

67 { event.Skip(); }
virtual void PANEL_FP_LIB_TABLE_BASE::pageChangedHandler ( wxAuiNotebookEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_FP_LIB_TABLE.

Definition at line 61 of file panel_fp_lib_table_base.h.

Referenced by PANEL_FP_LIB_TABLE_BASE(), and ~PANEL_FP_LIB_TABLE_BASE().

61 { event.Skip(); }

Member Data Documentation

wxBitmapButton* PANEL_FP_LIB_TABLE_BASE::m_append_button
protected
wxBitmapButton* PANEL_FP_LIB_TABLE_BASE::m_browse_button
protected
wxBitmapButton* PANEL_FP_LIB_TABLE_BASE::m_delete_button
protected
wxStaticText* PANEL_FP_LIB_TABLE_BASE::m_GblTableFilename
protected
wxPanel* PANEL_FP_LIB_TABLE_BASE::m_global_panel
protected

Definition at line 45 of file panel_fp_lib_table_base.h.

Referenced by PANEL_FP_LIB_TABLE_BASE().

wxBitmapButton* PANEL_FP_LIB_TABLE_BASE::m_move_down_button
protected
wxBitmapButton* PANEL_FP_LIB_TABLE_BASE::m_move_up_button
protected
wxStaticText* PANEL_FP_LIB_TABLE_BASE::m_PrjTableFilename
protected
wxPanel* PANEL_FP_LIB_TABLE_BASE::m_project_panel
protected

Definition at line 49 of file panel_fp_lib_table_base.h.

Referenced by PANEL_FP_LIB_TABLE_BASE().

wxStaticText* PANEL_FP_LIB_TABLE_BASE::m_staticText3
protected

Definition at line 46 of file panel_fp_lib_table_base.h.

Referenced by PANEL_FP_LIB_TABLE_BASE().

wxStaticText* PANEL_FP_LIB_TABLE_BASE::m_staticText4
protected

Definition at line 50 of file panel_fp_lib_table_base.h.

Referenced by PANEL_FP_LIB_TABLE_BASE().


The documentation for this class was generated from the following files: