KiCad PCB EDA Suite
panel_eeschema_template_fieldnames_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version Oct 26 2018)
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_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_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( 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  bSizer10->Add( m_addFieldButton, 0, wxTOP|wxRIGHT, 5 );
66 
67 
68  bSizer10->Add( 20, 0, 0, wxEXPAND, 5 );
69 
70  m_deleteFieldButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
71  bSizer10->Add( m_deleteFieldButton, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
72 
73 
74  m_topMargin->Add( bSizer10, 0, wxEXPAND, 10 );
75 
76 
77  m_leftMargin->Add( m_topMargin, 1, wxEXPAND|wxRIGHT|wxLEFT, 10 );
78 
79 
80  bPanelSizer->Add( m_leftMargin, 1, wxEXPAND, 5 );
81 
82 
83  this->SetSizer( bPanelSizer );
84  this->Layout();
85  bPanelSizer->Fit( this );
86 
87  // Connect Events
88  m_grid->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnSizeGrid ), NULL, this );
89  m_addFieldButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnAddButtonClick ), NULL, this );
90  m_deleteFieldButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnDeleteButtonClick ), NULL, this );
91 }
92 
94 {
95  // Disconnect Events
96  m_grid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnSizeGrid ), NULL, this );
97  m_addFieldButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnAddButtonClick ), NULL, this );
98  m_deleteFieldButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_EESCHEMA_TEMPLATE_FIELDNAMES_BASE::OnDeleteButtonClick ), NULL, this );
99 
100 }
#define NULL
#define _(s)
const char * name
Definition: DXF_plotter.cpp:56
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)
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:53