KiCad PCB EDA Suite
dialog_lib_edit_pin_table_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version Oct 17 2016)
3 // http://www.wxformbuilder.org/
4 //
5 // PLEASE DO "NOT" EDIT THIS FILE!
7 
8 #include "widgets/wx_grid.h"
9 
11 
13 
14 DIALOG_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 )
15 {
16  this->SetSizeHints( wxDefaultSize, wxDefaultSize );
17 
18  wxBoxSizer* top_sizer;
19  top_sizer = new wxBoxSizer( wxVERTICAL );
20 
21  m_grid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
22 
23  // Grid
24  m_grid->CreateGrid( 5, 10 );
25  m_grid->EnableEditing( true );
26  m_grid->EnableGridLines( true );
27  m_grid->EnableDragGridSize( false );
28  m_grid->SetMargins( 0, 0 );
29 
30  // Columns
31  m_grid->SetColSize( 0, 66 );
32  m_grid->SetColSize( 1, 84 );
33  m_grid->SetColSize( 2, 140 );
34  m_grid->SetColSize( 3, 140 );
35  m_grid->SetColSize( 4, 100 );
36  m_grid->SetColSize( 5, 110 );
37  m_grid->SetColSize( 6, 110 );
38  m_grid->SetColSize( 7, 84 );
39  m_grid->SetColSize( 8, 84 );
40  m_grid->SetColSize( 9, 84 );
41  m_grid->EnableDragColMove( false );
42  m_grid->EnableDragColSize( true );
43  m_grid->SetColLabelSize( 24 );
44  m_grid->SetColLabelValue( 0, _("Number") );
45  m_grid->SetColLabelValue( 1, _("Name") );
46  m_grid->SetColLabelValue( 2, _("Electrical Type") );
47  m_grid->SetColLabelValue( 3, _("Graphic Style") );
48  m_grid->SetColLabelValue( 4, _("Orientation") );
49  m_grid->SetColLabelValue( 5, _("Number Text Size") );
50  m_grid->SetColLabelValue( 6, _("Name Text Size") );
51  m_grid->SetColLabelValue( 7, _("Length") );
52  m_grid->SetColLabelValue( 8, _("X Position") );
53  m_grid->SetColLabelValue( 9, _("Y Position") );
54  m_grid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
55 
56  // Rows
57  m_grid->EnableDragRowSize( false );
58  m_grid->SetRowLabelSize( 0 );
59  m_grid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
60 
61  // Label Appearance
62 
63  // Cell Defaults
64  m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
65  m_grid->SetMinSize( wxSize( 720,240 ) );
66 
67  top_sizer->Add( m_grid, 1, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 10 );
68 
69  wxBoxSizer* bSizer2;
70  bSizer2 = new wxBoxSizer( wxHORIZONTAL );
71 
72  m_addButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
73  m_addButton->SetMinSize( wxSize( 30,29 ) );
74 
75  bSizer2->Add( m_addButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
76 
77 
78  bSizer2->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
79 
80  m_deleteButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
81  m_deleteButton->SetMinSize( wxSize( 30,29 ) );
82 
83  bSizer2->Add( m_deleteButton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 10 );
84 
85  m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
86  bSizer2->Add( m_staticline1, 0, wxEXPAND|wxALL, 5 );
87 
88  m_cbGroup = new wxCheckBox( this, wxID_ANY, _("Group by name"), wxDefaultPosition, wxDefaultSize, 0 );
89  bSizer2->Add( m_cbGroup, 0, wxALIGN_CENTER_VERTICAL|wxALL, 10 );
90 
91  m_refreshButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
92  m_refreshButton->SetMinSize( wxSize( 30,29 ) );
93 
94  bSizer2->Add( m_refreshButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 10 );
95 
96  m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
97  bSizer2->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 );
98 
99  m_staticText1 = new wxStaticText( this, wxID_ANY, _("Pin numbers:"), wxDefaultPosition, wxDefaultSize, 0 );
100  m_staticText1->Wrap( -1 );
101  bSizer2->Add( m_staticText1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 10 );
102 
103  m_summary = new wxStaticText( this, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 );
104  m_summary->Wrap( -1 );
105  bSizer2->Add( m_summary, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
106 
107  m_Buttons = new wxStdDialogButtonSizer();
108  m_ButtonsOK = new wxButton( this, wxID_OK );
109  m_Buttons->AddButton( m_ButtonsOK );
110  m_ButtonsCancel = new wxButton( this, wxID_CANCEL );
111  m_Buttons->AddButton( m_ButtonsCancel );
112  m_Buttons->Realize();
113 
114  bSizer2->Add( m_Buttons, 0, wxEXPAND, 5 );
115 
116 
117  top_sizer->Add( bSizer2, 0, wxEXPAND|wxLEFT, 5 );
118 
119 
120  this->SetSizer( top_sizer );
121  this->Layout();
122  top_sizer->Fit( this );
123 
124  this->Centre( wxBOTH );
125 
126  // Connect Events
127  this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnClose ) );
128  this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnUpdateUI ) );
129  m_grid->Connect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnCellEdited ), NULL, this );
130  m_grid->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnSize ), NULL, this );
131  m_addButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnAddRow ), NULL, this );
132  m_deleteButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnDeleteRow ), NULL, this );
133  m_cbGroup->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnRebuildRows ), NULL, this );
134  m_refreshButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnRebuildRows ), NULL, this );
135  m_ButtonsCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnCancel ), NULL, this );
136 }
137 
139 {
140  // Disconnect Events
141  this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnClose ) );
142  this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnUpdateUI ) );
143  m_grid->Disconnect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnCellEdited ), NULL, this );
144  m_grid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnSize ), NULL, this );
145  m_addButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnAddRow ), NULL, this );
146  m_deleteButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnDeleteRow ), NULL, this );
147  m_cbGroup->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnRebuildRows ), NULL, this );
148  m_refreshButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnRebuildRows ), NULL, this );
149  m_ButtonsCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_TABLE_BASE::OnCancel ), NULL, this );
150 
151 }
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 OnRebuildRows(wxCommandEvent &event)=0
Class DIALOG_SHIM may sit in the inheritance tree between wxDialog and any class written by wxFormBui...
Definition: dialog_shim.h:82
virtual void OnDeleteRow(wxCommandEvent &event)=0
virtual void OnUpdateUI(wxUpdateUIEvent &event)=0
virtual void OnAddRow(wxCommandEvent &event)=0
virtual void OnCancel(wxCommandEvent &event)=0
virtual void OnClose(wxCloseEvent &event)=0
virtual void OnSize(wxSizeEvent &event)=0
virtual void OnCellEdited(wxGridEvent &event)=0