KiCad PCB EDA Suite
dialog_list_selector_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version Jun 5 2014)
3 // http://www.wxformbuilder.org/
4 //
5 // PLEASE DO "NOT" EDIT THIS FILE!
7 
9 
11 
12 EDA_LIST_DIALOG_BASE::EDA_LIST_DIALOG_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( 400,400 ), wxDefaultSize );
15 
16  wxBoxSizer* bSizerMain;
17  bSizerMain = new wxBoxSizer( wxVERTICAL );
18 
19  m_filterLabel = new wxStaticText( this, wxID_ANY, _("Filter:"), wxDefaultPosition, wxDefaultSize, 0 );
20  m_filterLabel->Wrap( -1 );
21  m_filterLabel->SetToolTip( _("Enter a string to filter items.\nOnly names containing this string will be listed") );
22 
23  bSizerMain->Add( m_filterLabel, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
24 
25  m_filterBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
26  bSizerMain->Add( m_filterBox, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
27 
28  m_staticText2 = new wxStaticText( this, wxID_ANY, _("Items:"), wxDefaultPosition, wxDefaultSize, 0 );
29  m_staticText2->Wrap( -1 );
30  bSizerMain->Add( m_staticText2, 0, wxRIGHT|wxLEFT, 5 );
31 
32  m_listBox = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES|wxALWAYS_SHOW_SB|wxVSCROLL );
33  m_listBox->SetMinSize( wxSize( -1,200 ) );
34 
35  bSizerMain->Add( m_listBox, 3, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
36 
37  m_staticTextMsg = new wxStaticText( this, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 );
38  m_staticTextMsg->Wrap( -1 );
39  bSizerMain->Add( m_staticTextMsg, 0, wxRIGHT|wxLEFT, 5 );
40 
41  m_messages = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
42  m_messages->SetMinSize( wxSize( -1,80 ) );
43 
44  bSizerMain->Add( m_messages, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
45 
46  m_sdbSizer = new wxStdDialogButtonSizer();
47  m_sdbSizerOK = new wxButton( this, wxID_OK );
48  m_sdbSizer->AddButton( m_sdbSizerOK );
49  m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
50  m_sdbSizer->AddButton( m_sdbSizerCancel );
51  m_sdbSizer->Realize();
52 
53  bSizerMain->Add( m_sdbSizer, 0, wxALL|wxEXPAND, 5 );
54 
55 
56  this->SetSizer( bSizerMain );
57  this->Layout();
58 
59  this->Centre( wxBOTH );
60 
61  // Connect Events
62  this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( EDA_LIST_DIALOG_BASE::onClose ) );
63  m_filterBox->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( EDA_LIST_DIALOG_BASE::textChangeInFilterBox ), NULL, this );
64  m_listBox->Connect( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler( EDA_LIST_DIALOG_BASE::onListItemActivated ), NULL, this );
65  m_listBox->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( EDA_LIST_DIALOG_BASE::onListItemSelected ), NULL, this );
66  m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( EDA_LIST_DIALOG_BASE::onCancelClick ), NULL, this );
67  m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( EDA_LIST_DIALOG_BASE::onOkClick ), NULL, this );
68 }
69 
71 {
72  // Disconnect Events
73  this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( EDA_LIST_DIALOG_BASE::onClose ) );
74  m_filterBox->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( EDA_LIST_DIALOG_BASE::textChangeInFilterBox ), NULL, this );
75  m_listBox->Disconnect( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler( EDA_LIST_DIALOG_BASE::onListItemActivated ), NULL, this );
76  m_listBox->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( EDA_LIST_DIALOG_BASE::onListItemSelected ), NULL, this );
77  m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( EDA_LIST_DIALOG_BASE::onCancelClick ), NULL, this );
78  m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( EDA_LIST_DIALOG_BASE::onOkClick ), NULL, this );
79 
80 }
virtual void onListItemActivated(wxListEvent &event)=0
wxStdDialogButtonSizer * m_sdbSizer
virtual void onOkClick(wxCommandEvent &event)=0
Class DIALOG_SHIM may sit in the inheritance tree between wxDialog and any class written by wxFormBui...
Definition: dialog_shim.h:60
virtual void textChangeInFilterBox(wxCommandEvent &event)=0
EDA_LIST_DIALOG_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=wxEmptyString, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 400), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
virtual void onCancelClick(wxCommandEvent &event)=0
virtual void onClose(wxCloseEvent &event)=0
virtual void onListItemSelected(wxListEvent &event)=0