KiCad PCB EDA Suite
panel_pcbnew_action_plugins_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version 3.9.0 Jun 3 2020)
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_PCBNEW_ACTION_PLUGINS_BASE::PANEL_PCBNEW_ACTION_PLUGINS_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* bPanelSizer;
17  bPanelSizer = new wxBoxSizer( wxVERTICAL );
18 
19  wxBoxSizer* bGridSizer;
20  bGridSizer = new wxBoxSizer( wxVERTICAL );
21 
22  m_grid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
23 
24  // Grid
25  m_grid->CreateGrid( 3, 6 );
26  m_grid->EnableEditing( false );
27  m_grid->EnableGridLines( true );
28  m_grid->EnableDragGridSize( false );
29  m_grid->SetMargins( 0, 0 );
30 
31  // Columns
32  m_grid->AutoSizeColumns();
33  m_grid->EnableDragColMove( false );
34  m_grid->EnableDragColSize( true );
35  m_grid->SetColLabelSize( 22 );
36  m_grid->SetColLabelValue( 0, _("Icon") );
37  m_grid->SetColLabelValue( 1, _("Show button") );
38  m_grid->SetColLabelValue( 2, _("Name") );
39  m_grid->SetColLabelValue( 3, _("Category") );
40  m_grid->SetColLabelValue( 4, _("Description") );
41  m_grid->SetColLabelValue( 5, _("Path") );
42  m_grid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
43 
44  // Rows
45  m_grid->EnableDragRowSize( true );
46  m_grid->SetRowLabelSize( 0 );
47  m_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
48 
49  // Label Appearance
50 
51  // Cell Defaults
52  m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
53  bGridSizer->Add( m_grid, 1, wxALL|wxEXPAND, 5 );
54 
55 
56  bPanelSizer->Add( bGridSizer, 1, wxALIGN_LEFT|wxEXPAND|wxLEFT, 0 );
57 
58  wxBoxSizer* bButtonsSizer;
59  bButtonsSizer = new wxBoxSizer( wxHORIZONTAL );
60 
61  m_moveUpButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
62  bButtonsSizer->Add( m_moveUpButton, 0, wxLEFT|wxRIGHT, 5 );
63 
64  m_moveDownButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
65  bButtonsSizer->Add( m_moveDownButton, 0, wxRIGHT, 5 );
66 
67 
68  bButtonsSizer->Add( 0, 0, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 );
69 
70  m_reloadButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
71  bButtonsSizer->Add( m_reloadButton, 0, wxLEFT|wxRIGHT, 5 );
72 
73 
74  bPanelSizer->Add( bButtonsSizer, 0, wxEXPAND, 0 );
75 
76 
77  this->SetSizer( bPanelSizer );
78  this->Layout();
79  bPanelSizer->Fit( this );
80 
81  // Connect Events
82  m_grid->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( PANEL_PCBNEW_ACTION_PLUGINS_BASE::OnGridCellClick ), NULL, this );
83  m_moveUpButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PCBNEW_ACTION_PLUGINS_BASE::OnMoveUpButtonClick ), NULL, this );
84  m_moveDownButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PCBNEW_ACTION_PLUGINS_BASE::OnMoveDownButtonClick ), NULL, this );
85  m_reloadButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PCBNEW_ACTION_PLUGINS_BASE::OnReloadButtonClick ), NULL, this );
86 }
87 
89 {
90  // Disconnect Events
91  m_grid->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( PANEL_PCBNEW_ACTION_PLUGINS_BASE::OnGridCellClick ), NULL, this );
92  m_moveUpButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PCBNEW_ACTION_PLUGINS_BASE::OnMoveUpButtonClick ), NULL, this );
93  m_moveDownButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PCBNEW_ACTION_PLUGINS_BASE::OnMoveDownButtonClick ), NULL, this );
94  m_reloadButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PCBNEW_ACTION_PLUGINS_BASE::OnReloadButtonClick ), NULL, this );
95 
96 }
virtual void OnMoveDownButtonClick(wxCommandEvent &event)
virtual void OnReloadButtonClick(wxCommandEvent &event)
virtual void OnGridCellClick(wxGridEvent &event)
PANEL_PCBNEW_ACTION_PLUGINS_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 OnMoveUpButtonClick(wxCommandEvent &event)
#define NULL
const char * name
Definition: DXF_plotter.cpp:60
#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