KiCad PCB EDA Suite
PANEL_PCBNEW_ACTION_PLUGINS_BASE Class Reference

Class PANEL_PCBNEW_ACTION_PLUGINS_BASE. More...

#include <panel_pcbnew_action_plugins_base.h>

Inheritance diagram for PANEL_PCBNEW_ACTION_PLUGINS_BASE:
PANEL_PCBNEW_ACTION_PLUGINS

Public Member Functions

 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)
 
 ~PANEL_PCBNEW_ACTION_PLUGINS_BASE ()
 

Protected Member Functions

virtual void OnGridCellClick (wxGridEvent &event)
 
virtual void OnMoveUpButtonClick (wxCommandEvent &event)
 
virtual void OnMoveDownButtonClick (wxCommandEvent &event)
 
virtual void OnReloadButtonClick (wxCommandEvent &event)
 

Protected Attributes

WX_GRIDm_grid
 
wxBitmapButton * m_moveUpButton
 
wxBitmapButton * m_moveDownButton
 
wxBitmapButton * m_reloadButton
 

Detailed Description

Constructor & Destructor Documentation

◆ PANEL_PCBNEW_ACTION_PLUGINS_BASE()

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

Definition at line 14 of file panel_pcbnew_action_plugins_base.cpp.

14  : 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 }
virtual void OnMoveDownButtonClick(wxCommandEvent &event)
virtual void OnReloadButtonClick(wxCommandEvent &event)
virtual void OnGridCellClick(wxGridEvent &event)
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

References _, m_grid, m_moveDownButton, m_moveUpButton, m_reloadButton, NULL, OnGridCellClick(), OnMoveDownButtonClick(), OnMoveUpButtonClick(), OnReloadButtonClick(), and WX_GRID::SetColLabelSize().

◆ ~PANEL_PCBNEW_ACTION_PLUGINS_BASE()

PANEL_PCBNEW_ACTION_PLUGINS_BASE::~PANEL_PCBNEW_ACTION_PLUGINS_BASE ( )

Definition at line 88 of file panel_pcbnew_action_plugins_base.cpp.

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)
virtual void OnMoveUpButtonClick(wxCommandEvent &event)
#define NULL

References m_grid, m_moveDownButton, m_moveUpButton, m_reloadButton, NULL, OnGridCellClick(), OnMoveDownButtonClick(), OnMoveUpButtonClick(), and OnReloadButtonClick().

Member Function Documentation

◆ OnGridCellClick()

virtual void PANEL_PCBNEW_ACTION_PLUGINS_BASE::OnGridCellClick ( wxGridEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_PCBNEW_ACTION_PLUGINS.

Definition at line 45 of file panel_pcbnew_action_plugins_base.h.

45 { event.Skip(); }

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

◆ OnMoveDownButtonClick()

virtual void PANEL_PCBNEW_ACTION_PLUGINS_BASE::OnMoveDownButtonClick ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_PCBNEW_ACTION_PLUGINS.

Definition at line 47 of file panel_pcbnew_action_plugins_base.h.

47 { event.Skip(); }

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

◆ OnMoveUpButtonClick()

virtual void PANEL_PCBNEW_ACTION_PLUGINS_BASE::OnMoveUpButtonClick ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_PCBNEW_ACTION_PLUGINS.

Definition at line 46 of file panel_pcbnew_action_plugins_base.h.

46 { event.Skip(); }

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

◆ OnReloadButtonClick()

virtual void PANEL_PCBNEW_ACTION_PLUGINS_BASE::OnReloadButtonClick ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_PCBNEW_ACTION_PLUGINS.

Definition at line 48 of file panel_pcbnew_action_plugins_base.h.

48 { event.Skip(); }

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

Member Data Documentation

◆ m_grid

◆ m_moveDownButton

wxBitmapButton* PANEL_PCBNEW_ACTION_PLUGINS_BASE::m_moveDownButton
protected

◆ m_moveUpButton

wxBitmapButton* PANEL_PCBNEW_ACTION_PLUGINS_BASE::m_moveUpButton
protected

◆ m_reloadButton

wxBitmapButton* PANEL_PCBNEW_ACTION_PLUGINS_BASE::m_reloadButton
protected

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