KiCad PCB EDA Suite
PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE Class Reference

Class PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE. More...

#include <panel_eeschema_template_fieldnames_base.h>

Inheritance diagram for PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE:
PANEL_EESCHEMA_TEMPLATE_FIELDNAMES

Public Member Functions

 PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_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_EESCHEMA_TEMPLATE_FIELDNAMES_BASE ()
 

Protected Member Functions

virtual void OnSizeGrid (wxSizeEvent &event)
 
virtual void OnAddButtonClick (wxCommandEvent &event)
 
virtual void OnDeleteButtonClick (wxCommandEvent &event)
 

Protected Attributes

WX_GRIDm_grid
 
wxBitmapButton * m_addFieldButton
 
wxBitmapButton * m_deleteFieldButton
 

Detailed Description

Constructor & Destructor Documentation

PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_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_eeschema_template_fieldnames_base.cpp.

References m_addFieldButton, m_deleteFieldButton, m_grid, OnAddButtonClick(), OnDeleteButtonClick(), and OnSizeGrid().

Referenced by OnDeleteButtonClick().

14  : wxPanel( parent, id, pos, size, style, name )
15 {
16  wxBoxSizer* bPanelSizer;
17  bPanelSizer = new wxBoxSizer( wxHORIZONTAL );
18 
19  wxBoxSizer* bMargins;
20  bMargins = new wxBoxSizer( wxVERTICAL );
21 
22  m_grid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
23 
24  // Grid
25  m_grid->CreateGrid( 0, 3 );
26  m_grid->EnableEditing( true );
27  m_grid->EnableGridLines( true );
28  m_grid->EnableDragGridSize( false );
29  m_grid->SetMargins( 0, 0 );
30 
31  // Columns
32  m_grid->SetColSize( 0, 300 );
33  m_grid->SetColSize( 1, 60 );
34  m_grid->SetColSize( 2, 60 );
35  m_grid->EnableDragColMove( false );
36  m_grid->EnableDragColSize( true );
37  m_grid->SetColLabelSize( 22 );
38  m_grid->SetColLabelValue( 0, _("Name") );
39  m_grid->SetColLabelValue( 1, _("Visible") );
40  m_grid->SetColLabelValue( 2, _("URL") );
41  m_grid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
42 
43  // Rows
44  m_grid->EnableDragRowSize( true );
45  m_grid->SetRowLabelSize( 0 );
46  m_grid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
47 
48  // Label Appearance
49 
50  // Cell Defaults
51  m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
52  bMargins->Add( m_grid, 1, wxEXPAND|wxTOP, 2 );
53 
54  wxBoxSizer* bSizer10;
55  bSizer10 = new wxBoxSizer( wxHORIZONTAL );
56 
57  m_addFieldButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
58  m_addFieldButton->SetMinSize( wxSize( 29,29 ) );
59 
60  bSizer10->Add( m_addFieldButton, 0, wxTOP|wxRIGHT, 5 );
61 
62 
63  bSizer10->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
64 
65  m_deleteFieldButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
66  m_deleteFieldButton->SetMinSize( wxSize( 29,29 ) );
67 
68  bSizer10->Add( m_deleteFieldButton, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
69 
70 
71  bMargins->Add( bSizer10, 0, wxEXPAND, 5 );
72 
73 
74  bPanelSizer->Add( bMargins, 1, wxEXPAND|wxRIGHT|wxLEFT, 10 );
75 
76 
77  this->SetSizer( bPanelSizer );
78  this->Layout();
79  bPanelSizer->Fit( this );
80 
81  // Connect Events
82  m_grid->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnSizeGrid ), NULL, this );
83  m_addFieldButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnAddButtonClick ), NULL, this );
84  m_deleteFieldButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnDeleteButtonClick ), NULL, this );
85 }
const char * name
Definition: DXF_plotter.cpp:61
PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::~PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE ( )

Definition at line 87 of file panel_eeschema_template_fieldnames_base.cpp.

References m_addFieldButton, m_deleteFieldButton, m_grid, OnAddButtonClick(), OnDeleteButtonClick(), and OnSizeGrid().

Referenced by OnDeleteButtonClick().

88 {
89  // Disconnect Events
90  m_grid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnSizeGrid ), NULL, this );
91  m_addFieldButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnAddButtonClick ), NULL, this );
92  m_deleteFieldButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnDeleteButtonClick ), NULL, this );
93 
94 }

Member Function Documentation

virtual void PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnAddButtonClick ( wxCommandEvent &  event)
inlineprotectedvirtual
virtual void PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnDeleteButtonClick ( wxCommandEvent &  event)
inlineprotectedvirtual
virtual void PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnSizeGrid ( wxSizeEvent &  event)
inlineprotectedvirtual

Member Data Documentation

wxBitmapButton* PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::m_addFieldButton
protected
wxBitmapButton* PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::m_deleteFieldButton
protected

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