KiCad PCB EDA Suite
dialog_annotate_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/infobar.h"
9 #include "wx_html_report_panel.h"
10 
11 #include "dialog_annotate_base.h"
12 
14 
15 DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_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* bmainSizer;
20  bmainSizer = new wxBoxSizer( wxVERTICAL );
21 
22  m_infoBar = new WX_INFOBAR( this );
23  m_infoBar->Hide();
24 
25  bmainSizer->Add( m_infoBar, 0, wxEXPAND|wxBOTTOM, 5 );
26 
27  wxBoxSizer* bupperSizer;
28  bupperSizer = new wxBoxSizer( wxVERTICAL );
29 
30  wxFlexGridSizer* fgSizer1;
31  fgSizer1 = new wxFlexGridSizer( 2, 2, 0, 0 );
32  fgSizer1->AddGrowableCol( 0 );
33  fgSizer1->AddGrowableCol( 1 );
34  fgSizer1->SetFlexibleDirection( wxBOTH );
35  fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
36 
37  wxString m_rbScopeChoices[] = { _("Entire schematic"), _("Current sheet only"), _("Selection only") };
38  int m_rbScopeNChoices = sizeof( m_rbScopeChoices ) / sizeof( wxString );
39  m_rbScope = new wxRadioBox( this, wxID_ANY, _("Scope"), wxDefaultPosition, wxDefaultSize, m_rbScopeNChoices, m_rbScopeChoices, 1, wxRA_SPECIFY_COLS );
40  m_rbScope->SetSelection( 1 );
41  fgSizer1->Add( m_rbScope, 0, wxALL|wxEXPAND, 5 );
42 
43  wxStaticBoxSizer* sbSizer1;
44  sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Order") ), wxVERTICAL );
45 
46  wxBoxSizer* bSizerXpos;
47  bSizerXpos = new wxBoxSizer( wxHORIZONTAL );
48 
49  m_rbSortBy_X_Position = new wxRadioButton( sbSizer1->GetStaticBox(), ID_SORT_BY_X_POSITION, _("Sort symbols by &X position"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
50  bSizerXpos->Add( m_rbSortBy_X_Position, 0, wxALIGN_CENTER_VERTICAL, 3 );
51 
52 
53  bSizerXpos->Add( 0, 0, 1, 0, 5 );
54 
55  annotate_down_right_bitmap = new wxStaticBitmap( sbSizer1->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
56  bSizerXpos->Add( annotate_down_right_bitmap, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
57 
58 
59  sbSizer1->Add( bSizerXpos, 0, wxEXPAND, 5 );
60 
61 
62  sbSizer1->Add( 0, 5, 0, wxEXPAND, 5 );
63 
64  wxBoxSizer* bSizerYpos;
65  bSizerYpos = new wxBoxSizer( wxHORIZONTAL );
66 
67  m_rbSortBy_Y_Position = new wxRadioButton( sbSizer1->GetStaticBox(), ID_SORT_BY_Y_POSITION, _("Sort symbols by &Y position"), wxDefaultPosition, wxDefaultSize, 0 );
68  bSizerYpos->Add( m_rbSortBy_Y_Position, 0, wxALIGN_CENTER_VERTICAL, 3 );
69 
70 
71  bSizerYpos->Add( 0, 0, 1, 0, 5 );
72 
73  annotate_right_down_bitmap = new wxStaticBitmap( sbSizer1->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
74  bSizerYpos->Add( annotate_right_down_bitmap, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
75 
76 
77  sbSizer1->Add( bSizerYpos, 0, wxEXPAND, 5 );
78 
79 
80  fgSizer1->Add( sbSizer1, 0, wxALL|wxEXPAND, 5 );
81 
82  wxString m_rbOptionsChoices[] = { _("Keep existing annotations"), _("Reset existing annotations") };
83  int m_rbOptionsNChoices = sizeof( m_rbOptionsChoices ) / sizeof( wxString );
84  m_rbOptions = new wxRadioBox( this, wxID_ANY, _("Options"), wxDefaultPosition, wxDefaultSize, m_rbOptionsNChoices, m_rbOptionsChoices, 1, wxRA_SPECIFY_COLS );
85  m_rbOptions->SetSelection( 0 );
86  fgSizer1->Add( m_rbOptions, 0, wxALL|wxEXPAND, 5 );
87 
88  wxStaticBoxSizer* sbSizer2;
89  sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Numbering") ), wxVERTICAL );
90 
91  wxGridBagSizer* gbSizer1;
92  gbSizer1 = new wxGridBagSizer( 0, 0 );
93  gbSizer1->SetFlexibleDirection( wxBOTH );
94  gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
95 
96  m_rbFirstFree = new wxRadioButton( sbSizer2->GetStaticBox(), wxID_FIRST_FREE, _("Use first free number after:"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
97  gbSizer1->Add( m_rbFirstFree, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 2 );
98 
99  m_textNumberAfter = new wxTextCtrl( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 60,-1 ), 0 );
100  gbSizer1->Add( m_textNumberAfter, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxLEFT|wxRIGHT, 2 );
101 
102  m_rbSheetX100 = new wxRadioButton( sbSizer2->GetStaticBox(), wxID_SHEET_X_100, _("First free after sheet number X 100"), wxDefaultPosition, wxDefaultSize, 0 );
103  gbSizer1->Add( m_rbSheetX100, wxGBPosition( 1, 0 ), wxGBSpan( 1, 2 ), wxBOTTOM|wxTOP, 4 );
104 
105  m_rbSheetX1000 = new wxRadioButton( sbSizer2->GetStaticBox(), wxID_SHEET_X_1000, _("First free after sheet number X 1000"), wxDefaultPosition, wxDefaultSize, 0 );
106  gbSizer1->Add( m_rbSheetX1000, wxGBPosition( 2, 0 ), wxGBSpan( 1, 2 ), wxBOTTOM|wxTOP, 2 );
107 
108 
109  sbSizer2->Add( gbSizer1, 1, wxEXPAND, 5 );
110 
111 
112  fgSizer1->Add( sbSizer2, 1, wxALL|wxEXPAND, 5 );
113 
114 
115  bupperSizer->Add( fgSizer1, 0, wxBOTTOM|wxEXPAND, 5 );
116 
117  m_MessageWindow = new WX_HTML_REPORT_PANEL( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
118  m_MessageWindow->SetMinSize( wxSize( -1,120 ) );
119 
120  bupperSizer->Add( m_MessageWindow, 5, wxEXPAND|wxRIGHT|wxLEFT, 5 );
121 
122 
123  bmainSizer->Add( bupperSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 6 );
124 
125  wxBoxSizer* m_buttonsSizer;
126  m_buttonsSizer = new wxBoxSizer( wxHORIZONTAL );
127 
128  m_btnClear = new wxButton( this, ID_CLEAR_ANNOTATION_CMP, _("Clear Annotation"), wxDefaultPosition, wxDefaultSize, 0 );
129  m_buttonsSizer->Add( m_btnClear, 0, wxEXPAND|wxALL, 10 );
130 
131 
132  m_buttonsSizer->Add( 0, 0, 1, wxEXPAND, 5 );
133 
134  m_sdbSizer1 = new wxStdDialogButtonSizer();
135  m_sdbSizer1OK = new wxButton( this, wxID_OK );
136  m_sdbSizer1->AddButton( m_sdbSizer1OK );
137  m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
138  m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
139  m_sdbSizer1->Realize();
140 
141  m_buttonsSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 5 );
142 
143 
144  bmainSizer->Add( m_buttonsSizer, 0, wxEXPAND|wxLEFT, 5 );
145 
146 
147  this->SetSizer( bmainSizer );
148  this->Layout();
149  bmainSizer->Fit( this );
150 
151  // Connect Events
152  this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_ANNOTATE_BASE::OnClose ) );
153  m_rbScope->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnOptionChanged ), NULL, this );
154  m_rbSortBy_X_Position->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnOptionChanged ), NULL, this );
155  m_rbSortBy_Y_Position->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnOptionChanged ), NULL, this );
156  m_rbOptions->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnOptionChanged ), NULL, this );
157  m_rbFirstFree->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnOptionChanged ), NULL, this );
158  m_textNumberAfter->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnOptionChanged ), NULL, this );
159  m_rbSheetX100->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnOptionChanged ), NULL, this );
160  m_rbSheetX1000->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnOptionChanged ), NULL, this );
161  m_btnClear->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnClearAnnotationClick ), NULL, this );
162  m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnCloseClick ), NULL, this );
163  m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnApplyClick ), NULL, this );
164 }
165 
167 {
168  // Disconnect Events
169  this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_ANNOTATE_BASE::OnClose ) );
170  m_rbScope->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnOptionChanged ), NULL, this );
171  m_rbSortBy_X_Position->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnOptionChanged ), NULL, this );
172  m_rbSortBy_Y_Position->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnOptionChanged ), NULL, this );
173  m_rbOptions->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnOptionChanged ), NULL, this );
174  m_rbFirstFree->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnOptionChanged ), NULL, this );
175  m_textNumberAfter->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnOptionChanged ), NULL, this );
176  m_rbSheetX100->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnOptionChanged ), NULL, this );
177  m_rbSheetX1000->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnOptionChanged ), NULL, this );
178  m_btnClear->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnClearAnnotationClick ), NULL, this );
179  m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnCloseClick ), NULL, this );
180  m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnApplyClick ), NULL, this );
181 
182 }
#define ID_CLEAR_ANNOTATION_CMP
virtual void OnOptionChanged(wxCommandEvent &event)
wxRadioButton * m_rbSortBy_X_Position
#define wxID_SHEET_X_100
virtual void OnClearAnnotationClick(wxCommandEvent &event)
wxRadioButton * m_rbSheetX1000
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:82
wxStaticBitmap * annotate_right_down_bitmap
#define NULL
virtual void OnApplyClick(wxCommandEvent &event)
wxRadioButton * m_rbSortBy_Y_Position
#define wxID_FIRST_FREE
WX_HTML_REPORT_PANEL * m_MessageWindow
#define _(s)
virtual void OnClose(wxCloseEvent &event)
#define wxID_SHEET_X_1000
wxRadioButton * m_rbFirstFree
#define ID_SORT_BY_X_POSITION
wxRadioButton * m_rbSheetX100
A modified version of the wxInfoBar class that allows us to:
Definition: infobar.h:73
wxStaticBitmap * annotate_down_right_bitmap
DIALOG_ANNOTATE_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Annotate Schematic"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
#define ID_SORT_BY_Y_POSITION
virtual void OnCloseClick(wxCommandEvent &event)
wxStdDialogButtonSizer * m_sdbSizer1
A widget for browsing a rich text error/status report.