-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCheckBox.h
More file actions
85 lines (75 loc) · 2.05 KB
/
Copy pathCheckBox.h
File metadata and controls
85 lines (75 loc) · 2.05 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/// \file
/// \author Matthew Allen (fret@memecode.com)
/// \brief A check box control
#ifndef _GCHECK_BOX_H_
#define _GCHECK_BOX_H_
/// A check box to allow the user to select a boolean setting, i.e. a non-mutually exclusive option. For
/// mutually exclusive options see LRadioButton.
class LgiClass LCheckBox :
#ifdef WINNATIVE
public LControl,
#else
public LView,
#endif
public LClickable,
public ResObject
{
class LCheckBoxPrivate *d;
public:
enum State
{
CheckOff,
CheckOn,
CheckPartial,
};
/// Constructor
LCheckBox
(
/// The control ID
int id = -1,
/// The text of the label
const char *name = NULL,
/// The initial state of the control
int InitState = false
);
~LCheckBox();
// Methods
const char *GetClass() override { return "LCheckBox"; }
/// Returns whether the control is 3 state
bool ThreeState();
/// Sets whether the control is 3 state.
///
/// In the case that the control is 3 state use the 'State' enum.
void ThreeState(bool t);
/// Returns the current value, 0 or 1. Or possibly 2 if ThreeState() is set (see also the 'State' enum)
int64 Value() override;
/// Sets the current value.
void Value(int64 b) override;
// Events
void OnMouseClick(LMouse &m) override;
void OnMouseEnter(LMouse &m) override;
void OnMouseExit(LMouse &m) override;
bool OnKey(LKey &k) override;
void OnFocus(bool f) override;
void OnPosChange() override;
void OnPaint(LSurface *pDC) override;
void OnAttach() override;
void OnStyleChange();
LMessage::Result OnEvent(LMessage *Msg) override;
int OnNotify(LViewI *Ctrl, const LNotification &n) override;
void OnClick(const LMouse &m) override;
// Impl
const char *Name() override { return LView::Name(); }
const char16 *NameW() override { return LView::NameW(); }
bool Name(const char *n) override;
bool NameW(const char16 *n) override;
void SetFont(LFont *Fnt, bool OwnIt = false) override;
bool OnLayout(LViewLayoutInfo &Inf) override;
int BoxSize();
#if defined(WINNATIVE)
int SysOnNotify(int Msg, int Code);
#elif defined(HAIKU)
void OnCreate();
#endif
};
#endif