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

kdeui

  • kdeui
kpopupmenu.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2000 Daniel M. Duley <mosfet@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 #ifndef _KPOPUP_H
19 #define _KPOPUP_H "$Id$"
20 
21 #define INCLUDE_MENUITEM_DEF
22 
23 #include <tqpopupmenu.h>
24 #include <kpixmapeffect.h>
25 #include <kpixmap.h>
26 #include <kdelibs_export.h>
38 class KDEUI_EXPORT KPopupTitle : public TQWidget
39 {
40  Q_OBJECT
41 
42 public:
47  KPopupTitle(TQWidget *parent=0, const char *name=0);
52  KPopupTitle(KPixmapEffect::GradientType gradient, const TQColor &color,
53  const TQColor &textColor, TQWidget *parent=0,
54  const char *name=0) KDE_DEPRECATED;
59  KPopupTitle(const KPixmap &background, const TQColor &color,
60  const TQColor &textColor, TQWidget *parent=0,
61  const char *name=0) KDE_DEPRECATED;
67  void setTitle(const TQString &text, const TQPixmap *icon=0);
71  TQString title() const { return titleStr; }
75  TQPixmap icon() const { return miniicon; }
76 
77  TQSize sizeHint() const;
78 
79 public slots:
81  void setText( const TQString &text );
83  void setIcon( const TQPixmap &pix );
84 
85 protected:
86  void calcSize();
87  void paintEvent(TQPaintEvent *ev);
88 
89  // Remove in KDE4
90  KPixmapEffect::GradientType grType;
91  TQString titleStr;
92  // Remove in KDE4
93  KPixmap fill;
94  TQPixmap miniicon;
95  TQColor fgColor, bgColor, grHigh, grLow;
96  bool useGradient;
97 
98 protected:
99  virtual void virtual_hook( int id, void* data );
100 private:
101  class KPopupTitlePrivate;
102  KPopupTitlePrivate *d;
103 };
104 
123 class KDEUI_EXPORT KPopupMenu : public TQPopupMenu {
124  Q_OBJECT
125  TQ_OBJECT
126 public:
130  KPopupMenu(TQWidget *parent=0, const char *name=0);
131 
135  ~KPopupMenu();
136 
140  int insertTitle(const TQString &text, int id=-1, int index=-1);
144  int insertTitle(const TQPixmap &icon, const TQString &text, int id=-1,
145  int index=-1);
150  void changeTitle(int id, const TQString &text);
154  void changeTitle(int id, const TQPixmap &icon, const TQString &text);
160  TQString title(int id=-1) const;
164  TQPixmap titlePixmap(int id) const;
165 
180  void setKeyboardShortcutsEnabled(bool enable);
181 
187  void setKeyboardShortcutsExecute(bool enable);
188 
194  KPopupMenu(const TQString &title, TQWidget *parent=0, const char *name=0) KDE_DEPRECATED;
195 
201  void setTitle(const TQString &title) KDE_DEPRECATED;
202 
207  TQPopupMenu* contextMenu();
208 
213  const TQPopupMenu* contextMenu() const;
214 
219  void hideContextMenu();
220 
225  static KPopupMenu* contextMenuFocus();
226 
231  static int contextMenuFocusItem();
232 
237  virtual void activateItemAt(int index);
243  TQt::ButtonState state() const;
244 
245 signals:
253  void aboutToShowContextMenu(KPopupMenu* menu, int menuItem, TQPopupMenu* ctxMenu);
254 
255 protected:
256  virtual void closeEvent(TQCloseEvent *);
257  virtual void keyPressEvent(TQKeyEvent* e);
259  virtual void mouseReleaseEvent(TQMouseEvent* e);
260  virtual void mousePressEvent(TQMouseEvent* e);
261  virtual bool focusNextPrevChild( bool next );
262  virtual void contextMenuEvent(TQContextMenuEvent *e);
263  virtual void hideEvent(TQHideEvent*);
264 
265  virtual void virtual_hook( int id, void* data );
266 
267 protected slots:
269  TQString underlineText(const TQString& text, uint length);
271  void resetKeyboardVars(bool noMatches = false);
272  void itemHighlighted(int whichItem);
273  void showCtxMenu(TQPoint pos);
274  void ctxMenuHiding();
275  void ctxMenuHideShowingMenu();
276 
277 private:
278  class KPopupMenuPrivate;
279  KPopupMenuPrivate *d;
280 };
281 
282 #endif
KPopupMenu
A menu with title items.
Definition: kpopupmenu.h:123
KPixmap
KPopupTitle::icon
TQPixmap icon() const
Returns the current icon.
Definition: kpopupmenu.h:75
KPopupTitle::title
TQString title() const
Returns the current title.
Definition: kpopupmenu.h:71
KPopupTitle
KPopupMenu title widget.
Definition: kpopupmenu.h:38

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.6
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |