diff options
| author | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-12-26 14:08:52 +0900 |
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-12-27 22:38:28 +0900 |
| commit | 50326e196a9245af21604da7dc3a36eea52784ed (patch) | |
| tree | 955f50c739379c59d3846c5c6ec25c8f5856fb91 /src/widgets/tqdockwindow.cpp | |
| parent | 854c5d5c9cfd48a2d5a17366fb6805219eab4859 (diff) | |
| download | tqt-50326e196a9245af21604da7dc3a36eea52784ed.tar.gz tqt-50326e196a9245af21604da7dc3a36eea52784ed.zip | |
Replace TRUE/FALSE with boolean values true/false - part 10
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src/widgets/tqdockwindow.cpp')
| -rw-r--r-- | src/widgets/tqdockwindow.cpp | 158 |
1 files changed, 79 insertions, 79 deletions
diff --git a/src/widgets/tqdockwindow.cpp b/src/widgets/tqdockwindow.cpp index fa20b1745..a0d71ec8c 100644 --- a/src/widgets/tqdockwindow.cpp +++ b/src/widgets/tqdockwindow.cpp @@ -61,9 +61,9 @@ #define MAC_DRAG_HACK #endif #ifdef TQ_WS_MACX -static bool default_opaque = TRUE; +static bool default_opaque = true; #else -static bool default_opaque = FALSE; +static bool default_opaque = false; #endif class TQDockWindowPrivate @@ -103,7 +103,7 @@ private: TQDockWindowResizeHandle::TQDockWindowResizeHandle( TQt::Orientation o, TQWidget *parent, TQDockWindow *w, const char * ) - : TQWidget( parent, "qt_dockwidget_internal" ), mousePressed( FALSE ), unclippedPainter( 0 ), dockWindow( w ) + : TQWidget( parent, "qt_dockwidget_internal" ), mousePressed( false ), unclippedPainter( 0 ), dockWindow( w ) { setOrientation( o ); } @@ -137,7 +137,7 @@ void TQDockWindowResizeHandle::mousePressEvent( TQMouseEvent *e ) if ( e->button() != LeftButton ) return; e->accept(); - mousePressed = TRUE; + mousePressed = true; if ( !dockWindow->opaqueMoving() ) startLineDraw(); lastPos = firstPos = e->globalPos(); @@ -185,7 +185,7 @@ void TQDockWindowResizeHandle::mouseMoveEvent( TQMouseEvent *e ) lastPos = e->globalPos(); if ( dockWindow->opaqueMoving() ) { mouseReleaseEvent( e ); - mousePressed = TRUE; + mousePressed = true; firstPos = e->globalPos(); } if ( !dockWindow->opaqueMoving() ) @@ -237,7 +237,7 @@ void TQDockWindowResizeHandle::mouseReleaseEvent( TQMouseEvent *e ) } TQApplication::postEvent( dockWindow->area(), new TQEvent( TQEvent::LayoutHint ) ); - mousePressed = FALSE; + mousePressed = false; } void TQDockWindowResizeHandle::paintEvent( TQPaintEvent * ) @@ -260,7 +260,7 @@ void TQDockWindowResizeHandle::startLineDraw() int scr = TQApplication::desktop()->screenNumber( this ); TQWidget *paint_on = TQApplication::desktop()->screen( scr ); #endif - unclippedPainter = new TQPainter( paint_on, TRUE ); + unclippedPainter = new TQPainter( paint_on, true ); unclippedPainter->setPen( TQPen( gray, orientation() == Horizontal ? height() : width() ) ); unclippedPainter->setRasterOp( XorROP ); } @@ -388,9 +388,9 @@ private: TQDockWindowHandle::TQDockWindowHandle( TQDockWindow *dw ) : TQWidget( dw, "qt_dockwidget_internal", WNoAutoErase ), dockWindow( dw ), - closeButton( 0 ), opaque( default_opaque ), mousePressed( FALSE ) + closeButton( 0 ), opaque( default_opaque ), mousePressed( false ) { - ctrlDown = FALSE; + ctrlDown = false; timer = new TQTimer( this ); connect( timer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( minimize() ) ); #ifdef TQ_WS_WIN @@ -422,7 +422,7 @@ void TQDockWindowHandle::keyPressEvent( TQKeyEvent *e ) if ( !mousePressed ) return; if ( e->key() == Key_Control ) { - ctrlDown = TRUE; + ctrlDown = true; dockWindow->handleMove( mapFromGlobal(TQCursor::pos()) - offset, TQCursor::pos(), !opaque ); } } @@ -432,7 +432,7 @@ void TQDockWindowHandle::keyReleaseEvent( TQKeyEvent *e ) if ( !mousePressed ) return; if ( e->key() == Key_Control ) { - ctrlDown = FALSE; + ctrlDown = false; dockWindow->handleMove( mapFromGlobal(TQCursor::pos()) - offset, TQCursor::pos(), !opaque ); } } @@ -448,8 +448,8 @@ void TQDockWindowHandle::mousePressEvent( TQMouseEvent *e ) if ( e->button() != LeftButton ) return; e->accept(); - hadDblClick = FALSE; - mousePressed = TRUE; + hadDblClick = false; + mousePressed = true; offset = e->pos(); dockWindow->startRectDraw( mapToGlobal( e->pos() ), !opaque ); if ( !opaque ) @@ -468,24 +468,24 @@ void TQDockWindowHandle::mouseMoveEvent( TQMouseEvent *e ) void TQDockWindowHandle::mouseReleaseEvent( TQMouseEvent *e ) { - ctrlDown = FALSE; + ctrlDown = false; tqApp->removeEventFilter( dockWindow ); if ( oldFocus ) oldFocus->setFocus(); if ( !mousePressed ) return; dockWindow->endRectDraw( !opaque ); - mousePressed = FALSE; + mousePressed = false; #ifdef TQ_WS_MAC releaseMouse(); #endif if ( !hadDblClick && offset == e->pos() ) { - timer->start( TQApplication::doubleClickInterval(), TRUE ); + timer->start( TQApplication::doubleClickInterval(), true ); } else if ( !hadDblClick ) { dockWindow->updatePosition( e->globalPos() ); } if ( opaque ) - dockWindow->titleBar->mousePressed = FALSE; + dockWindow->titleBar->mousePressed = false; } void TQDockWindowHandle::minimize() @@ -567,16 +567,16 @@ void TQDockWindowHandle::mouseDoubleClickEvent( TQMouseEvent *e ) e->accept(); timer->stop(); emit doubleClicked(); - hadDblClick = TRUE; + hadDblClick = true; } TQDockWindowTitleBar::TQDockWindowTitleBar( TQDockWindow *dw ) : TQTitleBar( 0, dw, "qt_dockwidget_internal" ), dockWindow( dw ), - mousePressed( FALSE ), hadDblClick( FALSE ), opaque( default_opaque ) + mousePressed( false ), hadDblClick( false ), opaque( default_opaque ) { setWFlags( getWFlags() | WStyle_Tool ); - ctrlDown = FALSE; - setMouseTracking( TRUE ); + ctrlDown = false; + setMouseTracking( true ); setFixedHeight( style().pixelMetric( TQStyle::PM_TitleBarHeight, this ) ); connect( this, TQ_SIGNAL(doClose()), dockWindow, TQ_SLOT(hide()) ); } @@ -586,7 +586,7 @@ void TQDockWindowTitleBar::keyPressEvent( TQKeyEvent *e ) if ( !mousePressed ) return; if ( e->key() == Key_Control ) { - ctrlDown = TRUE; + ctrlDown = true; dockWindow->handleMove( mapFromGlobal( TQCursor::pos() ) - offset, TQCursor::pos(), !opaque ); } } @@ -596,7 +596,7 @@ void TQDockWindowTitleBar::keyReleaseEvent( TQKeyEvent *e ) if ( !mousePressed ) return; if ( e->key() == Key_Control ) { - ctrlDown = FALSE; + ctrlDown = false; dockWindow->handleMove( mapFromGlobal( TQCursor::pos() ) - offset, TQCursor::pos(), !opaque ); } } @@ -625,8 +625,8 @@ void TQDockWindowTitleBar::mousePressEvent( TQMouseEvent *e ) e->accept(); bool oldPressed = mousePressed; - mousePressed = TRUE; - hadDblClick = FALSE; + mousePressed = true; + hadDblClick = false; offset = e->pos(); dockWindow->startRectDraw( mapToGlobal( e->pos() ), !opaque ); // grabMouse resets the Windows mouse press count, so we never receive a double click on Windows @@ -658,7 +658,7 @@ void TQDockWindowTitleBar::mouseReleaseEvent( TQMouseEvent *e ) return; } - ctrlDown = FALSE; + ctrlDown = false; tqApp->removeEventFilter( dockWindow ); if ( oldFocus ) oldFocus->setFocus(); @@ -671,12 +671,12 @@ void TQDockWindowTitleBar::mouseReleaseEvent( TQMouseEvent *e ) if ( !mousePressed ) return; dockWindow->endRectDraw( !opaque ); - mousePressed = FALSE; + mousePressed = false; if ( !hadDblClick ) dockWindow->updatePosition( e->globalPos() ); if ( opaque ) { - dockWindow->horHandle->mousePressed = FALSE; - dockWindow->verHandle->mousePressed = FALSE; + dockWindow->horHandle->mousePressed = false; + dockWindow->verHandle->mousePressed = false; } } @@ -698,7 +698,7 @@ void TQDockWindowTitleBar::updateGui() void TQDockWindowTitleBar::mouseDoubleClickEvent( TQMouseEvent * ) { emit doubleClicked(); - hadDblClick = TRUE; + hadDblClick = true; } /*! @@ -876,7 +876,7 @@ void TQDockWindowTitleBar::mouseDoubleClickEvent( TQMouseEvent * ) \fn void TQDockWindow::visibilityChanged( bool visible ) This signal is emitted when the visibility of the dock window - relatively to its dock area is changed. If \a visible is TRUE, the + relatively to its dock area is changed. If \a visible is true, the TQDockWindow is now visible to the dock area, otherwise it has been hidden. @@ -914,7 +914,7 @@ TQDockWindow::TQDockWindow( TQWidget* parent, const char* name, WFlags f ) : TQFrame( parent, name, f | WType_Dialog | WStyle_Customize | WStyle_NoBorder ) { curPlace = InDock; - isToolbar = FALSE; + isToolbar = false; init(); } @@ -939,7 +939,7 @@ TQDockWindow::TQDockWindow( Place p, TQWidget *parent, const char *name, WFlags : TQFrame( parent, name, f | WType_Dialog | WStyle_Customize | WStyle_NoBorder ) { curPlace = p; - isToolbar = FALSE; + isToolbar = false; init(); } @@ -972,9 +972,9 @@ void TQDockWindow::init() unclippedPainter = 0; dockArea = 0; tmpDockArea = 0; - resizeEnabled = FALSE; - moveEnabled = TRUE; - nl = FALSE; + resizeEnabled = false; + moveEnabled = true; + nl = false; opaque = default_opaque; cMode = Never; offs = 0; @@ -984,7 +984,7 @@ void TQDockWindow::init() lastSize = TQSize( -1, -1 ); widgetResizeHandler = new TQWidgetResizeHandler( this ); - widgetResizeHandler->setMovingEnabled( FALSE ); + widgetResizeHandler->setMovingEnabled( false ); titleBar = new TQDockWindowTitleBar( this ); verHandle = new TQDockWindowHandle( this ); @@ -1059,8 +1059,8 @@ void TQDockWindow::init() } updateGui(); - stretchable[ Horizontal ] = FALSE; - stretchable[ Vertical ] = FALSE; + stretchable[ Horizontal ] = false; + stretchable[ Vertical ] = false; connect( titleBar, TQ_SIGNAL( doubleClicked() ), this, TQ_SLOT( dock() ) ); connect( verHandle, TQ_SIGNAL( doubleClicked() ), this, TQ_SLOT( undock() ) ); @@ -1119,7 +1119,7 @@ TQDockWindow::~TQDockWindow() { tqApp->removeEventFilter( this ); if ( area() ) - area()->removeDockWindow( this, FALSE, FALSE ); + area()->removeDockWindow( this, false, false ); TQDockArea *a = area(); if ( !a && dockWindowData ) a = ( (TQDockArea::DockWindowData*)dockWindowData )->area; @@ -1158,7 +1158,7 @@ void TQDockWindow::swapRect( TQRect &r, TQt::Orientation o, const TQPoint &offse TQWidget *TQDockWindow::areaAt( const TQPoint &gp ) { - TQWidget *w = tqApp->widgetAt( gp, TRUE ); + TQWidget *w = tqApp->widgetAt( gp, true ); if ( w && ( w == this || w == titleBar ) && parentWidget() ) w = parentWidget()->childAt( parentWidget()->mapFromGlobal( gp ) ); @@ -1175,7 +1175,7 @@ TQWidget *TQDockWindow::areaAt( const TQPoint &gp ) if ( a && a->isDockWindowAccepted( this ) ) return a; } - w = w->parentWidget( TRUE ); + w = w->parentWidget( true ); } return 0; } @@ -1273,8 +1273,8 @@ void TQDockWindow::updateGui() verHandle->hide(); #ifdef TQ_WS_MAC if(horHandle->mousePressed) { - horHandle->mousePressed = FALSE; - verHandle->mousePressed = TRUE; + horHandle->mousePressed = false; + verHandle->mousePressed = true; verHandle->grabMouse(); } #endif @@ -1287,8 +1287,8 @@ void TQDockWindow::updateGui() horHandle->updateGui(); #ifdef TQ_WS_MAC if(verHandle->mousePressed) { - verHandle->mousePressed = FALSE; - horHandle->mousePressed = TRUE; + verHandle->mousePressed = false; + horHandle->mousePressed = true; horHandle->grabMouse(); } #endif @@ -1350,7 +1350,7 @@ void TQDockWindow::updateGui() #else hbox->setMargin( 2 ); #endif - widgetResizeHandler->setActive( FALSE ); + widgetResizeHandler->setActive( false ); } } @@ -1360,10 +1360,10 @@ void TQDockWindow::updatePosition( const TQPoint &globalPos ) lastSize = size(); bool doAdjustSize = curPlace != state && state == OutsideDock; - bool doUpdate = TRUE; - bool doOrientationChange = TRUE; + bool doUpdate = true; + bool doOrientationChange = true; if ( state != curPlace && state == InDock ) { - doUpdate = FALSE; + doUpdate = false; curPlace = state; updateGui(); TQApplication::sendPostedEvents(); @@ -1372,22 +1372,22 @@ void TQDockWindow::updatePosition( const TQPoint &globalPos ) if ( state == InDock ) { if ( tmpDockArea ) { - bool differentDocks = FALSE; + bool differentDocks = false; if ( dockArea && dockArea != tmpDockArea ) { - differentDocks = TRUE; + differentDocks = true; delete (TQDockArea::DockWindowData*)dockWindowData; dockWindowData = dockArea->dockWindowData( this ); - dockArea->removeDockWindow( this, FALSE, FALSE ); + dockArea->removeDockWindow( this, false, false ); } dockArea = tmpDockArea; if ( differentDocks ) { if ( doUpdate ) { - doUpdate = FALSE; + doUpdate = false; curPlace = state; updateGui(); } emit orientationChanged( tmpDockArea->orientation() ); - doOrientationChange = FALSE; + doOrientationChange = false; } else { updateGui(); } @@ -1402,7 +1402,7 @@ void TQDockWindow::updatePosition( const TQPoint &globalPos ) return; delete (TQDockArea::DockWindowData*)dockWindowData; dockWindowData = dockArea->dockWindowData( this ); - dockArea->removeDockWindow( this, TRUE, + dockArea->removeDockWindow( this, true, startOrientation != Horizontal && ::tqt_cast<TQToolBar*>(this) ); } dockArea = 0; @@ -1479,7 +1479,7 @@ void TQDockWindow::startRectDraw( const TQPoint &so, bool drawRect ) int scr = TQApplication::desktop()->screenNumber( this ); TQWidget *paint_on = TQApplication::desktop()->screen( scr ); #endif - unclippedPainter = new TQPainter( paint_on, TRUE ); + unclippedPainter = new TQPainter( paint_on, true ); unclippedPainter->setPen( TQPen( gray, curPlace == OutsideDock ? 3 : 1 ) ); unclippedPainter->setRasterOp( XorROP ); currRect = TQRect( realWidgetPos( this ), size() ); @@ -1549,9 +1549,9 @@ void TQDockWindow::drawContents( TQPainter *p ) when floating. A dock window is both horizontally and vertically stretchable if - you call setResizeEnabled(TRUE). + you call setResizeEnabled(true). - This property is FALSE by default. + This property is false by default. \sa setVerticallyStretchable() setHorizontallyStretchable() */ @@ -1569,7 +1569,7 @@ void TQDockWindow::setResizeEnabled( bool b ) area, move the dock window to another dock area, or float the dock window. - This property is TRUE by default. + This property is true by default. */ void TQDockWindow::setMovingEnabled( bool b ) @@ -1611,8 +1611,8 @@ void TQDockWindow::setCloseMode( int m ) } /*! - Returns TRUE if the dock window has a close button; otherwise - returns FALSE. The result depends on the dock window's \l Place + Returns true if the dock window has a close button; otherwise + returns false. The result depends on the dock window's \l Place and its \l CloseMode. \sa setCloseMode() @@ -1634,11 +1634,11 @@ int TQDockWindow::closeMode() const \brief whether the dock window is horizontally stretchable. A dock window is horizontally stretchable if you call - setHorizontallyStretchable(TRUE) or setResizeEnabled(TRUE). + setHorizontallyStretchable(true) or setResizeEnabled(true). \sa setResizeEnabled() - \bug Strecthability is broken. You must call setResizeEnabled(TRUE) to get + \bug Strecthability is broken. You must call setResizeEnabled(true) to get proper behavior and even then TQDockWindow does not limit stretchablilty. */ @@ -1652,11 +1652,11 @@ void TQDockWindow::setHorizontallyStretchable( bool b ) \brief whether the dock window is vertically stretchable. A dock window is vertically stretchable if you call - setVerticallyStretchable(TRUE) or setResizeEnabled(TRUE). + setVerticallyStretchable(true) or setResizeEnabled(true). \sa setResizeEnabled() - \bug Strecthability is broken. You must call setResizeEnabled(TRUE) to get + \bug Strecthability is broken. You must call setResizeEnabled(true) to get proper behavior and even then TQDockWindow does not limit stretchablilty. */ @@ -1685,7 +1685,7 @@ bool TQDockWindow::isVerticallyStretchable() const \sa setResizeEnabled() - \bug Strecthability is broken. You must call setResizeEnabled(TRUE) to get + \bug Strecthability is broken. You must call setResizeEnabled(true) to get proper behavior and even then TQDockWindow does not limit stretchablilty. */ @@ -1771,7 +1771,7 @@ void TQDockWindow::setFixedExtentHeight( int h ) \brief whether the dock window prefers to start a new line in the dock area. - The default is FALSE, i.e. the dock window doesn't require a new + The default is false, i.e. the dock window doesn't require a new line in the dock area. */ @@ -1873,7 +1873,7 @@ void TQDockWindow::undock( TQWidget *w ) if ( dockArea ) { delete (TQDockArea::DockWindowData*)dockWindowData; dockWindowData = dockArea->dockWindowData( this ); - dockArea->removeDockWindow( this, TRUE, orientation() != Horizontal && ::tqt_cast<TQToolBar*>(this) ); + dockArea->removeDockWindow( this, true, orientation() != Horizontal && ::tqt_cast<TQToolBar*>(this) ); } dockArea = 0; if ( lastPos != TQPoint( -1, -1 ) && lastPos.x() > 0 && lastPos.y() > 0 ) @@ -1895,7 +1895,7 @@ void TQDockWindow::undock( TQWidget *w ) show(); } } else { - reparent( w, 0, TQPoint( 0, 0 ), FALSE ); + reparent( w, 0, TQPoint( 0, 0 ), false ); move( -width() - 5, -height() - 5 ); resize( 1, 1 ); show(); @@ -1919,7 +1919,7 @@ void TQDockWindow::undock( TQWidget *w ) void TQDockWindow::removeFromDock( bool fixNewLines ) { if ( dockArea ) - dockArea->removeDockWindow( this, FALSE, FALSE, fixNewLines ); + dockArea->removeDockWindow( this, false, false, fixNewLines ); } /*! @@ -1984,7 +1984,7 @@ void TQDockWindow::showEvent( TQShowEvent *e ) \brief whether the dock window will be shown normally whilst it is being moved. - If this property is FALSE, (the default), the dock window will be + If this property is false, (the default), the dock window will be represented by an outline rectangle whilst it is being moved. \warning Currently opaque moving has some problems and we do not @@ -2048,7 +2048,7 @@ void TQDockWindow::updateSplitterVisibility( bool visible ) bool TQDockWindow::eventFilter( TQObject * o, TQEvent *e ) { if ( !o->isWidgetType() ) - return FALSE; + return false; if ( e->type() == TQEvent::KeyPress && ( horHandle->mousePressed || @@ -2058,17 +2058,17 @@ bool TQDockWindow::eventFilter( TQObject * o, TQEvent *e ) if ( ke->key() == Key_Escape ) { horHandle->mousePressed = verHandle->mousePressed = - titleBar->mousePressed = FALSE; + titleBar->mousePressed = false; endRectDraw( !opaque ); tqApp->removeEventFilter( this ); - return TRUE; + return true; } } else if ( ((TQWidget*)o)->topLevelWidget() != this && place() == OutsideDock && isTopLevel() ) { if ( (e->type() == TQEvent::WindowDeactivate || e->type() == TQEvent::WindowActivate ) ) event( e ); } - return FALSE; + return false; } /*! \reimp */ @@ -2078,19 +2078,19 @@ bool TQDockWindow::event( TQEvent *e ) case TQEvent::WindowDeactivate: if ( place() == OutsideDock && isTopLevel() && parentWidget() && parentWidget()->isActiveWindow() ) - return TRUE; + return true; case TQEvent::Hide: if ( !isHidden() ) break; // fall through case TQEvent::HideToParent: - emit visibilityChanged( FALSE ); + emit visibilityChanged( false ); break; case TQEvent::Show: if ( e->spontaneous() ) break; case TQEvent::ShowToParent: - emit visibilityChanged( TRUE ); + emit visibilityChanged( true ); break; default: break; |
