23 #if defined (HAVE_CONFIG_H)
27 #include <QAbstractButton>
28 #include <QButtonGroup>
32 #include <QMouseEvent>
33 #include <QRadioButton>
54 return QFrame::NoFrame;
56 return (QFrame::Box | QFrame::Sunken);
58 return (QFrame::Box | QFrame::Raised);
60 return (QFrame::Panel | QFrame::Sunken);
62 return (QFrame::Panel | QFrame::Raised);
64 return (QFrame::Panel | QFrame::Plain);
70 p.setColor (QPalette::Window,
72 p.setColor (QPalette::WindowText,
74 p.setColor (QPalette::Light,
76 p.setColor (QPalette::Dark,
106 QFrame*
frame =
new QFrame(container);
107 return new ButtonGroup (go,
new QButtonGroup (frame), frame);
116 :
Object (go, frame), m_hiddenbutton(0), m_container (0), m_title (0),
117 m_blockUpdates (
false)
121 frame->setObjectName (
"UIButtonGroup");
122 frame->setAutoFillBackground (
true);
128 QPalette pal = frame->palette ();
130 frame->setPalette (pal);
139 if (frame->hasMouseTracking ())
142 { w->setMouseTracking (
true); }
144 { w->setMouseTracking (
true); }
148 if (! title.isEmpty ())
150 m_title =
new QLabel (title, frame);
151 m_title->setAutoFillBackground (
true);
152 m_title->setContentsMargins (4, 0, 4, 0);
157 frame->installEventFilter (
this);
162 QTimer::singleShot (0, frame, SLOT (show (
void)));
163 QTimer::singleShot (0, buttongroup, SLOT (show (
void)));
182 switch (xevent->type ())
194 Utils::properties<uibuttongroup> (go);
198 QFrame*
frame = qWidget<QFrame> ();
201 (pp, frame->height ()));
210 case QEvent::MouseButtonPress:
212 QMouseEvent*
m =
dynamic_cast<QMouseEvent*
> (xevent);
214 if (m->button () == Qt::RightButton)
229 switch (xevent->type ())
232 if (qWidget<QWidget> ()->isVisible ())
253 QFrame*
frame = qWidget<QFrame> ();
279 QPalette pal = frame->palette ();
282 frame->setPalette (pal);
292 if (title.isEmpty ())
302 QPalette pal = frame->palette ();
304 m_title =
new QLabel (title, frame);
305 m_title->setAutoFillBackground (
true);
306 m_title->setContentsMargins (4, 0, 4, 0);
375 m_blockUpdates =
false;
391 QFrame*
frame = qWidget<QFrame> ();
414 m_title->move (frame->width () - bw - offset - sz.width (), 0);
416 m_title->move (bw+offset, frame->height () - sz.height ());
418 m_title->move (frame->width () - bw - offset - sz.width (),
419 frame->height () - sz.height ());
421 m_title->move (frame->width () / 2 - sz.width () / 2, 0);
423 m_title->move (frame->width () / 2 - sz.width () / 2,
424 frame->height () - sz.height ());
439 connect (btn, SIGNAL (toggled (
bool)), SLOT (
buttonToggled (
bool)));
453 QAbstractButton* checkedBtn =
m_buttongroup->checkedButton();
462 if (oldValue != newValue)
478 QAbstractButton* checkedBtn =
m_buttongroup->checkedButton();
482 if (oldValue != newValue)
485 eventData.
setfield (
"OldValue", oldValue.as_octave_value ());
488 eventData.
setfield (
"EventName",
"SelectionChanged");
492 selectionChangedEventObject);
static void setupPalette(const uibuttongroup::properties &pp, QPalette &p)
static void post_callback(const graphics_handle &h, const std::string &name, const octave_value &data=Matrix())
bool is_visible(void) const
static int frameStyleFromProperties(const uibuttongroup::properties &pp)
QString fromStdString(const std::string &s)
void setfield(const std::string &key, const octave_value &val)
static Object * parentObject(const graphics_object &go)
virtual Container * innerContainer(void)=0
static int borderWidthFromProperties(const uibuttongroup::properties &pp)
void redraw(bool sync=false)
virtual void update_boundingbox(void)
static void executeAt(const base_properties &props, const QPoint &pt)
QColor fromRgb(const Matrix &rgb)
template QFont computeFont< uibuttongroup >(const uibuttongroup::properties &props, int height)
nd deftypefn *octave_map m
std::complex< double > w(std::complex< double > z, double relerr=0)
static Object * fromQObject(QObject *obj)
base_properties & get_properties(void)
virtual QObject * qObject(void)
graphics_object object(void) const
octave::unwind_protect frame
bool valid_object(void) const
static Object * toolkitObject(const graphics_object &go)
octave_handle graphics_handle
static graphics_object get_object(double val)
Canvas * canvas(const graphics_handle &handle, bool create=true)
virtual void set(const caseless_str &, const octave_value &)
graphics_handle get___myhandle__(void) const
octave_value as_octave_value(void) const
base_properties & properties(void)
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))
static void post_set(const graphics_handle &h, const std::string &name, const octave_value &value, bool notify_toolkit=true)