KiCad PCB EDA Suite
dialog_bom_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 
8 #include "dialog_bom_base.h"
9 
11 
12 DIALOG_BOM_BASE::DIALOG_BOM_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( wxSize( -1,-1 ), wxDefaultSize );
15 
16  wxBoxSizer* bMainSizer;
17  bMainSizer = new wxBoxSizer( wxVERTICAL );
18 
19  wxBoxSizer* bUpperSizer;
20  bUpperSizer = new wxBoxSizer( wxHORIZONTAL );
21 
22  wxBoxSizer* bLeftSizer;
23  bLeftSizer = new wxBoxSizer( wxVERTICAL );
24 
25  m_staticTextGeneratorTitle = new wxStaticText( this, wxID_ANY, _("BOM generator scripts:"), wxDefaultPosition, wxDefaultSize, 0 );
26  m_staticTextGeneratorTitle->Wrap( -1 );
27  bLeftSizer->Add( m_staticTextGeneratorTitle, 0, wxTOP, 5 );
28 
29  m_lbGenerators = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
30  m_lbGenerators->SetMinSize( wxSize( 250,-1 ) );
31 
32  bLeftSizer->Add( m_lbGenerators, 1, wxEXPAND, 5 );
33 
34 
35  bUpperSizer->Add( bLeftSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 10 );
36 
37  wxBoxSizer* bRightSizer;
38  bRightSizer = new wxBoxSizer( wxVERTICAL );
39 
40  wxBoxSizer* bNameSizer;
41  bNameSizer = new wxBoxSizer( wxHORIZONTAL );
42 
43  m_staticTextName = new wxStaticText( this, wxID_ANY, _("Generator nickname:"), wxDefaultPosition, wxDefaultSize, 0 );
44  m_staticTextName->Wrap( -1 );
45  bNameSizer->Add( m_staticTextName, 0, wxALIGN_CENTER_VERTICAL, 5 );
46 
47  m_textCtrlName = new wxTextCtrl( this, IN_NAMELINE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
48  bNameSizer->Add( m_textCtrlName, 1, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 );
49 
50 
51  bRightSizer->Add( bNameSizer, 0, wxEXPAND|wxTOP|wxLEFT, 6 );
52 
53  m_Messages = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
54  m_Messages->SetMinSize( wxSize( 300,200 ) );
55 
56  bRightSizer->Add( m_Messages, 1, wxEXPAND|wxLEFT, 5 );
57 
58 
59  bUpperSizer->Add( bRightSizer, 2, wxEXPAND|wxRIGHT|wxTOP, 10 );
60 
61 
62  bMainSizer->Add( bUpperSizer, 2, wxEXPAND|wxALL, 5 );
63 
64  wxBoxSizer* bGeneratorButtons;
65  bGeneratorButtons = new wxBoxSizer( wxHORIZONTAL );
66 
67  m_buttonAddGenerator = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
68  m_buttonAddGenerator->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
69  m_buttonAddGenerator->SetToolTip( _("Add a new BOM generator and its command line to the list") );
70 
71  bGeneratorButtons->Add( m_buttonAddGenerator, 0, wxRIGHT|wxLEFT, 5 );
72 
73  m_buttonEdit = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
74  m_buttonEdit->SetToolTip( _("Edit the script file in the text editor") );
75 
76  bGeneratorButtons->Add( m_buttonEdit, 0, wxRIGHT, 5 );
77 
78 
79  bGeneratorButtons->Add( 20, 0, 0, 0, 5 );
80 
81  m_buttonDelGenerator = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
82  m_buttonDelGenerator->SetToolTip( _("Remove the current generator script from list") );
83 
84  bGeneratorButtons->Add( m_buttonDelGenerator, 0, wxRIGHT, 5 );
85 
86 
87  bMainSizer->Add( bGeneratorButtons, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
88 
89  wxBoxSizer* bbottomSizer;
90  bbottomSizer = new wxBoxSizer( wxVERTICAL );
91 
92  m_staticTextCmd = new wxStaticText( this, wxID_ANY, _("Command line running the generator:"), wxDefaultPosition, wxDefaultSize, 0 );
93  m_staticTextCmd->Wrap( -1 );
94  bbottomSizer->Add( m_staticTextCmd, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
95 
96  m_textCtrlCommand = new wxTextCtrl( this, ID_CMDLINE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
97  m_textCtrlCommand->SetMinSize( wxSize( 380,-1 ) );
98 
99  bbottomSizer->Add( m_textCtrlCommand, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
100 
101  m_checkBoxShowConsole = new wxCheckBox( this, wxID_ANY, _("Show console window"), wxDefaultPosition, wxDefaultSize, 0 );
102  m_checkBoxShowConsole->SetToolTip( _("By default, command line runs with hidden console window and output is redirected to the info display.\nSet this option to show the window of the running command.") );
103 
104  bbottomSizer->Add( m_checkBoxShowConsole, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
105 
106 
107  bMainSizer->Add( bbottomSizer, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
108 
109  m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
110  bMainSizer->Add( m_staticline, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
111 
112  wxBoxSizer* bSizer8;
113  bSizer8 = new wxBoxSizer( wxHORIZONTAL );
114 
115  m_buttonReset = new wxButton( this, wxID_ANY, _("Reset to Defaults"), wxDefaultPosition, wxDefaultSize, 0 );
116  m_buttonReset->SetToolTip( _("Reset the list of BOM generator scripts to the default settings") );
117 
118  bSizer8->Add( m_buttonReset, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 10 );
119 
120 
121  bSizer8->Add( 0, 0, 1, wxEXPAND, 5 );
122 
123  m_sdbSizer = new wxStdDialogButtonSizer();
124  m_sdbSizerOK = new wxButton( this, wxID_OK );
125  m_sdbSizer->AddButton( m_sdbSizerOK );
126  m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
127  m_sdbSizer->AddButton( m_sdbSizerCancel );
128  m_sdbSizerHelp = new wxButton( this, wxID_HELP );
129  m_sdbSizer->AddButton( m_sdbSizerHelp );
130  m_sdbSizer->Realize();
131 
132  bSizer8->Add( m_sdbSizer, 0, wxEXPAND|wxALL, 5 );
133 
134 
135  bMainSizer->Add( bSizer8, 0, wxEXPAND|wxLEFT, 5 );
136 
137 
138  this->SetSizer( bMainSizer );
139  this->Layout();
140  bMainSizer->Fit( this );
141 
142  this->Centre( wxBOTH );
143 
144  // Connect Events
145  this->Connect( wxEVT_IDLE, wxIdleEventHandler( DIALOG_BOM_BASE::OnIdle ) );
146  m_lbGenerators->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_BOM_BASE::OnGeneratorSelected ), NULL, this );
147  m_textCtrlName->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_BOM_BASE::OnNameEdited ), NULL, this );
148  m_buttonAddGenerator->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnAddGenerator ), NULL, this );
149  m_buttonEdit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnEditGenerator ), NULL, this );
150  m_buttonDelGenerator->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnRemoveGenerator ), NULL, this );
151  m_textCtrlCommand->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_BOM_BASE::OnCommandLineEdited ), NULL, this );
152  m_checkBoxShowConsole->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnShowConsoleChanged ), NULL, this );
153  m_sdbSizerHelp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnHelp ), NULL, this );
154  m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnRunGenerator ), NULL, this );
155 }
156 
158 {
159  // Disconnect Events
160  this->Disconnect( wxEVT_IDLE, wxIdleEventHandler( DIALOG_BOM_BASE::OnIdle ) );
161  m_lbGenerators->Disconnect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_BOM_BASE::OnGeneratorSelected ), NULL, this );
162  m_textCtrlName->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_BOM_BASE::OnNameEdited ), NULL, this );
163  m_buttonAddGenerator->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnAddGenerator ), NULL, this );
164  m_buttonEdit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnEditGenerator ), NULL, this );
165  m_buttonDelGenerator->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnRemoveGenerator ), NULL, this );
166  m_textCtrlCommand->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_BOM_BASE::OnCommandLineEdited ), NULL, this );
167  m_checkBoxShowConsole->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnShowConsoleChanged ), NULL, this );
168  m_sdbSizerHelp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnHelp ), NULL, this );
169  m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnRunGenerator ), NULL, this );
170 
171 }
wxBitmapButton * m_buttonEdit
wxBitmapButton * m_buttonAddGenerator
wxStaticText * m_staticTextName
wxStdDialogButtonSizer * m_sdbSizer
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:82
wxButton * m_sdbSizerOK
wxButton * m_buttonReset
virtual void OnRemoveGenerator(wxCommandEvent &event)
wxTextCtrl * m_textCtrlName
virtual void OnNameEdited(wxCommandEvent &event)
wxCheckBox * m_checkBoxShowConsole
#define NULL
wxStaticText * m_staticTextCmd
wxTextCtrl * m_textCtrlCommand
wxButton * m_sdbSizerHelp
wxStaticLine * m_staticline
#define _(s)
wxTextCtrl * m_Messages
virtual void OnIdle(wxIdleEvent &event)
wxStaticText * m_staticTextGeneratorTitle
virtual void OnCommandLineEdited(wxCommandEvent &event)
virtual void OnRunGenerator(wxCommandEvent &event)
virtual void OnGeneratorSelected(wxCommandEvent &event)
virtual void OnAddGenerator(wxCommandEvent &event)
wxListBox * m_lbGenerators
wxButton * m_sdbSizerCancel
DIALOG_BOM_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Bill of Material"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
virtual void OnShowConsoleChanged(wxCommandEvent &event)
virtual void OnHelp(wxCommandEvent &event)
virtual void OnEditGenerator(wxCommandEvent &event)
wxBitmapButton * m_buttonDelGenerator