FDOSTUI
FreeDOS Text User Interface
include
checkbtn.hpp
Go to the documentation of this file.
1
/*
2
CHECKBTN.HPP
3
4
License CC0 PUBLIC DOMAIN
5
6
To the extent possible under law, Mark J. Olesen has waived all copyright
7
and related or neighboring rights to FDOSTUI Library. This work is published
8
from: United States.
9
*/
10
#ifndef __checkbtn_hpp__
11
12
#include "
button.hpp
"
13
#include "
wm.hpp
"
14
15
class
checkbutton
:
public
button
16
{
17
18
public
:
19
20
checkbutton
(
21
int
const
i_pos_x,
22
int
const
i_pos_y,
23
unsigned
int
const
i_len_x,
24
unsigned
int
const
i_len_y);
25
26
virtual
27
~checkbutton
();
28
29
void
30
clear_state
();
31
32
bool
33
get_state
()
const
;
34
35
void
36
set_state
();
37
38
protected
:
39
40
private
:
41
42
checkbutton
();
43
44
checkbutton
(
45
const
checkbutton
&);
46
47
checkbutton
&
48
operator=(
checkbutton
const
&);
49
50
};
51
52
inline
void
53
checkbutton::clear_state
()
54
{
55
56
if
(
m_state
)
57
{
58
m_state
=
false
;
59
set_damage
(
DAMAGE_VALUE
);
60
wm_draw_widget
(
this
);
61
}
62
63
return
;
64
}
65
66
inline
bool
67
checkbutton::get_state
()
const
68
{
69
return
m_state
;
70
}
71
72
inline
void
73
checkbutton::set_state
()
74
{
75
76
if
(
false
==
m_state
)
77
{
78
m_state
=
true
;
79
set_damage
(
DAMAGE_VALUE
);
80
wm_draw_widget
(
this
);
81
toggled
();
82
}
83
84
return
;
85
}
86
87
#define __checkbtn_hpp__
88
#endif
checkbutton::get_state
bool get_state() const
get current state
Definition:
checkbtn.hpp:67
wm_draw_widget
void wm_draw_widget(widget *const i_widget)
draw a widget
Definition:
wm.cpp:199
button::toggled
virtual void toggled()
method called when button state changes
Definition:
button.hpp:171
wm.hpp
window management routines
button.hpp
contains button class
checkbutton
check button widget
Definition:
checkbtn.hpp:15
checkbutton::set_state
void set_state()
sets the state to checked
Definition:
checkbtn.hpp:73
widget::DAMAGE_VALUE
Definition:
widget.hpp:29
button::m_state
bool m_state
on/off state (for normal button ignored)
Definition:
button.hpp:88
checkbutton::clear_state
void clear_state()
sets the state to unchecked
Definition:
checkbtn.hpp:53
checkbutton::~checkbutton
virtual ~checkbutton()
destructor
Definition:
checkbtn.cpp:23
widget::set_damage
virtual void set_damage(unsigned int const i_damage=DAMAGE_NONE)
set the damage bits
Definition:
widget.hpp:401
button
Allows a user to click on a button.
Definition:
button.hpp:21
Generated by
1.8.14