23 #if defined (HAVE_CONFIG_H) 29 #include <QMouseEvent> 42 QPalette
p =
w->palette ();
44 if (props.style_is (
"edit")
45 || props.style_is (
"listbox"))
47 p.setColor (QPalette::Base,
49 p.setColor (QPalette::Text,
52 else if (props.style_is (
"popupmenu"))
55 p.setColor (QPalette::Base,
57 p.setColor (QPalette::Text,
59 p.setColor (QPalette::Button,
61 p.setColor (QPalette::ButtonText,
64 else if (props.style_is (
"radiobutton")
65 || props.style_is (
"checkbox"))
67 p.setColor (QPalette::Button,
69 p.setColor (QPalette::WindowText,
72 else if (props.style_is (
"pushbutton")
73 || props.style_is (
"togglebutton"))
75 p.setColor (QPalette::Button,
77 p.setColor (QPalette::ButtonText,
82 p.setColor (QPalette::Window,
84 p.setColor (QPalette::WindowText,
110 w->setEnabled (up.enable_is (
"on"));
112 w->setVisible (up.is_visible ());
115 w->installEventFilter (
this);
131 case uicontrol::properties::ID_POSITION:
139 case uicontrol::properties::ID_FONTNAME:
140 case uicontrol::properties::ID_FONTSIZE:
141 case uicontrol::properties::ID_FONTWEIGHT:
142 case uicontrol::properties::ID_FONTANGLE:
146 case uicontrol::properties::ID_FONTUNITS:
153 case uicontrol::properties::ID_BACKGROUNDCOLOR:
154 case uicontrol::properties::ID_FOREGROUNDCOLOR:
158 case uicontrol::properties::ID_ENABLE:
159 w->setEnabled (up.enable_is (
"on"));
162 case uicontrol::properties::ID_TOOLTIPSTRING:
166 case base_properties::ID_VISIBLE:
167 w->setVisible (up.is_visible ());
170 case uicontrol::properties::ID_KEYPRESSFCN:
182 switch (xevent->type ())
190 (properties<uicontrol> ()));
194 case QEvent::MouseButtonPress:
198 QMouseEvent *m =
dynamic_cast<QMouseEvent *
> (xevent);
203 if (m->button () != Qt::LeftButton
204 || ! up.enable_is (
"on"))
212 "windowbuttondownfcn");
215 if (m->button () == Qt::RightButton)
220 if (up.style_is (
"listbox"))
230 case QEvent::MouseMove:
231 if (qWidget<QWidget> ()->hasMouseTracking ())
235 QMouseEvent *m =
dynamic_cast<QMouseEvent *
> (xevent);
245 case QEvent::KeyPress:
255 keyData.
getfield (
"Character"),
false);
264 return Object::eventFilter (watched, xevent);
static void post_callback(const graphics_handle &h, const std::string &name, const octave_value &data=Matrix())
graphics_handle get_handle(void) const
QString fromStdString(const std::string &s)
bool eventFilter(QObject *watched, QEvent *e)
void init(QWidget *w, bool callBase=false)
Matrix figureCurrentPoint(const graphics_object &fig, QMouseEvent *event)
template QFont computeFont< uicontrol >(const uicontrol::properties &props, int height)
static void executeAt(const base_properties &props, const QPoint &pt)
QColor fromRgb(const Matrix &rgb)
static void updatePalette(const uicontrol::properties &props, QWidget *w)
octave_scalar_map makeKeyEventStruct(QKeyEvent *event)
std::complex< double > w(std::complex< double > z, double relerr=0)
void init(QObject *obj, bool callBase=false)
Matrix get_boundingbox(bool internal=false, const Matrix &parent_pix_size=Matrix()) const
octave_value getfield(const std::string &key) const
graphics_object object(void) const
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
std::string figureSelectionType(QMouseEvent *event, bool isDoubleClick)
bool m_keyPressHandlerDefined
BaseControl(const graphics_object &go, QWidget *w)
graphics_object get_ancestor(const std::string &type) const
static void post_set(const graphics_handle &h, const std::string &name, const octave_value &value, bool notify_toolkit=true)