Boost.UI
User Interface Boost library
|
Go to the documentation of this file.
8 #ifndef BOOST_UI_CHECK_BOX_HPP
9 #define BOOST_UI_CHECK_BOX_HPP
13 #ifdef BOOST_HAS_PRAGMA_ONCE
19 #include <boost/logic/tribool.hpp>
20 #include <boost/optional.hpp>
39 else if ( !value ) uncheck();
45 if ( !value ) indeterminate();
46 else if ( *value ) check();
53 bool is_checked()
const;
54 bool is_unchecked()
const;
55 bool is_indeterminate()
const;
58 return is_checked() ? boost::tribool(
true)
59 : is_unchecked() ? boost::tribool(
false)
60 : boost::indeterminate;
64 return is_checked() ? boost::optional<bool>(
true)
65 : is_unchecked() ? boost::optional<bool>(
false)
77 void detail_create(widget& parent,
const uistring& text,
bool is_tri_state);
81 void on_toggle_raw(
const boost::function<
void()>& handler);
84 detail_impl* get_impl();
85 const detail_impl* get_impl()
const;
99 { create(parent, text); }
101 { detail_create(parent, text,
false);
return *
this; }
116 { create(parent, text); }
118 { detail_create(parent, text,
true);
return *
this; }
125 #endif // BOOST_UI_CHECK_BOX_HPP
Helper class to convert string between UI and application logic only.
Definition: string.hpp:49
check_box & create(widget &parent, const uistring &text)
Creates check box widget with text.
Definition: check_box.hpp:100
check_box_base & uncheck()
Sets check box state.
Definition: check_box.hpp:34
Labelled widget that that permits the user to make a binary choice.
Definition: check_box.hpp:92
Check box base class.
Definition: check_box.hpp:28
boost::optional< bool > optional() const
Returns check box state.
Definition: check_box.hpp:62
check_box_base & check(nullopt_t)
Sets check box state.
Definition: check_box.hpp:32
check_box_base & tribool(boost::tribool value)
Sets check box state.
Definition: check_box.hpp:36
check_box_base & optional(boost::optional< bool > value)
Sets check box state.
Definition: check_box.hpp:43
Boost C++ libraries namespace.
Definition: window.hpp:19
Labelled widget that that permits the user to make a ternary choice.
Definition: check_box.hpp:109
check_box(widget &parent, const uistring &text)
Creates check box widget with text.
Definition: check_box.hpp:98
tri_state_check_box(widget &parent, const uistring &text)
Creates tri-state check box widget with text.
Definition: check_box.hpp:115
tri_state_check_box & create(widget &parent, const uistring &text)
Creates tri-state check box widget with text.
Definition: check_box.hpp:117
boost::tribool tribool() const
Returns check box state.
Definition: check_box.hpp:56