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

wxBoxSizer * m_leftMargin
 
wxBoxSizer * m_topMargin
 
wxStaticText * m_title
 
WX_GRIDm_grid
 
wxBitmapButton * m_addFieldButton
 
wxBitmapButton * m_deleteFieldButton
 

Detailed Description

Constructor & Destructor Documentation

◆ PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE()

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.

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

◆ ~PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE()

PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::~PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE ( )

Definition at line 97 of file panel_eeschema_template_fieldnames_base.cpp.

98 {
99  // Disconnect Events
100  m_grid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnSizeGrid ), NULL, this );
101  m_addFieldButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnAddButtonClick ), NULL, this );
102  m_deleteFieldButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnDeleteButtonClick ), NULL, this );
103 
104 }
#define NULL

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

Member Function Documentation

◆ OnAddButtonClick()

virtual void PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnAddButtonClick ( wxCommandEvent &  event)
inlineprotectedvirtual

◆ OnDeleteButtonClick()

virtual void PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnDeleteButtonClick ( wxCommandEvent &  event)
inlineprotectedvirtual

◆ OnSizeGrid()

virtual void PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnSizeGrid ( wxSizeEvent &  event)
inlineprotectedvirtual

Member Data Documentation

◆ m_addFieldButton

wxBitmapButton* PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::m_addFieldButton
protected

◆ m_deleteFieldButton

wxBitmapButton* PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::m_deleteFieldButton
protected

◆ m_grid

◆ m_leftMargin

wxBoxSizer* PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::m_leftMargin
protected

◆ m_title

wxStaticText* PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::m_title
protected

◆ m_topMargin

wxBoxSizer* PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::m_topMargin
protected

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