summaryrefslogtreecommitdiff
path: root/libopie2/opieui/oledbox.h
authorwimpie <wimpie>2005-01-04 01:31:07 (UTC)
committer wimpie <wimpie>2005-01-04 01:31:07 (UTC)
commit0f3d74b472817e6b4f9d80adc122281b84629c1f (patch) (side-by-side diff)
tree2016f779dfacb383963b1249b30e76dc33d0491b /libopie2/opieui/oledbox.h
parentbe2b938724a08036dd43480f10b7b88174147062 (diff)
downloadopie-0f3d74b472817e6b4f9d80adc122281b84629c1f.zip
opie-0f3d74b472817e6b4f9d80adc122281b84629c1f.tar.gz
opie-0f3d74b472817e6b4f9d80adc122281b84629c1f.tar.bz2
CONTROL file : changed VERSION string
added oledbox widget (like a checkbox but better suitable for visible non editable boolean feedback)
Diffstat (limited to 'libopie2/opieui/oledbox.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/oledbox.h56
1 files changed, 56 insertions, 0 deletions
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 <qwidget.h>
+#include <qcolor.h>
+
+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