KiCad PCB EDA Suite
PANEL_TEXT_VARIABLES_BASE Class Reference

Class PANEL_TEXT_VARIABLES_BASE. More...

#include <panel_text_variables_base.h>

Inheritance diagram for PANEL_TEXT_VARIABLES_BASE:
PANEL_TEXT_VARIABLES

Public Member Functions

 PANEL_TEXT_VARIABLES_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_TEXT_VARIABLES_BASE ()
 

Protected Member Functions

virtual void OnUpdateUI (wxUpdateUIEvent &event)
 
virtual void OnGridCellChange (wxGridEvent &event)
 
virtual void OnGridSize (wxSizeEvent &event)
 
virtual void OnAddTextVar (wxCommandEvent &event)
 
virtual void OnRemoveTextVar (wxCommandEvent &event)
 

Protected Attributes

WX_GRIDm_TextVars
 
wxBitmapButton * m_btnAddTextVar
 
wxBitmapButton * m_btnDeleteTextVar
 

Detailed Description

Class PANEL_TEXT_VARIABLES_BASE.

Definition at line 34 of file panel_text_variables_base.h.

Constructor & Destructor Documentation

◆ PANEL_TEXT_VARIABLES_BASE()

PANEL_TEXT_VARIABLES_BASE::PANEL_TEXT_VARIABLES_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_text_variables_base.cpp.

14 : wxPanel( parent, id, pos, size, style, name )
15{
16 wxBoxSizer* bPanelSizer;
17 bPanelSizer = new wxBoxSizer( wxVERTICAL );
18
19 wxBoxSizer* bSizer3;
20 bSizer3 = new wxBoxSizer( wxVERTICAL );
21
22 m_TextVars = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
23
24 // Grid
25 m_TextVars->CreateGrid( 1, 2 );
26 m_TextVars->EnableEditing( true );
27 m_TextVars->EnableGridLines( true );
28 m_TextVars->EnableDragGridSize( false );
29 m_TextVars->SetMargins( 0, 0 );
30
31 // Columns
32 m_TextVars->SetColSize( 0, 150 );
33 m_TextVars->SetColSize( 1, 454 );
34 m_TextVars->EnableDragColMove( false );
35 m_TextVars->EnableDragColSize( true );
37 m_TextVars->SetColLabelValue( 0, _("Variable Name") );
38 m_TextVars->SetColLabelValue( 1, _("Text Substitution") );
39 m_TextVars->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
40
41 // Rows
42 m_TextVars->EnableDragRowSize( true );
43 m_TextVars->SetRowLabelSize( 0 );
44 m_TextVars->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
45
46 // Label Appearance
47
48 // Cell Defaults
49 m_TextVars->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
50 m_TextVars->SetMinSize( wxSize( 604,170 ) );
51
52 bSizer3->Add( m_TextVars, 1, wxEXPAND|wxALL, 5 );
53
54 wxBoxSizer* bSizerEnvVarBtns;
55 bSizerEnvVarBtns = new wxBoxSizer( wxHORIZONTAL );
56
57 m_btnAddTextVar = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
58 bSizerEnvVarBtns->Add( m_btnAddTextVar, 0, wxRIGHT, 5 );
59
60
61 bSizerEnvVarBtns->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
62
63 m_btnDeleteTextVar = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
64 bSizerEnvVarBtns->Add( m_btnDeleteTextVar, 0, wxRIGHT|wxLEFT, 5 );
65
66
67 bSizer3->Add( bSizerEnvVarBtns, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
68
69
70 bPanelSizer->Add( bSizer3, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
71
72
73 this->SetSizer( bPanelSizer );
74 this->Layout();
75 bPanelSizer->Fit( this );
76
77 // Connect Events
78 this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_TEXT_VARIABLES_BASE::OnUpdateUI ) );
79 m_TextVars->Connect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( PANEL_TEXT_VARIABLES_BASE::OnGridCellChange ), NULL, this );
80 m_TextVars->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_TEXT_VARIABLES_BASE::OnGridSize ), NULL, this );
81 m_btnAddTextVar->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_TEXT_VARIABLES_BASE::OnAddTextVar ), NULL, this );
82 m_btnDeleteTextVar->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_TEXT_VARIABLES_BASE::OnRemoveTextVar ), NULL, this );
83}
const char * name
Definition: DXF_plotter.cpp:56
virtual void OnGridCellChange(wxGridEvent &event)
virtual void OnRemoveTextVar(wxCommandEvent &event)
virtual void OnUpdateUI(wxUpdateUIEvent &event)
virtual void OnGridSize(wxSizeEvent &event)
virtual void OnAddTextVar(wxCommandEvent &event)
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:76
#define _(s)

References _, m_btnAddTextVar, m_btnDeleteTextVar, m_TextVars, OnAddTextVar(), OnGridCellChange(), OnGridSize(), OnRemoveTextVar(), OnUpdateUI(), and WX_GRID::SetColLabelSize().

◆ ~PANEL_TEXT_VARIABLES_BASE()

PANEL_TEXT_VARIABLES_BASE::~PANEL_TEXT_VARIABLES_BASE ( )

Definition at line 85 of file panel_text_variables_base.cpp.

86{
87 // Disconnect Events
88 this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_TEXT_VARIABLES_BASE::OnUpdateUI ) );
89 m_TextVars->Disconnect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( PANEL_TEXT_VARIABLES_BASE::OnGridCellChange ), NULL, this );
90 m_TextVars->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_TEXT_VARIABLES_BASE::OnGridSize ), NULL, this );
91 m_btnAddTextVar->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_TEXT_VARIABLES_BASE::OnAddTextVar ), NULL, this );
92 m_btnDeleteTextVar->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_TEXT_VARIABLES_BASE::OnRemoveTextVar ), NULL, this );
93
94}

References m_btnAddTextVar, m_btnDeleteTextVar, m_TextVars, OnAddTextVar(), OnGridCellChange(), OnGridSize(), OnRemoveTextVar(), and OnUpdateUI().

Member Function Documentation

◆ OnAddTextVar()

virtual void PANEL_TEXT_VARIABLES_BASE::OnAddTextVar ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_TEXT_VARIABLES.

Definition at line 47 of file panel_text_variables_base.h.

47{ event.Skip(); }

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

◆ OnGridCellChange()

virtual void PANEL_TEXT_VARIABLES_BASE::OnGridCellChange ( wxGridEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_TEXT_VARIABLES.

Definition at line 45 of file panel_text_variables_base.h.

45{ event.Skip(); }

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

◆ OnGridSize()

virtual void PANEL_TEXT_VARIABLES_BASE::OnGridSize ( wxSizeEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_TEXT_VARIABLES.

Definition at line 46 of file panel_text_variables_base.h.

46{ event.Skip(); }

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

◆ OnRemoveTextVar()

virtual void PANEL_TEXT_VARIABLES_BASE::OnRemoveTextVar ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_TEXT_VARIABLES.

Definition at line 48 of file panel_text_variables_base.h.

48{ event.Skip(); }

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

◆ OnUpdateUI()

virtual void PANEL_TEXT_VARIABLES_BASE::OnUpdateUI ( wxUpdateUIEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_TEXT_VARIABLES.

Definition at line 44 of file panel_text_variables_base.h.

44{ event.Skip(); }

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

Member Data Documentation

◆ m_btnAddTextVar

wxBitmapButton* PANEL_TEXT_VARIABLES_BASE::m_btnAddTextVar
protected

◆ m_btnDeleteTextVar

wxBitmapButton* PANEL_TEXT_VARIABLES_BASE::m_btnDeleteTextVar
protected

◆ m_TextVars


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