KiCad PCB EDA Suite
dialog_lib_edit_pin_table_base.cpp
Go to the documentation of this file.
1
2// C++ code generated with wxFormBuilder (version Oct 26 2018)
3// http://www.wxformbuilder.org/
4//
5// PLEASE DO *NOT* EDIT THIS FILE!
7
9#include "widgets/wx_grid.h"
10
12
14
15DIALOG_LIB_EDIT_PIN_TABLE_BASE::DIALOG_LIB_EDIT_PIN_TABLE_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
16{
17 this->SetSizeHints( wxDefaultSize, wxDefaultSize );
18
19 wxBoxSizer* top_sizer;
20 top_sizer = new wxBoxSizer( wxVERTICAL );
21
22 wxBoxSizer* bSummarySizer;
23 bSummarySizer = new wxBoxSizer( wxHORIZONTAL );
24
25 m_staticTextPinNumbers = new wxStaticText( this, wxID_ANY, _("Pin numbers:"), wxDefaultPosition, wxDefaultSize, 0 );
26 m_staticTextPinNumbers->Wrap( -1 );
27 bSummarySizer->Add( m_staticTextPinNumbers, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
28
29 m_pin_numbers_summary = new wxStaticText( this, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 );
30 m_pin_numbers_summary->Wrap( -1 );
31 bSummarySizer->Add( m_pin_numbers_summary, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
32
33
34 bSummarySizer->Add( 0, 0, 1, wxEXPAND, 5 );
35
36 m_staticTextPinCount = new wxStaticText( this, wxID_ANY, _("Pin count:"), wxDefaultPosition, wxDefaultSize, 0 );
37 m_staticTextPinCount->Wrap( -1 );
38 bSummarySizer->Add( m_staticTextPinCount, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 10 );
39
40 m_pin_count = new wxStaticText( this, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 );
41 m_pin_count->Wrap( -1 );
42 bSummarySizer->Add( m_pin_count, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
43
44
45 bSummarySizer->Add( 0, 0, 1, wxEXPAND, 5 );
46
47 m_staticTextDuplicatePins = new wxStaticText( this, wxID_ANY, _("Duplicate pins:"), wxDefaultPosition, wxDefaultSize, 0 );
48 m_staticTextDuplicatePins->Wrap( -1 );
49 bSummarySizer->Add( m_staticTextDuplicatePins, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 10 );
50
51 m_duplicate_pins = new wxStaticText( this, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 );
52 m_duplicate_pins->Wrap( -1 );
53 bSummarySizer->Add( m_duplicate_pins, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
54
55
56 top_sizer->Add( bSummarySizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 );
57
58 wxBoxSizer* bGridMarginsSizer;
59 bGridMarginsSizer = new wxBoxSizer( wxVERTICAL );
60
61 m_grid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxSize( 800,400 ), 0 );
62
63 // Grid
64 m_grid->CreateGrid( 5, 14 );
65 m_grid->EnableEditing( true );
66 m_grid->EnableGridLines( true );
67 m_grid->EnableDragGridSize( false );
68 m_grid->SetMargins( 0, 0 );
69
70 // Columns
71 m_grid->SetColSize( 0, 60 );
72 m_grid->SetColSize( 1, 66 );
73 m_grid->SetColSize( 2, 84 );
74 m_grid->SetColSize( 3, 140 );
75 m_grid->SetColSize( 4, 140 );
76 m_grid->SetColSize( 5, 100 );
77 m_grid->SetColSize( 6, 110 );
78 m_grid->SetColSize( 7, 110 );
79 m_grid->SetColSize( 8, 84 );
80 m_grid->SetColSize( 9, 84 );
81 m_grid->SetColSize( 10, 84 );
82 m_grid->SetColSize( 11, 84 );
83 m_grid->SetColSize( 12, 66 );
84 m_grid->EnableDragColMove( false );
85 m_grid->EnableDragColSize( true );
87 m_grid->SetColLabelValue( 0, _("Count") );
88 m_grid->SetColLabelValue( 1, _("Number") );
89 m_grid->SetColLabelValue( 2, _("Name") );
90 m_grid->SetColLabelValue( 3, _("Electrical Type") );
91 m_grid->SetColLabelValue( 4, _("Graphic Style") );
92 m_grid->SetColLabelValue( 5, _("Orientation") );
93 m_grid->SetColLabelValue( 6, _("Number Text Size") );
94 m_grid->SetColLabelValue( 7, _("Name Text Size") );
95 m_grid->SetColLabelValue( 8, _("Length") );
96 m_grid->SetColLabelValue( 9, _("X Position") );
97 m_grid->SetColLabelValue( 10, _("Y Position") );
98 m_grid->SetColLabelValue( 11, _("Visible") );
99 m_grid->SetColLabelValue( 12, _("Unit") );
100 m_grid->SetColLabelValue( 13, _("De Morgan") );
101 m_grid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
102
103 // Rows
104 m_grid->EnableDragRowSize( false );
105 m_grid->SetRowLabelSize( 0 );
106 m_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
107
108 // Label Appearance
109
110 // Cell Defaults
111 m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
112 m_grid->SetMinSize( wxSize( 690,200 ) );
113
114 bGridMarginsSizer->Add( m_grid, 1, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 10 );
115
116
117 top_sizer->Add( bGridMarginsSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
118
119 wxBoxSizer* bBottomSizer;
120 bBottomSizer = new wxBoxSizer( wxHORIZONTAL );
121
122 wxBoxSizer* bSizer5;
123 bSizer5 = new wxBoxSizer( wxHORIZONTAL );
124
125 m_addButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
126 bSizer5->Add( m_addButton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
127
128 m_deleteButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
129 bSizer5->Add( m_deleteButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 10 );
130
131 m_divider1 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
132 m_divider1->Enable( false );
133
134 bSizer5->Add( m_divider1, 0, wxEXPAND|wxALL, 4 );
135
136 m_cbGroup = new wxCheckBox( this, wxID_ANY, _("Group by name"), wxDefaultPosition, wxDefaultSize, 0 );
137 bSizer5->Add( m_cbGroup, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
138
139 m_groupSelected = new wxButton( this, wxID_ANY, _("Group Selected"), wxDefaultPosition, wxDefaultSize, 0 );
140 bSizer5->Add( m_groupSelected, 0, wxALL|wxALIGN_CENTER_VERTICAL, 7 );
141
142 m_refreshButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
143 bSizer5->Add( m_refreshButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 10 );
144
145 m_divider2 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
146 m_divider2->Enable( false );
147
148 bSizer5->Add( m_divider2, 0, wxEXPAND|wxALL, 4 );
149
150 m_cbFilterByUnit = new wxCheckBox( this, wxID_ANY, _("Filter by unit:"), wxDefaultPosition, wxDefaultSize, 0 );
151 bSizer5->Add( m_cbFilterByUnit, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 );
152
153 wxArrayString m_unitFilterChoices;
154 m_unitFilter = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_unitFilterChoices, 0 );
155 m_unitFilter->SetSelection( 0 );
156 bSizer5->Add( m_unitFilter, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
157
158
159 bBottomSizer->Add( bSizer5, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 );
160
161
162 bBottomSizer->Add( 30, 0, 1, wxEXPAND, 5 );
163
164 m_Buttons = new wxStdDialogButtonSizer();
165 m_ButtonsOK = new wxButton( this, wxID_OK );
166 m_Buttons->AddButton( m_ButtonsOK );
167 m_ButtonsCancel = new wxButton( this, wxID_CANCEL );
168 m_Buttons->AddButton( m_ButtonsCancel );
169 m_Buttons->Realize();
170
171 bBottomSizer->Add( m_Buttons, 0, wxEXPAND|wxALL, 5 );
172
173
174 top_sizer->Add( bBottomSizer, 0, wxLEFT|wxEXPAND, 10 );
175
176
177 this->SetSizer( top_sizer );
178 this->Layout();
179 top_sizer->Fit( this );
180
181 this->Centre( wxBOTH );
182
183 // Connect Events
184 this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnClose ) );
185 this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnUpdateUI ) );
186 m_grid->Connect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnCellEdited ), NULL, this );
187 m_grid->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnSize ), NULL, this );
188 m_addButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnAddRow ), NULL, this );
189 m_deleteButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnDeleteRow ), NULL, this );
190 m_cbGroup->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnRebuildRows ), NULL, this );
191 m_groupSelected->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnGroupSelected ), NULL, this );
192 m_refreshButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnRebuildRows ), NULL, this );
193 m_cbFilterByUnit->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnFilterCheckBox ), NULL, this );
194 m_unitFilter->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnFilterChoice ), NULL, this );
195 m_ButtonsCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnCancel ), NULL, this );
196}
197
199{
200 // Disconnect Events
201 this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnClose ) );
202 this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnUpdateUI ) );
203 m_grid->Disconnect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnCellEdited ), NULL, this );
204 m_grid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnSize ), NULL, this );
205 m_addButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnAddRow ), NULL, this );
206 m_deleteButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnDeleteRow ), NULL, this );
207 m_cbGroup->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnRebuildRows ), NULL, this );
208 m_groupSelected->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnGroupSelected ), NULL, this );
209 m_refreshButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnRebuildRows ), NULL, this );
210 m_cbFilterByUnit->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnFilterCheckBox ), NULL, this );
211 m_unitFilter->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnFilterChoice ), NULL, this );
212 m_ButtonsCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnCancel ), NULL, this );
213
214}
A bitmap button widget that behaves like an AUI toolbar item's button when it is drawn.
Definition: bitmap_button.h:40
bool Enable(bool aEnable=true) override
Enable the button.
virtual void OnUpdateUI(wxUpdateUIEvent &event)=0
virtual void OnAddRow(wxCommandEvent &event)=0
virtual void OnClose(wxCloseEvent &event)=0
virtual void OnDeleteRow(wxCommandEvent &event)=0
virtual void OnGroupSelected(wxCommandEvent &event)=0
virtual void OnFilterCheckBox(wxCommandEvent &event)=0
virtual void OnCellEdited(wxGridEvent &event)=0
virtual void OnSize(wxSizeEvent &event)=0
virtual void OnRebuildRows(wxCommandEvent &event)=0
DIALOG_LIB_EDIT_PIN_TABLE_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Pin Table"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
virtual void OnCancel(wxCommandEvent &event)=0
virtual void OnFilterChoice(wxCommandEvent &event)=0
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:83
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:74
#define _(s)