00001 #ifndef KDE_PUSHBUTTON_H 00002 #define KDE_PUSHBUTTON_H 00003 00004 #include <faith/widget.h> 00005 #include <faith/application.h> 00006 #include <faith/ui.h> 00007 00008 namespace Faith 00009 { 00010 00011 class FAITH_UI_EXPORT PushButton : public Widget 00012 { 00013 K_OBJECT 00014 bool mInside; 00015 bool mDown, mOn, mIsDefault; 00016 00017 public: 00018 PushButton(Faith::Widget *parent, const char *name=0); 00019 PushButton(const Faith::String &text, Faith::Widget *parent, const char *name=0); 00020 00021 Faith::String text() const { return caption(); } 00022 bool isDown() const { return mDown; } 00023 bool isEnabled() const { return true; } 00024 bool isDefault() const { return mIsDefault; } 00025 void setDefault(bool d) { mIsDefault = d; } 00026 00027 virtual Size sizeHint() const; 00028 00029 protected: 00030 void paintEvent(Faith::PaintEvent *e); 00031 void mouseReleaseEvent(Faith::MouseEvent *e); 00032 void mousePressEvent(Faith::MouseEvent *e); 00033 void mouseMoveEvent(Faith::MouseEvent *e); 00034 00035 signals: 00036 void clicked(); 00037 }; 00038 00039 } 00040 00041 #endif 00042
1.4.7