• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdeui
 

kdeui

  • kdeui
ktoolbarbutton.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 1997, 1998 Stephan Kulow (coolo@kde.org)
3  (C) 1997, 1998 Sven Radej (radej@kde.org)
4  (C) 1997, 1998 Mark Donohoe (donohoe@kde.org)
5  (C) 1997, 1998 Matthias Ettrich (ettrich@kde.org)
6  (C) 2000 Kurt Granroth (granroth@kde.org)
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Library General Public
10  License version 2 as published by the Free Software Foundation.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 
23 #ifndef _KTOOLBARBUTTON_H
24 #define _KTOOLBARBUTTON_H
25 
26 #include <tqpixmap.h>
27 #include <tqtoolbutton.h>
28 #include <tqintdict.h>
29 #include <tqstring.h>
30 #include <kglobal.h>
31 
32 class KToolBar;
33 class KToolBarButtonPrivate;
34 class KInstance;
35 class TQEvent;
36 class TQPopupMenu;
37 class TQPainter;
38 
44 class KDEUI_EXPORT KToolBarButton : public TQToolButton
45 {
46  Q_OBJECT
47  TQ_OBJECT
48 
49 public:
62  KToolBarButton(const TQString& icon, int id, TQWidget *parent,
63  const char *name=0L, const TQString &txt=TQString::null,
64  KInstance *_instance = KGlobal::instance());
65 
77  KToolBarButton(const TQPixmap& pixmap, int id, TQWidget *parent,
78  const char *name=0L, const TQString &txt=TQString::null);
79 
86  KToolBarButton(TQWidget *parent=0L, const char *name=0L);
87 
91  ~KToolBarButton();
92 
93 #ifndef KDE_NO_COMPAT
94 
103  // this one is from TQButton, so #ifdef-ing it out doesn't break BC
104  virtual void setPixmap(const TQPixmap &pixmap) KDE_DEPRECATED;
105 
113  void setDefaultPixmap(const TQPixmap& pixmap) KDE_DEPRECATED;
114 
122  void setDisabledPixmap(const TQPixmap& pixmap) KDE_DEPRECATED;
123 #endif
124 
131  virtual void setText(const TQString &text);
132 
139  virtual void setIcon(const TQString &icon);
140 
142  virtual void setIcon( const TQPixmap &pixmap )
143  { TQToolButton::setIcon( pixmap ); }
144 
151  virtual void setIconSet( const TQIconSet &iconset );
152 
153 #ifndef KDE_NO_COMPAT
154 
165  KDE_DEPRECATED void setIcon(const TQString &icon, bool generate ) { Q_UNUSED(generate); setIcon( icon ); }
166 
174  void setDefaultIcon(const TQString& icon) KDE_DEPRECATED;
175 
183  void setDisabledIcon(const TQString& icon) KDE_DEPRECATED;
184 #endif
185 
191  void on(bool flag = true);
192 
196  void toggle();
197 
205  void setToggle(bool toggle = true);
206 
210  TQPopupMenu *popup();
211 
216  int id() const;
217 
226  void setPopup (TQPopupMenu *p, bool unused = false);
227 
238  void setDelayedPopup(TQPopupMenu *p, bool unused = false);
239 
245  void setRadio(bool f = true);
246 
254  void setNoStyle(bool no_style = true);
255 
256 signals:
260  void clicked(int);
267  void buttonClicked(int, TQt::ButtonState state);
268  void doubleClicked(int);
269  void pressed(int);
270  void released(int);
271  void toggled(int);
272  void highlighted(int, bool);
273 
274 public slots:
280  void modeChange();
281  virtual void setTextLabel(const TQString&, bool tipToo);
282 
283 protected:
284  bool event(TQEvent *e);
285  void paletteChange(const TQPalette &);
286  void leaveEvent(TQEvent *e);
287  void enterEvent(TQEvent *e);
288  void drawButton(TQPainter *p);
289  bool eventFilter (TQObject *o, TQEvent *e);
291  void mousePressEvent( TQMouseEvent * );
293  void mouseReleaseEvent( TQMouseEvent * );
294  void showMenu();
295  TQSize sizeHint() const;
296  TQSize minimumSizeHint() const;
297  TQSize minimumSize() const;
298 
300  bool isRaised() const;
302  bool isActive() const;
304  int iconTextMode() const;
305 
306 protected slots:
307  void slotClicked();
308  void slotPressed();
309  void slotReleased();
310  void slotToggled();
311  void slotDelayTimeout();
312 
313 protected:
314  virtual void virtual_hook( int id, void* data );
315 private:
316  KToolBarButtonPrivate *d;
317 };
318 
324 class KDEUI_EXPORT KToolBarButtonList : public TQIntDict<KToolBarButton>
325 {
326 public:
327  KToolBarButtonList();
328  ~KToolBarButtonList() {}
329 };
330 
331 #endif
KToolBarButton
A toolbar button.
Definition: ktoolbarbutton.h:44
KToolBarButtonList
List of KToolBarButton objects.
Definition: ktoolbarbutton.h:324
KInstance
KGlobal::instance
static KInstance * instance()
KToolBarButton::setIcon
virtual void setIcon(const TQPixmap &pixmap)
Definition: ktoolbarbutton.h:142
KToolBar
Floatable toolbar with auto resize.
Definition: ktoolbar.h:104
KToolBarButton::setIcon
KDE_DEPRECATED void setIcon(const TQString &icon, bool generate)
Definition: ktoolbarbutton.h:165

kdeui

Skip menu "kdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdeui

Skip menu "kdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdeui by doxygen 1.8.13
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |