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

tdeui

  • tdeui
tdepopupmenu.cpp
1/* This file is part of the KDE libraries
2 Copyright (C) 2000 Daniel M. Duley <mosfet@kde.org>
3 Copyright (C) 2002 Hamish Rodda <rodda@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19#include <tqcursor.h>
20#include <tqpainter.h>
21#include <tqtimer.h>
22#include <tqfontmetrics.h>
23
24#include <tqstyle.h>
25
26#include "tdepopupmenu.h"
27
28#include <kdebug.h>
29#include <tdeapplication.h>
30
31TDEPopupTitle::TDEPopupTitle(TQWidget *parent, const char *name)
32 : TQWidget(parent, name)
33{
34 setMinimumSize(16, fontMetrics().height()+8);
35}
36
37TDEPopupTitle::TDEPopupTitle(KPixmapEffect::GradientType /* gradient */,
38 const TQColor &/* color */, const TQColor &/* textColor */,
39 TQWidget *parent, const char *name)
40 : TQWidget(parent, name)
41{
42 calcSize();
43}
44
45TDEPopupTitle::TDEPopupTitle(const KPixmap & /* background */, const TQColor &/* color */,
46 const TQColor &/* textColor */, TQWidget *parent,
47 const char *name)
48 : TQWidget(parent, name)
49{
50 calcSize();
51}
52
53void TDEPopupTitle::setTitle(const TQString &text, const TQPixmap *icon)
54{
55 titleStr = text;
56 if (icon)
57 miniicon = *icon;
58 else
59 miniicon.resize(0, 0);
60
61 calcSize();
62}
63
64void TDEPopupTitle::setText( const TQString &text )
65{
66 titleStr = text;
67 calcSize();
68}
69
70void TDEPopupTitle::setIcon( const TQPixmap &pix )
71{
72 miniicon = pix;
73 calcSize();
74}
75
76void TDEPopupTitle::calcSize()
77{
78 TQFont f = font();
79 f.setBold(true);
80 int w = miniicon.width()+TQFontMetrics(f).width(titleStr);
81 int h = TQMAX( fontMetrics().height(), miniicon.height() );
82 setMinimumSize( w+16, h+8 );
83}
84
85void TDEPopupTitle::paintEvent(TQPaintEvent *)
86{
87 TQRect r(rect());
88 TQPainter p(this);
89 tdeApp->style().drawPrimitive(TQStyle::PE_HeaderSectionMenu, &p, r, palette().active());
90
91 if (!miniicon.isNull())
92 p.drawPixmap(4, (r.height()-miniicon.height())/2, miniicon);
93
94 if (!titleStr.isNull())
95 {
96 p.setPen(palette().active().text());
97 TQFont f = p.font();
98 f.setBold(true);
99 p.setFont(f);
100 if(!miniicon.isNull())
101 {
102 p.drawText(miniicon.width()+8, 0, width()-(miniicon.width()+8),
103 height(), AlignLeft | AlignVCenter | SingleLine,
104 titleStr);
105 }
106 else
107 {
108 p.drawText(0, 0, width(), height(),
109 AlignCenter | SingleLine, titleStr);
110 }
111 }
112}
113
114TQSize TDEPopupTitle::sizeHint() const
115{
116 return minimumSize();
117}
118
119class TDEPopupMenu::TDEPopupMenuPrivate
120{
121public:
122 TDEPopupMenuPrivate ()
123 : noMatches(false)
124 , shortcuts(false)
125 , autoExec(false)
126 , lastHitIndex(-1)
127 , state(TQt::NoButton)
128 , m_ctxMenu(0)
129 {}
130
131 ~TDEPopupMenuPrivate ()
132 {
133 delete m_ctxMenu;
134 }
135
136 TQString m_lastTitle;
137
138 // variables for keyboard navigation
139 TQTimer clearTimer;
140
141 bool noMatches : 1;
142 bool shortcuts : 1;
143 bool autoExec : 1;
144
145 TQString keySeq;
146 TQString originalText;
147
148 int lastHitIndex;
149 TQt::ButtonState state;
150
151 // support for RMB menus on menus
152 TQPopupMenu* m_ctxMenu;
153 static bool s_continueCtxMenuShow;
154 static int s_highlightedItem;
155 static TDEPopupMenu* s_contextedMenu;
156};
157
158int TDEPopupMenu::TDEPopupMenuPrivate::s_highlightedItem(-1);
159TDEPopupMenu* TDEPopupMenu::TDEPopupMenuPrivate::s_contextedMenu(0);
160bool TDEPopupMenu::TDEPopupMenuPrivate::s_continueCtxMenuShow(true);
161
162TDEPopupMenu::TDEPopupMenu(TQWidget *parent, const char *name)
163 : TQPopupMenu(parent, name)
164{
165 d = new TDEPopupMenuPrivate;
166 resetKeyboardVars();
167 connect(&(d->clearTimer), TQ_SIGNAL(timeout()), TQ_SLOT(resetKeyboardVars()));
168}
169
170TDEPopupMenu::~TDEPopupMenu()
171{
172 if (TDEPopupMenuPrivate::s_contextedMenu == this)
173 {
174 TDEPopupMenuPrivate::s_contextedMenu = 0;
175 TDEPopupMenuPrivate::s_highlightedItem = -1;
176 }
177
178 delete d;
179}
180
181int TDEPopupMenu::insertTitle(const TQString &text, int id, int index)
182{
183 TDEPopupTitle *titleItem = new TDEPopupTitle();
184 titleItem->setTitle(text);
185 int ret = insertItem(titleItem, id, index);
186 setItemEnabled(ret, false);
187 return ret;
188}
189
190int TDEPopupMenu::insertTitle(const TQPixmap &icon, const TQString &text, int id,
191 int index)
192{
193 TDEPopupTitle *titleItem = new TDEPopupTitle();
194 titleItem->setTitle(text, &icon);
195 int ret = insertItem(titleItem, id, index);
196 setItemEnabled(ret, false);
197 return ret;
198}
199
200void TDEPopupMenu::changeTitle(int id, const TQString &text)
201{
202 TQMenuItem *item = findItem(id);
203 if(item){
204 if(item->widget())
205 ((TDEPopupTitle *)item->widget())->setTitle(text);
206#ifndef NDEBUG
207 else
208 kdWarning() << "TDEPopupMenu: changeTitle() called with non-title id "<< id << endl;
209#endif
210 }
211#ifndef NDEBUG
212 else
213 kdWarning() << "TDEPopupMenu: changeTitle() called with invalid id " << id << endl;
214#endif
215}
216
217void TDEPopupMenu::changeTitle(int id, const TQPixmap &icon, const TQString &text)
218{
219 TQMenuItem *item = findItem(id);
220 if(item){
221 if(item->widget())
222 ((TDEPopupTitle *)item->widget())->setTitle(text, &icon);
223#ifndef NDEBUG
224 else
225 kdWarning() << "TDEPopupMenu: changeTitle() called with non-title id "<< id << endl;
226#endif
227 }
228#ifndef NDEBUG
229 else
230 kdWarning() << "TDEPopupMenu: changeTitle() called with invalid id " << id << endl;
231#endif
232}
233
234TQString TDEPopupMenu::title(int id) const
235{
236 if(id == -1) // obsolete
237 return d->m_lastTitle;
238 TQMenuItem *item = findItem(id);
239 if(item){
240 if(item->widget())
241 return ((TDEPopupTitle *)item->widget())->title();
242 else
243 tqWarning("TDEPopupMenu: title() called with non-title id %d.", id);
244 }
245 else
246 tqWarning("TDEPopupMenu: title() called with invalid id %d.", id);
247 return TQString::null;
248}
249
250TQPixmap TDEPopupMenu::titlePixmap(int id) const
251{
252 TQMenuItem *item = findItem(id);
253 if(item){
254 if(item->widget())
255 return ((TDEPopupTitle *)item->widget())->icon();
256 else
257 tqWarning("TDEPopupMenu: titlePixmap() called with non-title id %d.", id);
258 }
259 else
260 tqWarning("TDEPopupMenu: titlePixmap() called with invalid id %d.", id);
261 TQPixmap tmp;
262 return tmp;
263}
264
268void TDEPopupMenu::closeEvent(TQCloseEvent*e)
269{
270 if (d->shortcuts)
271 resetKeyboardVars();
272 TQPopupMenu::closeEvent(e);
273}
274
275void TDEPopupMenu::activateItemAt(int index)
276{
277 d->state = TQt::NoButton;
278 TQPopupMenu::activateItemAt(index);
279}
280
281TQt::ButtonState TDEPopupMenu::state() const
282{
283 return d->state;
284}
285
286void TDEPopupMenu::keyPressEvent(TQKeyEvent* e)
287{
288 d->state = TQt::NoButton;
289 if (!d->shortcuts) {
290 // continue event processing by Qpopup
291 //e->ignore();
292 d->state = e->state();
293 TQPopupMenu::keyPressEvent(e);
294 return;
295 }
296
297 int i = 0;
298 bool firstpass = true;
299 TQString keyString = e->text();
300
301 // check for common commands dealt with by QPopup
302 int key = e->key();
303 if (key == Key_Escape || key == Key_Return || key == Key_Enter
304 || key == Key_Up || key == Key_Down || key == Key_Left
305 || key == Key_Right || key == Key_F1) {
306
307 resetKeyboardVars();
308 // continue event processing by Qpopup
309 //e->ignore();
310 d->state = e->state();
311 TQPopupMenu::keyPressEvent(e);
312 return;
313 } else if ( key == Key_Shift || key == Key_Control || key == Key_Alt || key == Key_Meta )
314 return TQPopupMenu::keyPressEvent(e);
315
316 // check to see if the user wants to remove a key from the sequence (backspace)
317 // or clear the sequence (delete)
318 if (!d->keySeq.isNull()) {
319
320 if (key == Key_Backspace) {
321
322 if (d->keySeq.length() == 1) {
323 resetKeyboardVars();
324 return;
325 }
326
327 // keep the last sequence in keyString
328 keyString = d->keySeq.left(d->keySeq.length() - 1);
329
330 // allow sequence matching to be tried again
331 resetKeyboardVars();
332
333 } else if (key == Key_Delete) {
334 resetKeyboardVars();
335
336 // clear active item
337 setActiveItem(0);
338 return;
339
340 } else if (d->noMatches) {
341 // clear if there are no matches
342 resetKeyboardVars();
343
344 // clear active item
345 setActiveItem(0);
346
347 } else {
348 // the key sequence is not a null string
349 // therefore the lastHitIndex is valid
350 i = d->lastHitIndex;
351 }
352 } else if (key == Key_Backspace && parentMenu) {
353 // backspace with no chars in the buffer... go back a menu.
354 hide();
355 resetKeyboardVars();
356 return;
357 }
358
359 d->keySeq += keyString;
360 int seqLen = d->keySeq.length();
361
362 for (; i < (int)count(); i++) {
363 // compare typed text with text of this entry
364 int j = idAt(i);
365
366 // don't search disabled entries
367 if (!isItemEnabled(j))
368 continue;
369
370 TQString thisText;
371
372 // retrieve the right text
373 // (the last selected item one may have additional ampersands)
374 if (i == d->lastHitIndex)
375 thisText = d->originalText;
376 else
377 thisText = text(j);
378
379 // if there is an accelerator present, remove it
380 if ((int)accel(j) != 0)
381 thisText = thisText.replace("&", TQString());
382
383 // chop text to the search length
384 thisText = thisText.left(seqLen);
385
386 // do the search
387 if (!thisText.find(d->keySeq, 0, false)) {
388
389 if (firstpass) {
390 // match
391 setActiveItem(i);
392
393 // check to see if we're underlining a different item
394 if (d->lastHitIndex != i)
395 // yes; revert the underlining
396 changeItem(idAt(d->lastHitIndex), d->originalText);
397
398 // set the original text if it's a different item
399 if (d->lastHitIndex != i || d->lastHitIndex == -1)
400 d->originalText = text(j);
401
402 // underline the currently selected item
403 changeItem(j, underlineText(d->originalText, d->keySeq.length()));
404
405 // remember what's going on
406 d->lastHitIndex = i;
407
408 // start/restart the clear timer
409 d->clearTimer.start(5000, true);
410
411 // go around for another try, to see if we can execute
412 firstpass = false;
413 } else {
414 // don't allow execution
415 return;
416 }
417 }
418
419 // fall through to allow execution
420 }
421
422 if (!firstpass) {
423 if (d->autoExec) {
424 // activate anything
425 activateItemAt(d->lastHitIndex);
426 resetKeyboardVars();
427
428 } else if (findItem(idAt(d->lastHitIndex)) &&
429 findItem(idAt(d->lastHitIndex))->popup()) {
430 // only activate sub-menus
431 activateItemAt(d->lastHitIndex);
432 resetKeyboardVars();
433 }
434
435 return;
436 }
437
438 // no matches whatsoever, clean up
439 resetKeyboardVars(true);
440 //e->ignore();
441 TQPopupMenu::keyPressEvent(e);
442}
443
444bool TDEPopupMenu::focusNextPrevChild( bool next )
445{
446 resetKeyboardVars();
447 return TQPopupMenu::focusNextPrevChild( next );
448}
449
450TQString TDEPopupMenu::underlineText(const TQString& text, uint length)
451{
452 TQString ret = text;
453 for (uint i = 0; i < length; i++) {
454 if (ret[2*i] != '&')
455 ret.insert(2*i, "&");
456 }
457 return ret;
458}
459
460void TDEPopupMenu::resetKeyboardVars(bool noMatches /* = false */)
461{
462 // Clean up keyboard variables
463 if (d->lastHitIndex != -1) {
464 changeItem(idAt(d->lastHitIndex), d->originalText);
465 d->lastHitIndex = -1;
466 }
467
468 if (!noMatches) {
469 d->keySeq = TQString::null;
470 }
471
472 d->noMatches = noMatches;
473}
474
475void TDEPopupMenu::setKeyboardShortcutsEnabled(bool enable)
476{
477 d->shortcuts = enable;
478}
479
480void TDEPopupMenu::setKeyboardShortcutsExecute(bool enable)
481{
482 d->autoExec = enable;
483}
492void TDEPopupMenu::mousePressEvent(TQMouseEvent* e)
493{
494 if (d->m_ctxMenu && d->m_ctxMenu->isVisible())
495 {
496 // hide on a second context menu event
497 d->m_ctxMenu->hide();
498 }
499
500 TQPopupMenu::mousePressEvent(e);
501}
502
503void TDEPopupMenu::mouseReleaseEvent(TQMouseEvent* e)
504{
505 // Save the button, and the modifiers from state()
506 d->state = TQt::ButtonState(e->button() | (e->state() & KeyButtonMask));
507
508 if ( !d->m_ctxMenu || !d->m_ctxMenu->isVisible() )
509 TQPopupMenu::mouseReleaseEvent(e);
510}
511
512TQPopupMenu* TDEPopupMenu::contextMenu()
513{
514 if (!d->m_ctxMenu)
515 {
516 d->m_ctxMenu = new TQPopupMenu(this);
517 connect(d->m_ctxMenu, TQ_SIGNAL(aboutToHide()), this, TQ_SLOT(ctxMenuHiding()));
518 }
519
520 return d->m_ctxMenu;
521}
522
523const TQPopupMenu* TDEPopupMenu::contextMenu() const
524{
525 return const_cast< TDEPopupMenu* >( this )->contextMenu();
526}
527
528void TDEPopupMenu::hideContextMenu()
529{
530 TDEPopupMenuPrivate::s_continueCtxMenuShow = false;
531}
532
533int TDEPopupMenu::contextMenuFocusItem()
534{
535 return TDEPopupMenuPrivate::s_highlightedItem;
536}
537
538TDEPopupMenu* TDEPopupMenu::contextMenuFocus()
539{
540 return TDEPopupMenuPrivate::s_contextedMenu;
541}
542
543void TDEPopupMenu::itemHighlighted(int /* whichItem */)
544{
545 if (!d->m_ctxMenu || !d->m_ctxMenu->isVisible())
546 {
547 return;
548 }
549
550 d->m_ctxMenu->hide();
551 showCtxMenu(mapFromGlobal(TQCursor::pos()));
552}
553
554void TDEPopupMenu::showCtxMenu(TQPoint pos)
555{
556 TQMenuItem* item = findItem(TDEPopupMenuPrivate::s_highlightedItem);
557 if (item)
558 {
559 TQPopupMenu* subMenu = item->popup();
560 if (subMenu)
561 {
562 disconnect(subMenu, TQ_SIGNAL(aboutToShow()), this, TQ_SLOT(ctxMenuHideShowingMenu()));
563 }
564 }
565
566 TDEPopupMenuPrivate::s_highlightedItem = idAt(pos);
567
568 if (TDEPopupMenuPrivate::s_highlightedItem == -1)
569 {
570 TDEPopupMenuPrivate::s_contextedMenu = 0;
571 return;
572 }
573
574 emit aboutToShowContextMenu(this, TDEPopupMenuPrivate::s_highlightedItem, d->m_ctxMenu);
575
576 TQPopupMenu* subMenu = findItem(TDEPopupMenuPrivate::s_highlightedItem)->popup();
577 if (subMenu)
578 {
579 connect(subMenu, TQ_SIGNAL(aboutToShow()), TQ_SLOT(ctxMenuHideShowingMenu()));
580 TQTimer::singleShot(100, subMenu, TQ_SLOT(hide()));
581 }
582
583 if (!TDEPopupMenuPrivate::s_continueCtxMenuShow)
584 {
585 TDEPopupMenuPrivate::s_continueCtxMenuShow = true;
586 return;
587 }
588
589 TDEPopupMenuPrivate::s_contextedMenu = this;
590 d->m_ctxMenu->popup(this->mapToGlobal(pos));
591 connect(this, TQ_SIGNAL(highlighted(int)), this, TQ_SLOT(itemHighlighted(int)));
592}
593
594/*
595 * this method helps prevent submenus popping up while we have a context menu
596 * showing
597 */
598void TDEPopupMenu::ctxMenuHideShowingMenu()
599{
600 TQMenuItem* item = findItem(TDEPopupMenuPrivate::s_highlightedItem);
601 if (item)
602 {
603 TQPopupMenu* subMenu = item->popup();
604 if (subMenu)
605 {
606 TQTimer::singleShot(0, subMenu, TQ_SLOT(hide()));
607 }
608 }
609}
610
611void TDEPopupMenu::ctxMenuHiding()
612{
613 if (TDEPopupMenuPrivate::s_highlightedItem)
614 {
615 TQPopupMenu* subMenu = findItem(TDEPopupMenuPrivate::s_highlightedItem)->popup();
616 if (subMenu)
617 {
618 disconnect(subMenu, TQ_SIGNAL(aboutToShow()), this, TQ_SLOT(ctxMenuHideShowingMenu()));
619 }
620 }
621
622 disconnect(this, TQ_SIGNAL(highlighted(int)), this, TQ_SLOT(itemHighlighted(int)));
623 TDEPopupMenuPrivate::s_continueCtxMenuShow = true;
624}
625
626void TDEPopupMenu::contextMenuEvent(TQContextMenuEvent* e)
627{
628 if (d->m_ctxMenu)
629 {
630 if (e->reason() == TQContextMenuEvent::Mouse)
631 {
632 showCtxMenu(e->pos());
633 }
634 else if (actItem != -1)
635 {
636 showCtxMenu(itemGeometry(actItem).center());
637 }
638
639 e->accept();
640 return;
641 }
642
643 TQPopupMenu::contextMenuEvent(e);
644}
645
646void TDEPopupMenu::hideEvent(TQHideEvent*)
647{
648 if (d->m_ctxMenu && d->m_ctxMenu->isVisible())
649 {
650 // we need to block signals here when the ctxMenu is showing
651 // to prevent the TQPopupMenu::activated(int) signal from emitting
652 // when hiding with a context menu, the user doesn't expect the
653 // menu to actually do anything.
654 // since hideEvent gets called very late in the process of hiding
655 // (deep within TQWidget::hide) the activated(int) signal is the
656 // last signal to be emitted, even after things like aboutToHide()
657 // AJS
658 blockSignals(true);
659 d->m_ctxMenu->hide();
660 blockSignals(false);
661 }
662}
667// Obsolete
668TDEPopupMenu::TDEPopupMenu(const TQString& title, TQWidget *parent, const char *name)
669 : TQPopupMenu(parent, name)
670{
671 d = new TDEPopupMenuPrivate;
672 insertTitle(title);
673}
674
675// Obsolete
676void TDEPopupMenu::setTitle(const TQString &title)
677{
678 TDEPopupTitle *titleItem = new TDEPopupTitle();
679 titleItem->setTitle(title);
680 insertItem(titleItem);
681 d->m_lastTitle = title;
682}
683
684void TDEPopupTitle::virtual_hook( int, void* )
685{ /*BASE::virtual_hook( id, data );*/ }
686
687void TDEPopupMenu::virtual_hook( int, void* )
688{ /*BASE::virtual_hook( id, data );*/ }
689
690#include "tdepopupmenu.moc"
KPixmap
TDEPopupMenu
A menu with title items.
Definition: tdepopupmenu.h:123
TDEPopupMenu::setTitle
void setTitle(const TQString &title) TDE_DEPRECATED
Definition: tdepopupmenu.cpp:676
TDEPopupMenu::activateItemAt
virtual void activateItemAt(int index)
Reimplemented for internal purposes.
Definition: tdepopupmenu.cpp:275
TDEPopupMenu::hideContextMenu
void hideContextMenu()
Hides the context menu if shown.
Definition: tdepopupmenu.cpp:528
TDEPopupMenu::contextMenu
TQPopupMenu * contextMenu()
Returns the context menu associated with this menu.
Definition: tdepopupmenu.cpp:512
TDEPopupMenu::contextMenuFocusItem
static int contextMenuFocusItem()
returns the ID of the menuitem associated with the current context menu
Definition: tdepopupmenu.cpp:533
TDEPopupMenu::contextMenuFocus
static TDEPopupMenu * contextMenuFocus()
Returns the TDEPopupMenu associated with the current context menu.
Definition: tdepopupmenu.cpp:538
TDEPopupMenu::resetKeyboardVars
void resetKeyboardVars(bool noMatches=false)
Definition: tdepopupmenu.cpp:460
TDEPopupMenu::setKeyboardShortcutsExecute
void setKeyboardShortcutsExecute(bool enable)
Enables execution of the menu item once it is uniquely specified.
Definition: tdepopupmenu.cpp:480
TDEPopupMenu::changeTitle
void changeTitle(int id, const TQString &text)
Changes the title of the item at the specified id.
Definition: tdepopupmenu.cpp:200
TDEPopupMenu::~TDEPopupMenu
~TDEPopupMenu()
Destructs the object.
Definition: tdepopupmenu.cpp:170
TDEPopupMenu::mousePressEvent
virtual void mousePressEvent(TQMouseEvent *e)
End keyboard navigation.
Definition: tdepopupmenu.cpp:492
TDEPopupMenu::mouseReleaseEvent
virtual void mouseReleaseEvent(TQMouseEvent *e)
Definition: tdepopupmenu.cpp:503
TDEPopupMenu::closeEvent
virtual void closeEvent(TQCloseEvent *)
This is re-implemented for keyboard navigation.
Definition: tdepopupmenu.cpp:268
TDEPopupMenu::insertTitle
int insertTitle(const TQString &text, int id=-1, int index=-1)
Inserts a title item with no icon.
Definition: tdepopupmenu.cpp:181
TDEPopupMenu::title
TQString title(int id=-1) const
Returns the title of the title item at the specified id.
Definition: tdepopupmenu.cpp:234
TDEPopupMenu::titlePixmap
TQPixmap titlePixmap(int id) const
Returns the icon of the title item at the specified id.
Definition: tdepopupmenu.cpp:250
TDEPopupMenu::TDEPopupMenu
TDEPopupMenu(TQWidget *parent=0, const char *name=0)
Constructs a TDEPopupMenu.
Definition: tdepopupmenu.cpp:162
TDEPopupMenu::underlineText
TQString underlineText(const TQString &text, uint length)
Definition: tdepopupmenu.cpp:450
TDEPopupMenu::aboutToShowContextMenu
void aboutToShowContextMenu(TDEPopupMenu *menu, int menuItem, TQPopupMenu *ctxMenu)
connect to this signal to be notified when a context menu is about to be shown
TDEPopupMenu::setKeyboardShortcutsEnabled
void setKeyboardShortcutsEnabled(bool enable)
Enables keyboard navigation by searching for the entered key sequence.
Definition: tdepopupmenu.cpp:475
TDEPopupMenu::state
TQt::ButtonState state() const
Return the state of the mouse button and keyboard modifiers when the last menuitem was activated.
Definition: tdepopupmenu.cpp:281
TDEPopupTitle
TDEPopupMenu title widget.
Definition: tdepopupmenu.h:39
TDEPopupTitle::setTitle
void setTitle(const TQString &text, const TQPixmap *icon=0)
Sets the title string and optional icon for the title widget.
Definition: tdepopupmenu.cpp:53
TDEPopupTitle::TDEPopupTitle
TDEPopupTitle(TQWidget *parent=0, const char *name=0)
Constructs a title widget with the user specified gradient, pixmap, and colors.
Definition: tdepopupmenu.cpp:31
TDEPopupTitle::setText
void setText(const TQString &text)
Definition: tdepopupmenu.cpp:64
TDEPopupTitle::icon
TQPixmap icon() const
Returns the current icon.
Definition: tdepopupmenu.h:75
TDEPopupTitle::setIcon
void setIcon(const TQPixmap &pix)
Definition: tdepopupmenu.cpp:70
kdWarning
kdbgstream kdWarning(int area=0)
endl
kndbgstream & endl(kndbgstream &s)
TDEStdAccel::key
int key(StdAccel id)

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
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.9.4
This website is maintained by Timothy Pearson.