KiCad PCB EDA Suite
PANEL_MODEDIT_DEFAULTS_BASE Class Reference

Class PANEL_MODEDIT_DEFAULTS_BASE. More...

#include <panel_modedit_defaults_base.h>

Inheritance diagram for PANEL_MODEDIT_DEFAULTS_BASE:
PANEL_MODEDIT_DEFAULTS

Public Member Functions

 PANEL_MODEDIT_DEFAULTS_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_MODEDIT_DEFAULTS_BASE ()
 

Protected Member Functions

virtual void OnGridSize (wxSizeEvent &event)
 
virtual void OnAddTextItem (wxCommandEvent &event)
 
virtual void OnDeleteTextItem (wxCommandEvent &event)
 

Protected Attributes

wxStaticText * defaultTextItemsLabel
 
WX_GRIDm_textItemsGrid
 
wxBitmapButton * m_bpAdd
 
wxBitmapButton * m_bpDelete
 
wxStaticText * m_staticTextInfo
 
WX_GRIDm_layerClassesGrid
 

Detailed Description

Constructor & Destructor Documentation

◆ PANEL_MODEDIT_DEFAULTS_BASE()

PANEL_MODEDIT_DEFAULTS_BASE::PANEL_MODEDIT_DEFAULTS_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_modedit_defaults_base.cpp.

14  : wxPanel( parent, id, pos, size, style, name )
15 {
16  wxBoxSizer* bSizerMain;
17  bSizerMain = new wxBoxSizer( wxVERTICAL );
18 
19  wxBoxSizer* bSizerMargins;
20  bSizerMargins = new wxBoxSizer( wxVERTICAL );
21 
22  defaultTextItemsLabel = new wxStaticText( this, wxID_ANY, _("Default text items for new footprints:"), wxDefaultPosition, wxDefaultSize, 0 );
23  defaultTextItemsLabel->Wrap( -1 );
24  bSizerMargins->Add( defaultTextItemsLabel, 0, wxTOP|wxLEFT, 5 );
25 
26  wxStaticBoxSizer* sbSizerTexts;
27  sbSizerTexts = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL );
28 
29  m_textItemsGrid = new WX_GRID( sbSizerTexts->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), 0 );
30 
31  // Grid
32  m_textItemsGrid->CreateGrid( 2, 3 );
33  m_textItemsGrid->EnableEditing( true );
34  m_textItemsGrid->EnableGridLines( true );
35  m_textItemsGrid->EnableDragGridSize( false );
36  m_textItemsGrid->SetMargins( 0, 0 );
37 
38  // Columns
39  m_textItemsGrid->SetColSize( 0, 233 );
40  m_textItemsGrid->SetColSize( 1, 60 );
41  m_textItemsGrid->SetColSize( 2, 120 );
42  m_textItemsGrid->EnableDragColMove( false );
43  m_textItemsGrid->EnableDragColSize( true );
45  m_textItemsGrid->SetColLabelValue( 0, _("Text Items") );
46  m_textItemsGrid->SetColLabelValue( 1, _("Show") );
47  m_textItemsGrid->SetColLabelValue( 2, _("Layer") );
48  m_textItemsGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
49 
50  // Rows
51  m_textItemsGrid->EnableDragRowSize( false );
52  m_textItemsGrid->SetRowLabelSize( 160 );
53  m_textItemsGrid->SetRowLabelValue( 0, _("Reference designator") );
54  m_textItemsGrid->SetRowLabelValue( 1, _("Value") );
55  m_textItemsGrid->SetRowLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
56 
57  // Label Appearance
58 
59  // Cell Defaults
60  m_textItemsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
61  m_textItemsGrid->SetMinSize( wxSize( -1,140 ) );
62 
63  sbSizerTexts->Add( m_textItemsGrid, 1, wxALL|wxBOTTOM|wxEXPAND, 5 );
64 
65  wxBoxSizer* bButtonSize;
66  bButtonSize = new wxBoxSizer( wxHORIZONTAL );
67 
68  m_bpAdd = new wxBitmapButton( sbSizerTexts->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
69  m_bpAdd->SetMinSize( wxSize( 30,29 ) );
70 
71  bButtonSize->Add( m_bpAdd, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 );
72 
73 
74  bButtonSize->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
75 
76  m_bpDelete = new wxBitmapButton( sbSizerTexts->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
77  m_bpDelete->SetMinSize( wxSize( 30,29 ) );
78 
79  bButtonSize->Add( m_bpDelete, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 );
80 
81 
82  sbSizerTexts->Add( bButtonSize, 0, wxEXPAND, 5 );
83 
84 
85  bSizerMargins->Add( sbSizerTexts, 1, wxEXPAND|wxLEFT, 20 );
86 
87  m_staticTextInfo = new wxStaticText( this, wxID_ANY, _("Note: a blank reference designator or value will use the footprint name."), wxDefaultPosition, wxDefaultSize, 0 );
88  m_staticTextInfo->Wrap( -1 );
89  m_staticTextInfo->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
90 
91  bSizerMargins->Add( m_staticTextInfo, 0, wxBOTTOM|wxLEFT, 25 );
92 
93 
94  bSizerMargins->Add( 0, 0, 0, wxEXPAND|wxTOP|wxBOTTOM, 10 );
95 
96  wxBoxSizer* defaultPropertiesSizer;
97  defaultPropertiesSizer = new wxBoxSizer( wxVERTICAL );
98 
99  wxStaticText* defaultPropertiesLabel;
100  defaultPropertiesLabel = new wxStaticText( this, wxID_ANY, _("Default properties for new graphic items:"), wxDefaultPosition, wxDefaultSize, 0 );
101  defaultPropertiesLabel->Wrap( -1 );
102  defaultPropertiesSizer->Add( defaultPropertiesLabel, 0, wxBOTTOM|wxRIGHT, 5 );
103 
104  m_layerClassesGrid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
105 
106  // Grid
107  m_layerClassesGrid->CreateGrid( 6, 5 );
108  m_layerClassesGrid->EnableEditing( true );
109  m_layerClassesGrid->EnableGridLines( true );
110  m_layerClassesGrid->EnableDragGridSize( false );
111  m_layerClassesGrid->SetMargins( 0, 0 );
112 
113  // Columns
114  m_layerClassesGrid->SetColSize( 0, 110 );
115  m_layerClassesGrid->SetColSize( 1, 100 );
116  m_layerClassesGrid->SetColSize( 2, 100 );
117  m_layerClassesGrid->SetColSize( 3, 100 );
118  m_layerClassesGrid->SetColSize( 4, 60 );
119  m_layerClassesGrid->EnableDragColMove( false );
120  m_layerClassesGrid->EnableDragColSize( true );
122  m_layerClassesGrid->SetColLabelValue( 0, _("Line Thickness") );
123  m_layerClassesGrid->SetColLabelValue( 1, _("Text Width") );
124  m_layerClassesGrid->SetColLabelValue( 2, _("Text Height") );
125  m_layerClassesGrid->SetColLabelValue( 3, _("Text Thickness") );
126  m_layerClassesGrid->SetColLabelValue( 4, _("Italic") );
127  m_layerClassesGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
128 
129  // Rows
130  m_layerClassesGrid->EnableDragRowSize( false );
131  m_layerClassesGrid->SetRowLabelSize( 125 );
132  m_layerClassesGrid->SetRowLabelValue( 0, _("Silk Layers") );
133  m_layerClassesGrid->SetRowLabelValue( 1, _("Copper Layers") );
134  m_layerClassesGrid->SetRowLabelValue( 2, _("Edge Cuts") );
135  m_layerClassesGrid->SetRowLabelValue( 3, _("Courtyards") );
136  m_layerClassesGrid->SetRowLabelValue( 4, _("Fab Layers") );
137  m_layerClassesGrid->SetRowLabelValue( 5, _("Other Layers") );
138  m_layerClassesGrid->SetRowLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
139 
140  // Label Appearance
141 
142  // Cell Defaults
143  m_layerClassesGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
144  m_layerClassesGrid->SetToolTip( _("Net Class parameters") );
145 
146  defaultPropertiesSizer->Add( m_layerClassesGrid, 1, wxBOTTOM|wxLEFT, 20 );
147 
148 
149  bSizerMargins->Add( defaultPropertiesSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
150 
151 
152  bSizerMain->Add( bSizerMargins, 1, wxRIGHT|wxLEFT, 5 );
153 
154 
155  this->SetSizer( bSizerMain );
156  this->Layout();
157  bSizerMain->Fit( this );
158 
159  // Connect Events
160  m_textItemsGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_MODEDIT_DEFAULTS_BASE::OnGridSize ), NULL, this );
161  m_bpAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_MODEDIT_DEFAULTS_BASE::OnAddTextItem ), NULL, this );
162  m_bpDelete->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_MODEDIT_DEFAULTS_BASE::OnDeleteTextItem ), NULL, this );
163 }
virtual void OnGridSize(wxSizeEvent &event)
#define NULL
virtual void OnDeleteTextItem(wxCommandEvent &event)
const char * name
Definition: DXF_plotter.cpp:60
#define _(s)
Definition: 3d_actions.cpp:33
virtual void OnAddTextItem(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:49

References _, defaultTextItemsLabel, m_bpAdd, m_bpDelete, m_layerClassesGrid, m_staticTextInfo, m_textItemsGrid, NULL, OnAddTextItem(), OnDeleteTextItem(), OnGridSize(), and WX_GRID::SetColLabelSize().

◆ ~PANEL_MODEDIT_DEFAULTS_BASE()

PANEL_MODEDIT_DEFAULTS_BASE::~PANEL_MODEDIT_DEFAULTS_BASE ( )

Definition at line 165 of file panel_modedit_defaults_base.cpp.

166 {
167  // Disconnect Events
168  m_textItemsGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_MODEDIT_DEFAULTS_BASE::OnGridSize ), NULL, this );
169  m_bpAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_MODEDIT_DEFAULTS_BASE::OnAddTextItem ), NULL, this );
170  m_bpDelete->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_MODEDIT_DEFAULTS_BASE::OnDeleteTextItem ), NULL, this );
171 
172 }
virtual void OnGridSize(wxSizeEvent &event)
#define NULL
virtual void OnDeleteTextItem(wxCommandEvent &event)
virtual void OnAddTextItem(wxCommandEvent &event)

References m_bpAdd, m_bpDelete, m_textItemsGrid, NULL, OnAddTextItem(), OnDeleteTextItem(), and OnGridSize().

Member Function Documentation

◆ OnAddTextItem()

virtual void PANEL_MODEDIT_DEFAULTS_BASE::OnAddTextItem ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_MODEDIT_DEFAULTS.

Definition at line 51 of file panel_modedit_defaults_base.h.

51 { event.Skip(); }

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

◆ OnDeleteTextItem()

virtual void PANEL_MODEDIT_DEFAULTS_BASE::OnDeleteTextItem ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_MODEDIT_DEFAULTS.

Definition at line 52 of file panel_modedit_defaults_base.h.

52 { event.Skip(); }

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

◆ OnGridSize()

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

Definition at line 50 of file panel_modedit_defaults_base.h.

50 { event.Skip(); }

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

Member Data Documentation

◆ defaultTextItemsLabel

wxStaticText* PANEL_MODEDIT_DEFAULTS_BASE::defaultTextItemsLabel
protected

Definition at line 42 of file panel_modedit_defaults_base.h.

Referenced by PANEL_MODEDIT_DEFAULTS_BASE().

◆ m_bpAdd

wxBitmapButton* PANEL_MODEDIT_DEFAULTS_BASE::m_bpAdd
protected

◆ m_bpDelete

wxBitmapButton* PANEL_MODEDIT_DEFAULTS_BASE::m_bpDelete
protected

◆ m_layerClassesGrid

◆ m_staticTextInfo

wxStaticText* PANEL_MODEDIT_DEFAULTS_BASE::m_staticTextInfo
protected

◆ m_textItemsGrid


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