KiCad PCB EDA Suite
dialog_edit_symbols_libid_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version 3.9.0 Jun 3 2020)
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_SYMBOLS_LIBID_BASE::DIALOG_EDIT_SYMBOLS_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_CENTER, wxALIGN_CENTER );
41 
42  // Rows
43  m_grid->EnableDragRowSize( false );
44  m_grid->SetRowLabelSize( 0 );
45  m_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
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* bSizerButtons;
56  bSizerButtons = new wxBoxSizer( wxHORIZONTAL );
57 
58  m_buttonOrphanItems = new wxButton( this, wxID_ANY, _("Map Orphans"), wxDefaultPosition, wxDefaultSize, 0 );
59  m_buttonOrphanItems->SetToolTip( _("If some symbols are orphaned (the linked symbol is not found anywhere),\ntry to find a candidate having the same name in one of loaded symbol libraries.") );
60 
61  bSizerButtons->Add( m_buttonOrphanItems, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
62 
63  m_checkBoxUpdateFields = new wxCheckBox( this, wxID_ANY, _("Update symbol fields from new library"), wxDefaultPosition, wxDefaultSize, 0 );
64  m_checkBoxUpdateFields->SetToolTip( _("Replace current symbols fields by fields from the new library.\nWarning: fields \"Value\" and \"Footprints\" will be therefore replaced.") );
65 
66  bSizerButtons->Add( m_checkBoxUpdateFields, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
67 
68 
69  bSizerButtons->Add( 0, 0, 1, wxEXPAND, 5 );
70 
71  m_sdbSizer = new wxStdDialogButtonSizer();
72  m_sdbSizerOK = new wxButton( this, wxID_OK );
73  m_sdbSizer->AddButton( m_sdbSizerOK );
74  m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
75  m_sdbSizer->AddButton( m_sdbSizerCancel );
76  m_sdbSizer->Realize();
77 
78  bSizerButtons->Add( m_sdbSizer, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
79 
80 
81  bSizerMain->Add( bSizerButtons, 0, wxEXPAND|wxLEFT, 5 );
82 
83 
84  this->SetSizer( bSizerMain );
85  this->Layout();
86  bSizerMain->Fit( this );
87 
88  this->Centre( wxBOTH );
89 
90  // Connect Events
91  m_grid->Connect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( DIALOG_EDIT_SYMBOLS_LIBID_BASE::onCellBrowseLib ), NULL, this );
92  m_grid->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_EDIT_SYMBOLS_LIBID_BASE::OnSizeGrid ), NULL, this );
93  m_buttonOrphanItems->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_SYMBOLS_LIBID_BASE::onClickOrphansButton ), NULL, this );
94  m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_SYMBOLS_LIBID_BASE::onCancel ), NULL, this );
95 }
96 
98 {
99  // Disconnect Events
100  m_grid->Disconnect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( DIALOG_EDIT_SYMBOLS_LIBID_BASE::onCellBrowseLib ), NULL, this );
101  m_grid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_EDIT_SYMBOLS_LIBID_BASE::OnSizeGrid ), NULL, this );
102  m_buttonOrphanItems->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_SYMBOLS_LIBID_BASE::onClickOrphansButton ), NULL, this );
103  m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_SYMBOLS_LIBID_BASE::onCancel ), NULL, this );
104 
105 }
virtual void onClickOrphansButton(wxCommandEvent &event)
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:82
#define NULL
#define _(s)
DIALOG_EDIT_SYMBOLS_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 onCancel(wxCommandEvent &event)
virtual void OnSizeGrid(wxSizeEvent &event)
virtual void onCellBrowseLib(wxGridEvent &event)
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:53