KiCad PCB EDA Suite
dialog_erc_base.cpp
Go to the documentation of this file.
1 // 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/infobar.h"
10 
11 #include "dialog_erc_base.h"
12 
14 
15 DIALOG_ERC_BASE::DIALOG_ERC_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* bSizer1;
20  bSizer1 = new wxBoxSizer( wxVERTICAL );
21 
22  m_infoBar = new WX_INFOBAR( this );
23  m_infoBar->Hide();
24 
25  bSizer1->Add( m_infoBar, 0, wxEXPAND, 5 );
26 
27  wxBoxSizer* bMainSizer;
28  bMainSizer = new wxBoxSizer( wxVERTICAL );
29 
30  m_notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
31  messagesPanel = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
32  wxBoxSizer* bMessagesSizer;
33  bMessagesSizer = new wxBoxSizer( wxVERTICAL );
34 
35  m_messages = new WX_HTML_REPORT_BOX( messagesPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO );
36  bMessagesSizer->Add( m_messages, 1, wxEXPAND|wxBOTTOM|wxLEFT, 5 );
37 
38 
39  messagesPanel->SetSizer( bMessagesSizer );
40  messagesPanel->Layout();
41  bMessagesSizer->Fit( messagesPanel );
42  m_notebook->AddPage( messagesPanel, _("Messages"), true );
43  violationsPanel = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
44  wxBoxSizer* bViolationsSizer;
45  bViolationsSizer = new wxBoxSizer( wxVERTICAL );
46 
47  m_markerDataView = new wxDataViewCtrl( violationsPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_NO_HEADER );
48  m_markerDataView->SetToolTip( _("Click on items to highlight them on the board.") );
49  m_markerDataView->SetMinSize( wxSize( 640,260 ) );
50 
51  bViolationsSizer->Add( m_markerDataView, 2, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
52 
53 
54  violationsPanel->SetSizer( bViolationsSizer );
55  violationsPanel->Layout();
56  bViolationsSizer->Fit( violationsPanel );
57  m_notebook->AddPage( violationsPanel, _("Violations"), false );
58 
59  bMainSizer->Add( m_notebook, 1, wxEXPAND, 5 );
60 
61  wxBoxSizer* bSeveritySizer;
62  bSeveritySizer = new wxBoxSizer( wxHORIZONTAL );
63 
64  m_showLabel = new wxStaticText( this, wxID_ANY, _("Show:"), wxDefaultPosition, wxDefaultSize, 0 );
65  m_showLabel->Wrap( -1 );
66  bSeveritySizer->Add( m_showLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
67 
68  m_showAll = new wxCheckBox( this, wxID_ANY, _("All"), wxDefaultPosition, wxDefaultSize, 0 );
69  bSeveritySizer->Add( m_showAll, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
70 
71 
72  bSeveritySizer->Add( 35, 0, 0, wxEXPAND, 5 );
73 
74  m_showErrors = new wxCheckBox( this, wxID_ANY, _("Errors"), wxDefaultPosition, wxDefaultSize, 0 );
75  bSeveritySizer->Add( m_showErrors, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
76 
77  m_errorsBadge = new NUMBER_BADGE( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
78  bSeveritySizer->Add( m_errorsBadge, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 25 );
79 
80  m_showWarnings = new wxCheckBox( this, wxID_ANY, _("Warnings"), wxDefaultPosition, wxDefaultSize, 0 );
81  bSeveritySizer->Add( m_showWarnings, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
82 
83  m_warningsBadge = new NUMBER_BADGE( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
84  bSeveritySizer->Add( m_warningsBadge, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 25 );
85 
86  m_showExclusions = new wxCheckBox( this, wxID_ANY, _("Exclusions"), wxDefaultPosition, wxDefaultSize, 0 );
87  bSeveritySizer->Add( m_showExclusions, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
88 
89  m_exclusionsBadge = new NUMBER_BADGE( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
90  bSeveritySizer->Add( m_exclusionsBadge, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 25 );
91 
92 
93  bSeveritySizer->Add( 0, 0, 1, wxEXPAND, 5 );
94 
95  m_saveReport = new wxButton( this, wxID_ANY, _("Save..."), wxDefaultPosition, wxDefaultSize, 0 );
96  bSeveritySizer->Add( m_saveReport, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
97 
98 
99  bMainSizer->Add( bSeveritySizer, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 );
100 
101 
102  bSizer1->Add( bMainSizer, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 8 );
103 
104  m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
105  bSizer1->Add( m_staticline1, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 );
106 
107  m_buttonsSizer = new wxBoxSizer( wxHORIZONTAL );
108 
109  m_buttondelmarkers = new wxButton( this, ID_ERASE_DRC_MARKERS, _("Delete Markers"), wxDefaultPosition, wxDefaultSize, 0 );
110  m_buttonsSizer->Add( m_buttondelmarkers, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 8 );
111 
112 
113  m_buttonsSizer->Add( 0, 0, 1, wxEXPAND, 5 );
114 
115  m_sdbSizer1 = new wxStdDialogButtonSizer();
116  m_sdbSizer1OK = new wxButton( this, wxID_OK );
117  m_sdbSizer1->AddButton( m_sdbSizer1OK );
118  m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
119  m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
120  m_sdbSizer1->Realize();
121 
122  m_buttonsSizer->Add( m_sdbSizer1, 0, wxEXPAND|wxALL, 5 );
123 
124 
125  bSizer1->Add( m_buttonsSizer, 0, wxEXPAND|wxLEFT, 5 );
126 
127 
128  this->SetSizer( bSizer1 );
129  this->Layout();
130  bSizer1->Fit( this );
131 
132  // Connect Events
133  this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_ERC_BASE::OnCloseErcDialog ) );
134  m_messages->Connect( wxEVT_COMMAND_HTML_LINK_CLICKED, wxHtmlLinkEventHandler( DIALOG_ERC_BASE::OnLinkClicked ), NULL, this );
135  m_markerDataView->Connect( wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler( DIALOG_ERC_BASE::OnERCItemDClick ), NULL, this );
136  m_markerDataView->Connect( wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU, wxDataViewEventHandler( DIALOG_ERC_BASE::OnERCItemRClick ), NULL, this );
137  m_markerDataView->Connect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_ERC_BASE::OnERCItemSelected ), NULL, this );
138  m_showAll->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnSeverity ), NULL, this );
139  m_showErrors->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnSeverity ), NULL, this );
140  m_showWarnings->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnSeverity ), NULL, this );
141  m_showExclusions->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnSeverity ), NULL, this );
142  m_saveReport->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnSaveReport ), NULL, this );
143  m_buttondelmarkers->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnEraseDrcMarkersClick ), NULL, this );
144  m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnCancelClick ), NULL, this );
145  m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnRunERCClick ), NULL, this );
146 }
147 
149 {
150  // Disconnect Events
151  this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_ERC_BASE::OnCloseErcDialog ) );
152  m_messages->Disconnect( wxEVT_COMMAND_HTML_LINK_CLICKED, wxHtmlLinkEventHandler( DIALOG_ERC_BASE::OnLinkClicked ), NULL, this );
153  m_markerDataView->Disconnect( wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler( DIALOG_ERC_BASE::OnERCItemDClick ), NULL, this );
154  m_markerDataView->Disconnect( wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU, wxDataViewEventHandler( DIALOG_ERC_BASE::OnERCItemRClick ), NULL, this );
155  m_markerDataView->Disconnect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_ERC_BASE::OnERCItemSelected ), NULL, this );
156  m_showAll->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnSeverity ), NULL, this );
157  m_showErrors->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnSeverity ), NULL, this );
158  m_showWarnings->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnSeverity ), NULL, this );
159  m_showExclusions->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnSeverity ), NULL, this );
160  m_saveReport->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnSaveReport ), NULL, this );
161  m_buttondelmarkers->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnEraseDrcMarkersClick ), NULL, this );
162  m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnCancelClick ), NULL, this );
163  m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ERC_BASE::OnRunERCClick ), NULL, this );
164 
165 }
#define ID_ERASE_DRC_MARKERS
virtual void OnLinkClicked(wxHtmlLinkEvent &event)
wxButton * m_buttondelmarkers
NUMBER_BADGE * m_errorsBadge
virtual void OnERCItemSelected(wxDataViewEvent &event)
A slimmed down version of WX_HTML_REPORT_PANEL.
wxCheckBox * m_showExclusions
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:82
virtual void OnEraseDrcMarkersClick(wxCommandEvent &event)
wxButton * m_sdbSizer1Cancel
A simple UI element that puts a number on top of a colored rounded rectangle with a fill color that s...
Definition: number_badge.h:38
virtual void OnRunERCClick(wxCommandEvent &event)
virtual void OnSaveReport(wxCommandEvent &event)
virtual void OnSeverity(wxCommandEvent &event)
wxCheckBox * m_showAll
#define NULL
virtual void OnCloseErcDialog(wxCloseEvent &event)
wxButton * m_sdbSizer1OK
wxStdDialogButtonSizer * m_sdbSizer1
wxBoxSizer * m_buttonsSizer
#define _(s)
virtual void OnERCItemRClick(wxDataViewEvent &event)
wxNotebook * m_notebook
wxButton * m_saveReport
NUMBER_BADGE * m_warningsBadge
wxPanel * violationsPanel
wxCheckBox * m_showWarnings
WX_INFOBAR * m_infoBar
A modified version of the wxInfoBar class that allows us to:
Definition: infobar.h:73
DIALOG_ERC_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Electrical Rules Checker"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
wxCheckBox * m_showErrors
NUMBER_BADGE * m_exclusionsBadge
wxDataViewCtrl * m_markerDataView
WX_HTML_REPORT_BOX * m_messages
wxStaticText * m_showLabel
virtual void OnCancelClick(wxCommandEvent &event)
wxStaticLine * m_staticline1
wxPanel * messagesPanel
virtual void OnERCItemDClick(wxDataViewEvent &event)