KiCad PCB EDA Suite
dialog_edit_components_libid_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version Dec 30 2017)
3 // http://www.wxformbuilder.org/
4 //
5 // PLEASE DO *NOT* EDIT THIS FILE!
7 
9 
11 
12 DIALOG_EDIT_COMPONENTS_LIBID_BASE::DIALOG_EDIT_COMPONENTS_LIBID_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
13 {
14  this->SetSizeHints( wxDefaultSize, wxDefaultSize );
15 
16  wxBoxSizer* bSizerMain;
17  bSizerMain = new wxBoxSizer( wxVERTICAL );
18 
19  m_panelGrid = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
20  wxBoxSizer* bSizerGrid;
21  bSizerGrid = new wxBoxSizer( wxVERTICAL );
22 
23  m_grid = new wxGrid( m_panelGrid, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
24 
25  // Grid
26  m_grid->CreateGrid( 5, 3 );
27  m_grid->EnableEditing( true );
28  m_grid->EnableGridLines( true );
29  m_grid->EnableDragGridSize( false );
30  m_grid->SetMargins( 0, 0 );
31 
32  // Columns
33  m_grid->SetColSize( 0, 300 );
34  m_grid->SetColSize( 1, 200 );
35  m_grid->SetColSize( 2, 200 );
36  m_grid->EnableDragColMove( false );
37  m_grid->EnableDragColSize( true );
38  m_grid->SetColLabelSize( 30 );
39  m_grid->SetColLabelValue( 0, _("Symbols") );
40  m_grid->SetColLabelValue( 1, _("Current Library Reference") );
41  m_grid->SetColLabelValue( 2, _("New Library Reference") );
42  m_grid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
43 
44  // Rows
45  m_grid->AutoSizeRows();
46  m_grid->EnableDragRowSize( true );
47  m_grid->SetRowLabelSize( 30 );
48  m_grid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
49 
50  // Label Appearance
51 
52  // Cell Defaults
53  m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
54  m_grid->SetMinSize( wxSize( 700,-1 ) );
55 
56  bSizerGrid->Add( m_grid, 1, wxALL|wxEXPAND, 5 );
57 
58 
59  m_panelGrid->SetSizer( bSizerGrid );
60  m_panelGrid->Layout();
61  bSizerGrid->Fit( m_panelGrid );
62  bSizerMain->Add( m_panelGrid, 1, wxEXPAND | wxALL, 5 );
63 
64  m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
65  bSizerMain->Add( m_staticline, 0, wxEXPAND | wxALL, 5 );
66 
67  wxBoxSizer* bSizerMsgWarning;
68  bSizerMsgWarning = new wxBoxSizer( wxVERTICAL );
69 
70  m_staticTextWarning = new wxStaticText( this, wxID_ANY, _("Warning: Changes made from this dialog cannot be undone, after closing it."), wxDefaultPosition, wxDefaultSize, 0 );
71  m_staticTextWarning->Wrap( -1 );
72  m_staticTextWarning->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
73 
74  bSizerMsgWarning->Add( m_staticTextWarning, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 );
75 
76 
77  bSizerMain->Add( bSizerMsgWarning, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 );
78 
79  wxBoxSizer* bSizerButtons;
80  bSizerButtons = new wxBoxSizer( wxHORIZONTAL );
81 
82  m_sdbSizer = new wxStdDialogButtonSizer();
83  m_sdbSizerOK = new wxButton( this, wxID_OK );
84  m_sdbSizer->AddButton( m_sdbSizerOK );
85  m_sdbSizerApply = new wxButton( this, wxID_APPLY );
86  m_sdbSizer->AddButton( m_sdbSizerApply );
87  m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
88  m_sdbSizer->AddButton( m_sdbSizerCancel );
89  m_sdbSizer->Realize();
90 
91  bSizerButtons->Add( m_sdbSizer, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
92 
93  m_buttonUndo = new wxButton( this, wxID_ANY, _("Undo Changes"), wxDefaultPosition, wxDefaultSize, 0 );
94  bSizerButtons->Add( m_buttonUndo, 0, wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
95 
96  m_buttonBrowseLibs = new wxButton( this, wxID_ANY, _("Browse Libraries"), wxDefaultPosition, wxDefaultSize, 0 );
97  bSizerButtons->Add( m_buttonBrowseLibs, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
98 
99  m_buttonOrphanItems = new wxButton( this, wxID_ANY, _("Map Orphans"), wxDefaultPosition, wxDefaultSize, 0 );
100  m_buttonOrphanItems->SetToolTip( _("If some components are orphan (the linked symbol is found nowhere),\ntry to find a candidate having the same name in one of loaded symbol libraries") );
101 
102  bSizerButtons->Add( m_buttonOrphanItems, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
103 
104 
105  bSizerMain->Add( bSizerButtons, 0, wxALIGN_RIGHT, 5 );
106 
107 
108  this->SetSizer( bSizerMain );
109  this->Layout();
110  bSizerMain->Fit( this );
111 
112  this->Centre( wxBOTH );
113 
114  // Connect Events
115  m_grid->Connect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onCellBrowseLib ), NULL, this );
116  m_grid->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onCellBrowseLib ), NULL, this );
117  m_grid->Connect( wxEVT_GRID_LABEL_LEFT_DCLICK, wxGridEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onCellBrowseLib ), NULL, this );
118  m_grid->Connect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onCellBrowseLib ), NULL, this );
119  m_sdbSizerApply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onApplyButton ), NULL, this );
120  m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onCancel ), NULL, this );
121  m_buttonUndo->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onUndoChangesButton ), NULL, this );
122  m_buttonUndo->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::updateUIChangesButton ), NULL, this );
123  m_buttonBrowseLibs->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onButtonBrowseLibraries ), NULL, this );
124  m_buttonBrowseLibs->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::updateUIBrowseButton ), NULL, this );
125  m_buttonOrphanItems->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onClickOrphansButton ), NULL, this );
126 }
127 
129 {
130  // Disconnect Events
131  m_grid->Disconnect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onCellBrowseLib ), NULL, this );
132  m_grid->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onCellBrowseLib ), NULL, this );
133  m_grid->Disconnect( wxEVT_GRID_LABEL_LEFT_DCLICK, wxGridEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onCellBrowseLib ), NULL, this );
134  m_grid->Disconnect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onCellBrowseLib ), NULL, this );
135  m_sdbSizerApply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onApplyButton ), NULL, this );
136  m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onCancel ), NULL, this );
137  m_buttonUndo->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onUndoChangesButton ), NULL, this );
138  m_buttonUndo->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::updateUIChangesButton ), NULL, this );
139  m_buttonBrowseLibs->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onButtonBrowseLibraries ), NULL, this );
140  m_buttonBrowseLibs->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::updateUIBrowseButton ), NULL, this );
141  m_buttonOrphanItems->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onClickOrphansButton ), NULL, this );
142 
143 }
virtual void onCancel(wxCommandEvent &event)
Class DIALOG_SHIM may sit in the inheritance tree between wxDialog and any class written by wxFormBui...
Definition: dialog_shim.h:70
virtual void onApplyButton(wxCommandEvent &event)
virtual void onUndoChangesButton(wxCommandEvent &event)
virtual void onClickOrphansButton(wxCommandEvent &event)
DIALOG_EDIT_COMPONENTS_LIBID_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Symbol Library References"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
virtual void onCellBrowseLib(wxGridEvent &event)
virtual void updateUIBrowseButton(wxUpdateUIEvent &event)
virtual void updateUIChangesButton(wxUpdateUIEvent &event)
virtual void onButtonBrowseLibraries(wxCommandEvent &event)