From 0f3d74b472817e6b4f9d80adc122281b84629c1f Mon Sep 17 00:00:00 2001 From: wimpie Date: Tue, 04 Jan 2005 01:31:07 +0000 Subject: CONTROL file : changed VERSION string added oledbox widget (like a checkbox but better suitable for visible non editable boolean feedback) --- (limited to 'libopie2/opieui/oledbox.h') diff --git a/libopie2/opieui/oledbox.h b/libopie2/opieui/oledbox.h new file mode 100644 index 0000000..dd930bd --- a/dev/null +++ b/libopie2/opieui/oledbox.h @@ -0,0 +1,56 @@ +#ifndef __OPIE_OLED_H__ +#define __OPIE_OLED_H__ + +#include +#include + +class QPixmap; + +#define _QTE_IS_TOO_DUMB_TO_DRAW_AN_ARC + +class OLedBox : public QWidget { + Q_OBJECT + +public: + OLedBox ( const QColor &col = red, QWidget *parent = 0, const char *name = 0 ); + virtual ~OLedBox ( ); + + QColor color ( ) const; + bool isOn ( ) const; + void setReadOnly( bool R ) + { m_readonly = R; } + inline bool readOnly( void ) const + { return m_readonly; } + + virtual QSize sizeHint ( ) const; + +public slots: + void toggle ( ); + void setOn ( bool on ); + void setColor ( const QColor &col ); + +signals: + void toggled ( bool ); + +protected: + virtual void paintEvent ( QPaintEvent *e ); + virtual void resizeEvent ( QResizeEvent *e ); + + virtual void mousePressEvent ( QMouseEvent *e ); + +private: + void drawLed ( QPixmap *, const QColor &col ); + +private: + QPixmap *m_pix [2]; + + QColor m_color; + bool m_on; + bool m_readonly; + +#ifdef _QTE_IS_TOO_DUMB_TO_DRAW_AN_ARC + static QPixmap *s_border_pix; +#endif +}; + +#endif -- cgit v0.9.0.2