diff options
Diffstat (limited to 'arts/builder/qttableview.cpp')
-rw-r--r-- | arts/builder/qttableview.cpp | 128 |
1 files changed, 64 insertions, 64 deletions
diff --git a/arts/builder/qttableview.cpp b/arts/builder/qttableview.cpp index 36236fe3..827b96d2 100644 --- a/arts/builder/qttableview.cpp +++ b/arts/builder/qttableview.cpp @@ -108,7 +108,7 @@ void TQCornerSquare::paintEvent( TQPaintEvent * ) \warning the functions setNumRows(), setNumCols(), setCellHeight(), setCellWidth(), setTableFlags() and clearTableFlags() may cause virtual functions such as cellWidth() and cellHeight() to be called, - even if autoUpdate() is FALSE. This may cause errors if relevant + even if autoUpdate() is false. This may cause errors if relevant state variables are not initialized. \warning Experience has shown that use of this widget tends to cause @@ -215,7 +215,7 @@ void QtTableView::show() Repaints the table view directly by calling paintEvent() directly unless updates are disabled. - Erases the view area \a (x,y,w,h) if \a erase is TRUE. Parameters \a + Erases the view area \a (x,y,w,h) if \a erase is true. Parameters \a (x,y) are in \e widget coordinates. If \a w is negative, it is replaced with <code>width() - x</code>. @@ -250,7 +250,7 @@ void QtTableView::repaint( int x, int y, int w, int h, bool erase ) /*! \overload void QtTableView::repaint( const TQRect &r, bool erase ) - Replaints rectangle \a r. If \a erase is TRUE draws the background + Repaints rectangle \a r. If \a erase is true draws the background using the palette's background. */ @@ -464,7 +464,7 @@ void QtTableView::setYOffset( int y ) in the view. Parameters \a (x,y) are in \e table coordinates. The interaction with \link setTableFlags() Tbl_snapTo*Grid \endlink - is tricky. If \a updateScrBars is TRUE, the scroll bars are + is tricky. If \a updateScrBars is true, the scroll bars are updated. \sa xOffset(), yOffset(), setXOffset(), setYOffset(), setTopLeftCell() @@ -707,8 +707,8 @@ int QtTableView::totalHeight() /*! \fn bool QtTableView::testTableFlags( uint f ) const - Returns TRUE if any of the table flags in \a f are currently set, - otherwise FALSE. + Returns true if any of the table flags in \a f are currently set, + otherwise false. \sa setTableFlags(), clearTableFlags(), tableFlags() */ @@ -717,7 +717,7 @@ int QtTableView::totalHeight() Sets the table flags to \a f. If a flag setting changes the appearance of the table, the table is - repainted if - and only if - autoUpdate() is TRUE. + repainted if - and only if - autoUpdate() is true. The table flags are mostly single bits, though there are some multibit flags for convenience. Here is a complete list: @@ -784,15 +784,15 @@ void QtTableView::setTableFlags( uint f ) tFlags |= f; bool updateOn = autoUpdate(); - setAutoUpdate( FALSE ); + setAutoUpdate( false ); uint repaintMask = Tbl_cutCellsV | Tbl_cutCellsH; if ( f & Tbl_vScrollBar ) { - setVerScrollBar( TRUE ); + setVerScrollBar( true ); } if ( f & Tbl_hScrollBar ) { - setHorScrollBar( TRUE ); + setHorScrollBar( true ); } if ( f & Tbl_autoVScrollBar ) { updateScrollBars( verRange ); @@ -822,7 +822,7 @@ void QtTableView::setTableFlags( uint f ) } if ( updateOn ) { - setAutoUpdate( TRUE ); + setAutoUpdate( true ); updateScrollBars(); if ( isVisible() && (f & repaintMask) ) repaint(); @@ -850,15 +850,15 @@ void QtTableView::clearTableFlags( uint f ) tFlags &= ~f; bool updateOn = autoUpdate(); - setAutoUpdate( FALSE ); + setAutoUpdate( false ); uint repaintMask = Tbl_cutCellsV | Tbl_cutCellsH; if ( f & Tbl_vScrollBar ) { - setVerScrollBar( FALSE ); + setVerScrollBar( false ); } if ( f & Tbl_hScrollBar ) { - setHorScrollBar( FALSE ); + setHorScrollBar( false ); } if ( f & Tbl_scrollLastHCell ) { int maxX = maxXOffset(); @@ -891,7 +891,7 @@ void QtTableView::clearTableFlags( uint f ) updateScrollBars( verRange ); } if ( updateOn ) { - setAutoUpdate( TRUE ); + setAutoUpdate( true ); updateScrollBars(); // returns immediately if nothing to do if ( isVisible() && (f & repaintMask) ) repaint(); @@ -903,7 +903,7 @@ void QtTableView::clearTableFlags( uint f ) /*! \fn bool QtTableView::autoUpdate() const - Returns TRUE if the view updates itself automatically whenever it + Returns true if the view updates itself automatically whenever it is changed in some way. \sa setAutoUpdate() @@ -912,11 +912,11 @@ void QtTableView::clearTableFlags( uint f ) /*! Sets the auto-update option of the table view to \a enable. - If \a enable is TRUE (this is the default), the view updates itself + If \a enable is true (this is the default), the view updates itself automatically whenever it has changed in some way (for example, when a \link setTableFlags() flag\endlink is changed). - If \a enable is FALSE, the view does NOT repaint itself or update + If \a enable is false, the view does NOT repaint itself or update its internal state variables when it is changed. This can be useful to avoid flicker during large changes and is singularly useless otherwise. Disable auto-update, do the changes, re-enable @@ -926,7 +926,7 @@ void QtTableView::clearTableFlags( uint f ) (i.e., between events). If, for example, the user interacts with the view when auto-update is off, strange things can happen. - Setting auto-update to TRUE does not repaint the view; you must call + Setting auto-update to true does not repaint the view; you must call repaint() to do this. \sa autoUpdate(), repaint() @@ -947,7 +947,7 @@ void QtTableView::setAutoUpdate( bool enable ) /*! Repaints the cell at row \a row, column \a col if it is inside the view. - If \a erase is TRUE, the relevant part of the view is cleared to the + If \a erase is true, the relevant part of the view is cleared to the background color/pixmap before the contents are repainted. \sa isVisible() @@ -1043,7 +1043,7 @@ int QtTableView::lastColVisible() const } /*! - Returns TRUE if \a row is at least partially visible. + Returns true if \a row is at least partially visible. \sa colIsVisible() */ @@ -1053,7 +1053,7 @@ bool QtTableView::rowIsVisible( int row ) const } /*! - Returns TRUE if \a col is at least partially visible. + Returns true if \a col is at least partially visible. \sa rowIsVisible() */ @@ -1093,10 +1093,10 @@ void QtTableView::coverCornerSquare( bool enable ) \internal Scroll the view to a position such that: - If \a horizontal is TRUE, the leftmost column shown fits snugly + If \a horizontal is true, the leftmost column shown fits snugly with the left edge of the view. - If \a vertical is TRUE, the top row shown fits snugly with the top + If \a vertical is true, the top row shown fits snugly with the top of the view. You can achieve the same effect automatically by setting any of the @@ -1142,7 +1142,7 @@ void QtTableView::horSbValue( int val ) tFlags |= Tbl_snapToHGrid; } } - setOffset( val, yOffs, FALSE ); + setOffset( val, yOffs, false ); } /*! @@ -1158,10 +1158,10 @@ void QtTableView::horSbSliding( int val ) if ( testTableFlags(Tbl_snapToHGrid) && testTableFlags(Tbl_smoothHScrolling) ) { tFlags &= ~Tbl_snapToHGrid; // turn off snapping while sliding - setOffset( val, yOffs, FALSE ); + setOffset( val, yOffs, false ); tFlags |= Tbl_snapToHGrid; // turn on snapping again } else { - setOffset( val, yOffs, FALSE ); + setOffset( val, yOffs, false ); } } @@ -1175,7 +1175,7 @@ void QtTableView::horSbSlidingDone( ) { if ( testTableFlags(Tbl_snapToHGrid) && testTableFlags(Tbl_smoothHScrolling) ) - snapToGrid( TRUE, FALSE ); + snapToGrid( true, false ); } /*! @@ -1196,7 +1196,7 @@ void QtTableView::verSbValue( int val ) tFlags |= Tbl_snapToVGrid; } } - setOffset( xOffs, val, FALSE ); + setOffset( xOffs, val, false ); } /*! @@ -1212,10 +1212,10 @@ void QtTableView::verSbSliding( int val ) if ( testTableFlags(Tbl_snapToVGrid) && testTableFlags(Tbl_smoothVScrolling) ) { tFlags &= ~Tbl_snapToVGrid; // turn off snapping while sliding - setOffset( xOffs, val, FALSE ); + setOffset( xOffs, val, false ); tFlags |= Tbl_snapToVGrid; // turn on snapping again } else { - setOffset( xOffs, val, FALSE ); + setOffset( xOffs, val, false ); } } @@ -1229,7 +1229,7 @@ void QtTableView::verSbSlidingDone( ) { if ( testTableFlags(Tbl_snapToVGrid) && testTableFlags(Tbl_smoothVScrolling) ) - snapToGrid( FALSE, TRUE ); + snapToGrid( false, true ); } @@ -1280,7 +1280,7 @@ void QtTableView::paintEvent( TQPaintEvent *e ) TQPainter paint( this ); - if ( !contentsRect().contains( updateR, TRUE ) ) {// update frame ? + if ( !contentsRect().contains( updateR, true ) ) {// update frame ? drawFrame( &paint ); if ( updateR.left() < frameWidth() ) //### updateR.setLeft( frameWidth() ); @@ -1346,7 +1346,7 @@ void QtTableView::paintEvent( TQPaintEvent *e ) frameWidth() > 0 && !winR.contains( cellR ) ) { //##arnt paint.setClipRect( cellUR ); paintCell( &paint, row, col ); - paint.setClipping( FALSE ); + paint.setClipping( false ); } else { paintCell( &paint, row, col ); } @@ -1358,7 +1358,7 @@ void QtTableView::paintEvent( TQPaintEvent *e ) frameWidth() > 0 && !winR.contains( cellR ) ) { //##arnt paint.setClipRect( cellUR ); paintCell( &paint, row, col ); - paint.setClipping( FALSE ); + paint.setClipping( false ); } else { paintCell( &paint, row, col ); } @@ -1379,7 +1379,7 @@ void QtTableView::paintEvent( TQPaintEvent *e ) // Note that this needs to be done regardless whether we do // eraseInPaint or not. Reason: a subclass may implement - // flicker-freeness and encourage the use of repaint(FALSE). + // flicker-freeness and encourage the use of repaint(false). // The subclass, however, cannot draw all pixels, just those // inside the cells. So QtTableView is reponsible for all pixels // outside the cells. @@ -1445,7 +1445,7 @@ TQScrollBar *QtTableView::verticalScrollBar() const #endif sb->resize( sb->sizeHint() ); // height is irrelevant TQ_CHECK_PTR(sb); - sb->setTracking( FALSE ); + sb->setTracking( false ); sb->setFocusPolicy( TQWidget::NoFocus ); connect( sb, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(verSbValue(int))); @@ -1477,7 +1477,7 @@ TQScrollBar *QtTableView::horizontalScrollBar() const sb->resize( sb->sizeHint() ); // width is irrelevant sb->setFocusPolicy( TQWidget::NoFocus ); TQ_CHECK_PTR(sb); - sb->setTracking( FALSE ); + sb->setTracking( false ); connect( sb, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(horSbValue(int))); connect( sb, TQ_SIGNAL(sliderMoved(int)), @@ -1506,14 +1506,14 @@ void QtTableView::setHorScrollBar( bool on, bool update ) else sbDirty = sbDirty | (horMask | verMask); if ( testTableFlags( Tbl_vScrollBar ) ) - coverCornerSquare( TRUE ); + coverCornerSquare( true ); if ( autoUpdate() ) sbDirty = sbDirty | horMask; } else { tFlags &= ~Tbl_hScrollBar; if ( !hScrollBar ) return; - coverCornerSquare( FALSE ); + coverCornerSquare( false ); bool hideScrollBar = autoUpdate() && hScrollBar->isVisible(); if ( hideScrollBar ) hScrollBar->hide(); @@ -1545,14 +1545,14 @@ void QtTableView::setVerScrollBar( bool on, bool update ) else sbDirty = sbDirty | (horMask | verMask); if ( testTableFlags( Tbl_hScrollBar ) ) - coverCornerSquare( TRUE ); + coverCornerSquare( true ); if ( autoUpdate() ) sbDirty = sbDirty | verMask; } else { tFlags &= ~Tbl_vScrollBar; if ( !vScrollBar ) return; - coverCornerSquare( FALSE ); + coverCornerSquare( false ); bool hideScrollBar = autoUpdate() && vScrollBar->isVisible(); if ( hideScrollBar ) vScrollBar->hide(); @@ -1707,8 +1707,8 @@ int QtTableView::findCol( int xPos ) const /*! Computes the position in the widget of row \a row. - Returns TRUE and stores the result in \a *yPos (in \e widget - coordinates) if the row is visible. Returns FALSE and does not modify + Returns true and stores the result in \a *yPos (in \e widget + coordinates) if the row is visible. Returns false and does not modify \a *yPos if \a row is invisible or invalid. \sa colXPos(), findRow() @@ -1721,7 +1721,7 @@ bool QtTableView::rowYPos( int row, int *yPos ) const if ( cellH ) { int lastVisible = lastRowVisible(); if ( row > lastVisible || lastVisible == -1 ) - return FALSE; + return false; y = (row - yCellOffs)*cellH + minViewY() - yCellDelta; } else { //##arnt3 @@ -1732,23 +1732,23 @@ bool QtTableView::rowYPos( int row, int *yPos ) const while ( r < row && y <= maxY ) y += tw->cellHeight( r++ ); if ( y > maxY ) - return FALSE; + return false; } } else { - return FALSE; + return false; } if ( yPos ) *yPos = y; - return TRUE; + return true; } /*! Computes the position in the widget of column \a col. - Returns TRUE and stores the result in \a *xPos (in \e widget - coordinates) if the column is visible. Returns FALSE and does not + Returns true and stores the result in \a *xPos (in \e widget + coordinates) if the column is visible. Returns false and does not modify \a *xPos if \a col is invisible or invalid. \sa rowYPos(), findCol() @@ -1761,7 +1761,7 @@ bool QtTableView::colXPos( int col, int *xPos ) const if ( cellW ) { int lastVisible = lastColVisible(); if ( col > lastVisible || lastVisible == -1 ) - return FALSE; + return false; x = (col - xCellOffs)*cellW + minViewX() - xCellDelta; } else { //##arnt3 @@ -1772,14 +1772,14 @@ bool QtTableView::colXPos( int col, int *xPos ) const while ( c < col && x <= maxX ) x += tw->cellWidth( c++ ); if ( x > maxX ) - return FALSE; + return false; } } else { - return FALSE; + return false; } if ( xPos ) *xPos = x; - return TRUE; + return true; } @@ -1908,9 +1908,9 @@ void QtTableView::doAutoScrollBars() w += cellWidth( i++ ); } if ( w > viewW ) - hScrollOn = TRUE; + hScrollOn = true; else - hScrollOn = FALSE; + hScrollOn = false; } if ( testTableFlags(Tbl_autoVScrollBar) ) { @@ -1923,21 +1923,21 @@ void QtTableView::doAutoScrollBars() } if ( h > viewH ) - vScrollOn = TRUE; + vScrollOn = true; else - vScrollOn = FALSE; + vScrollOn = false; } if ( testTableFlags(Tbl_autoHScrollBar) && vScrollOn && !hScrollOn ) if ( w > viewW - VSBEXT ) - hScrollOn = TRUE; + hScrollOn = true; if ( testTableFlags(Tbl_autoVScrollBar) && hScrollOn && !vScrollOn ) if ( h > viewH - HSBEXT ) - vScrollOn = TRUE; + vScrollOn = true; - setHorScrollBar( hScrollOn, FALSE ); - setVerScrollBar( vScrollOn, FALSE ); + setHorScrollBar( hScrollOn, false ); + setVerScrollBar( vScrollOn, false ); updateFrameSize(); } @@ -2259,10 +2259,10 @@ void QtTableView::showOrHideScrollBars() void QtTableView::updateTableSize() { bool updateOn = autoUpdate(); - setAutoUpdate( FALSE ); + setAutoUpdate( false ); int xofs = xOffset(); xOffs++; //so that setOffset will not return immediately - setOffset(xofs,yOffset(),FALSE); //to calculate internal state correctly + setOffset(xofs,yOffset(),false); //to calculate internal state correctly setAutoUpdate(updateOn); updateScrollBars( horSteps | horRange | |