summaryrefslogtreecommitdiff
path: root/libopie/oclickablelabel.h
authorzecke <zecke>2003-04-13 16:57:28 (UTC)
committer zecke <zecke>2003-04-13 16:57:28 (UTC)
commit0b311079ff19798866291034663757103c6ba935 (patch) (unidiff)
tree70ddccf3a3147475050fa06cc2d807a71ab1d5ee /libopie/oclickablelabel.h
parent1537ccb435ca725c793db6e94e0b9e83484b57e7 (diff)
downloadopie-0b311079ff19798866291034663757103c6ba935.zip
opie-0b311079ff19798866291034663757103c6ba935.tar.gz
opie-0b311079ff19798866291034663757103c6ba935.tar.bz2
Jumbo API documentation update
and some API fixed ColorDialog is now OColorDialog!!! keep the namespace tidy! ColorPopupMenu is now OColorPopupMenu!!! keep the namespace tidy ColorDialog TT couldn't break bc we can so make it const QColor& OTimePicker add some convience methods more I might have forgot
Diffstat (limited to 'libopie/oclickablelabel.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/oclickablelabel.h35
1 files changed, 29 insertions, 6 deletions
diff --git a/libopie/oclickablelabel.h b/libopie/oclickablelabel.h
index f65c440..4b6dcbc 100644
--- a/libopie/oclickablelabel.h
+++ b/libopie/oclickablelabel.h
@@ -1,30 +1,53 @@
1#ifndef CLICKABLELABEL 1#ifndef CLICKABLELABEL
2#define CLICKABLELABEL 2#define CLICKABLELABEL
3 3
4#include <qlabel.h> 4#include <qlabel.h>
5 5
6class OClickableLabel: public QLabel 6/**
7 * This class is a special QLabel which can behave
8 * as a QPushButton or QToggleButton.
9 * The reason to use a clickable is if you want to save space
10 * or you want to skip the border of a normal button
11 *
12 * <pre>
13 * QLabel* lbl = new OClickableLabel( parent, "PushLabel" );
14 * lbl->setPixmap( "config" );
15 * QWhatsThis::add( lbl, tr("Click here to do something") );
16 * </pre>
17 *
18 * @short A Label behaving as button
19 * @author Hakan Ardo, Maximillian Reiß ( harlekin@handhelds.org )
20 * @see QLabel
21 * @see QPushButton
22 * @see QToggleButton
23 * @version 1.0
24 */
25
26class OClickableLabel: public QLabel
7{ 27{
8 Q_OBJECT 28 Q_OBJECT
9public: 29public:
10 OClickableLabel(QWidget* parent = 0, const char* name = 0, 30 OClickableLabel(QWidget* parent = 0, const char* name = 0,
11 WFlags fl = 0); 31 WFlags fl = 0);
12 void setToggleButton(bool t); 32 void setToggleButton(bool t);
33
13 protected: 34 protected:
14 void mousePressEvent( QMouseEvent *e ); 35 void mousePressEvent( QMouseEvent *e );
15 void mouseReleaseEvent( QMouseEvent *e ); 36 void mouseReleaseEvent( QMouseEvent *e );
16 void mouseMoveEvent( QMouseEvent *e ); 37 void mouseMoveEvent( QMouseEvent *e );
38
17 public slots: 39 public slots:
18 void setOn(bool on); 40 void setOn(bool on);
19 signals: 41 signals:
20 void clicked(); 42 void clicked();
21 void toggled(bool on); 43 void toggled(bool on);
22 private: 44 private:
23 bool isToggle; 45 bool isToggle : 1;
24 bool isDown; 46 bool isDown : 1;
47 bool textInverted : 1;
48
25 void showState(bool on); 49 void showState(bool on);
26 bool textInverted;
27 void setInverted(bool on); 50 void setInverted(bool on);
28}; 51};
29 52
30#endif 53#endif