KiCad PCB EDA Suite
dialog_bom_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version Dec 1 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( 30,30 ), 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( 30,30 ), 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( 0, 0, 0, wxRIGHT|wxLEFT, 5 );
80 
81  m_buttonDelGenerator = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 30,30 ), 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  m_sdbSizer = new wxStdDialogButtonSizer();
113  m_sdbSizerOK = new wxButton( this, wxID_OK );
114  m_sdbSizer->AddButton( m_sdbSizerOK );
115  m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
116  m_sdbSizer->AddButton( m_sdbSizerCancel );
117  m_sdbSizerHelp = new wxButton( this, wxID_HELP );
118  m_sdbSizer->AddButton( m_sdbSizerHelp );
119  m_sdbSizer->Realize();
120 
121  bMainSizer->Add( m_sdbSizer, 0, wxEXPAND|wxALL, 5 );
122 
123 
124  this->SetSizer( bMainSizer );
125  this->Layout();
126 
127  this->Centre( wxBOTH );
128 
129  // Connect Events
130  this->Connect( wxEVT_IDLE, wxIdleEventHandler( DIALOG_BOM_BASE::OnIdle ) );
131  m_lbGenerators->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_BOM_BASE::OnGeneratorSelected ), NULL, this );
132  m_textCtrlName->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_BOM_BASE::OnNameEdited ), NULL, this );
133  m_buttonAddGenerator->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnAddGenerator ), NULL, this );
134  m_buttonEdit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnEditGenerator ), NULL, this );
135  m_buttonDelGenerator->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnRemoveGenerator ), NULL, this );
136  m_textCtrlCommand->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_BOM_BASE::OnCommandLineEdited ), NULL, this );
137  m_checkBoxShowConsole->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnShowConsoleChanged ), NULL, this );
138  m_sdbSizerHelp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnHelp ), NULL, this );
139  m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnRunGenerator ), NULL, this );
140 }
141 
143 {
144  // Disconnect Events
145  this->Disconnect( wxEVT_IDLE, wxIdleEventHandler( DIALOG_BOM_BASE::OnIdle ) );
146  m_lbGenerators->Disconnect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_BOM_BASE::OnGeneratorSelected ), NULL, this );
147  m_textCtrlName->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_BOM_BASE::OnNameEdited ), NULL, this );
148  m_buttonAddGenerator->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnAddGenerator ), NULL, this );
149  m_buttonEdit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnEditGenerator ), NULL, this );
150  m_buttonDelGenerator->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnRemoveGenerator ), NULL, this );
151  m_textCtrlCommand->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_BOM_BASE::OnCommandLineEdited ), NULL, this );
152  m_checkBoxShowConsole->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnShowConsoleChanged ), NULL, this );
153  m_sdbSizerHelp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnHelp ), NULL, this );
154  m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BOM_BASE::OnRunGenerator ), NULL, this );
155 
156 }
wxBitmapButton * m_buttonEdit
wxBitmapButton * m_buttonAddGenerator
wxStaticText * m_staticTextName
wxStdDialogButtonSizer * m_sdbSizer
Class DIALOG_SHIM may sit in the inheritance tree between wxDialog and any class written by wxFormBui...
Definition: dialog_shim.h:83
wxButton * m_sdbSizerOK
virtual void OnRemoveGenerator(wxCommandEvent &event)
wxTextCtrl * m_textCtrlName
virtual void OnNameEdited(wxCommandEvent &event)
wxCheckBox * m_checkBoxShowConsole
wxStaticText * m_staticTextCmd
wxTextCtrl * m_textCtrlCommand
wxButton * m_sdbSizerHelp
wxStaticLine * m_staticline
wxTextCtrl * m_Messages
#define _(s)
virtual void OnIdle(wxIdleEvent &event)
wxStaticText * m_staticTextGeneratorTitle
DIALOG_BOM_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Bill of Material"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(617, 433), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
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
virtual void OnShowConsoleChanged(wxCommandEvent &event)
virtual void OnHelp(wxCommandEvent &event)
virtual void OnEditGenerator(wxCommandEvent &event)
wxBitmapButton * m_buttonDelGenerator