summaryrefslogtreecommitdiffstats
path: root/src/widgets/tqmenubar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/tqmenubar.cpp')
-rw-r--r--src/widgets/tqmenubar.cpp136
1 files changed, 68 insertions, 68 deletions
diff --git a/src/widgets/tqmenubar.cpp b/src/widgets/tqmenubar.cpp
index 58507e4d4..653c00a5f 100644
--- a/src/widgets/tqmenubar.cpp
+++ b/src/widgets/tqmenubar.cpp
@@ -68,7 +68,7 @@ public:
};
#if defined(QT_ACCESSIBILITY_SUPPORT)
-static bool inMenu = FALSE;
+static bool inMenu = false;
#endif
#if defined(TQ_WS_X11)
@@ -266,11 +266,11 @@ TQMenuBar::TQMenuBar( TQWidget *parent, const char *name )
: TQFrame( parent, name, WNoAutoErase )
{
#if defined( TQ_WS_MAC ) && !defined(TQMAC_QMENUBAR_NO_NATIVE)
- mac_eaten_menubar = FALSE;
+ mac_eaten_menubar = false;
mac_d = 0;
macCreateNativeMenubar();
#endif
- isMenuBar = TRUE;
+ isMenuBar = true;
#ifndef TQT_NO_ACCEL
autoaccel = 0;
#endif
@@ -351,11 +351,11 @@ void TQMenuBar::updateItem( int id )
{
int i = indexOf( id );
if ( i >= 0 && irects )
- repaint( irects[i], FALSE );
+ repaint( irects[i], false );
}
#if defined(TQ_WS_MAC) && !defined(TQMAC_QMENUBAR_NO_NATIVE)
-static bool fromFrameChange = FALSE;
+static bool fromFrameChange = false;
#endif
/*!
@@ -370,7 +370,7 @@ void TQMenuBar::menuContentsChanged()
{
// here the part that can't be delayed
TQMenuData::menuContentsChanged();
- badSize = TRUE; // might change the size
+ badSize = true; // might change the size
if( pendingDelayedContentsChanges )
return;
pendingDelayedContentsChanges = 1;
@@ -448,7 +448,7 @@ void TQMenuBar::performDelayedChanges()
if(mac_eaten_menubar && needMacUpdate) {
macDirtyNativeMenubar();
- bool all_hidden = TRUE;
+ bool all_hidden = true;
if(irects) {
for(int i = 0; all_hidden && i < (int)mitems->count(); i++)
all_hidden = irects[i].isEmpty();
@@ -486,11 +486,11 @@ void TQMenuBar::menuDelPopup( TQPopupMenu *popup )
void TQMenuBar::frameChanged()
{
#if defined(TQ_WS_MAC) && !defined(TQMAC_QMENUBAR_NO_NATIVE)
- fromFrameChange = TRUE;
+ fromFrameChange = true;
#endif
menuContentsChanged();
#if defined(TQ_WS_MAC) && !defined(TQMAC_QMENUBAR_NO_NATIVE)
- fromFrameChange = FALSE;
+ fromFrameChange = false;
#endif
}
@@ -521,20 +521,20 @@ bool TQMenuBar::eventFilter( TQObject *object, TQEvent *event )
TQResizeEvent *e = (TQResizeEvent *)event;
int w = e->size().width();
setGeometry( 0, y(), w, heightForWidth(w) );
- return FALSE;
+ return false;
}
if ( !isVisible() || !object->isWidgetType() )
- return FALSE;
+ return false;
if ( object == this && event->type() == TQEvent::LanguageChange ) {
- badSize = TRUE;
+ badSize = true;
calculateRects();
- return FALSE;
+ return false;
} else if ( event->type() == TQEvent::MouseButtonPress ||
event->type() == TQEvent::MouseButtonRelease ) {
waitforalt = 0;
- return FALSE;
+ return false;
} else if ( waitforalt && event->type() == TQEvent::FocusOut ) {
// some window systems/managers use alt/meta as accelerator keys
// for switching between windows/desktops/etc. If the focus
@@ -548,13 +548,13 @@ bool TQMenuBar::eventFilter( TQObject *object, TQEvent *event )
TQWidget * f = ((TQWidget *)object)->focusWidget();
if (f)
f->removeEventFilter( this );
- return FALSE;
+ return false;
} else if ( !( event->type() == TQEvent::Accel ||
event->type() == TQEvent::AccelOverride ||
event->type() == TQEvent::KeyPress ||
event->type() == TQEvent::KeyRelease ) ||
!style().styleHint(TQStyle::SH_MenuBar_AltKeyNavigation, this) ) {
- return FALSE;
+ return false;
}
TQKeyEvent * ke = (TQKeyEvent *) event;
@@ -571,12 +571,12 @@ bool TQMenuBar::eventFilter( TQObject *object, TQEvent *event )
if ( object->parent() )
object->removeEventFilter( this );
ke->accept();
- return TRUE;
+ return true;
// Menu has focus, send focus back
} else if ( hasFocus() ) {
- setAltMode( FALSE );
+ setAltMode( false );
ke->accept();
- return TRUE;
+ return true;
// Start waiting for Alt release on focus widget
} else if ( ke->stateAfter() == AltButton ) {
waitforalt = 1;
@@ -588,17 +588,17 @@ bool TQMenuBar::eventFilter( TQObject *object, TQEvent *event )
}
// Other modifiers kills focus on menubar
} else if ( ke->key() == Key_Control || ke->key() == Key_Shift) {
- setAltMode( FALSE );
+ setAltMode( false );
// Got other key, no need to wait for Alt release
} else {
waitforalt = 0;
}
// ### ! block all accelerator events when the menu bar is active
if ( tqApp && tqApp->focusWidget() == this ) {
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
#endif
// look for Alt release
@@ -610,7 +610,7 @@ bool TQMenuBar::eventFilter( TQObject *object, TQEvent *event )
&& TQMenuData::d->aInt == qt_xfocusout_grab_counter
#endif
) {
- setAltMode( TRUE );
+ setAltMode( true );
if ( object->parent() )
object->removeEventFilter( this );
TQWidget * tlw = ((TQWidget *)object)->topLevelWidget();
@@ -621,18 +621,18 @@ bool TQMenuBar::eventFilter( TQObject *object, TQEvent *event )
tlw->removeEventFilter( this );
tlw->installEventFilter( this );
}
- return TRUE;
+ return true;
// Cancel if next keypress is NOT Alt/Meta,
} else if ( !hasFocus() && (event->type() == TQEvent::AccelOverride ) &&
!(((TQKeyEvent *)event)->key() == Key_Alt ||
((TQKeyEvent *)event)->key() == Key_Meta) ) {
if ( object->parent() )
object->removeEventFilter( this );
- setAltMode( FALSE );
+ setAltMode( false );
}
}
- return FALSE; // don't stop event
+ return false; // don't stop event
}
@@ -670,7 +670,7 @@ void TQMenuBar::accelActivated( int id )
#endif
if ( !isEnabled() ) // the menu bar is disabled
return;
- setAltMode( TRUE );
+ setAltMode( true );
setActiveItem( indexOf( id ) );
}
#endif
@@ -696,17 +696,17 @@ bool TQMenuBar::tryMouseEvent( TQPopupMenu *, TQMouseEvent *e )
{
TQPoint pos = mapFromGlobal( e->globalPos() );
if ( !rect().contains( pos ) ) // outside
- return FALSE;
+ return false;
int item = itemAtPos( pos );
if ( item == -1 && (e->type() == TQEvent::MouseButtonPress ||
e->type() == TQEvent::MouseButtonRelease) ) {
hidePopups();
goodbye();
- return FALSE;
+ return false;
}
TQMouseEvent ee( e->type(), pos, e->globalPos(), e->button(), e->state() );
event( &ee );
- return TRUE;
+ return true;
}
@@ -718,7 +718,7 @@ void TQMenuBar::tryKeyEvent( TQPopupMenu *, TQKeyEvent *e )
void TQMenuBar::goodbye( bool cancelled )
{
- mouseBtDn = FALSE;
+ mouseBtDn = false;
popupvisible = 0;
setAltMode( cancelled && style().styleHint(TQStyle::SH_MenuBar_AltKeyNavigation, this) );
}
@@ -729,7 +729,7 @@ void TQMenuBar::openActPopup()
#if defined(QT_ACCESSIBILITY_SUPPORT)
if ( !inMenu ) {
TQAccessible::updateAccessibility( this, 0, TQAccessible::MenuStart );
- inMenu = TRUE;
+ inMenu = true;
}
#endif
@@ -769,9 +769,9 @@ void TQMenuBar::openActPopup()
Q_ASSERT( popup->parentMenu == 0 );
popup->parentMenu = this; // set parent menu
- popup->snapToMouse = FALSE;
+ popup->snapToMouse = false;
popup->popup( pos );
- popup->snapToMouse = TRUE;
+ popup->snapToMouse = true;
}
/*!
@@ -782,7 +782,7 @@ void TQMenuBar::openActPopup()
void TQMenuBar::hidePopups()
{
#if defined(QT_ACCESSIBILITY_SUPPORT)
- bool anyVisible = FALSE;
+ bool anyVisible = false;
#endif
TQMenuItemListIt it(*mitems);
TQMenuItem *mi;
@@ -790,7 +790,7 @@ void TQMenuBar::hidePopups()
++it;
if ( mi->popup() && mi->popup()->isVisible() ) {
#if defined(QT_ACCESSIBILITY_SUPPORT)
- anyVisible = TRUE;
+ anyVisible = true;
#endif
mi->popup()->hide();
}
@@ -798,7 +798,7 @@ void TQMenuBar::hidePopups()
#if defined(QT_ACCESSIBILITY_SUPPORT)
if ( !popupvisible && anyVisible && inMenu ) {
TQAccessible::updateAccessibility( this, 0, TQAccessible::MenuEnd );
- inMenu = FALSE;
+ inMenu = false;
}
#endif
}
@@ -826,7 +826,7 @@ void TQMenuBar::show()
#if defined(TQ_WS_MAC) && !defined(TQMAC_QMENUBAR_NO_NATIVE)
if(mac_eaten_menubar) {
//If all elements are invisible no reason for me to be visible either
- bool all_hidden = TRUE;
+ bool all_hidden = true;
if(irects) {
for(int i = 0; all_hidden && i < (int)mitems->count(); i++)
all_hidden = irects[i].isEmpty();
@@ -858,7 +858,7 @@ void TQMenuBar::show()
void TQMenuBar::hide()
{
TQWidget::hide();
- setAltMode( FALSE );
+ setAltMode( false );
hidePopups();
#ifndef TQT_NO_MAINWINDOW
TQMainWindow *mw = ::tqt_cast<TQMainWindow*>(parent());
@@ -874,7 +874,7 @@ void TQMenuBar::hide()
void TQMenuBar::fontChange( const TQFont & f )
{
- badSize = TRUE;
+ badSize = true;
updateGeometry();
if ( isVisible() )
calculateRects();
@@ -1056,7 +1056,7 @@ int TQMenuBar::calculateRects( int max_width )
mi->widget()->show();
}
}
- badSize = FALSE;
+ badSize = false;
}
return max_height;
@@ -1211,7 +1211,7 @@ void TQMenuBar::mousePressEvent( TQMouseEvent *e )
{
if ( e->button() != LeftButton )
return;
- mouseBtDn = TRUE; // mouse button down
+ mouseBtDn = true; // mouse button down
int item = itemAtPos( e->pos() );
if ( item == actItem && popupvisible )
toggleclose = 1;
@@ -1222,10 +1222,10 @@ void TQMenuBar::mousePressEvent( TQMouseEvent *e )
// itemviews to redraw their selections
if ( mi && mi->popup() )
TQFocusEvent::setReason( TQFocusEvent::Popup );
- setAltMode( TRUE );
+ setAltMode( true );
TQFocusEvent::setReason( oldReason );
}
- setActiveItem( item, TRUE, FALSE );
+ setActiveItem( item, true, false );
}
@@ -1238,7 +1238,7 @@ void TQMenuBar::mouseReleaseEvent( TQMouseEvent *e )
return;
if ( !mouseBtDn )
return;
- mouseBtDn = FALSE; // mouse button up
+ mouseBtDn = false; // mouse button up
int item = itemAtPos( e->pos() );
if ( ( item >= 0 && !mitems->at(item)->isEnabledAndVisible() ) ||
( actItem >= 0 && !mitems->at(actItem)->isEnabledAndVisible() ) ) {
@@ -1246,13 +1246,13 @@ void TQMenuBar::mouseReleaseEvent( TQMouseEvent *e )
setActiveItem( -1 );
return;
}
- bool showMenu = TRUE;
+ bool showMenu = true;
if ( toggleclose &&
// pressing an item twice closes in windows, but not in motif :/
style().styleHint(TQStyle::SH_GUIStyle) == WindowsStyle &&
actItem == item ) {
- showMenu = FALSE;
- setAltMode( FALSE );
+ showMenu = false;
+ setAltMode( false );
}
setActiveItem( item, showMenu, !hasMouseTracking() );
toggleclose = 0;
@@ -1273,11 +1273,11 @@ void TQMenuBar::mouseMoveEvent( TQMouseEvent *e )
actItem = -1; // trigger update
}
}
- setActiveItem( item, FALSE, FALSE );
+ setActiveItem( item, false, false );
return;
}
if ( item != actItem && item >= 0 && ( popupvisible || mouseBtDn ) )
- setActiveItem( item, TRUE, FALSE );
+ setActiveItem( item, true, false );
}
@@ -1332,7 +1332,7 @@ void TQMenuBar::keyPressEvent( TQKeyEvent *e )
break;
case Key_Escape:
- setAltMode( FALSE );
+ setAltMode( false );
break;
}
@@ -1411,7 +1411,7 @@ void TQMenuBar::resizeEvent( TQResizeEvent *e )
TQFrame::resizeEvent( e );
if ( badSize )
return;
- badSize = TRUE;
+ badSize = true;
calculateRects();
}
@@ -1441,20 +1441,20 @@ void TQMenuBar::setActiveItem( int i, bool show, bool activate_first_item )
int n = TQMAX( actItem, i );
actItem = i;
if ( irects && n >= 0 )
- repaint( irects[n], FALSE );
+ repaint( irects[n], false );
} else if ( TQABS(i-actItem) == 1 ) {
// two neighbouring items need repainting
int o = actItem;
actItem = i;
if ( irects )
- repaint( irects[i].unite( irects[o] ), FALSE );
+ repaint( irects[i].unite( irects[o] ), false );
} else {
// two non-neighbouring items need repainting
int o = actItem;
actItem = i;
if ( irects ) {
- repaint( irects[o], FALSE );
- repaint( irects[i], FALSE );
+ repaint( irects[o], false );
+ repaint( irects[i], false );
}
}
@@ -1462,7 +1462,7 @@ void TQMenuBar::setActiveItem( int i, bool show, bool activate_first_item )
if ( !popupvisible && actItem >= 0 && irects ) {
TQRect mfrect = irects[actItem];
- setMicroFocusHint( mfrect.x(), mfrect.y(), mfrect.width(), mfrect.height(), FALSE );
+ setMicroFocusHint( mfrect.x(), mfrect.y(), mfrect.width(), mfrect.height(), false );
}
#if defined(QT_ACCESSIBILITY_SUPPORT)
@@ -1480,7 +1480,7 @@ void TQMenuBar::setActiveItem( int i, bool show, bool activate_first_item )
if ( activate_first_item )
popup->setFirstItemActive();
} else { // not a popup
- goodbye( FALSE );
+ goodbye( false );
if ( mi->signal() ) // activate signal
mi->signal()->activate();
emit activated( mi->id() );
@@ -1493,15 +1493,15 @@ void TQMenuBar::setAltMode( bool enable )
#if defined(QT_ACCESSIBILITY_SUPPORT)
if ( inMenu && !enable ) {
TQAccessible::updateAccessibility( this, 0, TQAccessible::MenuEnd );
- inMenu = FALSE;
+ inMenu = false;
} else if ( !inMenu && enable ) {
TQAccessible::updateAccessibility( this, 0, TQAccessible::MenuStart );
- inMenu = TRUE;
+ inMenu = true;
}
#endif
waitforalt = 0;
- actItemDown = FALSE;
+ actItemDown = false;
if ( enable ) {
if ( !TQMenuData::d->aWidget )
TQMenuData::d->aWidget = tqApp->focusWidget();
@@ -1546,7 +1546,7 @@ void TQMenuBar::setupAccelerators()
if ( !autoaccel ) {
autoaccel = new TQAccel( this );
TQ_CHECK_PTR( autoaccel );
- autoaccel->setIgnoreWhatsThis( TRUE );
+ autoaccel->setIgnoreWhatsThis( true );
connect( autoaccel, TQ_SIGNAL(activated(int)),
TQ_SLOT(accelActivated(int)) );
connect( autoaccel, TQ_SIGNAL(activatedAmbiguously(int)),
@@ -1561,7 +1561,7 @@ void TQMenuBar::setupAccelerators()
TQPopupMenu* popup = mi->popup();
popup->updateAccel( this );
if ( !popup->isEnabled() )
- popup->enableAccel( FALSE );
+ popup->enableAccel( false );
}
}
}
@@ -1572,7 +1572,7 @@ void TQMenuBar::setupAccelerators()
*/
bool TQMenuBar::customWhatsThis() const
{
- return TRUE;
+ return true;
}
@@ -1587,7 +1587,7 @@ void TQMenuBar::focusInEvent( TQFocusEvent * )
while ( actItem < 0 && ++i < (int) mitems->count() ) {
TQMenuItem* mi = mitems->at( i );
if ( mi && mi->isEnabledAndVisible() && !mi->isSeparator() )
- setActiveItem( i, FALSE );
+ setActiveItem( i, false );
}
} else if ( !popupvisible ) {
updateItem( idAt( actItem ) );
@@ -1601,7 +1601,7 @@ void TQMenuBar::focusOutEvent( TQFocusEvent * )
{
updateItem( idAt( actItem ) );
if ( !popupvisible )
- setAltMode( FALSE );
+ setAltMode( false );
}
/*!
@@ -1651,7 +1651,7 @@ TQSize TQMenuBar::minimumSizeHint() const
\brief the popup orientation
The default popup orientation. By default, menus pop "down" the
- screen. By setting the property to TRUE, the menu will pop "up".
+ screen. By setting the property to true, the menu will pop "up".
You might call this for menus that are \e below the document to
which they refer.
@@ -1677,7 +1677,7 @@ void TQMenuBar::activateItemAt( int index )
if ( index >= 0 && index < (int) mitems->count() )
setActiveItem( index );
else
- goodbye( FALSE );
+ goodbye( false );
}
#endif // TQT_NO_MENUBAR