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(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
 
 ~PANEL_FP_LIB_TABLE_BASE ()
 

Protected Member Functions

virtual void OnUpdateUI (wxUpdateUIEvent &event)
 
virtual void appendRowHandler (wxCommandEvent &event)
 
virtual void moveUpHandler (wxCommandEvent &event)
 
virtual void moveDownHandler (wxCommandEvent &event)
 
virtual void deleteRowHandler (wxCommandEvent &event)
 
virtual void onSizeGrid (wxSizeEvent &event)
 

Protected Attributes

wxNotebook * m_notebook
 
wxPanel * m_global_panel
 
WX_GRIDm_global_grid
 
wxPanel * m_project_panel
 
WX_GRIDm_project_grid
 
wxPanel * m_buttonsPanel
 
wxBitmapButton * m_append_button
 
SPLIT_BUTTONm_browseButton
 
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 38 of file panel_fp_lib_table_base.h.

Constructor & Destructor Documentation

◆ PANEL_FP_LIB_TABLE_BASE()

PANEL_FP_LIB_TABLE_BASE::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 
)

Definition at line 14 of file panel_fp_lib_table_base.cpp.

14  : 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 }
virtual void onSizeGrid(wxSizeEvent &event)
#define NULL
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:59
#define _(s)
Definition: 3d_actions.cpp:33
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:49
virtual void deleteRowHandler(wxCommandEvent &event)

References _, appendRowHandler(), deleteRowHandler(), m_append_button, m_browseButton, m_buttonsPanel, m_delete_button, m_global_grid, m_global_panel, m_move_down_button, m_move_up_button, m_notebook, m_path_subs_grid, m_project_grid, m_project_panel, moveDownHandler(), moveUpHandler(), NULL, onSizeGrid(), OnUpdateUI(), and WX_GRID::SetColLabelSize().

◆ ~PANEL_FP_LIB_TABLE_BASE()

PANEL_FP_LIB_TABLE_BASE::~PANEL_FP_LIB_TABLE_BASE ( )

Definition at line 188 of file panel_fp_lib_table_base.cpp.

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)
#define NULL
virtual void moveDownHandler(wxCommandEvent &event)
virtual void OnUpdateUI(wxUpdateUIEvent &event)
virtual void appendRowHandler(wxCommandEvent &event)
virtual void moveUpHandler(wxCommandEvent &event)
virtual void deleteRowHandler(wxCommandEvent &event)

References appendRowHandler(), deleteRowHandler(), m_append_button, m_delete_button, m_move_down_button, m_move_up_button, m_path_subs_grid, moveDownHandler(), moveUpHandler(), NULL, onSizeGrid(), and OnUpdateUI().

Member Function Documentation

◆ appendRowHandler()

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

Reimplemented in PANEL_FP_LIB_TABLE.

Definition at line 58 of file panel_fp_lib_table_base.h.

58 { event.Skip(); }

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

◆ deleteRowHandler()

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

Reimplemented in PANEL_FP_LIB_TABLE.

Definition at line 61 of file panel_fp_lib_table_base.h.

61 { event.Skip(); }

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

◆ moveDownHandler()

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

Reimplemented in PANEL_FP_LIB_TABLE.

Definition at line 60 of file panel_fp_lib_table_base.h.

60 { event.Skip(); }

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

◆ moveUpHandler()

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

Reimplemented in PANEL_FP_LIB_TABLE.

Definition at line 59 of file panel_fp_lib_table_base.h.

59 { event.Skip(); }

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

◆ onSizeGrid()

virtual void PANEL_FP_LIB_TABLE_BASE::onSizeGrid ( wxSizeEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_FP_LIB_TABLE.

Definition at line 62 of file panel_fp_lib_table_base.h.

62 { event.Skip(); }

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

◆ OnUpdateUI()

virtual void PANEL_FP_LIB_TABLE_BASE::OnUpdateUI ( wxUpdateUIEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_FP_LIB_TABLE.

Definition at line 57 of file panel_fp_lib_table_base.h.

57 { event.Skip(); }

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

Member Data Documentation

◆ m_append_button

wxBitmapButton* PANEL_FP_LIB_TABLE_BASE::m_append_button
protected

◆ m_browseButton

SPLIT_BUTTON* PANEL_FP_LIB_TABLE_BASE::m_browseButton
protected

◆ m_buttonsPanel

wxPanel* PANEL_FP_LIB_TABLE_BASE::m_buttonsPanel
protected

◆ m_delete_button

wxBitmapButton* PANEL_FP_LIB_TABLE_BASE::m_delete_button
protected

◆ m_global_grid

◆ m_global_panel

wxPanel* PANEL_FP_LIB_TABLE_BASE::m_global_panel
protected

Definition at line 44 of file panel_fp_lib_table_base.h.

Referenced by PANEL_FP_LIB_TABLE_BASE().

◆ m_move_down_button

wxBitmapButton* PANEL_FP_LIB_TABLE_BASE::m_move_down_button
protected

◆ m_move_up_button

wxBitmapButton* PANEL_FP_LIB_TABLE_BASE::m_move_up_button
protected

◆ m_notebook

wxNotebook* PANEL_FP_LIB_TABLE_BASE::m_notebook
protected

◆ m_path_subs_grid

◆ m_project_grid

◆ m_project_panel

wxPanel* PANEL_FP_LIB_TABLE_BASE::m_project_panel
protected

Definition at line 46 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: