23 #if defined (HAVE_CONFIG_H)
30 #include <QMouseEvent>
46 return QFrame::NoFrame;
48 return (QFrame::Box | QFrame::Sunken);
50 return (QFrame::Box | QFrame::Raised);
52 return (QFrame::Panel | QFrame::Sunken);
54 return (QFrame::Panel | QFrame::Raised);
56 return (QFrame::Panel | QFrame::Plain);
62 p.setColor (QPalette::Window,
64 p.setColor (QPalette::WindowText,
66 p.setColor (QPalette::Light,
68 p.setColor (QPalette::Dark,
97 return new Panel (go,
new QFrame (container));
104 :
Object (go, frame), m_container (0), m_title (0), m_blockUpdates (
false)
108 frame->setObjectName (
"UIPanel");
109 frame->setAutoFillBackground (
true);
115 QPalette pal = frame->palette ();
117 frame->setPalette (pal);
122 if (frame->hasMouseTracking ())
125 { w->setMouseTracking (
true); }
129 if (! title.isEmpty ())
131 m_title =
new QLabel (title, frame);
132 m_title->setAutoFillBackground (
true);
133 m_title->setContentsMargins (4, 0, 4, 0);
138 frame->installEventFilter (
this);
142 QTimer::singleShot (0, frame, SLOT (show (
void)));
157 switch (xevent->type ())
169 Utils::properties<uipanel> (go);
173 QFrame*
frame = qWidget<QFrame> ();
176 (pp, frame->height ()));
185 case QEvent::MouseButtonPress:
187 QMouseEvent*
m =
dynamic_cast<QMouseEvent*
> (xevent);
189 if (m->button () == Qt::RightButton)
208 switch (xevent->type ())
211 if (qWidget<QWidget> ()->isVisible ())
235 QFrame*
frame = qWidget<QFrame> ();
261 QPalette pal = frame->palette ();
264 frame->setPalette (pal);
274 if (title.isEmpty ())
284 QPalette pal = frame->palette ();
286 m_title =
new QLabel (title, frame);
287 m_title->setAutoFillBackground (
true);
288 m_title->setContentsMargins (4, 0, 4, 0);
333 m_blockUpdates =
false;
349 QFrame*
frame = qWidget<QFrame> ();
372 m_title->move (frame->width () - bw - offset - sz.width (), 0);
374 m_title->move (bw+offset, frame->height () - sz.height ());
376 m_title->move (frame->width () - bw - offset - sz.width (),
377 frame->height () - sz.height ());
379 m_title->move (frame->width () / 2 - sz.width () / 2, 0);
381 m_title->move (frame->width () / 2 - sz.width () / 2,
382 frame->height () - sz.height ());
static void setupPalette(const uibuttongroup::properties &pp, QPalette &p)
std::string get_title(void) const
double get_borderwidth(void) const
bool is_visible(void) const
bool eventFilter(QObject *watched, QEvent *event)
Matrix get_backgroundcolor_rgb(void) const
static int frameStyleFromProperties(const uibuttongroup::properties &pp)
static Panel * create(const graphics_object &go)
QString fromStdString(const std::string &s)
bool titleposition_is(const std::string &v) const
static Object * parentObject(const graphics_object &go)
virtual Container * innerContainer(void)=0
static int borderWidthFromProperties(const uibuttongroup::properties &pp)
void redraw(bool sync=false)
Matrix get_foregroundcolor_rgb(void) const
virtual void update_boundingbox(void)
static void executeAt(const base_properties &props, const QPoint &pt)
QColor fromRgb(const Matrix &rgb)
bool bordertype_is(const std::string &v) const
nd deftypefn *octave_map m
std::complex< double > w(std::complex< double > z, double relerr=0)
Matrix get_shadowcolor_rgb(void) const
base_properties & get_properties(void)
template QFont computeFont< uipanel >(const uipanel::properties &props, int height)
virtual QObject * qObject(void)
bool fontunits_is(const std::string &v) const
Panel(const graphics_object &go, QFrame *frame)
graphics_object object(void) const
Matrix get_boundingbox(bool internal=false, const Matrix &parent_pix_size=Matrix()) const
octave::unwind_protect frame
bool valid_object(void) const
Canvas * canvas(const graphics_handle &handle, bool create=true)
Matrix get_highlightcolor_rgb(void) const