KiCad PCB EDA Suite
PANEL_FP_EDITOR_DEFAULTS_BASE Class Reference

Class PANEL_FP_EDITOR_DEFAULTS_BASE. More...

#include <panel_fp_editor_defaults_base.h>

Inheritance diagram for PANEL_FP_EDITOR_DEFAULTS_BASE:
PANEL_FP_EDITOR_DEFAULTS

Public Member Functions

 PANEL_FP_EDITOR_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_FP_EDITOR_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_graphicsGrid
 

Detailed Description

Constructor & Destructor Documentation

◆ PANEL_FP_EDITOR_DEFAULTS_BASE()

PANEL_FP_EDITOR_DEFAULTS_BASE::PANEL_FP_EDITOR_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_fp_editor_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  wxBoxSizer* defaultTextItemsSizer;
27  defaultTextItemsSizer = new wxBoxSizer( wxVERTICAL );
28 
29  m_textItemsGrid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxBORDER_SIMPLE|wxTAB_TRAVERSAL );
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, 268 );
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  defaultTextItemsSizer->Add( m_textItemsGrid, 1, wxALL|wxBOTTOM|wxEXPAND, 5 );
64 
65  wxBoxSizer* bButtonSize;
66  bButtonSize = new wxBoxSizer( wxHORIZONTAL );
67 
68  m_bpAdd = new wxBitmapButton( this, 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( this, 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  bButtonSize->Add( 0, 0, 1, wxEXPAND, 5 );
83 
84  m_staticTextInfo = new wxStaticText( this, wxID_ANY, _("Note: a blank reference designator or value will use the footprint name."), wxDefaultPosition, wxDefaultSize, 0 );
85  m_staticTextInfo->Wrap( -1 );
86  m_staticTextInfo->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
87 
88  bButtonSize->Add( m_staticTextInfo, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
89 
90 
91  defaultTextItemsSizer->Add( bButtonSize, 0, wxEXPAND, 5 );
92 
93 
94  bSizerMargins->Add( defaultTextItemsSizer, 1, wxEXPAND|wxLEFT, 20 );
95 
96 
97  bSizerMargins->Add( 0, 0, 0, wxEXPAND|wxTOP|wxBOTTOM, 10 );
98 
99  wxBoxSizer* defaultPropertiesSizer;
100  defaultPropertiesSizer = new wxBoxSizer( wxVERTICAL );
101 
102  wxStaticText* defaultPropertiesLabel;
103  defaultPropertiesLabel = new wxStaticText( this, wxID_ANY, _("Default properties for new graphic items:"), wxDefaultPosition, wxDefaultSize, 0 );
104  defaultPropertiesLabel->Wrap( -1 );
105  defaultPropertiesSizer->Add( defaultPropertiesLabel, 0, wxBOTTOM|wxRIGHT, 5 );
106 
107  m_graphicsGrid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SIMPLE|wxTAB_TRAVERSAL );
108 
109  // Grid
110  m_graphicsGrid->CreateGrid( 6, 5 );
111  m_graphicsGrid->EnableEditing( true );
112  m_graphicsGrid->EnableGridLines( true );
113  m_graphicsGrid->EnableDragGridSize( false );
114  m_graphicsGrid->SetMargins( 0, 0 );
115 
116  // Columns
117  m_graphicsGrid->SetColSize( 0, 110 );
118  m_graphicsGrid->SetColSize( 1, 100 );
119  m_graphicsGrid->SetColSize( 2, 100 );
120  m_graphicsGrid->SetColSize( 3, 100 );
121  m_graphicsGrid->SetColSize( 4, 60 );
122  m_graphicsGrid->EnableDragColMove( false );
123  m_graphicsGrid->EnableDragColSize( true );
125  m_graphicsGrid->SetColLabelValue( 0, _("Line Thickness") );
126  m_graphicsGrid->SetColLabelValue( 1, _("Text Width") );
127  m_graphicsGrid->SetColLabelValue( 2, _("Text Height") );
128  m_graphicsGrid->SetColLabelValue( 3, _("Text Thickness") );
129  m_graphicsGrid->SetColLabelValue( 4, _("Italic") );
130  m_graphicsGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
131 
132  // Rows
133  m_graphicsGrid->EnableDragRowSize( false );
134  m_graphicsGrid->SetRowLabelSize( 125 );
135  m_graphicsGrid->SetRowLabelValue( 0, _("Silk Layers") );
136  m_graphicsGrid->SetRowLabelValue( 1, _("Copper Layers") );
137  m_graphicsGrid->SetRowLabelValue( 2, _("Edge Cuts") );
138  m_graphicsGrid->SetRowLabelValue( 3, _("Courtyards") );
139  m_graphicsGrid->SetRowLabelValue( 4, _("Fab Layers") );
140  m_graphicsGrid->SetRowLabelValue( 5, _("Other Layers") );
141  m_graphicsGrid->SetRowLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
142 
143  // Label Appearance
144 
145  // Cell Defaults
146  m_graphicsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
147  m_graphicsGrid->SetToolTip( _("Net Class parameters") );
148 
149  defaultPropertiesSizer->Add( m_graphicsGrid, 1, wxBOTTOM|wxLEFT, 20 );
150 
151 
152  bSizerMargins->Add( defaultPropertiesSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
153 
154 
155  bSizerMain->Add( bSizerMargins, 1, wxRIGHT|wxLEFT, 5 );
156 
157 
158  this->SetSizer( bSizerMain );
159  this->Layout();
160  bSizerMain->Fit( this );
161 
162  // Connect Events
163  m_textItemsGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_FP_EDITOR_DEFAULTS_BASE::OnGridSize ), NULL, this );
164  m_bpAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_EDITOR_DEFAULTS_BASE::OnAddTextItem ), NULL, this );
165  m_bpDelete->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_FP_EDITOR_DEFAULTS_BASE::OnDeleteTextItem ), NULL, this );
166 }
virtual void OnGridSize(wxSizeEvent &event)
#define NULL
const char * name
Definition: DXF_plotter.cpp:59
virtual void OnAddTextItem(wxCommandEvent &event)
#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
virtual void OnDeleteTextItem(wxCommandEvent &event)

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

◆ ~PANEL_FP_EDITOR_DEFAULTS_BASE()

PANEL_FP_EDITOR_DEFAULTS_BASE::~PANEL_FP_EDITOR_DEFAULTS_BASE ( )

Definition at line 168 of file panel_fp_editor_defaults_base.cpp.

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

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

Member Function Documentation

◆ OnAddTextItem()

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

Reimplemented in PANEL_FP_EDITOR_DEFAULTS.

Definition at line 50 of file panel_fp_editor_defaults_base.h.

50 { event.Skip(); }

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

◆ OnDeleteTextItem()

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

Reimplemented in PANEL_FP_EDITOR_DEFAULTS.

Definition at line 51 of file panel_fp_editor_defaults_base.h.

51 { event.Skip(); }

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

◆ OnGridSize()

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

Definition at line 49 of file panel_fp_editor_defaults_base.h.

49 { event.Skip(); }

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

Member Data Documentation

◆ defaultTextItemsLabel

wxStaticText* PANEL_FP_EDITOR_DEFAULTS_BASE::defaultTextItemsLabel
protected

Definition at line 41 of file panel_fp_editor_defaults_base.h.

Referenced by PANEL_FP_EDITOR_DEFAULTS_BASE().

◆ m_bpAdd

wxBitmapButton* PANEL_FP_EDITOR_DEFAULTS_BASE::m_bpAdd
protected

◆ m_bpDelete

wxBitmapButton* PANEL_FP_EDITOR_DEFAULTS_BASE::m_bpDelete
protected

◆ m_graphicsGrid

◆ m_staticTextInfo

wxStaticText* PANEL_FP_EDITOR_DEFAULTS_BASE::m_staticTextInfo
protected

◆ m_textItemsGrid


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