blob: 24b823bde6ea1e0128a5257f9fc6345027531069 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
#include "globals.h"
#include "Field.h"
#include "FieldState.h"
Field::Field(Dialog *aDlg, const char *aName)
: dlg(aDlg), name(aName), onChangeCallback(NULL), onChangeCallbackParam(NULL), enabled(true)
{
}
Field::~Field()
{
}
Dialog * Field::getDialog() const
{
return dlg;
}
const char * Field::getName() const
{
return name.c_str();
}
bool Field::isEnabled() const
{
return enabled;
}
void Field::setEnabled(bool enabled)
{
this->enabled = enabled;
fireOnChange();
}
const TCHAR * Field::getToolTip() const
{
return tooltip.c_str();
}
void Field::setToolTip(const TCHAR *tooltip)
{
this->tooltip = tooltip;
}
void Field::setOnChangeCallback(FieldCallback cb, void *param /*= NULL*/)
{
onChangeCallback = cb;
onChangeCallbackParam = param;
}
void Field::fireOnChange() const
{
if (onChangeCallback != NULL)
onChangeCallback(onChangeCallbackParam, this);
}
|