diff options
Diffstat (limited to 'src/kernel/tqaccel.cpp')
| -rw-r--r-- | src/kernel/tqaccel.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/src/kernel/tqaccel.cpp b/src/kernel/tqaccel.cpp index 6569aa8dc..af5b354f5 100644 --- a/src/kernel/tqaccel.cpp +++ b/src/kernel/tqaccel.cpp @@ -142,7 +142,7 @@ struct TQAccelItem { // internal accelerator item TQAccelItem( const TQKeySequence &k, int i ) - { key=k; id=i; enabled=TRUE; signal=0; } + { key=k; id=i; enabled=true; signal=0; } ~TQAccelItem() { delete signal; } int id; TQKeySequence key; @@ -206,15 +206,15 @@ bool TQ_EXPORT tqt_tryComposeUnicode( TQWidget* w, TQKeyEvent* e){ } #ifdef TQ_WS_MAC -static bool qt_accel_no_shortcuts = TRUE; +static bool qt_accel_no_shortcuts = true; #else -static bool qt_accel_no_shortcuts = FALSE; +static bool qt_accel_no_shortcuts = false; #endif void TQ_EXPORT tqt_setAccelAutoShortcuts(bool b) { qt_accel_no_shortcuts = b; } /* \internal - Returns TRUE if the accel is in the current subwindow, else FALSE. + Returns true if the accel is in the current subwindow, else false. */ bool TQAccelManager::correctSubWindow( TQWidget* w, TQAccelPrivate* d ) { #if !defined ( Q_OS_MACX ) @@ -222,7 +222,7 @@ bool TQAccelManager::correctSubWindow( TQWidget* w, TQAccelPrivate* d ) { #else if ( !d->watch || (!d->watch->isVisible() && !d->watch->inherits( "TQMenuBar" )) || !d->watch->isEnabled() ) #endif - return FALSE; + return false; TQWidget* tlw = w->topLevelWidget(); TQWidget* wtlw = d->watch->topLevelWidget(); @@ -233,21 +233,21 @@ bool TQAccelManager::correctSubWindow( TQWidget* w, TQAccelPrivate* d ) { return tlw->parentWidget()->topLevelWidget() == wtlw; if ( wtlw != tlw ) - return FALSE; + return false; #endif /* if we live in a MDI subwindow, ignore the event if we are not the active document window */ TQWidget* sw = d->watch; while ( sw && !sw->testWFlags( WSubWindow ) ) - sw = sw->parentWidget( TRUE ); + sw = sw->parentWidget( true ); if ( sw ) { // we are in a subwindow indeed TQWidget* fw = w; while ( fw && fw != sw ) - fw = fw->parentWidget( TRUE ); + fw = fw->parentWidget( true ); if ( fw != sw ) // focus widget not in our subwindow - return FALSE; + return false; } - return TRUE; + return true; } inline int TQAccelManager::translateModifiers( ButtonState state ) @@ -326,7 +326,7 @@ bool TQAccelManager::tryAccelEvent( TQWidget* w, TQKeyEvent* e ) e->ignore(); TQApplication::sendSpontaneousEvent( w, e ); if ( e->isAccepted() ) - return FALSE; + return false; } e->t = TQEvent::Accel; e->ignore(); @@ -349,7 +349,7 @@ bool TQAccelManager::tryComposeUnicode( TQWidget* w, TQKeyEvent* e ) if ( value >= 0 && value <= 9 ) { TQApplication::composedUnicode *= 10; TQApplication::composedUnicode += value; - return TRUE; + return true; } else { // Composing interrupted, dispatch! if ( TQApplication::composedUnicode ) { @@ -361,7 +361,7 @@ bool TQAccelManager::tryComposeUnicode( TQWidget* w, TQKeyEvent* e ) TQApplication::sendEvent( w, &ker ); } TQApplication::composedUnicode = 0; - return TRUE; + return true; } // Meta compose end, dispatch } else if ( (e->type() == TQEvent::KeyRelease) && @@ -377,10 +377,10 @@ bool TQAccelManager::tryComposeUnicode( TQWidget* w, TQKeyEvent* e ) TQApplication::sendEvent( w, &ker ); } TQApplication::composedUnicode = 0; - return TRUE; + return true; } } - return FALSE; + return false; } /* @@ -399,7 +399,7 @@ bool TQAccelManager::dispatchAccelEvent( TQWidget* w, TQKeyEvent* e ) // Modifiers can NOT be accelerators... if ( e->key() >= Key_Shift && e->key() <= Key_Alt ) - return FALSE; + return false; SequenceMatch result = TQt::NoMatch; TQKeySequence tocheck, partial; @@ -413,11 +413,11 @@ bool TQAccelManager::dispatchAccelEvent( TQWidget* w, TQKeyEvent* e ) TQKeyEvent pe = *e; int n = -1; int hasShift = (e->state()&TQt::ShiftButton)?1:0; - bool identicalDisabled = FALSE; - bool matchFound = FALSE; + bool identicalDisabled = false; + bool matchFound = false; do { accel = accels.first(); - matchFound = FALSE; + matchFound = false; while ( accel ) { if ( correctSubWindow( w, accel ) ) { if ( accel->enabled ) { @@ -432,16 +432,16 @@ bool TQAccelManager::dispatchAccelEvent( TQWidget* w, TQKeyEvent* e ) lastaccel = accel; lastitem = item; n++; - matchFound = TRUE; + matchFound = true; if ( n > TQMAX(clash,0) ) goto doclash; } else { - identicalDisabled = TRUE; + identicalDisabled = true; } } if ( item->enabled && TQt::PartialMatch == result ) { partial = tocheck; - matchFound = TRUE; + matchFound = true; } item = accel->aitems.prev(); } @@ -449,7 +449,7 @@ bool TQAccelManager::dispatchAccelEvent( TQWidget* w, TQKeyEvent* e ) item = accel->aitems.last(); while( item ) { if ( TQt::Identical == match( &pe, item, tocheck ) ) - identicalDisabled = TRUE; + identicalDisabled = true; item = accel->aitems.prev(); } } @@ -497,7 +497,7 @@ bool TQAccelManager::dispatchAccelEvent( TQWidget* w, TQKeyEvent* e ) intermediate = TQKeySequence(); lastaccel->activate( lastitem ); e->accept(); - return TRUE; + return true; } doclash: // found more than one match @@ -531,15 +531,15 @@ bool TQAccelManager::dispatchAccelEvent( TQWidget* w, TQKeyEvent* e ) firstaccel->activateAmbiguously( firstitem ); } e->accept(); - return TRUE; + return true; } TQAccelPrivate::TQAccelPrivate( TQAccel* p ) : parent( p ) { TQAccelManager::self()->registerAccel( this ); - aitems.setAutoDelete( TRUE ); - ignorewhatsthis = FALSE; + aitems.setAutoDelete( true ); + ignorewhatsthis = false; } TQAccelPrivate::~TQAccelPrivate() @@ -572,7 +572,7 @@ TQAccel::TQAccel( TQWidget *parent, const char *name ) : TQObject( parent, name ) { d = new TQAccelPrivate( this ); - d->enabled = TRUE; + d->enabled = true; d->watch = parent; #if defined(QT_CHECK_NULL) if ( !d->watch ) @@ -590,7 +590,7 @@ TQAccel::TQAccel( TQWidget* watch, TQObject *parent, const char *name ) : TQObject( parent, name ) { d = new TQAccelPrivate( this ); - d->enabled = TRUE; + d->enabled = true; d->watch = watch; #if defined(QT_CHECK_NULL) if ( !d->watch ) @@ -628,8 +628,8 @@ TQAccel::~TQAccel() /*! - Returns TRUE if the accelerator is enabled; otherwise returns - FALSE. + Returns true if the accelerator is enabled; otherwise returns + false. \sa setEnabled(), isItemEnabled() */ @@ -641,8 +641,8 @@ bool TQAccel::isEnabled() const /*! - Enables the accelerator if \a enable is TRUE, or disables it if \a - enable is FALSE. + Enables the accelerator if \a enable is true, or disables it if \a + enable is false. Individual keys can also be enabled or disabled using setItemEnabled(). To work, a key must be an enabled item in an @@ -746,8 +746,8 @@ int TQAccel::findKey( const TQKeySequence& key ) const /*! - Returns TRUE if the accelerator item with the identifier \a id is - enabled. Returns FALSE if the item is disabled or cannot be found. + Returns true if the accelerator item with the identifier \a id is + enabled. Returns false if the item is disabled or cannot be found. \sa setItemEnabled(), isEnabled() */ @@ -755,13 +755,13 @@ int TQAccel::findKey( const TQKeySequence& key ) const bool TQAccel::isItemEnabled( int id ) const { TQAccelItem *item = find_id( d->aitems, id); - return item ? item->enabled : FALSE; + return item ? item->enabled : false; } /*! Enables the accelerator item with the identifier \a id if \a - enable is TRUE, and disables item \a id if \a enable is FALSE. + enable is true, and disables item \a id if \a enable is false. To work, an item must be enabled and be in an enabled TQAccel. @@ -806,7 +806,7 @@ bool TQAccel::connectItem( int id, const TQObject *receiver, const char *member } return item->signal->connect( receiver, member ); } - return FALSE; + return false; } /*! @@ -822,7 +822,7 @@ bool TQAccel::disconnectItem( int id, const TQObject *receiver, TQAccelItem *item = find_id( d->aitems, id); if ( item && item->signal ) return item->signal->disconnect( receiver, member ); - return FALSE; + return false; } void TQAccelPrivate::activate( TQAccelItem* item ) @@ -1085,5 +1085,5 @@ to help. Ask them for ISBN 1859121047. /*! \obsolete serves no purpose anymore */ void TQAccel::repairEventFilter() {} /*! \obsolete serves no purpose anymore */ -bool TQAccel::eventFilter( TQObject *, TQEvent * ) { return FALSE; } +bool TQAccel::eventFilter( TQObject *, TQEvent * ) { return false; } #endif // TQT_NO_ACCEL |
