Code::Blocks  SVN r11506
scriptingsettingsdlg.h
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 
6 #ifndef SCRIPTINGSETTINGSDLG_H
7 #define SCRIPTINGSETTINGSDLG_H
8 
9 #include <vector>
10 #include <wx/listctrl.h> // wxListEvent
11 
12 #include "scrollingdialog.h"
13 
14 class ScriptEntry// : public ISerializable (<-- can't make it work)
15 {
16 public:
18  {
19  return wxString::Format(_T("%s;%d;%d;%s"), script.c_str(), enabled ? 1 : 0, registered ? 1 : 0, menu.c_str());
20  }
21  void SerializeIn(const wxString& s)
22  {
23  wxString tmp = s;
24  script = tmp.BeforeFirst(_T(';'));
25  tmp = tmp.AfterFirst(_T(';'));
26  enabled = tmp.BeforeFirst(_T(';')) == _T("1") ? true : false;
27  tmp = tmp.AfterFirst(_T(';'));
28  registered = tmp.BeforeFirst(_T(';')) == _T("1") ? true : false;
29  tmp = tmp.AfterFirst(_T(';'));
30  menu = tmp.BeforeFirst(_T(';'));
31  }
32 
34  bool enabled;
35  bool registered;
37 };
38 typedef std::vector<ScriptEntry> ScriptsVector;
39 
41 {
42  public:
45 
46  void EndModal(int retCode);
47  protected:
48  void FillScripts();
49  void UpdateState();
50  void FillTrusts();
51  void UpdateTrustsState();
52  void LoadItem(long item);
53  void SaveItem(long item);
54 
55  void OnListSelection(wxListEvent& event);
56  void OnListDeselection(wxListEvent& event);
57  void OnAddScript(wxCommandEvent& event);
58  void OnRemoveScript(wxCommandEvent& event);
59  void OnScriptChanged(wxCommandEvent& event);
60  void OnScriptMenuChanged(wxCommandEvent& event);
61  void OnEnable(wxCommandEvent& event);
62  void OnRegister(wxCommandEvent& event);
63  void OnBrowse(wxCommandEvent& event);
64 
65  void OnTrustSelection(wxListEvent& event);
66  void OnDeleteTrust(wxCommandEvent& event);
67  void OnValidateTrusts(wxCommandEvent& event);
68 
71  private:
72  DECLARE_EVENT_TABLE()
73 };
74 
75 
76 
77 #endif // SCRIPTINGSETTINGSDLG_H
void EndModal(int retCode)
Definition: sc_dialog.cpp:112
void SerializeIn(const wxString &s)
std::vector< ScriptEntry > ScriptsVector
wxCStrData c_str() const
#define _T(string)
wxString AfterFirst(wxUniChar ch) const
wxString BeforeFirst(wxUniChar ch, wxString *rest=NULL) const
wxString SerializeOut() const
static wxString Format(const wxString &format,...)