26 #if defined (HAVE_CONFIG_H)
30 #include <QAbstractButton>
47 :
BaseControl (oct_qobj, interp, go, btn), m_blockCallback (false)
52 str.replace (
"&",
"&&");
54 if (btn->isCheckable () || up.style_is (
"togglebutton"))
56 btn->setCheckable (
true);
58 Matrix value = up.get_value ().matrix_value ();
60 if (value.
numel () > 0 && value(0) == up.get_max ())
61 btn->setChecked (
true);
75 QAbstractButton *btn = qWidget<QAbstractButton> ();
79 case uicontrol::properties::ID_STRING:
82 str.replace (
"&",
"&&");
87 case uicontrol::properties::ID_VALUE:
89 if (btn->isCheckable ())
91 Matrix value = up.get_value ().matrix_value ();
93 if (value.
numel () > 0)
95 double dValue = value(0);
97 if (dValue != 0.0 && dValue != 1.0)
98 warning (
"button value not within valid display range");
99 else if (dValue == up.get_min () && btn->isChecked ())
101 btn->setChecked (
false);
102 if (up.style_is (
"radiobutton") || up.style_is (
"togglebutton"))
112 else if (dValue == up.get_max () && ! btn->isChecked ())
113 btn->setChecked (
true);
128 QAbstractButton *btn = qWidget<QAbstractButton> ();
138 Matrix oldValue = up.get_value ().matrix_value ();
139 double newValue = (checked ? up.get_max () : up.get_min ());
141 if (oldValue.
numel () != 1 || (newValue != oldValue(0)))
150 QAbstractButton *btn = qWidget<QAbstractButton> ();
152 if (! btn->isCheckable ())
octave_idx_type numel(void) const
Number of elements in the array.
octave::interpreter & m_interpreter
static Object * parentObject(octave::interpreter &interp, const graphics_object &go)
void gh_callback_event(const graphics_handle &h, const std::string &name)
void gh_set_event(const graphics_handle &h, const std::string &name, const octave_value &value)
graphics_object get_object(double val) const
octave::mutex graphics_lock(void)
Base class for Octave interfaces that use Qt.
gh_manager & get_gh_manager(void)
void warning(const char *fmt,...)
QString fromStdString(const std::string &s)