Code::Blocks
SVN r11506
src
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
:
17
wxString
SerializeOut
()
const
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
33
wxString
script
;
34
bool
enabled
;
35
bool
registered
;
36
wxString
menu
;
37
};
38
typedef
std::vector<ScriptEntry>
ScriptsVector
;
39
40
class
ScriptingSettingsDlg
:
public
wxScrollingDialog
41
{
42
public
:
43
ScriptingSettingsDlg
(
wxWindow
* parent);
44
~
ScriptingSettingsDlg
();
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
69
ScriptsVector
m_ScriptsVector
;
70
bool
m_IgnoreTextEvents
;
71
private
:
72
DECLARE_EVENT_TABLE()
73
};
74
75
76
77
#endif // SCRIPTINGSETTINGSDLG_H
ScriptBindings::EndModal
void EndModal(int retCode)
Definition:
sc_dialog.cpp:112
ScriptEntry
Definition:
scriptingsettingsdlg.h:14
ScriptEntry::SerializeIn
void SerializeIn(const wxString &s)
Definition:
scriptingsettingsdlg.h:21
listctrl.h
ScriptsVector
std::vector< ScriptEntry > ScriptsVector
Definition:
scriptingsettingsdlg.h:38
wxString::c_str
wxCStrData c_str() const
_T
#define _T(string)
wxScrollingDialog
Definition:
scrollingdialog.h:163
scrollingdialog.h
wxString::AfterFirst
wxString AfterFirst(wxUniChar ch) const
wxCommandEvent
ScriptEntry::menu
wxString menu
Definition:
scriptingsettingsdlg.h:36
wxListEvent
wxString::BeforeFirst
wxString BeforeFirst(wxUniChar ch, wxString *rest=NULL) const
ScriptEntry::registered
bool registered
Definition:
scriptingsettingsdlg.h:35
ScriptingSettingsDlg::m_IgnoreTextEvents
bool m_IgnoreTextEvents
Definition:
scriptingsettingsdlg.h:70
wxString
ScriptEntry::enabled
bool enabled
Definition:
scriptingsettingsdlg.h:34
ScriptEntry::SerializeOut
wxString SerializeOut() const
Definition:
scriptingsettingsdlg.h:17
ScriptingSettingsDlg
Definition:
scriptingsettingsdlg.h:40
ScriptEntry::script
wxString script
Definition:
scriptingsettingsdlg.h:33
ScriptingSettingsDlg::m_ScriptsVector
ScriptsVector m_ScriptsVector
Definition:
scriptingsettingsdlg.h:69
wxWindow
wxString::Format
static wxString Format(const wxString &format,...)
Generated by
1.8.13