Code::Blocks  SVN r11506
editkeywordsdlg.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
3  * http://www.gnu.org/licenses/lgpl-3.0.html
4  *
5  * $Revision: 10912 $
6  * $Id: editkeywordsdlg.cpp 10912 2016-09-25 16:10:13Z fuscated $
7  * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/src/editkeywordsdlg.cpp $
8  */
9 
10 #include <sdk.h>
11 
12 #ifndef CB_PRECOMP
13  #include <wx/button.h>
14  #include <wx/intl.h>
15  #include <wx/xrc/xmlres.h>
16  #include <wx/spinctrl.h>
17  #include <wx/stattext.h>
18  #include <wx/textctrl.h>
19  #include <wx/wxscintilla.h>
20  #include "editorcolourset.h"
21 #endif
22 
23 #include "editkeywordsdlg.h"
24 
25 BEGIN_EVENT_TABLE(EditKeywordsDlg, wxScrollingDialog)
26  EVT_SPINCTRL(wxID_ANY, EditKeywordsDlg::OnSetChange)
27 END_EVENT_TABLE()
28 
30  : m_pTheme(theme),
31  m_Lang(lang),
32  descriptions(descr)
33 {
34  //ctor
35  wxXmlResource::Get()->LoadObject(this, parent, _T("dlgEditLangKeywords"),_T("wxScrollingDialog"));
36  XRCCTRL(*this, "wxID_OK", wxButton)->SetDefault();
37 
38  spnSet = XRCCTRL(*this, "spnSet", wxSpinCtrl);
39  txtKeywords = XRCCTRL(*this, "txtKeywords", wxTextCtrl);
40  UpdateDlg();
41 }
42 
44 {
45  //dtor
46 }
47 
49 {
51  UpdateDlg();
52 }
53 
55 {
56  m_LastSet = spnSet->GetValue() - 1;
58  wxStaticText* txtDescription = XRCCTRL(*this, "txtDescription", wxStaticText);
59  if (descriptions.GetCount() > (size_t)m_LastSet)
60  txtDescription->SetLabel(descriptions[m_LastSet] + wxT(":"));
61  else
62  txtDescription->SetLabel(wxT("Keywords:"));
63 }
EditorColourSet * m_pTheme
#define _T(string)
wxString & GetKeywords(HighlightLanguage lang, int idx)
#define wxT(string)
wxTextCtrl * txtKeywords
void OnSetChange(wxSpinEvent &event)
void SetKeywords(HighlightLanguage lang, int idx, const wxString &keywords)
wxSpinCtrl * spnSet
int GetValue() const
HighlightLanguage m_Lang
size_t GetCount() const
static wxXmlResource * Get()
const wxArrayString & descriptions
wxObject * LoadObject(wxWindow *parent, const wxString &name, const wxString &classname)