diff options
Diffstat (limited to 'src/table/tqtable.cpp')
| -rw-r--r-- | src/table/tqtable.cpp | 706 |
1 files changed, 353 insertions, 353 deletions
diff --git a/src/table/tqtable.cpp b/src/table/tqtable.cpp index b990a854a..28fe17cf2 100644 --- a/src/table/tqtable.cpp +++ b/src/table/tqtable.cpp @@ -62,8 +62,8 @@ #include <stdlib.h> #include <limits.h> -static bool qt_update_cell_widget = TRUE; -static bool qt_table_clipper_enabled = TRUE; +static bool qt_update_cell_widget = true; +static bool qt_table_clipper_enabled = true; #ifndef QT_INTERNAL_TABLE TQ_EXPORT #endif @@ -131,7 +131,7 @@ private: void updateSelections(); void saveStates(); void setCaching( bool b ); - void swapSections( int oldIdx, int newIdx, bool swapTable = TRUE ); + void swapSections( int oldIdx, int newIdx, bool swapTable = true ); bool doSelection( TQMouseEvent *e ); void sectionLabelChanged( int section ); void resizeArrays( int n ); @@ -157,11 +157,11 @@ private: struct TQTablePrivate { - TQTablePrivate() : hasRowSpan( FALSE ), hasColSpan( FALSE ), - inMenuMode( FALSE ), redirectMouseEvent( FALSE ) + TQTablePrivate() : hasRowSpan( false ), hasColSpan( false ), + inMenuMode( false ), redirectMouseEvent( false ) { - hiddenRows.setAutoDelete( TRUE ); - hiddenCols.setAutoDelete( TRUE ); + hiddenRows.setAutoDelete( true ); + hiddenCols.setAutoDelete( true ); } uint hasRowSpan : 1; uint hasColSpan : 1; @@ -209,7 +209,7 @@ static bool isRowSelection( TQTable::SelectionMode selMode ) rectangle's four edges. All four are part of the selection. A newly created TQTableSelection is inactive -- isActive() returns - FALSE. You must use init() and expandTo() to activate it. + false. You must use init() and expandTo() to activate it. \sa TQTable TQTable::addSelection() TQTable::selection() TQTable::selectCells() TQTable::selectRow() TQTable::selectColumn() @@ -221,7 +221,7 @@ static bool isRowSelection( TQTable::SelectionMode selMode ) */ TQTableSelection::TQTableSelection() - : active( FALSE ), inited( FALSE ), tRow( -1 ), lCol( -1 ), + : active( false ), inited( false ), tRow( -1 ), lCol( -1 ), bRow( -1 ), rCol( -1 ), aRow( -1 ), aCol( -1 ) { } @@ -232,7 +232,7 @@ TQTableSelection::TQTableSelection() */ TQTableSelection::TQTableSelection( int start_row, int start_col, int end_row, int end_col ) - : active( FALSE ), inited( FALSE ), tRow( -1 ), lCol( -1 ), + : active( false ), inited( false ), tRow( -1 ), lCol( -1 ), bRow( -1 ), rCol( -1 ), aRow( -1 ), aCol( -1 ) { init( start_row, start_col ); @@ -254,8 +254,8 @@ void TQTableSelection::init( int row, int col ) { aCol = lCol = rCol = col; aRow = tRow = bRow = row; - active = FALSE; - inited = TRUE; + active = false; + inited = true; } /*! @@ -273,7 +273,7 @@ void TQTableSelection::expandTo( int row, int col ) { if ( !inited ) return; - active = TRUE; + active = true; if ( row < aRow ) { tRow = row; @@ -293,8 +293,8 @@ void TQTableSelection::expandTo( int row, int col ) } /*! - Returns TRUE if \a s includes the same cells as the selection; - otherwise returns FALSE. + Returns true if \a s includes the same cells as the selection; + otherwise returns false. */ bool TQTableSelection::operator==( const TQTableSelection &s ) const @@ -307,8 +307,8 @@ bool TQTableSelection::operator==( const TQTableSelection &s ) const /*! \fn bool TQTableSelection::operator!=( const TQTableSelection &s ) const - Returns TRUE if \a s does not include the same cells as the - selection; otherwise returns FALSE. + Returns true if \a s does not include the same cells as the + selection; otherwise returns false. */ @@ -480,7 +480,7 @@ int TQTableSelection::numCols() const By default, table items may be replaced by new TQTableItems during the lifetime of a TQTable. Therefore, if you create your own subclass of TQTableItem, and you want to ensure that - this does not happen, you must call setReplaceable(FALSE) + this does not happen, you must call setReplaceable(false) in the constructor of your subclass. \img tqtableitems.png Table Items @@ -533,8 +533,8 @@ int TQTableSelection::numCols() const \value Never The cell is not editable. The cell is actually editable only if TQTable::isRowReadOnly() is - FALSE for its row, TQTable::isColumnReadOnly() is FALSE for its - column, and TQTable::isReadOnly() is FALSE. + false for its row, TQTable::isColumnReadOnly() is false for its + column, and TQTable::isReadOnly() is false. TQComboTableItems have an isEditable() property. This property is used to indicate whether the user may enter their own text or are @@ -557,10 +557,10 @@ int TQTableSelection::numCols() const */ TQTableItem::TQTableItem( TQTable *table, EditType et ) - : txt(), pix(), t( table ), edType( et ), wordwrap( FALSE ), - tcha( TRUE ), rw( -1 ), cl( -1 ), rowspan( 1 ), colspan( 1 ) + : txt(), pix(), t( table ), edType( et ), wordwrap( false ), + tcha( true ), rw( -1 ), cl( -1 ), rowspan( 1 ), colspan( 1 ) { - enabled = TRUE; + enabled = true; } /*! @@ -576,10 +576,10 @@ TQTableItem::TQTableItem( TQTable *table, EditType et ) */ TQTableItem::TQTableItem( TQTable *table, EditType et, const TQString &text ) - : txt( text ), pix(), t( table ), edType( et ), wordwrap( FALSE ), - tcha( TRUE ), rw( -1 ), cl( -1 ), rowspan( 1 ), colspan( 1 ) + : txt( text ), pix(), t( table ), edType( et ), wordwrap( false ), + tcha( true ), rw( -1 ), cl( -1 ), rowspan( 1 ), colspan( 1 ) { - enabled = TRUE; + enabled = true; } /*! @@ -597,10 +597,10 @@ TQTableItem::TQTableItem( TQTable *table, EditType et, const TQString &text ) TQTableItem::TQTableItem( TQTable *table, EditType et, const TQString &text, const TQPixmap &p ) - : txt( text ), pix( p ), t( table ), edType( et ), wordwrap( FALSE ), - tcha( TRUE ), rw( -1 ), cl( -1 ), rowspan( 1 ), colspan( 1 ) + : txt( text ), pix( p ), t( table ), edType( et ), wordwrap( false ), + tcha( true ), rw( -1 ), cl( -1 ), rowspan( 1 ), colspan( 1 ) { - enabled = TRUE; + enabled = true; } /*! @@ -719,7 +719,7 @@ void TQTableItem::setText( const TQString &str ) using the painter \a p in the rectangular area \a cr using the color group \a cg. - If \a selected is TRUE the cell is displayed in a way that + If \a selected is true the cell is displayed in a way that indicates that it is highlighted. You don't usually need to use this function but if you want to @@ -734,7 +734,7 @@ void TQTableItem::setText( const TQString &str ) \code p->setClipRect( table()->cellRect(row, col), TQPainter::ClipPainter ); //... your drawing code - p->setClipping( FALSE ); + p->setClipping( false ); \endcode */ @@ -787,7 +787,7 @@ sizeHint(). TQWidget *TQTableItem::createEditor() const { TQLineEdit *e = new TQLineEdit( table()->viewport(), "qt_tableeditor" ); - e->setFrame( FALSE ); + e->setFrame( false ); e->setText( text() ); return e; } @@ -832,7 +832,7 @@ void TQTableItem::setContentFromEditor( TQWidget *w ) int TQTableItem::alignment() const { bool num; - bool ok1 = FALSE, ok2 = FALSE; + bool ok1 = false, ok2 = false; (void)text().toInt( &ok1 ); if ( !ok1 ) (void)text().toDouble( &ok2 ); // ### should be .-aligned @@ -842,7 +842,7 @@ int TQTableItem::alignment() const } /*! - If \a b is TRUE, the cell's text will be wrapped over multiple + If \a b is true, the cell's text will be wrapped over multiple lines, when necessary, to fit the width of the cell; otherwise the text will be written as a single line. @@ -855,8 +855,8 @@ void TQTableItem::setWordWrap( bool b ) } /*! - Returns TRUE if word wrap is enabled for the cell; otherwise - returns FALSE. + Returns true if word wrap is enabled for the cell; otherwise + returns false. \sa setWordWrap() */ @@ -892,8 +892,8 @@ TQTableItem::EditType TQTableItem::editType() const } /*! - If \a b is TRUE it is acceptable to replace the contents of the - cell with the contents of another TQTableItem. If \a b is FALSE the + If \a b is true it is acceptable to replace the contents of the + cell with the contents of another TQTableItem. If \a b is false the contents of the cell may not be replaced by the contents of another table item. Table items that span more than one cell may not have their contents replaced by another table item. @@ -924,7 +924,7 @@ void TQTableItem::setReplaceable( bool b ) bool TQTableItem::isReplaceable() const { if ( rowspan > 1 || colspan > 1 ) - return FALSE; + return false; return tcha; } @@ -1025,9 +1025,9 @@ void TQTableItem::setSpan( int rs, int cs ) for ( int c = 0; c < colspan; ++c ) { if ( r == 0 && c == 0 ) continue; - qt_update_cell_widget = FALSE; + qt_update_cell_widget = false; table()->setItem( r + rw, c + cl, this ); - qt_update_cell_widget = TRUE; + qt_update_cell_widget = true; rw = rrow; cl = rcol; } @@ -1118,7 +1118,7 @@ int TQTableItem::col() const } /*! - If \a b is TRUE, the table item is enabled; if \a b is FALSE the + If \a b is true, the table item is enabled; if \a b is false the table item is disabled. A disabled item doesn't respond to user interaction. @@ -1135,7 +1135,7 @@ void TQTableItem::setEnabled( bool b ) } /*! - Returns TRUE if the table item is enabled; otherwise returns FALSE. + Returns true if the table item is enabled; otherwise returns false. \sa setEnabled() */ @@ -1175,7 +1175,7 @@ bool TQTableItem::isEnabled() const currentText(), and the text of a particular item can be retrieved with text(). - If isEditable() is TRUE the TQComboTableItem will permit the user + If isEditable() is true the TQComboTableItem will permit the user to either choose an existing list item, or create a new list item by entering their own text; otherwise the user may only choose one of the existing list items. @@ -1201,11 +1201,11 @@ int TQComboTableItem::fakeRef = 0; /*! Creates a combo table item for the table \a table. The combobox's list of items is passed in the \a list argument. If \a editable is - TRUE the user may type in new list items; if \a editable is FALSE + true the user may type in new list items; if \a editable is false the user may only select from the list of items provided. By default TQComboTableItems cannot be replaced by other table - items since isReplaceable() returns FALSE by default. + items since isReplaceable() returns false by default. \sa TQTable::clearCell() EditType */ @@ -1213,10 +1213,10 @@ int TQComboTableItem::fakeRef = 0; TQComboTableItem::TQComboTableItem( TQTable *table, const TQStringList &list, bool editable ) : TQTableItem( table, WhenCurrent, "" ), entries( list ), current( 0 ), edit( editable ) { - setReplaceable( FALSE ); + setReplaceable( false ); if ( !TQComboTableItem::fakeCombo ) { TQComboTableItem::fakeComboWidget = new TQWidget( 0, 0 ); - TQComboTableItem::fakeCombo = new TQComboBox( FALSE, TQComboTableItem::fakeComboWidget, 0 ); + TQComboTableItem::fakeCombo = new TQComboBox( false, TQComboTableItem::fakeComboWidget, 0 ); TQComboTableItem::fakeCombo->hide(); } ++TQComboTableItem::fakeRef; @@ -1403,8 +1403,8 @@ TQString TQComboTableItem::text( int i ) const } /*! - If \a b is TRUE the combo table item can be edited, i.e. the user - may enter a new text item themselves. If \a b is FALSE the user may + If \a b is true the combo table item can be edited, i.e. the user + may enter a new text item themselves. If \a b is false the user may may only choose one of the existing items. \sa isEditable() @@ -1416,8 +1416,8 @@ void TQComboTableItem::setEditable( bool b ) } /*! - Returns TRUE if the user can add their own list items to the - combobox's list of items; otherwise returns FALSE. + Returns true if the user can add their own list items to the + combobox's list of items; otherwise returns false. \sa setEditable() */ @@ -1503,7 +1503,7 @@ TQSize TQComboTableItem::sizeHint() const */ TQCheckTableItem::TQCheckTableItem( TQTable *table, const TQString &txt ) - : TQTableItem( table, WhenCurrent, txt ), checked( FALSE ) + : TQTableItem( table, WhenCurrent, txt ), checked( false ) { } @@ -1578,7 +1578,7 @@ void TQCheckTableItem::paint( TQPainter *p, const TQColorGroup &cg, } /*! - If \a b is TRUE the checkbox is checked; if \a b is FALSE the + If \a b is true the checkbox is checked; if \a b is false the checkbox is unchecked. \sa isChecked() @@ -1595,8 +1595,8 @@ void TQCheckTableItem::setChecked( bool b ) } /*! - Returns TRUE if the checkbox table item is checked; otherwise - returns FALSE. + Returns true if the checkbox table item is checked; otherwise + returns false. \sa setChecked() */ @@ -1689,7 +1689,7 @@ TQSize TQCheckTableItem::sizeHint() const the table showing column numbers. (The numbers displayed start at 1, although row and column numbers within TQTable begin at 0.) - If you want to use mouse tracking call setMouseTracking( TRUE ) on + If you want to use mouse tracking call setMouseTracking( true ) on the \e viewport; (see \link tqscrollview.html#allviews TQScrollView\endlink). @@ -1747,7 +1747,7 @@ TQSize TQCheckTableItem::sizeHint() const independently of the user interface ordering. The table can be sorted using sortColumn(). Users can sort a - column by clicking its header if setSorting() is set to TRUE. Rows + column by clicking its header if setSorting() is set to true. Rows can be swapped with swapRows(), columns with swapColumns() and cells with swapCells(). @@ -2027,8 +2027,8 @@ TQSize TQCheckTableItem::sizeHint() const TQTable::TQTable( TQWidget *parent, const char *name ) : TQScrollView( parent, name, WNoAutoErase | WStaticContents ), leftHeader( 0 ), topHeader( 0 ), - currentSel( 0 ), lastSortCol( -1 ), sGrid( TRUE ), mRows( FALSE ), mCols( FALSE ), - asc( TRUE ), doSort( TRUE ), readOnly( FALSE ) + currentSel( 0 ), lastSortCol( -1 ), sGrid( true ), mRows( false ), mCols( false ), + asc( true ), doSort( true ), readOnly( false ) { init( 0, 0 ); } @@ -2048,8 +2048,8 @@ TQTable::TQTable( TQWidget *parent, const char *name ) TQTable::TQTable( int numRows, int numCols, TQWidget *parent, const char *name ) : TQScrollView( parent, name, WNoAutoErase | WStaticContents ), leftHeader( 0 ), topHeader( 0 ), - currentSel( 0 ), lastSortCol( -1 ), sGrid( TRUE ), mRows( FALSE ), mCols( FALSE ), - asc( TRUE ), doSort( TRUE ), readOnly( FALSE ) + currentSel( 0 ), lastSortCol( -1 ), sGrid( true ), mRows( false ), mCols( false ), + asc( true ), doSort( true ), readOnly( false ) { init( numRows, numCols ); } @@ -2060,25 +2060,25 @@ TQTable::TQTable( int numRows, int numCols, TQWidget *parent, const char *name ) void TQTable::init( int rows, int cols ) { #ifndef TQT_NO_DRAGANDDROP - setDragAutoScroll( FALSE ); + setDragAutoScroll( false ); #endif d = new TQTablePrivate; d->geomTimer = new TQTimer( this ); d->lastVisCol = 0; d->lastVisRow = 0; connect( d->geomTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( updateGeometriesSlot() ) ); - shouldClearSelection = FALSE; - dEnabled = FALSE; - roRows.setAutoDelete( TRUE ); - roCols.setAutoDelete( TRUE ); - setSorting( FALSE ); + shouldClearSelection = false; + dEnabled = false; + roRows.setAutoDelete( true ); + roCols.setAutoDelete( true ); + setSorting( false ); - unused = TRUE; // It's unused, ain't it? :) + unused = true; // It's unused, ain't it? :) selMode = Multi; - contents.setAutoDelete( TRUE ); - widgets.setAutoDelete( TRUE ); + contents.setAutoDelete( true ); + widgets.setAutoDelete( true ); // Enable clipper and set background mode enableClipper( qt_table_clipper_enabled ); @@ -2089,35 +2089,35 @@ void TQTable::init( int rows, int cols ) viewport()->setBackgroundMode( PaletteBase ); setBackgroundMode( PaletteBackground, PaletteBase ); setResizePolicy( Manual ); - selections.setAutoDelete( TRUE ); + selections.setAutoDelete( true ); // Create headers leftHeader = new TQTableHeader( rows, this, this, "left table header" ); leftHeader->setOrientation( Vertical ); - leftHeader->setTracking( TRUE ); - leftHeader->setMovingEnabled( TRUE ); + leftHeader->setTracking( true ); + leftHeader->setMovingEnabled( true ); topHeader = new TQTableHeader( cols, this, this, "right table header" ); topHeader->setOrientation( Horizontal ); - topHeader->setTracking( TRUE ); - topHeader->setMovingEnabled( TRUE ); + topHeader->setTracking( true ); + topHeader->setMovingEnabled( true ); if ( TQApplication::reverseLayout() ) setMargins( 0, fontMetrics().height() + 4, 30, 0 ); else setMargins( 30, fontMetrics().height() + 4, 0, 0 ); - topHeader->setUpdatesEnabled( FALSE ); - leftHeader->setUpdatesEnabled( FALSE ); + topHeader->setUpdatesEnabled( false ); + leftHeader->setUpdatesEnabled( false ); // Initialize headers int i = 0; for ( i = 0; i < numCols(); ++i ) topHeader->resizeSection( i, TQMAX( 100, TQApplication::globalStrut().height() ) ); for ( i = 0; i < numRows(); ++i ) leftHeader->resizeSection( i, TQMAX( 20, TQApplication::globalStrut().width() ) ); - topHeader->setUpdatesEnabled( TRUE ); - leftHeader->setUpdatesEnabled( TRUE ); + topHeader->setUpdatesEnabled( true ); + leftHeader->setUpdatesEnabled( true ); // Prepare for contents - contents.setAutoDelete( FALSE ); + contents.setAutoDelete( false ); // Connect header, table and scrollbars connect( horizontalScrollBar(), TQ_SIGNAL( valueChanged(int) ), @@ -2145,13 +2145,13 @@ void TQTable::init( int rows, int cols ) edMode = NotEditing; editRow = editCol = -1; - drawActiveSelection = TRUE; + drawActiveSelection = true; installEventFilter( this ); focusStl = SpreadSheet; - was_visible = FALSE; + was_visible = false; // initial size resize( 640, 480 ); @@ -2164,8 +2164,8 @@ void TQTable::init( int rows, int cols ) TQTable::~TQTable() { - setUpdatesEnabled( FALSE ); - contents.setAutoDelete( TRUE ); + setUpdatesEnabled( false ); + contents.setAutoDelete( true ); contents.clear(); widgets.clear(); @@ -2178,7 +2178,7 @@ void TQTable::setReadOnly( bool b ) TQTableItem *i = item(curRow, curCol); if (readOnly && isEditing()) { - endEdit(editRow, editCol, TRUE, FALSE); + endEdit(editRow, editCol, true, false); } else if (!readOnly && i && (i->editType() == TQTableItem::WhenCurrent || i->editType() == TQTableItem::Always)) { editCell(curRow, curCol); @@ -2186,7 +2186,7 @@ void TQTable::setReadOnly( bool b ) } /*! - If \a ro is TRUE, row \a row is set to be read-only; otherwise the + If \a ro is true, row \a row is set to be read-only; otherwise the row is set to be editable. Whether a cell in this row is editable or read-only depends on the @@ -2206,7 +2206,7 @@ void TQTable::setRowReadOnly( int row, bool ro ) if (curRow == row) { TQTableItem *i = item(curRow, curCol); if (ro && isEditing()) { - endEdit(editRow, editCol, TRUE, FALSE); + endEdit(editRow, editCol, true, false); } else if (!ro && i && (i->editType() == TQTableItem::WhenCurrent || i->editType() == TQTableItem::Always)) { editCell(curRow, curCol); @@ -2215,7 +2215,7 @@ void TQTable::setRowReadOnly( int row, bool ro ) } /*! - If \a ro is TRUE, column \a col is set to be read-only; otherwise + If \a ro is true, column \a col is set to be read-only; otherwise the column is set to be editable. Whether a cell in this column is editable or read-only depends on @@ -2236,7 +2236,7 @@ void TQTable::setColumnReadOnly( int col, bool ro ) if (curCol == col) { TQTableItem *i = item(curRow, curCol); if (ro && isEditing()) { - endEdit(editRow, editCol, TRUE, FALSE); + endEdit(editRow, editCol, true, false); } else if (!ro && i && (i->editType() == TQTableItem::WhenCurrent || i->editType() == TQTableItem::Always)) { editCell(curRow, curCol); @@ -2262,7 +2262,7 @@ bool TQTable::isReadOnly() const } /*! - Returns TRUE if row \a row is read-only; otherwise returns FALSE. + Returns true if row \a row is read-only; otherwise returns false. Whether a cell in this row is editable or read-only depends on the cell's \link TQTableItem::EditType EditType\endlink, and this @@ -2278,8 +2278,8 @@ bool TQTable::isRowReadOnly( int row ) const } /*! - Returns TRUE if column \a col is read-only; otherwise returns - FALSE. + Returns true if column \a col is read-only; otherwise returns + false. Whether a cell in this column is editable or read-only depends on the cell's EditType, and this setting: see \link @@ -2352,8 +2352,8 @@ TQTable::FocusStyle TQTable::focusStyle() const void TQTable::updateHeaderStates() { - horizontalHeader()->setUpdatesEnabled( FALSE ); - verticalHeader()->setUpdatesEnabled( FALSE ); + horizontalHeader()->setUpdatesEnabled( false ); + verticalHeader()->setUpdatesEnabled( false ); ( (TQTableHeader*)verticalHeader() )->setSectionStateToAll( TQTableHeader::Normal ); ( (TQTableHeader*)horizontalHeader() )->setSectionStateToAll( TQTableHeader::Normal ); @@ -2376,10 +2376,10 @@ void TQTable::updateHeaderStates() } } - horizontalHeader()->setUpdatesEnabled( TRUE ); - verticalHeader()->setUpdatesEnabled( TRUE ); - horizontalHeader()->repaint( FALSE ); - verticalHeader()->repaint( FALSE ); + horizontalHeader()->setUpdatesEnabled( true ); + verticalHeader()->setUpdatesEnabled( true ); + horizontalHeader()->repaint( false ); + verticalHeader()->repaint( false ); } /*! @@ -2437,7 +2437,7 @@ bool TQTable::showGrid() const \property TQTable::columnMovingEnabled \brief whether columns can be moved by the user - The default is FALSE. Columns are moved by dragging whilst holding + The default is false. Columns are moved by dragging whilst holding down the Ctrl key. \warning If TQTable is used to move header sections as a result of user @@ -2463,7 +2463,7 @@ bool TQTable::columnMovingEnabled() const \property TQTable::rowMovingEnabled \brief whether rows can be moved by the user - The default is FALSE. Rows are moved by dragging whilst holding + The default is false. Rows are moved by dragging whilst holding down the Ctrl key. \warning If TQTable is used to move header sections as a result of user @@ -2511,7 +2511,7 @@ void TQTable::resizeData( int len ) swap rows, e.g. for sorting, you will need to reimplement this function. (See the notes on large tables.) - If \a swapHeader is TRUE, the rows' header contents is also + If \a swapHeader is true, the rows' header contents is also swapped. This function will not update the TQTable, you will have to do @@ -2523,7 +2523,7 @@ void TQTable::resizeData( int len ) void TQTable::swapRows( int row1, int row2, bool swapHeader ) { if ( swapHeader ) - leftHeader->swapSections( row1, row2, FALSE ); + leftHeader->swapSections( row1, row2, false ); TQPtrVector<TQTableItem> tmpContents; tmpContents.resize( numCols() ); @@ -2531,8 +2531,8 @@ void TQTable::swapRows( int row1, int row2, bool swapHeader ) tmpWidgets.resize( numCols() ); int i; - contents.setAutoDelete( FALSE ); - widgets.setAutoDelete( FALSE ); + contents.setAutoDelete( false ); + widgets.setAutoDelete( false ); for ( i = 0; i < numCols(); ++i ) { TQTableItem *i1, *i2; i1 = item( row1, i ); @@ -2560,8 +2560,8 @@ void TQTable::swapRows( int row1, int row2, bool swapHeader ) widgets.insert( indexOf( row2, i ), tmpWidgets[ i ] ); } } - contents.setAutoDelete( FALSE ); - widgets.setAutoDelete( TRUE ); + contents.setAutoDelete( false ); + widgets.setAutoDelete( true ); updateRowWidgets( row1 ); updateRowWidgets( row2 ); @@ -2623,7 +2623,7 @@ void TQTable::setTopMargin( int m ) swap columns you will need to reimplement this function. (See the notes on large tables.) - If \a swapHeader is TRUE, the columns' header contents is also + If \a swapHeader is true, the columns' header contents is also swapped. \sa swapCells() @@ -2632,7 +2632,7 @@ void TQTable::setTopMargin( int m ) void TQTable::swapColumns( int col1, int col2, bool swapHeader ) { if ( swapHeader ) - topHeader->swapSections( col1, col2, FALSE ); + topHeader->swapSections( col1, col2, false ); TQPtrVector<TQTableItem> tmpContents; tmpContents.resize( numRows() ); @@ -2640,8 +2640,8 @@ void TQTable::swapColumns( int col1, int col2, bool swapHeader ) tmpWidgets.resize( numRows() ); int i; - contents.setAutoDelete( FALSE ); - widgets.setAutoDelete( FALSE ); + contents.setAutoDelete( false ); + widgets.setAutoDelete( false ); for ( i = 0; i < numRows(); ++i ) { TQTableItem *i1, *i2; i1 = item( i, col1 ); @@ -2669,8 +2669,8 @@ void TQTable::swapColumns( int col1, int col2, bool swapHeader ) widgets.insert( indexOf( i, col2 ), tmpWidgets[ i ] ); } } - contents.setAutoDelete( FALSE ); - widgets.setAutoDelete( TRUE ); + contents.setAutoDelete( false ); + widgets.setAutoDelete( true ); columnWidthChanged( col1 ); columnWidthChanged( col2 ); @@ -2699,8 +2699,8 @@ void TQTable::swapColumns( int col1, int col2, bool swapHeader ) void TQTable::swapCells( int row1, int col1, int row2, int col2 ) { - contents.setAutoDelete( FALSE ); - widgets.setAutoDelete( FALSE ); + contents.setAutoDelete( false ); + widgets.setAutoDelete( false ); TQTableItem *i1, *i2; i1 = item( row1, col1 ); i2 = item( row2, col2 ); @@ -2735,18 +2735,18 @@ void TQTable::swapCells( int row1, int col1, int row2, int col2 ) updateRowWidgets( row2 ); updateColWidgets( col1 ); updateColWidgets( col2 ); - contents.setAutoDelete( FALSE ); - widgets.setAutoDelete( TRUE ); + contents.setAutoDelete( false ); + widgets.setAutoDelete( true ); } static bool is_child_of( TQWidget *child, TQWidget *parent ) { while ( child ) { if ( child == parent ) - return TRUE; + return true; child = child->parentWidget(); } - return FALSE; + return false; } /*! @@ -2778,7 +2778,7 @@ void TQTable::drawContents( TQPainter *p, int cx, int cy, int cw, int ch ) if ( collast == -1 ) collast = numCols() - 1; - bool currentInSelection = FALSE; + bool currentInSelection = false; TQPtrListIterator<TQTableSelection> it( selections ); TQTableSelection *s; @@ -2835,7 +2835,7 @@ void TQTable::drawContents( TQPainter *p, int cx, int cy, int cw, int ch ) bool selected = isSelected( r, c ); if ( focusStl != FollowStyle && selected && !currentInSelection && r == curRow && c == curCol ) - selected = FALSE; + selected = false; paintCell( p, r, c, TQRect( colp, rowp, colw, rowh ), selected ); p->translate( -colp, -rowp ); @@ -2862,7 +2862,7 @@ void TQTable::drawContents( TQPainter *p, int cx, int cy, int cw, int ch ) // Paint empty rects paintEmptyArea( p, cx, cy, cw, ch ); - drawActiveSelection = TRUE; + drawActiveSelection = true; } /*! @@ -2920,7 +2920,7 @@ void TQTable::paintCell( TQPainter* p, int row, int col, has already been translated to the cell's origin. \a cr describes the cell coordinates in the content coordinate system. - If \a selected is TRUE the cell is highlighted. + If \a selected is true the cell is highlighted. \a cg is the colorgroup which should be used to draw the cell content. @@ -2944,7 +2944,7 @@ void TQTable::paintCell( TQPainter* p, int row, int col, \code p->setClipRect( cellRect(row, col), TQPainter::CoordPainter ); //... your drawing code - p->setClipping( FALSE ); + p->setClipping( false ); \endcode */ @@ -2954,7 +2954,7 @@ void TQTable::paintCell( TQPainter *p, int row, int col, if ( focusStl == SpreadSheet && selected && row == curRow && col == curCol && ( hasFocus() || viewport()->hasFocus() ) ) - selected = FALSE; + selected = false; int w = cr.width(); int h = cr.height(); @@ -3011,10 +3011,10 @@ void TQTable::paintFocus( TQPainter *p, const TQRect &cr ) p->drawRect( focusRect.x(), focusRect.y(), focusRect.width() - 1, focusRect.height() - 1 ); p->drawRect( focusRect.x() - 1, focusRect.y() - 1, focusRect.width() + 1, focusRect.height() + 1 ); } else { - TQColor c = isSelected( curRow, curCol, FALSE ) ? + TQColor c = isSelected( curRow, curCol, false ) ? colorGroup().highlight() : colorGroup().base(); style().drawPrimitive( TQStyle::PE_FocusRect, p, focusRect, colorGroup(), - ( isSelected( curRow, curCol, FALSE ) ? + ( isSelected( curRow, curCol, false ) ? TQStyle::Style_FocusAtBorder : TQStyle::Style_Default ), TQStyleOption(c) ); @@ -3107,7 +3107,7 @@ void TQTable::setItem( int row, int col, TQTableItem *item ) item->updateEditor( orow, ocol ); if ( row == curRow && col == curCol && item->editType() == TQTableItem::WhenCurrent ) { - if ( beginEdit( row, col, FALSE ) ) + if ( beginEdit( row, col, false ) ) setEditMode( Editing, row, col ); } } @@ -3124,9 +3124,9 @@ void TQTable::clearCell( int row, int col ) if ( (int)contents.size() != numRows() * numCols() ) resizeData( numRows() * numCols() ); clearCellWidget( row, col ); - contents.setAutoDelete( TRUE ); + contents.setAutoDelete( true ); contents.remove( indexOf( row, col ) ); - contents.setAutoDelete( FALSE ); + contents.setAutoDelete( false ); } /*! @@ -3219,7 +3219,7 @@ TQPixmap TQTable::pixmap( int row, int col ) const void TQTable::setCurrentCell( int row, int col ) { - setCurrentCell( row, col, TRUE, TRUE ); + setCurrentCell( row, col, true, true ); } // need to use a define, as leftMargin() is protected @@ -3247,7 +3247,7 @@ void TQTable::setCurrentCell( int row, int col, bool updateSelections, bool ensu TQTableItem *itm = oldItem; if ( itm && itm->editType() != TQTableItem::Always && itm->editType() != TQTableItem::Never ) - endEdit( itm->row(), itm->col(), TRUE, FALSE ); + endEdit( itm->row(), itm->col(), true, false ); int oldRow = curRow; int oldCol = curCol; curRow = row; @@ -3263,14 +3263,14 @@ void TQTable::setCurrentCell( int row, int col, bool updateSelections, bool ensu topHeader->setSectionState( oldCol, TQTableHeader::Normal ); else if ( isRowSelection( selectionMode() ) ) topHeader->setSectionState( oldCol, TQTableHeader::Selected ); - topHeader->setSectionState( curCol, isColumnSelected( curCol, TRUE ) ? + topHeader->setSectionState( curCol, isColumnSelected( curCol, true ) ? TQTableHeader::Selected : TQTableHeader::Bold ); } if ( oldRow != curRow ) { if ( !isRowSelected( oldRow ) ) leftHeader->setSectionState( oldRow, TQTableHeader::Normal ); - leftHeader->setSectionState( curRow, isRowSelected( curRow, TRUE ) ? + leftHeader->setSectionState( curRow, isRowSelected( curRow, true ) ? TQTableHeader::Selected : TQTableHeader::Bold ); } @@ -3286,7 +3286,7 @@ void TQTable::setCurrentCell( int row, int col, bool updateSelections, bool ensu viewport()->setFocus(); if ( itm && itm->editType() == TQTableItem::WhenCurrent ) { - if ( beginEdit( itm->row(), itm->col(), FALSE ) ) + if ( beginEdit( itm->row(), itm->col(), false ) ) setEditMode( Editing, itm->row(), itm->col() ); } else if ( itm && itm->editType() == TQTableItem::Always ) { if ( cellWidget( itm->row(), itm->col() ) ) @@ -3294,7 +3294,7 @@ void TQTable::setCurrentCell( int row, int col, bool updateSelections, bool ensu } if ( updateSelections && isRowSelection( selectionMode() ) && - !isSelected( curRow, curCol, FALSE ) ) { + !isSelected( curRow, curCol, false ) ) { if ( selectionMode() == TQTable::SingleRow ) clearSelection(); currentSel = new TQTableSelection(); @@ -3323,15 +3323,15 @@ void TQTable::ensureCellVisible( int row, int col ) } /*! - Returns TRUE if the cell at \a row, \a col is selected; otherwise - returns FALSE. + Returns true if the cell at \a row, \a col is selected; otherwise + returns false. \sa isRowSelected() isColumnSelected() */ bool TQTable::isSelected( int row, int col ) const { - return isSelected( row, col, TRUE ); + return isSelected( row, col, true ); } /*! \internal */ @@ -3347,18 +3347,18 @@ bool TQTable::isSelected( int row, int col, bool includeCurrent ) const row <= s->bottomRow() && col >= s->leftCol() && col <= s->rightCol() ) - return TRUE; + return true; if ( includeCurrent && row == currentRow() && col == currentColumn() ) - return TRUE; + return true; } - return FALSE; + return false; } /*! - Returns TRUE if row \a row is selected; otherwise returns FALSE. + Returns true if row \a row is selected; otherwise returns false. - If \a full is FALSE (the default), 'row is selected' means that at - least one cell in the row is selected. If \a full is TRUE, then 'row + If \a full is false (the default), 'row is selected' means that at + least one cell in the row is selected. If \a full is true, then 'row is selected' means every cell in the row is selected. \sa isColumnSelected() isSelected() @@ -3374,9 +3374,9 @@ bool TQTable::isRowSelected( int row, bool full ) const if ( s->isActive() && row >= s->topRow() && row <= s->bottomRow() ) - return TRUE; + return true; if ( row == currentRow() ) - return TRUE; + return true; } } else { TQPtrListIterator<TQTableSelection> it( selections ); @@ -3388,17 +3388,17 @@ bool TQTable::isRowSelected( int row, bool full ) const row <= s->bottomRow() && s->leftCol() == 0 && s->rightCol() == numCols() - 1 ) - return TRUE; + return true; } } - return FALSE; + return false; } /*! - Returns TRUE if column \a col is selected; otherwise returns FALSE. + Returns true if column \a col is selected; otherwise returns false. - If \a full is FALSE (the default), 'column is selected' means that - at least one cell in the column is selected. If \a full is TRUE, + If \a full is false (the default), 'column is selected' means that + at least one cell in the column is selected. If \a full is true, then 'column is selected' means every cell in the column is selected. @@ -3415,9 +3415,9 @@ bool TQTable::isColumnSelected( int col, bool full ) const if ( s->isActive() && col >= s->leftCol() && col <= s->rightCol() ) - return TRUE; + return true; if ( col == currentColumn() ) - return TRUE; + return true; } } else { TQPtrListIterator<TQTableSelection> it( selections ); @@ -3429,10 +3429,10 @@ bool TQTable::isColumnSelected( int col, bool full ) const col <= s->rightCol() && s->topRow() == 0 && s->bottomRow() == numRows() - 1 ) - return TRUE; + return true; } } - return FALSE; + return false; } /*! @@ -3485,7 +3485,7 @@ int TQTable::addSelection( const TQTableSelection &s ) selections.append( sel ); - repaintSelections( 0, sel, TRUE, TRUE ); + repaintSelections( 0, sel, true, true ); emit selectionChanged(); @@ -3501,17 +3501,17 @@ int TQTable::addSelection( const TQTableSelection &s ) void TQTable::removeSelection( const TQTableSelection &s ) { - selections.setAutoDelete( FALSE ); + selections.setAutoDelete( false ); for ( TQTableSelection *sel = selections.first(); sel; sel = selections.next() ) { if ( s == *sel ) { selections.removeRef( sel ); - repaintSelections( sel, 0, TRUE, TRUE ); + repaintSelections( sel, 0, true, true ); if ( sel == currentSel ) currentSel = 0; delete sel; } } - selections.setAutoDelete( TRUE ); + selections.setAutoDelete( true ); emit selectionChanged(); } @@ -3532,7 +3532,7 @@ void TQTable::removeSelection( int num ) if ( s == currentSel ) currentSel = 0; selections.removeRef( s ); - repaintContents( FALSE ); + repaintContents( false ); } /*! @@ -3579,7 +3579,7 @@ void TQTable::selectRow( int row ) row = TQMIN(numRows()-1, row); if ( row < 0 ) return; - bool isDataTable = FALSE; + bool isDataTable = false; #ifndef TQT_NO_SQL isDataTable = ::tqt_cast<TQDataTable*>(this) != 0; #endif @@ -3613,17 +3613,17 @@ void TQTable::contentsMousePressEvent( TQMouseEvent* e ) void TQTable::contentsMousePressEventEx( TQMouseEvent* e ) { - shouldClearSelection = FALSE; + shouldClearSelection = false; if ( isEditing() ) { if ( !cellGeometry( editRow, editCol ).contains( e->pos() ) ) { - endEdit( editRow, editCol, TRUE, edMode != Editing ); + endEdit( editRow, editCol, true, edMode != Editing ); } else { e->ignore(); return; } } - d->redirectMouseEvent = FALSE; + d->redirectMouseEvent = false; int tmpRow = rowAt( e->pos().y() ); int tmpCol = columnAt( e->pos().x() ); @@ -3649,7 +3649,7 @@ void TQTable::contentsMousePressEventEx( TQMouseEvent* e ) if ( ( e->state() & ShiftButton ) == ShiftButton ) { int oldRow = curRow; int oldCol = curCol; - setCurrentCell( tmpRow, tmpCol, selMode == SingleRow, TRUE ); + setCurrentCell( tmpRow, tmpCol, selMode == SingleRow, true ); if ( selMode != NoSelection && selMode != SingleRow ) { if ( !currentSel ) { currentSel = new TQTableSelection(); @@ -3668,11 +3668,11 @@ void TQTable::contentsMousePressEventEx( TQMouseEvent* e ) emit selectionChanged(); } } else if ( ( e->state() & ControlButton ) == ControlButton ) { - setCurrentCell( tmpRow, tmpCol, FALSE, TRUE ); + setCurrentCell( tmpRow, tmpCol, false, true ); if ( selMode != NoSelection ) { - if ( selMode == Single || ( selMode == SingleRow && !isSelected( tmpRow, tmpCol, FALSE ) ) ) + if ( selMode == Single || ( selMode == SingleRow && !isSelected( tmpRow, tmpCol, false ) ) ) clearSelection(); - if ( !(selMode == SingleRow && isSelected( tmpRow, tmpCol, FALSE )) ) { + if ( !(selMode == SingleRow && isSelected( tmpRow, tmpCol, false )) ) { currentSel = new TQTableSelection(); selections.append( currentSel ); if ( !isRowSelection( selectionMode() ) ) { @@ -3687,7 +3687,7 @@ void TQTable::contentsMousePressEventEx( TQMouseEvent* e ) } } } else { - setCurrentCell( tmpRow, tmpCol, FALSE, TRUE ); + setCurrentCell( tmpRow, tmpCol, false, true ); TQTableItem *itm = item( tmpRow, tmpCol ); if ( itm && itm->editType() == TQTableItem::WhenCurrent ) { TQWidget *w = cellWidget( tmpRow, tmpCol ); @@ -3696,15 +3696,15 @@ void TQTable::contentsMousePressEventEx( TQMouseEvent* e ) e->globalPos(), e->button(), e->state() ); TQApplication::sendPostedEvents( w, 0 ); TQApplication::sendEvent( w, &ev ); - d->redirectMouseEvent = TRUE; + d->redirectMouseEvent = true; } } - if ( isSelected( tmpRow, tmpCol, FALSE ) ) { - shouldClearSelection = TRUE; + if ( isSelected( tmpRow, tmpCol, false ) ) { + shouldClearSelection = true; } else { bool b = signalsBlocked(); if ( selMode != NoSelection ) - blockSignals( TRUE ); + blockSignals( true ); clearSelection(); blockSignals( b ); if ( selMode != NoSelection ) { @@ -3741,7 +3741,7 @@ void TQTable::contentsMouseDoubleClickEvent( TQMouseEvent *e ) if ( itm && !itm->isEnabled() ) return; if ( tmpRow != -1 && tmpCol != -1 ) { - if ( beginEdit( tmpRow, tmpCol, FALSE ) ) + if ( beginEdit( tmpRow, tmpCol, false ) ) setEditMode( Editing, tmpRow, tmpCol ); } @@ -3783,7 +3783,7 @@ void TQTable::contentsMouseMoveEvent( TQMouseEvent *e ) } #endif if ( selectionMode() == MultiRow && ( e->state() & ControlButton ) == ControlButton ) - shouldClearSelection = FALSE; + shouldClearSelection = false; if ( shouldClearSelection ) { clearSelection(); @@ -3796,7 +3796,7 @@ void TQTable::contentsMouseMoveEvent( TQMouseEvent *e ) currentSel->init( tmpRow, 0 ); emit selectionChanged(); } - shouldClearSelection = FALSE; + shouldClearSelection = false; } TQPoint pos = mapFromGlobal( e->globalPos() ); @@ -3804,7 +3804,7 @@ void TQTable::contentsMouseMoveEvent( TQMouseEvent *e ) autoScrollTimer->stop(); doAutoScroll(); if ( pos.x() < 0 || pos.x() > visibleWidth() || pos.y() < 0 || pos.y() > visibleHeight() ) - autoScrollTimer->start( 100, TRUE ); + autoScrollTimer->start( 100, true ); } /*! \internal @@ -3854,7 +3854,7 @@ void TQTable::doAutoScroll() if ( currentSel && selMode != NoSelection ) { TQTableSelection oldSelection = *currentSel; - bool useOld = TRUE; + bool useOld = true; if ( selMode != SingleRow ) { if ( !isRowSelection( selectionMode() ) ) { currentSel->expandTo( tmpRow, tmpCol ); @@ -3864,7 +3864,7 @@ void TQTable::doAutoScroll() } else { bool currentInSelection = tmpRow == curRow && isSelected( tmpRow, tmpCol ); if ( !currentInSelection ) { - useOld = FALSE; + useOld = false; clearSelection(); currentSel = new TQTableSelection(); selections.append( currentSel ); @@ -3875,16 +3875,16 @@ void TQTable::doAutoScroll() currentSel->expandTo( tmpRow, numCols() - 1 ); } } - setCurrentCell( tmpRow, tmpCol, FALSE, TRUE ); + setCurrentCell( tmpRow, tmpCol, false, true ); repaintSelections( useOld ? &oldSelection : 0, currentSel ); if ( currentSel && oldSelection != *currentSel ) emit selectionChanged(); } else { - setCurrentCell( tmpRow, tmpCol, FALSE, TRUE ); + setCurrentCell( tmpRow, tmpCol, false, true ); } if ( pos.x() < 0 || pos.x() > visibleWidth() || pos.y() < 0 || pos.y() > visibleHeight() ) - autoScrollTimer->start( 100, TRUE ); + autoScrollTimer->start( 100, true ); } /*! \reimp @@ -3915,7 +3915,7 @@ void TQTable::contentsMouseReleaseEvent( TQMouseEvent *e ) } emit selectionChanged(); } - shouldClearSelection = FALSE; + shouldClearSelection = false; } autoScrollTimer->stop(); @@ -3976,26 +3976,26 @@ bool TQTable::eventFilter( TQObject *o, TQEvent *e ) TQKeyEvent *ke = (TQKeyEvent*)e; if ( ke->key() == Key_Escape ) { if ( !itm || itm->editType() == TQTableItem::OnTyping ) - endEdit( editRow, editCol, FALSE, edMode != Editing ); - return TRUE; + endEdit( editRow, editCol, false, edMode != Editing ); + return true; } if ( ( ke->state() == NoButton || ke->state() == Keypad ) && ( ke->key() == Key_Return || ke->key() == Key_Enter ) ) { if ( !itm || itm->editType() == TQTableItem::OnTyping ) - endEdit( editRow, editCol, TRUE, edMode != Editing ); + endEdit( editRow, editCol, true, edMode != Editing ); activateNextCell(); - return TRUE; + return true; } if ( ke->key() == Key_Tab || ke->key() == Key_BackTab ) { if ( ke->state() & TQt::ControlButton ) - return FALSE; + return false; if ( !itm || itm->editType() == TQTableItem::OnTyping ) - endEdit( editRow, editCol, TRUE, edMode != Editing ); + endEdit( editRow, editCol, true, edMode != Editing ); if ( (ke->key() == Key_Tab) && !(ke->state() & ShiftButton) ) { if ( currentColumn() >= numCols() - 1 ) - return TRUE; + return true; int cc = TQMIN( numCols() - 1, currentColumn() + 1 ); while ( cc < numCols() ) { TQTableItem *i = item( currentRow(), cc ); @@ -4006,7 +4006,7 @@ bool TQTable::eventFilter( TQObject *o, TQEvent *e ) setCurrentCell( currentRow(), cc ); } else { // Key_BackTab if ( currentColumn() == 0 ) - return TRUE; + return true; int cc = TQMAX( 0, currentColumn() - 1 ); while ( cc >= 0 ) { TQTableItem *i = item( currentRow(), cc ); @@ -4017,9 +4017,9 @@ bool TQTable::eventFilter( TQObject *o, TQEvent *e ) setCurrentCell( currentRow(), cc ); } itm = item( curRow, curCol ); - if ( beginEdit( curRow, curCol, FALSE ) ) + if ( beginEdit( curRow, curCol, false ) ) setEditMode( Editing, curRow, curCol ); - return TRUE; + return true; } if ( ( edMode == Replacing || @@ -4029,10 +4029,10 @@ bool TQTable::eventFilter( TQObject *o, TQEvent *e ) ke->key() == Key_Next || ke->key() == Key_End || ke->key() == Key_Left || ke->key() == Key_Right ) ) { if ( !itm || itm->editType() == TQTableItem::OnTyping ) { - endEdit( editRow, editCol, TRUE, edMode != Editing ); + endEdit( editRow, editCol, true, edMode != Editing ); } keyPressEvent( ke ); - return TRUE; + return true; } } else { TQObjectList *l = viewport()->queryList( "TQWidget" ); @@ -4044,9 +4044,9 @@ bool TQTable::eventFilter( TQObject *o, TQEvent *e ) ke->key() != Key_Up && ke->key() != Key_Down && ke->key() != Key_Prior && ke->key() != Key_Next && ke->key() != Key_Home && ke->key() != Key_End ) ) - return FALSE; + return false; keyPressEvent( (TQKeyEvent*)e ); - return TRUE; + return true; } delete l; } @@ -4056,8 +4056,8 @@ bool TQTable::eventFilter( TQObject *o, TQEvent *e ) if ( isEditing() && editorWidget && o == editorWidget && ( (TQFocusEvent*)e )->reason() != TQFocusEvent::Popup ) { TQTableItem *itm = item( editRow, editCol ); if ( !itm || itm->editType() == TQTableItem::OnTyping ) { - endEdit( editRow, editCol, TRUE, edMode != Editing ); - return TRUE; + endEdit( editRow, editCol, true, edMode != Editing ); + return true; } } break; @@ -4067,7 +4067,7 @@ bool TQTable::eventFilter( TQObject *o, TQEvent *e ) TQWheelEvent* we = (TQWheelEvent*)e; scrollBy( 0, -we->delta() ); we->accept(); - return TRUE; + return true; } #endif default: @@ -4126,30 +4126,30 @@ void TQTable::keyPressEvent( TQKeyEvent* e ) int oldRow = tmpRow; int oldCol = tmpCol; - bool navigationKey = FALSE; + bool navigationKey = false; int r; switch ( e->key() ) { case Key_Left: tmpCol = TQMAX( 0, tmpCol - 1 ); - navigationKey = TRUE; + navigationKey = true; break; case Key_Right: tmpCol = TQMIN( numCols() - 1, tmpCol + 1 ); - navigationKey = TRUE; + navigationKey = true; break; case Key_Up: tmpRow = TQMAX( 0, tmpRow - 1 ); - navigationKey = TRUE; + navigationKey = true; break; case Key_Down: tmpRow = TQMIN( numRows() - 1, tmpRow + 1 ); - navigationKey = TRUE; + navigationKey = true; break; case Key_Prior: r = TQMAX( 0, rowAt( rowPos( tmpRow ) - visibleHeight() ) ); if ( r < tmpRow || tmpRow < 0 ) tmpRow = r; - navigationKey = TRUE; + navigationKey = true; break; case Key_Next: r = TQMIN( numRows() - 1, rowAt( rowPos( tmpRow ) + visibleHeight() ) ); @@ -4157,18 +4157,18 @@ void TQTable::keyPressEvent( TQKeyEvent* e ) tmpRow = r; else tmpRow = numRows() - 1; - navigationKey = TRUE; + navigationKey = true; break; case Key_Home: tmpRow = 0; - navigationKey = TRUE; + navigationKey = true; break; case Key_End: tmpRow = numRows() - 1; - navigationKey = TRUE; + navigationKey = true; break; case Key_F2: - if ( beginEdit( tmpRow, tmpCol, FALSE ) ) + if ( beginEdit( tmpRow, tmpCol, false ) ) setEditMode( Editing, tmpRow, tmpCol ); break; case Key_Enter: case Key_Return: @@ -4207,7 +4207,7 @@ void TQTable::keyPressEvent( TQKeyEvent* e ) TQTableItem *itm = item( tmpRow, tmpCol ); if ( !itm || itm->editType() == TQTableItem::OnTyping ) { TQWidget *w = beginEdit( tmpRow, tmpCol, - itm ? itm->isReplaceable() : TRUE ); + itm ? itm->isReplaceable() : true ); if ( w ) { setEditMode( ( !itm || ( itm && itm->isReplaceable() ) ? Replacing : Editing ), tmpRow, tmpCol ); @@ -4224,10 +4224,10 @@ void TQTable::keyPressEvent( TQKeyEvent* e ) fixCell( tmpRow, tmpCol, e->key() ); if ( ( e->state() & ShiftButton ) == ShiftButton && selMode != NoSelection && selMode != SingleRow ) { - bool justCreated = FALSE; - setCurrentCell( tmpRow, tmpCol, FALSE, TRUE ); + bool justCreated = false; + setCurrentCell( tmpRow, tmpCol, false, true ); if ( !currentSel ) { - justCreated = TRUE; + justCreated = true; currentSel = new TQTableSelection(); selections.append( currentSel ); if ( !isRowSelection( selectionMode() ) ) @@ -4243,23 +4243,23 @@ void TQTable::keyPressEvent( TQKeyEvent* e ) repaintSelections( justCreated ? 0 : &oldSelection, currentSel ); emit selectionChanged(); } else { - setCurrentCell( tmpRow, tmpCol, FALSE, TRUE ); + setCurrentCell( tmpRow, tmpCol, false, true ); if ( !isRowSelection( selectionMode() ) ) { clearSelection(); } else { - bool currentInSelection = tmpRow == oldRow && isSelected( tmpRow, tmpCol, FALSE ); + bool currentInSelection = tmpRow == oldRow && isSelected( tmpRow, tmpCol, false ); if ( !currentInSelection ) { - bool hasOldSel = FALSE; + bool hasOldSel = false; TQTableSelection oldSelection; if ( selectionMode() == MultiRow ) { bool b = signalsBlocked(); - blockSignals( TRUE ); + blockSignals( true ); clearSelection(); blockSignals( b ); } else { if ( currentSel ) { oldSelection = *currentSel; - hasOldSel = TRUE; + hasOldSel = true; selections.removeRef( currentSel ); leftHeader->setSectionState( oldSelection.topRow(), TQTableHeader::Normal ); } @@ -4274,7 +4274,7 @@ void TQTable::keyPressEvent( TQKeyEvent* e ) } } } else { - setCurrentCell( tmpRow, tmpCol, FALSE, TRUE ); + setCurrentCell( tmpRow, tmpCol, false, true ); } } @@ -4283,7 +4283,7 @@ void TQTable::keyPressEvent( TQKeyEvent* e ) void TQTable::focusInEvent( TQFocusEvent* ) { - d->inMenuMode = FALSE; + d->inMenuMode = false; TQWidget *editorWidget = cellWidget( editRow, editCol ); updateCell( curRow, curCol ); if ( style().styleHint( TQStyle::SH_ItemView_ChangeHighlightOnFocus, this ) ) @@ -4374,7 +4374,7 @@ void TQTable::paintEvent( TQPaintEvent *e ) #endif } -static bool inUpdateCell = FALSE; +static bool inUpdateCell = false; /*! Repaints the cell at \a row, \a col. @@ -4384,13 +4384,13 @@ void TQTable::updateCell( int row, int col ) { if ( inUpdateCell || row < 0 || col < 0 ) return; - inUpdateCell = TRUE; + inUpdateCell = true; TQRect cg = cellGeometry( row, col ); TQRect r( contentsToViewport( TQPoint( cg.x() - 2, cg.y() - 2 ) ), TQSize( cg.width() + 4, cg.height() + 4 ) ); if (viewport()->rect().intersects(r)) - TQApplication::postEvent( viewport(), new TQPaintEvent( r, FALSE ) ); - inUpdateCell = FALSE; + TQApplication::postEvent( viewport(), new TQPaintEvent( r, false ) ); + inUpdateCell = false; } void TQTable::repaintCell( int row, int col ) @@ -4404,7 +4404,7 @@ void TQTable::repaintCell( int row, int col ) TQRect v = viewport()->rect(); v.moveBy(contentsX(), contentsY()); if (v.intersects(r)) - repaintContents( r, FALSE ); + repaintContents( r, false ); } void TQTable::contentsToViewport2( int x, int y, int& vx, int& vy ) @@ -4450,10 +4450,10 @@ void TQTable::columnWidthChanged( int col ) resizeContents( s.width(), s.height() ); if ( contentsWidth() < w ) repaintContents( s.width(), contentsY(), - w - s.width() + 1, visibleHeight(), TRUE ); + w - s.width() + 1, visibleHeight(), true ); else repaintContents( w, contentsY(), - s.width() - w + 1, visibleHeight(), FALSE ); + s.width() - w + 1, visibleHeight(), false ); // update widgets that are affected by this change if ( widgets.size() ) { @@ -4481,10 +4481,10 @@ void TQTable::rowHeightChanged( int row ) resizeContents( s.width(), s.height() ); if ( contentsHeight() < h ) { repaintContents( contentsX(), contentsHeight(), - visibleWidth(), h - s.height() + 1, TRUE ); + visibleWidth(), h - s.height() + 1, true ); } else { repaintContents( contentsX(), h, - visibleWidth(), s.height() - h + 1, FALSE ); + visibleWidth(), s.height() - h + 1, false ); } // update widgets that are affected by this change @@ -4539,7 +4539,7 @@ void TQTable::columnIndexChanged( int, int fromIndex, int toIndex ) if ( doSort && lastSortCol == fromIndex && topHeader ) topHeader->setSortIndicator( toIndex, topHeader->sortIndicatorOrder() ); repaintContents( contentsX(), contentsY(), - visibleWidth(), visibleHeight(), FALSE ); + visibleWidth(), visibleHeight(), false ); } /*! @@ -4556,12 +4556,12 @@ void TQTable::columnIndexChanged( int, int fromIndex, int toIndex ) void TQTable::rowIndexChanged( int, int, int ) { repaintContents( contentsX(), contentsY(), - visibleWidth(), visibleHeight(), FALSE ); + visibleWidth(), visibleHeight(), false ); } /*! This function is called when the column \a col has been clicked. - The default implementation sorts this column if sorting() is TRUE. + The default implementation sorts this column if sorting() is true. */ void TQTable::columnClicked( int col ) @@ -4573,7 +4573,7 @@ void TQTable::columnClicked( int col ) asc = !asc; } else { lastSortCol = col; - asc = TRUE; + asc = true; } sortColumn( lastSortCol, asc ); } @@ -4597,11 +4597,11 @@ bool TQTable::sorting() const return doSort; } -static bool inUpdateGeometries = FALSE; +static bool inUpdateGeometries = false; void TQTable::delayedUpdateGeometries() { - d->geomTimer->start( 0, TRUE ); + d->geomTimer->start( 0, true ); } void TQTable::updateGeometriesSlot() @@ -4618,7 +4618,7 @@ void TQTable::updateGeometries() { if ( inUpdateGeometries ) return; - inUpdateGeometries = TRUE; + inUpdateGeometries = true; TQSize ts = tableSize(); if ( topHeader->offset() && ts.width() < topHeader->offset() + topHeader->width() ) @@ -4635,7 +4635,7 @@ void TQTable::updateGeometries() verticalScrollBar()->raise(); topHeader->updateStretches(); leftHeader->updateStretches(); - inUpdateGeometries = FALSE; + inUpdateGeometries = false; } /*! @@ -4779,7 +4779,7 @@ void TQTable::saveContents( TQPtrVector<TQTableItem> &tmp, { int nCols = numCols(); if ( editRow != -1 && editCol != -1 ) - endEdit( editRow, editCol, FALSE, edMode != Editing ); + endEdit( editRow, editCol, false, edMode != Editing ); tmp.resize( contents.size() ); tmp2.resize( widgets.size() ); int i; @@ -4808,12 +4808,12 @@ void TQTable::updateHeaderAndResizeContents( TQTableHeader *header, header->TQHeader::resizeArrays( rowCol ); header->TQTableHeader::resizeArrays( rowCol ); int old = num; - clearSelection( FALSE ); + clearSelection( false ); int i = 0; for ( i = old; i < rowCol; ++i ) header->addLabel( TQString::null, width ); } else { - clearSelection( FALSE ); + clearSelection( false ); if ( header == leftHeader ) { while ( numRows() > rowCol ) header->removeLabel( numRows() - 1 ); @@ -4823,12 +4823,12 @@ void TQTable::updateHeaderAndResizeContents( TQTableHeader *header, } } - contents.setAutoDelete( FALSE ); + contents.setAutoDelete( false ); contents.clear(); - contents.setAutoDelete( TRUE ); - widgets.setAutoDelete( FALSE ); + contents.setAutoDelete( true ); + widgets.setAutoDelete( false ); widgets.clear(); - widgets.setAutoDelete( TRUE ); + widgets.setAutoDelete( true ); resizeData( numRows() * numCols() ); // keep numStretches in sync @@ -4888,10 +4888,10 @@ void TQTable::finishContentsResze( bool updateBefore ) updateGeometries(); if ( updateBefore ) repaintContents( contentsX(), contentsY(), - visibleWidth(), visibleHeight(), TRUE ); + visibleWidth(), visibleHeight(), true ); else repaintContents( contentsX(), contentsY(), - visibleWidth(), visibleHeight(), FALSE ); + visibleWidth(), visibleHeight(), false ); if ( isRowSelection( selectionMode() ) ) { int r = curRow; @@ -4920,7 +4920,7 @@ void TQTable::setNumRows( int r ) saveContents( tmp, tmp2 ); bool isUpdatesEnabled = leftHeader->isUpdatesEnabled(); - leftHeader->setUpdatesEnabled( FALSE ); + leftHeader->setUpdatesEnabled( false ); bool updateBefore; updateHeaderAndResizeContents( leftHeader, numRows(), r, 20, updateBefore ); @@ -4969,7 +4969,7 @@ void TQTable::setNumCols( int c ) saveContents( tmp, tmp2 ); bool isUpdatesEnabled = topHeader->isUpdatesEnabled(); - topHeader->setUpdatesEnabled( FALSE ); + topHeader->setUpdatesEnabled( false ); bool updateBefore; updateHeaderAndResizeContents( topHeader, numCols(), c, 100, updateBefore ); @@ -5009,15 +5009,15 @@ void TQTable::setColumnLabels( const TQStringList &labels ) This function returns the widget which should be used as an editor for the contents of the cell at \a row, \a col. - If \a initFromCell is TRUE, the editor is used to edit the current + If \a initFromCell is true, the editor is used to edit the current contents of the cell (so the editor widget should be initialized - with this content). If \a initFromCell is FALSE, the content of + with this content). If \a initFromCell is false, the content of the cell is replaced with the new content which the user entered into the widget created by this function. The default functionality is as follows: if \a initFromCell is - TRUE or the cell has a TQTableItem and the table item's - TQTableItem::isReplaceable() is FALSE then the cell is asked to + true or the cell has a TQTableItem and the table item's + TQTableItem::isReplaceable() is false then the cell is asked to create an appropriate editor (using TQTableItem::createEditor()). Otherwise a TQLineEdit is used as the editor. @@ -5068,7 +5068,7 @@ TQWidget *TQTable::createEditor( int row, int col, bool initFromCell ) const // no contents in the cell yet, so open the default editor if ( !e ) { e = new TQLineEdit( viewport(), "qt_lineeditor" ); - ( (TQLineEdit*)e )->setFrame( FALSE ); + ( (TQLineEdit*)e )->setFrame( false ); } return e; @@ -5080,7 +5080,7 @@ TQWidget *TQTable::createEditor( int row, int col, bool initFromCell ) const (createEditor() is called) and setting the cell's editor with setCellWidget() to the newly created editor. (After editing is complete endEdit() will be called to replace the cell's content - with the editor's content.) If \a replace is TRUE the editor will + with the editor's content.) If \a replace is true the editor will start empty; otherwise it will be initialized with the cell's content (if any), i.e. the user will be modifying the original cell content. @@ -5115,11 +5115,11 @@ TQWidget *TQTable::beginEdit( int row, int col, bool replace ) This function is called when in-place editing of the cell at \a row, \a col is requested to stop. - If the cell is not being edited or \a accept is FALSE the function + If the cell is not being edited or \a accept is false the function returns and the cell's contents are left unchanged. - If \a accept is TRUE the content of the editor must be transferred - to the relevant cell. If \a replace is TRUE the current content of + If \a accept is true the content of the editor must be transferred + to the relevant cell. If \a replace is true the current content of this cell should be replaced by the content of the editor (this means removing the current TQTableItem of the cell and creating a new one for the cell). Otherwise (if possible) the content of the @@ -5208,8 +5208,8 @@ void TQTable::setCellContentFromEditor( int row, int col ) } /*! - Returns TRUE if the \l EditMode is \c Editing or \c Replacing; - otherwise (i.e. the \l EditMode is \c NotEditing) returns FALSE. + Returns true if the \l EditMode is \c Editing or \c Replacing; + otherwise (i.e. the \l EditMode is \c NotEditing) returns false. \sa TQTable::EditMode */ @@ -5275,8 +5275,8 @@ void TQTable::repaintSelections( TQTableSelection *oldSelection, if ( oldSelection && !oldSelection->isActive() ) oldSelection = 0; - bool optimizeOld = FALSE; - bool optimizeNew = FALSE; + bool optimizeOld = false; + bool optimizeNew = false; TQRect old; if ( oldSelection ) @@ -5303,7 +5303,7 @@ void TQTable::repaintSelections( TQTableSelection *oldSelection, old.width() > SHRT_MAX || old.height() > SHRT_MAX || cur.width() > SHRT_MAX || cur.height() > SHRT_MAX ) { TQRect rr = cur.unite( old ); - repaintContents( rr, FALSE ); + repaintContents( rr, false ); } else { old = TQRect( contentsToViewport2( old.topLeft() ), old.size() ); cur = TQRect( contentsToViewport2( cur.topLeft() ), cur.size() ); @@ -5315,12 +5315,12 @@ void TQTable::repaintSelections( TQTableSelection *oldSelection, for ( i = 0; i < (int)r3.rects().count(); ++i ) { TQRect r( r3.rects()[ i ] ); r = TQRect( viewportToContents2( r.topLeft() ), r.size() ); - repaintContents( r, FALSE ); + repaintContents( r, false ); } for ( i = 0; i < (int)r4.rects().count(); ++i ) { TQRect r( r4.rects()[ i ] ); r = TQRect( viewportToContents2( r.topLeft() ), r.size() ); - repaintContents( r, FALSE ); + repaintContents( r, false ); } } @@ -5354,13 +5354,13 @@ void TQTable::repaintSelections( TQTableSelection *oldSelection, for ( i = left; i <= right; ++i ) { if ( !isColumnSelected( i ) ) *s = TQTableHeader::Normal; - else if ( isColumnSelected( i, TRUE ) ) + else if ( isColumnSelected( i, true ) ) *s = TQTableHeader::Selected; else *s = TQTableHeader::Bold; ++s; } - topHeader->repaint( FALSE ); + topHeader->repaint( false ); } if ( updateVertical && numRows() > 0 && top >= 0 ) { @@ -5368,13 +5368,13 @@ void TQTable::repaintSelections( TQTableSelection *oldSelection, for ( i = top; i <= bottom; ++i ) { if ( !isRowSelected( i ) ) *s = TQTableHeader::Normal; - else if ( isRowSelected( i, TRUE ) ) + else if ( isRowSelected( i, true ) ) *s = TQTableHeader::Selected; else *s = TQTableHeader::Bold; ++s; } - leftHeader->repaint( FALSE ); + leftHeader->repaint( false ); } } @@ -5396,12 +5396,12 @@ void TQTable::repaintSelections() s->rightCol(), b ) ); } - repaintContents( r, FALSE ); + repaintContents( r, false ); } /*! Clears all selections and repaints the appropriate regions if \a - repaint is TRUE. + repaint is true. \sa removeSelection() */ @@ -5425,13 +5425,13 @@ void TQTable::clearSelection( bool repaint ) selections.clear(); if ( needRepaint && repaint ) - repaintContents( r, FALSE ); + repaintContents( r, false ); leftHeader->setSectionStateToAll( TQTableHeader::Normal ); - leftHeader->repaint( FALSE ); + leftHeader->repaint( false ); if ( !isRowSelection( selectionMode() ) ) { topHeader->setSectionStateToAll( TQTableHeader::Normal ); - topHeader->repaint( FALSE ); + topHeader->repaint( false ); } topHeader->setSectionState( curCol, TQTableHeader::Bold ); leftHeader->setSectionState( curRow, TQTableHeader::Bold ); @@ -5452,14 +5452,14 @@ TQRect TQTable::rangeGeometry( int topRow, int leftCol, int ca = columnAt( contentsX() + visibleWidth() ); if ( ca != -1 ) rightCol = TQMIN( rightCol, ca ); - optimize = TRUE; + optimize = true; TQRect rect; for ( int r = topRow; r <= bottomRow; ++r ) { for ( int c = leftCol; c <= rightCol; ++c ) { rect = rect.unite( cellGeometry( r, c ) ); TQTableItem *i = item( r, c ); if ( i && ( i->rowSpan() > 1 || i->colSpan() > 1 ) ) - optimize = FALSE; + optimize = false; } } return rect; @@ -5563,10 +5563,10 @@ static int cmpTableItems( const void *n1, const void *n2 ) #endif /*! - Sorts column \a col. If \a ascending is TRUE the sort is in + Sorts column \a col. If \a ascending is true the sort is in ascending order, otherwise the sort is in descending order. - If \a wholeRows is TRUE, entire rows are sorted using swapRows(); + If \a wholeRows is true, entire rows are sorted using swapRows(); otherwise only cells in the column are sorted using swapCells(). Note that if you are not using TQTableItems you will need to @@ -5600,7 +5600,7 @@ void TQTable::sortColumn( int col, bool ascending, bool wholeRows ) qsort( items, filledRows, sizeof( SortableTableItem ), cmpTableItems ); bool updatesEnabled = isUpdatesEnabled(); - setUpdatesEnabled( FALSE ); + setUpdatesEnabled( false ); for ( i = 0; i < numRows(); ++i ) { if ( i < filledRows ) { if ( ascending ) { @@ -5627,10 +5627,10 @@ void TQTable::sortColumn( int col, bool ascending, bool wholeRows ) if ( !wholeRows ) repaintContents( columnPos( col ), contentsY(), - columnWidth( col ), visibleHeight(), FALSE ); + columnWidth( col ), visibleHeight(), false ); else repaintContents( contentsX(), contentsY(), - visibleWidth(), visibleHeight(), FALSE ); + visibleWidth(), visibleHeight(), false ); delete [] items; } @@ -5647,7 +5647,7 @@ void TQTable::hideRow( int row ) return; d->hiddenRows.replace( row, new int( leftHeader->sectionSize( row ) ) ); leftHeader->resizeSection( row, 0 ); - leftHeader->setResizeEnabled( FALSE, row ); + leftHeader->setResizeEnabled( false, row ); if ( isRowStretchable(row) ) leftHeader->numStretches--; rowHeightChanged( row ); @@ -5673,7 +5673,7 @@ void TQTable::hideColumn( int col ) return; d->hiddenCols.replace( col, new int( topHeader->sectionSize( col ) ) ); topHeader->resizeSection( col, 0 ); - topHeader->setResizeEnabled( FALSE, col ); + topHeader->setResizeEnabled( false, col ); if ( isColumnStretchable(col) ) topHeader->numStretches--; columnWidthChanged( col ); @@ -5705,7 +5705,7 @@ void TQTable::showRow( int row ) } else if ( rowHeight( row ) == 0 ) { setRowHeight( row, 20 ); } - leftHeader->setResizeEnabled( TRUE, row ); + leftHeader->setResizeEnabled( true, row ); } /*! @@ -5726,12 +5726,12 @@ void TQTable::showColumn( int col ) } else if ( columnWidth( col ) == 0 ) { setColumnWidth( col, 20 ); } - topHeader->setResizeEnabled( TRUE, col ); + topHeader->setResizeEnabled( true, col ); } /*! - Returns TRUE if row \a row is hidden; otherwise returns - FALSE. + Returns true if row \a row is hidden; otherwise returns + false. \sa hideRow(), isColumnHidden() */ @@ -5741,8 +5741,8 @@ bool TQTable::isRowHidden( int row ) const } /*! - Returns TRUE if column \a col is hidden; otherwise returns - FALSE. + Returns true if column \a col is hidden; otherwise returns + false. \sa hideColumn(), isRowHidden() */ @@ -5853,7 +5853,7 @@ void TQTable::adjustRow( int row ) } /*! - If \a stretch is TRUE, column \a col is set to be stretchable; + If \a stretch is true, column \a col is set to be stretchable; otherwise column \a col is set to be unstretchable. If the table widget's width decreases or increases stretchable @@ -5873,7 +5873,7 @@ void TQTable::setColumnStretchable( int col, bool stretch ) } /*! - If \a stretch is TRUE, row \a row is set to be stretchable; + If \a stretch is true, row \a row is set to be stretchable; otherwise row \a row is set to be unstretchable. If the table widget's height decreases or increases stretchable @@ -5893,8 +5893,8 @@ void TQTable::setRowStretchable( int row, bool stretch ) } /*! - Returns TRUE if column \a col is stretchable; otherwise returns - FALSE. + Returns true if column \a col is stretchable; otherwise returns + false. \sa setColumnStretchable() isRowStretchable() */ @@ -5905,8 +5905,8 @@ bool TQTable::isColumnStretchable( int col ) const } /*! - Returns TRUE if row \a row is stretchable; otherwise returns - FALSE. + Returns true if row \a row is stretchable; otherwise returns + false. \sa setRowStretchable() isColumnStretchable() */ @@ -5934,7 +5934,7 @@ void TQTable::takeItem( TQTableItem *i ) if ( !i ) return; TQRect rect = cellGeometry( i->row(), i->col() ); - contents.setAutoDelete( FALSE ); + contents.setAutoDelete( false ); int bottom = i->row() + i->rowSpan(); if ( bottom > numRows() ) bottom = numRows(); @@ -5945,8 +5945,8 @@ void TQTable::takeItem( TQTableItem *i ) for ( int c = i->col(); c < right; ++c ) contents.remove( indexOf( r, c ) ); } - contents.setAutoDelete( TRUE ); - repaintContents( rect, FALSE ); + contents.setAutoDelete( true ); + repaintContents( rect, false ); int orow = i->row(); int ocol = i->col(); i->setRow( -1 ); @@ -5981,7 +5981,7 @@ void TQTable::setCellWidget( int row, int col, TQWidget *e ) TQWidget *w = cellWidget( row, col ); if ( w && row == editRow && col == editCol ) - endEdit( editRow, editCol, FALSE, edMode != Editing ); + endEdit( editRow, editCol, false, edMode != Editing ); e->installEventFilter( this ); clearCellWidget( row, col ); @@ -6067,9 +6067,9 @@ void TQTable::clearCellWidget( int row, int col ) w->removeEventFilter( this ); w->deleteLater(); } - widgets.setAutoDelete( FALSE ); + widgets.setAutoDelete( false ); widgets.remove( indexOf( row, col ) ); - widgets.setAutoDelete( TRUE ); + widgets.setAutoDelete( true ); } /*! @@ -6081,7 +6081,7 @@ void TQTable::clearCellWidget( int row, int col ) */ /*! - If \a b is TRUE, the table starts a drag (see dragObject()) when + If \a b is true, the table starts a drag (see dragObject()) when the user presses and moves the mouse on a selected cell. */ @@ -6091,7 +6091,7 @@ void TQTable::setDragEnabled( bool b ) } /*! - If this function returns TRUE, the table supports dragging. + If this function returns true, the table supports dragging. \sa setDragEnabled(); */ @@ -6124,9 +6124,9 @@ void TQTable::insertRows( int row, int count ) return; bool updatesEnabled = isUpdatesEnabled(); - setUpdatesEnabled( FALSE ); + setUpdatesEnabled( false ); bool leftHeaderUpdatesEnabled = leftHeader->isUpdatesEnabled(); - leftHeader->setUpdatesEnabled( FALSE ); + leftHeader->setUpdatesEnabled( false ); int oldLeftMargin = leftMargin(); setNumRows( numRows() + count ); @@ -6141,7 +6141,7 @@ void TQTable::insertRows( int row, int count ) int cc = TQMAX( 0, currentColumn() ); if ( curRow > row ) curRow -= count; // this is where curRow was - setCurrentCell( cr, cc, TRUE, FALSE ); // without ensureCellVisible + setCurrentCell( cr, cc, true, false ); // without ensureCellVisible // Repaint the header if ( leftHeaderUpdatesEnabled ) { @@ -6182,9 +6182,9 @@ void TQTable::insertColumns( int col, int count ) return; bool updatesEnabled = isUpdatesEnabled(); - setUpdatesEnabled( FALSE ); + setUpdatesEnabled( false ); bool topHeaderUpdatesEnabled = topHeader->isUpdatesEnabled(); - topHeader->setUpdatesEnabled( FALSE ); + topHeader->setUpdatesEnabled( false ); int oldTopMargin = topMargin(); setNumCols( numCols() + count ); @@ -6199,7 +6199,7 @@ void TQTable::insertColumns( int col, int count ) int cc = TQMAX( 0, currentColumn() ); if ( curCol > col ) curCol -= count; // this is where curCol was - setCurrentCell( cr, cc, TRUE, FALSE ); // without ensureCellVisible + setCurrentCell( cr, cc, true, false ); // without ensureCellVisible // Repaint the header if ( topHeaderUpdatesEnabled ) { @@ -6321,7 +6321,7 @@ void TQTable::removeColumns( const TQMemArray<int> &cols ) /*! Starts editing the cell at \a row, \a col. - If \a replace is TRUE the content of this cell will be replaced by + If \a replace is true the content of this cell will be replaced by the content of the editor when editing is finished, i.e. the user will be entering new data; otherwise the current content of the cell (if any) will be modified in the editor. @@ -6360,7 +6360,7 @@ void TQTable::contentsDragEnterEvent( TQDragEnterEvent *e ) fixRow( tmpRow, e->pos().y() ); fixCol( tmpCol, e->pos().x() ); if (e->source() != (TQObject*)cellWidget( currentRow(), currentColumn() ) ) - setCurrentCell( tmpRow, tmpCol, FALSE, TRUE ); + setCurrentCell( tmpRow, tmpCol, false, true ); e->accept(); } @@ -6379,7 +6379,7 @@ void TQTable::contentsDragMoveEvent( TQDragMoveEvent *e ) fixRow( tmpRow, e->pos().y() ); fixCol( tmpCol, e->pos().x() ); if (e->source() != (TQObject*)cellWidget( currentRow(), currentColumn() ) ) - setCurrentCell( tmpRow, tmpCol, FALSE, TRUE ); + setCurrentCell( tmpRow, tmpCol, false, true ); e->accept(); } @@ -6390,7 +6390,7 @@ void TQTable::contentsDragMoveEvent( TQDragMoveEvent *e ) void TQTable::contentsDragLeaveEvent( TQDragLeaveEvent * ) { - setCurrentCell( oldCurrentRow, oldCurrentCol, FALSE, TRUE ); + setCurrentCell( oldCurrentRow, oldCurrentCol, false, true ); } /*! @@ -6401,13 +6401,13 @@ void TQTable::contentsDragLeaveEvent( TQDragLeaveEvent * ) void TQTable::contentsDropEvent( TQDropEvent *e ) { - setCurrentCell( oldCurrentRow, oldCurrentCol, FALSE, TRUE ); + setCurrentCell( oldCurrentRow, oldCurrentCol, false, true ); emit dropped( e ); } /*! If the user presses the mouse on a selected cell, starts moving - (i.e. dragging), and dragEnabled() is TRUE, this function is + (i.e. dragging), and dragEnabled() is true, this function is called to obtain a drag object. A drag using this object begins immediately unless dragObject() returns 0. @@ -6465,7 +6465,7 @@ void TQTable::setEnabled( bool b ) if ( !b ) { // editor will lose focus, causing a crash deep in setEnabled(), // so we'll end the edit early. - endEdit( editRow, editCol, TRUE, edMode != Editing ); + endEdit( editRow, editCol, true, edMode != Editing ); } TQScrollView::setEnabled(b); } @@ -6507,16 +6507,16 @@ void TQTable::setEnabled( bool b ) TQTableHeader::TQTableHeader( int i, TQTable *t, TQWidget *parent, const char *name ) - : TQHeader( i, parent, name ), mousePressed(FALSE), startPos(-1), - table( t ), caching( FALSE ), resizedSection(-1), + : TQHeader( i, parent, name ), mousePressed(false), startPos(-1), + table( t ), caching( false ), resizedSection(-1), numStretches( 0 ) { - setIsATableHeader( TRUE ); + setIsATableHeader( true ); d = 0; states.resize( i ); stretchable.resize( i ); states.fill( Normal, -1 ); - stretchable.fill( FALSE, -1 ); + stretchable.fill( false, -1 ); autoScrollTimer = new TQTimer( this ); connect( autoScrollTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( doAutoScroll() ) ); @@ -6563,7 +6563,7 @@ void TQTableHeader::addLabel( const TQString &s , int size ) stretchable.resize( count() ); for ( ; s < count(); ++s ) { states[ s ] = Normal; - stretchable[ s ] = FALSE; + stretchable[ s ] = false; } } } @@ -6584,7 +6584,7 @@ void TQTableHeader::resizeArrays( int n ) stretchable.resize( n ); if ( n > old ) { for ( int i = old; i < n; ++i ) { - stretchable[ i ] = FALSE; + stretchable[ i ] = false; states[ i ] = Normal; } } @@ -6621,9 +6621,9 @@ void TQTableHeader::setSectionState( int s, SectionState astate ) states.data()[ s ] = astate; if ( isUpdatesEnabled() ) { if ( orientation() == Horizontal ) - repaint( sectionPos( s ) - offset(), 0, sectionSize( s ), height(), FALSE ); + repaint( sectionPos( s ) - offset(), 0, sectionSize( s ), height(), false ); else - repaint( 0, sectionPos( s ) - offset(), width(), sectionSize( s ), FALSE ); + repaint( 0, sectionPos( s ) - offset(), width(), sectionSize( s ), false ); } } @@ -6692,7 +6692,7 @@ void TQTableHeader::paintEvent( TQPaintEvent *e ) if ( !( orientation() == Horizontal && isRowSelection( table->selectionMode() ) ) && ( sectionState( i ) == Bold || sectionState( i ) == Selected ) ) { TQFont f( font() ); - f.setBold( TRUE ); + f.setBold( true ); p.setFont( f ); } paintSection( &p, i, r ); @@ -6755,14 +6755,14 @@ void TQTableHeader::mousePressEvent( TQMouseEvent *e ) if ( e->button() != LeftButton ) return; TQHeader::mousePressEvent( e ); - mousePressed = TRUE; + mousePressed = true; pressPos = real_pos( e->pos(), orientation() ); if ( !table->currentSel || ( e->state() & ShiftButton ) != ShiftButton ) startPos = -1; - setCaching( TRUE ); + setCaching( true ); resizedSection = -1; #ifdef TQT_NO_CURSOR - isResizing = FALSE; + isResizing = false; #else isResizing = cursor().shape() != ArrowCursor; if ( !isResizing && sectionAt( pressPos ) != -1 ) @@ -6796,13 +6796,13 @@ bool TQTableHeader::doSelection( TQMouseEvent *e ) if ( isRowSelection( table->selectionMode() ) ) { if ( orientation() == Horizontal ) - return TRUE; + return true; if ( table->selectionMode() == TQTable::SingleRow ) { int secAt = sectionAt( p ); if ( secAt == -1 ) - return TRUE; + return true; table->setCurrentCell( secAt, table->currentColumn() ); - return TRUE; + return true; } } @@ -6814,7 +6814,7 @@ bool TQTableHeader::doSelection( TQMouseEvent *e ) table->selectionMode() == TQTable::SingleRow ) { startPos = p; bool b = table->signalsBlocked(); - table->blockSignals( TRUE ); + table->blockSignals( true ); table->clearSelection(); table->blockSignals( b ); } @@ -6825,7 +6825,7 @@ bool TQTableHeader::doSelection( TQMouseEvent *e ) TQTableSelection *oldSelection = table->currentSel; if ( orientation() == Vertical ) { - if ( !table->isRowSelected( secAt, TRUE ) ) { + if ( !table->isRowSelected( secAt, true ) ) { table->currentSel = new TQTableSelection(); table->selections.append( table->currentSel ); table->currentSel->init( secAt, 0 ); @@ -6834,7 +6834,7 @@ bool TQTableHeader::doSelection( TQMouseEvent *e ) } table->setCurrentCell( secAt, 0 ); } else { // orientation == Horizontal - if ( !table->isColumnSelected( secAt, TRUE ) ) { + if ( !table->isColumnSelected( secAt, true ) ) { table->currentSel = new TQTableSelection(); table->selections.append( table->currentSel ); table->currentSel->init( 0, secAt ); @@ -6855,7 +6855,7 @@ bool TQTableHeader::doSelection( TQMouseEvent *e ) if ( sectionAt( p ) != -1 ) endPos = p; - return TRUE; + return true; } } @@ -6866,12 +6866,12 @@ bool TQTableHeader::doSelection( TQMouseEvent *e ) p -= offset(); if ( orientation() == Horizontal && ( p < 0 || p > width() ) ) { doAutoScroll(); - autoScrollTimer->start( 100, TRUE ); + autoScrollTimer->start( 100, true ); } else if ( orientation() == Vertical && ( p < 0 || p > height() ) ) { doAutoScroll(); - autoScrollTimer->start( 100, TRUE ); + autoScrollTimer->start( 100, true ); } - return TRUE; + return true; } return table->selectionMode() == TQTable::NoSelection; } @@ -6907,8 +6907,8 @@ void TQTableHeader::mouseReleaseEvent( TQMouseEvent *e ) if ( e->button() != LeftButton ) return; autoScrollTimer->stop(); - mousePressed = FALSE; - setCaching( FALSE ); + mousePressed = false; + setCaching( false ); TQHeader::mouseReleaseEvent( e ); #ifndef NO_LINE_WIDGET line1->hide(); @@ -6990,7 +6990,7 @@ void TQTableHeader::resizeEvent( TQResizeEvent *e ) TQHeader::resizeEvent( e ); if ( numStretches == 0 ) return; - stretchTimer->start( 0, TRUE ); + stretchTimer->start( 0, true ); } void TQTableHeader::updateStretches() @@ -7005,7 +7005,7 @@ void TQTableHeader::updateStretches() int pd = dim - ( sectionPos(count() - 1) + sectionSize(count() - 1) ); bool block = signalsBlocked(); - blockSignals( TRUE ); + blockSignals( true ); for ( i = 0; i < (int)stretchable.count(); ++i ) { if ( !stretchable[i] || ( stretchable[i] && table->d->hiddenCols[i] ) ) @@ -7023,8 +7023,8 @@ void TQTableHeader::updateStretches() resizeSection( i, TQMAX( 20, pd ) ); } blockSignals( block ); - table->repaintContents( FALSE ); - widgetStretchTimer->start( 100, TRUE ); + table->repaintContents( false ); + widgetStretchTimer->start( 100, true ); } void TQTableHeader::updateWidgetStretches() @@ -7052,7 +7052,7 @@ void TQTableHeader::updateSelections() *s = Selected; ++s; } - repaint( FALSE ); + repaint( false ); if (table->currentSel) { TQTableSelection oldSelection = *table->currentSel; @@ -7090,7 +7090,7 @@ void TQTableHeader::doAutoScroll() else table->ensureVisible( table->contentsX(), endPos ); updateSelections(); - autoScrollTimer->start( 100, TRUE ); + autoScrollTimer->start( 100, true ); } void TQTableHeader::sectionWidthChanged( int col, int, int ) @@ -7250,7 +7250,7 @@ void TQTableHeader::setCaching( bool b ) } /*! - If \a b is TRUE, section \a s is stretchable; otherwise the + If \a b is true, section \a s is stretchable; otherwise the section is not stretchable. \sa isSectionStretchable() @@ -7268,8 +7268,8 @@ void TQTableHeader::setSectionStretchable( int s, bool b ) } /*! - Returns TRUE if section \a s is stretcheable; otherwise returns - FALSE. + Returns true if section \a s is stretcheable; otherwise returns + false. \sa setSectionStretchable() */ @@ -7282,7 +7282,7 @@ bool TQTableHeader::isSectionStretchable( int s ) const void TQTableHeader::swapSections( int oldIdx, int newIdx, bool swapTable ) { extern bool tqt_qheader_label_return_null_strings; // tqheader.cpp - tqt_qheader_label_return_null_strings = TRUE; + tqt_qheader_label_return_null_strings = true; TQIconSet oldIconSet, newIconSet; if ( iconSet( oldIdx ) ) @@ -7298,7 +7298,7 @@ void TQTableHeader::swapSections( int oldIdx, int newIdx, bool swapTable ) setLabel( newIdx, oldIconSet, oldLabel ); } - tqt_qheader_label_return_null_strings = FALSE; + tqt_qheader_label_return_null_strings = false; int w1 = sectionSize( oldIdx ); int w2 = sectionSize( newIdx ); @@ -7344,7 +7344,7 @@ void TQTableHeader::setLabels(const TQStringList & labels) int i = 0; bool updates = isUpdatesEnabled(); const int c = TQMIN(count(), (int)labels.count()); - setUpdatesEnabled(FALSE); + setUpdatesEnabled(false); for ( TQStringList::ConstIterator it = labels.begin(); i < c; ++i, ++it ) { if (i == c - 1) { setUpdatesEnabled(updates); |
