diff options
Diffstat (limited to 'examples/tetrix/tqdragapp.cpp')
-rw-r--r-- | examples/tetrix/tqdragapp.cpp | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/examples/tetrix/tqdragapp.cpp b/examples/tetrix/tqdragapp.cpp index b726155d5..6c100ab79 100644 --- a/examples/tetrix/tqdragapp.cpp +++ b/examples/tetrix/tqdragapp.cpp @@ -110,7 +110,7 @@ bool TQDragApplication::notify( TQObject *o, TQEvent *e ) if ( dragger && !dragger->notify( o, e ) ) return TQApplication::notify( o, e ); else - return FALSE; + return false; } void DropWindow::paintEvent( TQPaintEvent * ) @@ -131,10 +131,10 @@ void DropWindow::closeEvent( TQCloseEvent *e ) TQDragger::TQDragger() { dragInfo.w = 0; - killingDrop = FALSE; - sendingChild = FALSE; - draggedDict.setAutoDelete( TRUE ); - dropDict .setAutoDelete( TRUE ); + killingDrop = false; + sendingChild = false; + draggedDict.setAutoDelete( true ); + dropDict .setAutoDelete( true ); menu = new TQPopupMenu; menu->insertItem( "Open drop window", 1 ); @@ -160,7 +160,7 @@ TQDragger::~TQDragger() bool TQDragger::notify( TQObject *o, TQEvent *e ) { if ( !o->isWidgetType() || o == menu ) - return FALSE; + return false; switch( e->type() ) { case TQEvent::MouseMove: { @@ -189,7 +189,7 @@ bool TQDragger::notify( TQObject *o, TQEvent *e ) default: break; } - return FALSE; + return false; } bool TQDragger::isParentToDragged( TQWidget *w ) @@ -200,24 +200,24 @@ bool TQDragger::isParentToDragged( TQWidget *w ) while( (tmp = iter.current()) ) { ++iter; if ( tmp->mother == w ) - return TRUE; + return true; } - return FALSE; + return false; } bool TQDragger::noWidgets( TQWidget *w ) { const TQObjectList *l = w->children(); if ( !l ) - return TRUE; + return true; TQObjectListIt iter( *l ); TQObject *tmp; while( (tmp = iter.current()) ) { ++iter; if ( tmp->isWidgetType() ) - return FALSE; + return false; } - return TRUE; + return true; } void TQDragger::sendAllChildrenHome( TQWidget *w ) @@ -248,7 +248,7 @@ bool TQDragger::dragEvent( TQWidget *w, TQMouseEvent *e ) w->parentWidget() == 0 ) { // is top level window hostWidget = w; menu->popup( w->mapToGlobal( e->pos() ) ); - return TRUE; + return true; } if ( !draggedDict.find( (long) w ) ) { DraggedInfo *tmp = new DraggedInfo; @@ -265,9 +265,9 @@ bool TQDragger::dragEvent( TQWidget *w, TQMouseEvent *e ) clickOffset = e->pos(); dragInfo.w = w; TQPoint p = w->mapToGlobal(TQPoint(0,0)); - w->reparent( 0, WType_Popup, p, TRUE ); + w->reparent( 0, WType_Popup, p, true ); - return TRUE; + return true; } case TQEvent::MouseButtonRelease: case TQEvent::MouseMove: { @@ -275,12 +275,12 @@ bool TQDragger::dragEvent( TQWidget *w, TQMouseEvent *e ) TQPoint p = TQCursor::pos() - clickOffset; dragInfo.w->move( p ); if ( e->type() == TQEvent::MouseMove ) - return TRUE; + return true; } else { - return FALSE; + return false; } if ( !dragInfo.w ) - return FALSE; + return false; if ( w != dragInfo.w ) w = dragInfo.w; dragInfo.w = 0; @@ -291,12 +291,12 @@ bool TQDragger::dragEvent( TQWidget *w, TQMouseEvent *e ) TQPoint p; if ( !target ) { target = openDropWindow( TQRect( pos, w->size() ), - FALSE); + false); p = TQPoint( 0, 0 ); } else p = target->mapFromGlobal( pos ); - w->reparent( target, 0, p, TRUE ); + w->reparent( target, 0, p, true ); DropInfo *tmp = dropDict.find( (long) dragInfo.mother ); if ( tmp ) { if ( !tmp->userOpened && noWidgets( tmp->w ) ) @@ -305,9 +305,9 @@ bool TQDragger::dragEvent( TQWidget *w, TQMouseEvent *e ) if ( !target->isVisible() ) target->show(); } - return TRUE; + return true; default: - return FALSE; + return false; } } @@ -317,7 +317,7 @@ bool TQDragger::killDropEvent( TQMouseEvent *e ) case TQEvent::MouseButtonDblClick: case TQEvent::MouseButtonPress: clickedWidget = cursorWidget(); - return TRUE; + return true; case TQEvent::MouseButtonRelease: hostWidget->releaseMouse(); if ( clickedWidget ) { @@ -328,13 +328,13 @@ bool TQDragger::killDropEvent( TQMouseEvent *e ) } } grabFinished(); - return TRUE; + return true; case TQEvent::MouseMove: - return TRUE; + return true; default: break; } - return FALSE; + return false; } bool TQDragger::sendChildEvent( TQMouseEvent *e ) @@ -343,7 +343,7 @@ bool TQDragger::sendChildEvent( TQMouseEvent *e ) case TQEvent::MouseButtonDblClick: case TQEvent::MouseButtonPress: clickedWidget = cursorWidget(); - return TRUE; + return true; case TQEvent::MouseButtonRelease: hostWidget->releaseMouse(); if ( clickedWidget ) { @@ -359,30 +359,30 @@ bool TQDragger::sendChildEvent( TQMouseEvent *e ) } grabFinished(); } - return TRUE; + return true; case TQEvent::MouseMove: - return TRUE; + return true; default: break; } - return FALSE; + return false; } bool TQDragger::startGrab() { if ( !hostWidget ) - return FALSE; + return false; clickedWidget = 0; cursor = hostWidget->cursor(); hostWidget->grabMouse(); hostWidget->setCursor( TQCursor( CrossCursor ) ); - return TRUE; + return true; } void TQDragger::grabFinished() { - killingDrop = FALSE; - sendingChild = FALSE; + killingDrop = false; + sendingChild = false; if(hostWidget) hostWidget->setCursor( cursor ); } @@ -396,7 +396,7 @@ void TQDragger::closeDropWindow( DropWindow *w ) void TQDragger::openDropWindow() { - TQWidget *tmp = openDropWindow( TQRect(100, 100, 300, 200), TRUE ); + TQWidget *tmp = openDropWindow( TQRect(100, 100, 300, 200), true ); tmp->show(); } @@ -405,10 +405,10 @@ TQWidget *TQDragger::openDropWindow( const TQRect &r, bool user ) DropInfo *tmp = new DropInfo; DropWindow *w = new DropWindow; if ( user ) { - tmp->userOpened = TRUE; + tmp->userOpened = true; w->setCaption( "Drop window" ); } else { - tmp->userOpened = FALSE; + tmp->userOpened = false; w->setCaption( "Auto drop window" ); } tmp->w = w; @@ -422,7 +422,7 @@ TQWidget *TQDragger::openDropWindow( const TQRect &r, bool user ) void TQDragger::killDropWindow() { if ( startGrab() ) - killingDrop = TRUE; + killingDrop = true; } void TQDragger::killDropWindow( DropInfo *di ) @@ -447,7 +447,7 @@ void TQDragger::killDropWindow( DropInfo *di ) void TQDragger::killAllDropWindows() { - killAllDropWindows( FALSE ); + killAllDropWindows( false ); } void TQDragger::killAllDropWindows( bool autoOnly ) @@ -466,13 +466,13 @@ void TQDragger::killAllDropWindows( bool autoOnly ) void TQDragger::sendChildHome( DraggedInfo *i ) { - i->w->reparent( i->mother, 0, i->pos, TRUE ); + i->w->reparent( i->mother, 0, i->pos, true ); } void TQDragger::sendChildHome() { if ( startGrab() ) - sendingChild = TRUE; + sendingChild = true; } void TQDragger::sendAllChildrenHome() @@ -485,7 +485,7 @@ void TQDragger::sendAllChildrenHome() sendChildHome( tmp ); draggedDict.remove( (long) tmp->w ); } - killAllDropWindows( TRUE ); + killAllDropWindows( true ); draggedDict.clear(); } |