KiCad PCB EDA Suite
dialog_edit_components_libid_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version Jul 11 2018)
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_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 )
15 {
16  this->SetSizeHints( wxDefaultSize, wxDefaultSize );
17 
18  wxBoxSizer* bSizerMain;
19  bSizerMain = new wxBoxSizer( wxVERTICAL );
20 
21  m_grid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
22 
23  // Grid
24  m_grid->CreateGrid( 5, 3 );
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, 280 );
32  m_grid->SetColSize( 1, 280 );
33  m_grid->SetColSize( 2, 280 );
34  m_grid->EnableDragColMove( false );
35  m_grid->EnableDragColSize( true );
36  m_grid->SetColLabelSize( 22 );
37  m_grid->SetColLabelValue( 0, _("Symbols") );
38  m_grid->SetColLabelValue( 1, _("Current Library Reference") );
39  m_grid->SetColLabelValue( 2, _("New Library Reference") );
40  m_grid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
41 
42  // Rows
43  m_grid->EnableDragRowSize( false );
44  m_grid->SetRowLabelSize( 0 );
45  m_grid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
46 
47  // Label Appearance
48 
49  // Cell Defaults
50  m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
51  m_grid->SetMinSize( wxSize( -1,300 ) );
52 
53  bSizerMain->Add( m_grid, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 );
54 
55  wxBoxSizer* bSizerMsgWarning;
56  bSizerMsgWarning = new wxBoxSizer( wxHORIZONTAL );
57 
58  m_staticTextWarning = new wxStaticText( this, wxID_ANY, _("Warning: changes made from this dialog cannot be undone after closing it."), wxDefaultPosition, wxDefaultSize, 0 );
59  m_staticTextWarning->Wrap( -1 );
60  m_staticTextWarning->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
61 
62  bSizerMsgWarning->Add( m_staticTextWarning, 1, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxTOP, 5 );
63 
64  m_buttonUndo = new wxButton( this, wxID_ANY, _("Undo Changes"), wxDefaultPosition, wxDefaultSize, 0 );
65  bSizerMsgWarning->Add( m_buttonUndo, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
66 
67 
68  bSizerMain->Add( bSizerMsgWarning, 0, wxALL|wxEXPAND, 10 );
69 
70  m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
71  bSizerMain->Add( m_staticline2, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
72 
73  wxBoxSizer* bSizerButtons;
74  bSizerButtons = new wxBoxSizer( wxHORIZONTAL );
75 
76  m_buttonOrphanItems = new wxButton( this, wxID_ANY, _("Map Orphans"), wxDefaultPosition, wxDefaultSize, 0 );
77  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") );
78 
79  bSizerButtons->Add( m_buttonOrphanItems, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
80 
81 
82  bSizerButtons->Add( 0, 0, 1, wxEXPAND, 5 );
83 
84  m_sdbSizer = new wxStdDialogButtonSizer();
85  m_sdbSizerOK = new wxButton( this, wxID_OK );
86  m_sdbSizer->AddButton( m_sdbSizerOK );
87  m_sdbSizerApply = new wxButton( this, wxID_APPLY );
88  m_sdbSizer->AddButton( m_sdbSizerApply );
89  m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
90  m_sdbSizer->AddButton( m_sdbSizerCancel );
91  m_sdbSizer->Realize();
92 
93  bSizerButtons->Add( m_sdbSizer, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
94 
95 
96  bSizerMain->Add( bSizerButtons, 0, wxEXPAND, 5 );
97 
98 
99  this->SetSizer( bSizerMain );
100  this->Layout();
101 
102  this->Centre( wxBOTH );
103 
104  // Connect Events
105  m_grid->Connect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onCellBrowseLib ), NULL, this );
106  m_grid->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onCellBrowseLib ), NULL, this );
107  m_grid->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::OnSizeGrid ), NULL, this );
108  m_buttonUndo->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onUndoChangesButton ), NULL, this );
109  m_buttonUndo->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::updateUIChangesButton ), NULL, this );
110  m_buttonOrphanItems->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onClickOrphansButton ), NULL, this );
111  m_sdbSizerApply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onApplyButton ), NULL, this );
112  m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onCancel ), NULL, this );
113 }
114 
116 {
117  // Disconnect Events
118  m_grid->Disconnect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onCellBrowseLib ), NULL, this );
119  m_grid->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onCellBrowseLib ), NULL, this );
120  m_grid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::OnSizeGrid ), NULL, this );
121  m_buttonUndo->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onUndoChangesButton ), NULL, this );
122  m_buttonUndo->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::updateUIChangesButton ), NULL, this );
123  m_buttonOrphanItems->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onClickOrphansButton ), NULL, this );
124  m_sdbSizerApply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onApplyButton ), NULL, this );
125  m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENTS_LIBID_BASE::onCancel ), NULL, this );
126 
127 }
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:53
virtual void onApplyButton(wxCommandEvent &event)
virtual void onUndoChangesButton(wxCommandEvent &event)
virtual void onClickOrphansButton(wxCommandEvent &event)
virtual void onCellBrowseLib(wxGridEvent &event)
virtual void updateUIChangesButton(wxUpdateUIEvent &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(831, 426), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)