Code::Blocks  SVN r11506
selectincludefile.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
3  * http://www.gnu.org/licenses/gpl-3.0.html
4  *
5  * $Revision: 8543 $
6  * $Id: selectincludefile.cpp 8543 2012-11-10 22:36:18Z thomasdenk $
7  * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/plugins/codecompletion/selectincludefile.cpp $
8  */
9 
10 #include "prep.h"
11 #include "selectincludefile.h"
12 
13 #include <wx/xrc/xmlres.h>
14 #include <wx/arrstr.h>
15 
16 BEGIN_EVENT_TABLE(SelectIncludeFile,wxScrollingDialog)
17  EVT_LISTBOX_DCLICK(XRCID("ID_LBX_INCLUDE_FILES"),SelectIncludeFile::OnOk)
18  EVT_BUTTON(XRCID("ID_BTN_OK"),SelectIncludeFile::OnOk)
19  EVT_BUTTON(XRCID("ID_BTN_CANCEL"),SelectIncludeFile::OnCancel)
20 END_EVENT_TABLE()
21 
22 SelectIncludeFile::SelectIncludeFile(wxWindow* parent, cb_unused wxWindowID id) // TODO: verify if class def shouldn't be different
23 {
24  wxXmlResource::Get()->LoadObject(this,parent,_T("SelectIncludeFile"),_T("wxScrollingDialog"));
25  LstIncludeFiles = XRCCTRL(*this,"ID_LBX_INCLUDE_FILES",wxListBox);
26 }
27 
29 {
30 }
31 
33 {
34  int pos = LstIncludeFiles->GetSelection();
35  if (pos != wxNOT_FOUND)
36  m_SelectedIncludeFile = LstIncludeFiles->GetString(pos);
37  else
39 
41 }
42 
44 {
46 }
47 
49 {
50  LstIncludeFiles->InsertItems(IncludeFiles, 0);
51  LstIncludeFiles->SetSelection(0);
52 }
void EndModal(int retCode)
Definition: sc_dialog.cpp:112
void OnCancel(wxCommandEvent &event)
#define _T(string)
#define wxNOT_FOUND
wxString m_SelectedIncludeFile
void OnOk(wxCommandEvent &event)
void Clear()
void AddListEntries(const wxArrayString &IncludeFile)
static wxXmlResource * Get()
int wxWindowID
wxObject * LoadObject(wxWindow *parent, const wxString &name, const wxString &classname)
wxListBox * LstIncludeFiles