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

tdeui

  • tdeui
tdepopupmenu.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 _TDEPOPUP_H
19 #define _TDEPOPUP_H "$Id$"
20 
21 #define INCLUDE_MENUITEM_DEF
22 
23 #include <tqpopupmenu.h>
24 #include <kpixmapeffect.h>
25 #include <kpixmap.h>
26 #include <tdelibs_export.h>
38 class TDEUI_EXPORT TDEPopupTitle : public TQWidget
39 {
40  Q_OBJECT
41 
42 public:
47  TDEPopupTitle(TQWidget *parent=0, const char *name=0);
52  TDEPopupTitle(KPixmapEffect::GradientType gradient, const TQColor &color,
53  const TQColor &textColor, TQWidget *parent=0,
54  const char *name=0) KDE_DEPRECATED;
59  TDEPopupTitle(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 TDEPopupTitlePrivate;
102  TDEPopupTitlePrivate *d;
103 };
104 
123 class TDEUI_EXPORT TDEPopupMenu : public TQPopupMenu {
124  Q_OBJECT
125 
126 public:
130  TDEPopupMenu(TQWidget *parent=0, const char *name=0);
131 
135  ~TDEPopupMenu();
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  TDEPopupMenu(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 TDEPopupMenu* contextMenuFocus();
226 
231  static int contextMenuFocusItem();
232 
237  virtual void activateItemAt(int index);
243  TQt::ButtonState state() const;
244 
245 signals:
253  void aboutToShowContextMenu(TDEPopupMenu* 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 TDEPopupMenuPrivate;
279  TDEPopupMenuPrivate *d;
280 };
281 
282 #endif
TDEPopupTitle::icon
TQPixmap icon() const
Returns the current icon.
Definition: tdepopupmenu.h:75
TDEPopupTitle::title
TQString title() const
Returns the current title.
Definition: tdepopupmenu.h:71
KPixmap
TDEPopupTitle
TDEPopupMenu title widget.
Definition: tdepopupmenu.h:38
TDEPopupMenu
A menu with title items.
Definition: tdepopupmenu.h:123

tdeui

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

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.8.8
This website is maintained by Timothy Pearson.