summaryrefslogtreecommitdiffstats
path: root/tqtinterface/qt4/src/widgets/tqpopupmenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tqtinterface/qt4/src/widgets/tqpopupmenu.cpp')
-rw-r--r--tqtinterface/qt4/src/widgets/tqpopupmenu.cpp74
1 files changed, 37 insertions, 37 deletions
diff --git a/tqtinterface/qt4/src/widgets/tqpopupmenu.cpp b/tqtinterface/qt4/src/widgets/tqpopupmenu.cpp
index 89f525a..a96b67d 100644
--- a/tqtinterface/qt4/src/widgets/tqpopupmenu.cpp
+++ b/tqtinterface/qt4/src/widgets/tqpopupmenu.cpp
@@ -75,7 +75,7 @@ bool tqwidget_is_popup_menu(QWidget* w) {
QWidget* tqwidget_parent_popup_menu(QWidget* w) {
TQPopupMenu* tqpm = dynamic_cast<TQPopupMenu*>(w);
if (tqpm) {
- TQMenuData *top = tqpm; // tqfind top level
+ TQMenuData *top = tqpm; // find top level
if ( top->parentMenu ) {
if (top->parentMenu->isPopupMenu == FALSE) return 0;
return (dynamic_cast<TQPopupMenu*>(top->parentMenu));
@@ -202,7 +202,7 @@ static TQMenuItem* whatsThisItem = 0;
into a popup menu (for example, a color selector).
A TQPopupMenu can also provide a tear-off menu. A tear-off menu is
- a top-level window that tqcontains a copy of the menu. This makes it
+ a top-level window that contains a copy of the menu. This makes it
possible for the user to "tear off" frequently used menus and
position them in a convenient place on the screen. If you want
that functionality for a certain menu, insert a tear-off handle
@@ -210,7 +210,7 @@ static TQMenuItem* whatsThisItem = 0;
mind that the concept isn't typically used on Microsoft Windows so
users may not be familiar with it. Consider using a TQToolBar
instead. Tear-off menus cannot contain custom widgets; if the
- original menu tqcontains a custom widget item, this item is omitted.
+ original menu contains a custom widget item, this item is omitted.
\link menu-example.html menu/menu.cpp\endlink is an example of
TQMenuBar and TQPopupMenu use.
@@ -752,7 +752,7 @@ static bool fromAccel = FALSE;
#ifndef TQT_NO_ACCEL
void TQPopupMenu::accelActivated( int id )
{
- TQMenuItem *mi = tqfindItem( id );
+ TQMenuItem *mi = findItem( id );
if ( mi && mi->isEnabledAndVisible() ) {
TQGuardedPtr<TQSignal> signal = mi->signal();
fromAccel = TRUE;
@@ -786,7 +786,7 @@ void TQPopupMenu::actSig( int id, bool inwhatsthis )
#ifndef TQT_NO_WHATSTHIS
TQRect r( itemGeometry( indexOf( id ) ) );
TQPoint p( r.center().x(), r.bottom() );
- TQString whatsThis = tqfindItem( id )->whatsThis();
+ TQString whatsThis = findItem( id )->whatsThis();
if ( whatsThis.isNull() )
whatsThis = TQWhatsThis::textFor( this, p );
TQWhatsThis::leaveWhatsThisMode( whatsThis, mapToGlobal( p ), this );
@@ -833,7 +833,7 @@ void TQPopupMenu::setFirstItemActive()
void TQPopupMenu::hideAllPopups()
{
- register TQMenuData *top = this; // tqfind top level popup
+ register TQMenuData *top = this; // find top level popup
if ( !preventAnimation )
TQTimer::singleShot( 10, this, TQT_SLOT(allowAnimation()) );
preventAnimation = TRUE;
@@ -889,7 +889,7 @@ void TQPopupMenu::hidePopups()
bool TQPopupMenu::tryMenuBar( TQMouseEvent *e )
{
- register TQMenuData *top = this; // tqfind top level
+ register TQMenuData *top = this; // find top level
while ( top->parentMenu )
top = top->parentMenu;
#ifndef TQT_NO_MENUBAR
@@ -910,7 +910,7 @@ bool TQPopupMenu::tryMouseEvent( TQPopupMenu *p, TQMouseEvent * e)
if ( p == this )
return FALSE;
TQPoint pos = mapFromGlobal( e->globalPos() );
- if ( !TQT_TQRECT_OBJECT(rect()).tqcontains( pos ) ) // outside
+ if ( !TQT_TQRECT_OBJECT(rect()).contains( pos ) ) // outside
return FALSE;
TQMouseEvent ee( e->type(), pos, e->globalPos(), e->button(), e->state() );
event( &ee );
@@ -925,7 +925,7 @@ bool TQPopupMenu::tryMouseEvent( TQPopupMenu *p, TQMouseEvent * e)
void TQPopupMenu::byeMenuBar()
{
#ifndef TQT_NO_MENUBAR
- register TQMenuData *top = this; // tqfind top level
+ register TQMenuData *top = this; // find top level
while ( top->parentMenu )
top = top->parentMenu;
#endif
@@ -945,7 +945,7 @@ void TQPopupMenu::byeMenuBar()
int TQPopupMenu::itemAtPos( const TQPoint &pos, bool ignoreSeparator ) const
{
- if ( !contentsRect().tqcontains(pos) )
+ if ( !contentsRect().contains(pos) )
return -1;
int row = 0;
@@ -988,7 +988,7 @@ int TQPopupMenu::itemAtPos( const TQPoint &pos, bool ignoreSeparator ) const
y = contentsRect().y();
x +=itemw;
}
- if ( TQRect( x, y, itemw, itemh ).tqcontains( pos ) )
+ if ( TQRect( x, y, itemw, itemh ).contains( pos ) )
break;
y += itemh;
++row;
@@ -1146,17 +1146,17 @@ TQSize TQPopupMenu::updateSize(bool force_update, bool do_resize)
if (! mi->text().isNull()) {
TQString s = mi->text();
int t;
- if ( (t = s.tqfind('\t')) >= 0 ) { // string tqcontains tab
+ if ( (t = s.find('\t')) >= 0 ) { // string contains tab
w += fm.width( s, t );
- w -= s.tqcontains('&') * fm.width('&');
- w += s.tqcontains("&&") * fm.width('&');
+ w -= s.contains('&') * fm.width('&');
+ w += s.contains("&&") * fm.width('&');
int tw = fm.width( s.mid(t + 1) );
if ( tw > tab)
tab = tw;
} else {
w += fm.width( s );
- w -= s.tqcontains('&') * fm.width('&');
- w += s.tqcontains("&&") * fm.width('&');
+ w -= s.contains('&') * fm.width('&');
+ w += s.contains("&&") * fm.width('&');
}
} else if (mi->pixmap())
w += mi->pixmap()->width();
@@ -1280,7 +1280,7 @@ void TQPopupMenu::updateAccel( TQWidget *tqparent )
delete autoaccel;
autoaccel = 0;
} else if ( !autoaccel ) {
- // we have no tqparent. Rather than ignoring any accelerators we try to tqfind this popup's main window
+ // we have no tqparent. Rather than ignoring any accelerators we try to find this popup's main window
if ( tornOff ) {
tqparent = this;
} else {
@@ -1322,13 +1322,13 @@ void TQPopupMenu::updateAccel( TQWidget *tqparent )
}
if ( !mi->text().isNull() || mi->custom() ) {
TQString s = mi->text();
- int i = s.tqfind('\t');
+ int i = s.find('\t');
// Note: Only looking at the first key in the sequence!
if ( (int)k && (int)k != TQt::Key_unknown ) {
TQString t = (TQString)mi->key();
if ( i >= 0 )
- s.tqreplace( i+1, s.length()-i, t );
+ s.replace( i+1, s.length()-i, t );
else {
s += '\t';
s += t;
@@ -1557,7 +1557,7 @@ void TQPopupMenu::drawContents( TQPainter* p )
if(d->scroll.scrollable & TQPopupMenuPrivate::Scroll::ScrollUp) {
TQRect rect(x, y, contentsRect().width(),
tqstyle().tqpixelMetric(TQStyle::PM_PopupMenuScrollerHeight, this));
- if(!p->hasClipping() || TQT_TQREGION_OBJECT(p->clipRegion()).tqcontains(rect)) {
+ if(!p->hasClipping() || TQT_TQREGION_OBJECT(p->clipRegion()).contains(rect)) {
TQStyle::SFlags flags = TQStyle::Style_Up;
if (isEnabled())
flags |= TQStyle::Style_Enabled;
@@ -1592,7 +1592,7 @@ void TQPopupMenu::drawContents( TQPainter* p )
if ( ncols > 1 && y + itemh > contentsRect().bottom() ) {
if ( y < contentsRect().bottom() ) {
TQRect rect(x, y, itemw, contentsRect().bottom() - y);
- if(!p->hasClipping() || TQT_TQREGION_OBJECT(p->clipRegion()).tqcontains(rect)) {
+ if(!p->hasClipping() || TQT_TQREGION_OBJECT(p->clipRegion()).contains(rect)) {
flags = TQStyle::Style_Default;
if (isEnabled() && mi->isEnabledAndVisible())
flags |= TQStyle::Style_Enabled;
@@ -1603,14 +1603,14 @@ void TQPopupMenu::drawContents( TQPainter* p )
y = contentsRect().y();
x +=itemw;
}
- if (!mi->widget() && (!p->hasClipping() || TQT_TQREGION_OBJECT(p->clipRegion()).tqcontains(TQRect(x, y, itemw, itemh))))
+ if (!mi->widget() && (!p->hasClipping() || TQT_TQREGION_OBJECT(p->clipRegion()).contains(TQRect(x, y, itemw, itemh))))
drawItem( p, tab, mi, row == actItem, x, y, itemw, itemh );
y += itemh;
++row;
}
if ( y < contentsRect().bottom() ) {
TQRect rect(x, y, itemw, contentsRect().bottom() - y);
- if(!p->hasClipping() || TQT_TQREGION_OBJECT(p->clipRegion()).tqcontains(rect)) {
+ if(!p->hasClipping() || TQT_TQREGION_OBJECT(p->clipRegion()).contains(rect)) {
flags = TQStyle::Style_Default;
if ( isEnabled() )
flags |= TQStyle::Style_Enabled;
@@ -1621,7 +1621,7 @@ void TQPopupMenu::drawContents( TQPainter* p )
if( d->scroll.scrollable & TQPopupMenuPrivate::Scroll::ScrollDown ) {
int sh = tqstyle().tqpixelMetric(TQStyle::PM_PopupMenuScrollerHeight, this);
TQRect rect(x, contentsRect().height() - sh, contentsRect().width(), sh);
- if(!p->hasClipping() || TQT_TQREGION_OBJECT(p->clipRegion()).tqcontains(rect)) {
+ if(!p->hasClipping() || TQT_TQREGION_OBJECT(p->clipRegion()).contains(rect)) {
TQStyle::SFlags flags = TQStyle::Style_Down;
if (isEnabled())
flags |= TQStyle::Style_Enabled;
@@ -1668,7 +1668,7 @@ void TQPopupMenu::closeEvent( TQCloseEvent * e) {
void TQPopupMenu::mousePressEvent( TQMouseEvent *e )
{
int sh = tqstyle().tqpixelMetric(TQStyle::PM_PopupMenuScrollerHeight, this);
- if (TQT_TQRECT_OBJECT(rect()).tqcontains(e->pos()) &&
+ if (TQT_TQRECT_OBJECT(rect()).contains(e->pos()) &&
((d->scroll.scrollable & TQPopupMenuPrivate::Scroll::ScrollUp && e->pos().y() <= sh) || //up
(d->scroll.scrollable & TQPopupMenuPrivate::Scroll::ScrollDown &&
e->pos().y() >= contentsRect().height() - sh))) //down
@@ -1677,7 +1677,7 @@ void TQPopupMenu::mousePressEvent( TQMouseEvent *e )
mouseBtDn = TRUE; // mouse button down
int item = itemAtPos( e->pos() );
if ( item == -1 ) {
- if ( !TQT_TQRECT_OBJECT(rect()).tqcontains(e->pos()) && !tryMenuBar(e) ) {
+ if ( !TQT_TQRECT_OBJECT(rect()).contains(e->pos()) && !tryMenuBar(e) ) {
byeMenuBar();
}
return;
@@ -1719,7 +1719,7 @@ void TQPopupMenu::mouseReleaseEvent( TQMouseEvent *e )
// to the menubar or our parent menu
int sh = tqstyle().tqpixelMetric(TQStyle::PM_PopupMenuScrollerHeight, this);
- if ( !TQT_TQRECT_OBJECT(rect()).tqcontains( e->pos() ) && tryMenuBar(e) ) {
+ if ( !TQT_TQRECT_OBJECT(rect()).contains( e->pos() ) && tryMenuBar(e) ) {
return;
}
else if((d->scroll.scrollable & TQPopupMenuPrivate::Scroll::ScrollUp && e->pos().y() <= sh) || //up
@@ -1730,7 +1730,7 @@ void TQPopupMenu::mouseReleaseEvent( TQMouseEvent *e )
if ( actItem < 0 ) { // we do not have an active item
// if the release is inside without motion (happens with
// oversized popup menus on small screens), ignore it
- if ( TQT_TQRECT_OBJECT(rect()).tqcontains( e->pos() ) && motion < 6 )
+ if ( TQT_TQRECT_OBJECT(rect()).contains( e->pos() ) && motion < 6 )
return;
else
byeMenuBar();
@@ -1794,9 +1794,9 @@ void TQPopupMenu::mouseMoveEvent( TQMouseEvent *e )
TQPopupMenu* p = (TQPopupMenu*)parentMenu;
int myIndex;
- p->tqfindPopup( this, &myIndex );
+ p->findPopup( this, &myIndex );
TQPoint pPos = p->mapFromParent( e->globalPos() );
- if ( p->actItem != myIndex && !TQT_TQRECT_OBJECT(p->rect()).tqcontains( pPos ) )
+ if ( p->actItem != myIndex && !TQT_TQRECT_OBJECT(p->rect()).contains( pPos ) )
p->setActiveItem( myIndex );
if ( tqstyle().tqstyleHint(TQStyle::SH_PopupMenu_SloppySubMenus, this )) {
@@ -1838,7 +1838,7 @@ void TQPopupMenu::mouseMoveEvent( TQMouseEvent *e )
if ( lastActItem >= 0 )
updateRow( lastActItem );
if ( lastActItem > 0 ||
- ( !TQT_TQRECT_OBJECT(rect()).tqcontains( e->pos() ) && !tryMenuBar( e ) ) ) {
+ ( !TQT_TQRECT_OBJECT(rect()).contains( e->pos() ) && !tryMenuBar( e ) ) ) {
popupSubMenuLater(tqstyle().tqstyleHint(TQStyle::SH_PopupMenu_SubMenuPopupDelay,
this), this);
}
@@ -1863,7 +1863,7 @@ void TQPopupMenu::mouseMoveEvent( TQMouseEvent *e )
return;
if ( tqstyle().tqstyleHint(TQStyle::SH_PopupMenu_SloppySubMenus, this) &&
- d->mouseMoveBuffer.tqcontains( e->pos() ) ) {
+ d->mouseMoveBuffer.contains( e->pos() ) ) {
actItem = item;
popupSubMenuLater( tqstyle().tqstyleHint(TQStyle::SH_PopupMenu_SubMenuPopupDelay, this) * 6,
this );
@@ -2078,7 +2078,7 @@ void TQPopupMenu::keyPressEvent( TQKeyEvent *e )
++it;
TQString s = m->text();
if ( !s.isEmpty() ) {
- int i = s.tqfind( '&' );
+ int i = s.find( '&' );
while ( i >= 0 && i < (int)s.length() - 1 ) {
if ( s[i+1].upper() == c ) {
ok_key = TRUE;
@@ -2091,7 +2091,7 @@ void TQPopupMenu::keyPressEvent( TQKeyEvent *e )
firstAfterCurrent = m;
break;
} else if ( s[i+1] == '&' ) {
- i = s.tqfind( '&', i+2 );
+ i = s.find( '&', i+2 );
} else {
break;
}
@@ -2137,7 +2137,7 @@ void TQPopupMenu::keyPressEvent( TQKeyEvent *e )
}
#ifndef TQT_NO_MENUBAR
if ( !ok_key ) { // send to menu bar
- register TQMenuData *top = this; // tqfind top level
+ register TQMenuData *top = this; // find top level
while ( top->parentMenu )
top = top->parentMenu;
if ( top->isMenuBar ) {
@@ -2430,7 +2430,7 @@ void TQPopupMenu::subMenuTimer() {
if ( tqstyle().tqstyleHint(TQStyle::SH_PopupMenu_SloppySubMenus, this )) {
TQPoint cur = TQCursor::pos();
- if ( r.tqcontains( mapFromGlobal( cur ) ) ) {
+ if ( r.contains( mapFromGlobal( cur ) ) ) {
TQPoint pts[4];
pts[0] = TQPoint( cur.x(), cur.y() - 2 );
pts[3] = TQPoint( cur.x(), cur.y() + 2 );
@@ -2753,7 +2753,7 @@ public:
Inserts a tear-off handle into the menu. A tear-off handle is a
special menu item that creates a copy of the menu when the menu is
selected. This "torn-off" copy lives in a separate window. It
- tqcontains the same menu items as the original menu, with the
+ contains the same menu items as the original menu, with the
exception of the tear-off handle.
The handle item is assigned the identifier \a id or an