20#ifndef TTDETOOLBARBUTTON_H
21#define TTDETOOLBARBUTTON_H
23#include <ttdeaction.h>
26#include <tqtoolbutton.h>
34class TTDEToolBarButton : public TQToolButton
38 TTDEToolBarButton( const TQString& icon, const TQString& txt,
39 TQWidget* parent = 0, const char *name=0L,
40 TDEInstance *_instance = TDEGlobal::instance());
42 TTDEToolBarButton( const TQPixmap&, const TQString&, TQWidget* parent=0, const char* name=0);
45 void setIconMode(TK::IconMode);
47 void setAutoRaised( bool);
54 void setEnabled( bool enable = true);
64 virtual void setPixmap( const TQPixmap &pixmap);
77 virtual void setPixmap( const TQPixmap &pixmap, bool generate);
85 virtual void setDefaultPixmap( const TQPixmap& pixmap);
93 virtual void setDisabledPixmap( const TQPixmap& pixmap);
101 virtual void setText( const TQString &text);
112 virtual void setIcon( const TQString &icon);
120 virtual void setDefaultIcon( const TQString& icon);
128 virtual void setDisabledIcon( const TQString& icon);
135 void on( bool flag = true);
149 void setToggle( bool toggle = true);
154 TQPopupMenu *popup();
163 void setPopup (TQPopupMenu *p);
179 void setDelayedPopup(TQPopupMenu *p, bool toggle = false);
181 TQPixmap getActivePixmap() const;
183 virtual TQSize sizeHint() const;
184 virtual TQSize minimumSizeHint() const;
187 void buttonClicked();
188 void buttonPressed();
189 void buttonReleased();
190 void buttonToggled();
196 void paletteChange( const TQPalette &);
197 void leaveEvent(TQEvent *e);
198 void enterEvent(TQEvent *e);
199 void drawButton(TQPainter *p);
200 bool eventFilter (TQObject *o, TQEvent *e);
203 void makeDefaultPixmap();
204 void makeDisabledPixmap();
205 bool arrowPressed( const TQPoint& pos ) {
208 return (x > width() - 12 && x <= width() && y > 0 && y < height());
212 TQPixmap defaultPixmap;
213 TQPixmap activePixmap;
214 TQPixmap disabledPixmap;
215 virtual void setIcon( const TQPixmap &p) { TQButton::setIcon(p); }
216 class TTDEToolBarButtonPrivate;
217 TTDEToolBarButtonPrivate *d;
225 void slotDelayTimeout();
|