summaryrefslogtreecommitdiffstats
path: root/src/widgets/tqlistbox.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2025-12-26 14:08:52 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2025-12-27 22:38:28 +0900
commit50326e196a9245af21604da7dc3a36eea52784ed (patch)
tree955f50c739379c59d3846c5c6ec25c8f5856fb91 /src/widgets/tqlistbox.cpp
parent854c5d5c9cfd48a2d5a17366fb6805219eab4859 (diff)
downloadtqt-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/tqlistbox.cpp')
-rw-r--r--src/widgets/tqlistbox.cpp387
1 files changed, 194 insertions, 193 deletions
diff --git a/src/widgets/tqlistbox.cpp b/src/widgets/tqlistbox.cpp
index c5032d1d4..a16f55007 100644
--- a/src/widgets/tqlistbox.cpp
+++ b/src/widgets/tqlistbox.cpp
@@ -69,20 +69,20 @@ public:
columnMode( TQListBox::FixedNumber ), numRows( 1 ), numColumns( 1 ),
currentRow( 0 ), currentColumn( 0 ),
mousePressRow( -1 ), mousePressColumn( -1 ),
- mouseMoveRow( -1 ), mouseMoveColumn( -1 ), mouseInternalPress( FALSE ),
+ mouseMoveRow( -1 ), mouseMoveColumn( -1 ), mouseInternalPress( false ),
scrollTimer( 0 ), updateTimer( 0 ), visibleTimer( 0 ),
selectionMode( TQListBox::Single ),
count( 0 ),
listBox( lb ), currInputString( TQString::null ),
- rowModeWins( FALSE ),
- ignoreMoves( FALSE ),
- layoutDirty( TRUE ),
- mustPaintAll( TRUE ),
- dragging( FALSE ),
- dirtyDrag ( FALSE ),
- variableHeight( TRUE /* !!! ### FALSE */ ),
- variableWidth( FALSE ),
- inMenuMode( FALSE )
+ rowModeWins( false ),
+ ignoreMoves( false ),
+ layoutDirty( true ),
+ mustPaintAll( true ),
+ dragging( false ),
+ dirtyDrag ( false ),
+ variableHeight( true /* !!! ### false */ ),
+ variableWidth( false ),
+ inMenuMode( false )
{}
int findItemByName( int item, const TQString &text );
~TQListBoxPrivate();
@@ -191,8 +191,8 @@ TQListBoxPrivate::~TQListBoxPrivate()
\obsolete
- Returns TRUE if vScrollBarMode() is \c Auto; otherwise returns
- FALSE.
+ Returns true if vScrollBarMode() is \c Auto; otherwise returns
+ false.
*/
/*!
@@ -200,7 +200,7 @@ TQListBoxPrivate::~TQListBoxPrivate()
\obsolete
- If \a enable is TRUE sets setVScrollBarMode() to \c AlwaysOn;
+ If \a enable is true sets setVScrollBarMode() to \c AlwaysOn;
otherwise sets setVScrollBarMode() to \c AlwaysOff.
*/
@@ -209,8 +209,8 @@ TQListBoxPrivate::~TQListBoxPrivate()
\obsolete
- Returns FALSE if vScrollBarMode() is \c AlwaysOff; otherwise
- returns TRUE.
+ Returns false if vScrollBarMode() is \c AlwaysOff; otherwise
+ returns true.
*/
/*!
@@ -218,7 +218,7 @@ TQListBoxPrivate::~TQListBoxPrivate()
\obsolete
- If \a enable is TRUE sets setVScrollBarMode() to \c AlwaysOn;
+ If \a enable is true sets setVScrollBarMode() to \c AlwaysOn;
otherwise sets setVScrollBarMode() to \c AlwaysOff.
*/
@@ -227,8 +227,8 @@ TQListBoxPrivate::~TQListBoxPrivate()
\obsolete
- Returns TRUE if hScrollBarMode() is \c Auto; otherwise returns
- FALSE.
+ Returns true if hScrollBarMode() is \c Auto; otherwise returns
+ false.
*/
/*!
@@ -236,7 +236,7 @@ TQListBoxPrivate::~TQListBoxPrivate()
\obsolete
- If \a enable is TRUE sets setHScrollBarMode() to \c AlwaysOn;
+ If \a enable is true sets setHScrollBarMode() to \c AlwaysOn;
otherwise sets setHScrollBarMode() to \c AlwaysOff.
*/
@@ -245,8 +245,8 @@ TQListBoxPrivate::~TQListBoxPrivate()
\obsolete
- Returns FALSE if vScrollBarMode() is \c AlwaysOff; otherwise
- returns TRUE.
+ Returns false if vScrollBarMode() is \c AlwaysOff; otherwise
+ returns true.
*/
/*!
@@ -254,7 +254,7 @@ TQListBoxPrivate::~TQListBoxPrivate()
\obsolete
- If \a enable is TRUE sets setHScrollBarMode() to \c AlwaysOn;
+ If \a enable is true sets setHScrollBarMode() to \c AlwaysOn;
otherwise sets setHScrollBarMode() to \c AlwaysOff.
*/
@@ -348,9 +348,9 @@ TQListBoxPrivate::~TQListBoxPrivate()
TQListBoxItem::TQListBoxItem( TQListBox* listbox )
{
lbox = listbox;
- s = FALSE;
- dirty = TRUE;
- custom_highlight = FALSE;
+ s = false;
+ dirty = true;
+ custom_highlight = false;
p = n = 0;
// just something that'll look noticeable in the debugger
@@ -369,9 +369,9 @@ TQListBoxItem::TQListBoxItem( TQListBox* listbox )
TQListBoxItem::TQListBoxItem( TQListBox* listbox, TQListBoxItem *after )
{
lbox = listbox;
- s = FALSE;
- dirty = TRUE;
- custom_highlight = FALSE;
+ s = false;
+ dirty = true;
+ custom_highlight = false;
p = n = 0;
// just something that'll be noticeable in the debugger
@@ -397,7 +397,7 @@ TQListBoxItem::~TQListBoxItem()
Defines whether the list box item is responsible for drawing
itself in a highlighted state when being selected.
- If \a b is FALSE (the default), the list box will draw some
+ If \a b is false (the default), the list box will draw some
default highlight indicator before calling paint().
\sa selected(), paint()
@@ -473,7 +473,7 @@ const TQPixmap *TQListBoxItem::pixmap() const
}
/*!
- If \a b is TRUE (the default) then this item can be selected by
+ If \a b is true (the default) then this item can be selected by
the user; otherwise this item cannot be selected by the user.
\sa isSelectable()
@@ -491,8 +491,8 @@ void TQListBoxItem::setSelectable( bool b )
}
/*!
- Returns TRUE if this item is selectable (the default); otherwise
- returns FALSE.
+ Returns true if this item is selectable (the default); otherwise
+ returns false.
\sa setSelectable()
*/
@@ -500,10 +500,10 @@ void TQListBoxItem::setSelectable( bool b )
bool TQListBoxItem::isSelectable() const
{
if ( !listBox() )
- return TRUE;
+ return true;
bool *sel = listBox()->d->selectable.find( ( (TQListBoxItem*)this ) );
if ( !sel )
- return TRUE;
+ return true;
else
return *sel;
}
@@ -841,7 +841,7 @@ int TQListBoxPixmap::rtti() const
If multiple rows are used, each row can be as high as necessary
(the normal setting), or you can request that all items will have
- the same height by calling setVariableHeight(FALSE). The same
+ the same height by calling setVariableHeight(false). The same
applies to a column's width, see setVariableWidth().
The TQListBox's items are TQListBoxItem objects. TQListBox provides
@@ -1007,15 +1007,15 @@ TQListBox::TQListBox( TQWidget *parent, const char *name, WFlags f )
d->visibleTimer = new TQTimer( this, "listbox visible timer" );
d->inputTimer = new TQTimer( this, "listbox input timer" );
d->resizeTimer = new TQTimer( this, "listbox resize timer" );
- d->clearing = FALSE;
+ d->clearing = false;
d->pressedItem = 0;
d->selectAnchor = 0;
- d->select = FALSE;
+ d->select = false;
d->rubber = 0;
- d->selectable.setAutoDelete( TRUE );
+ d->selectable.setAutoDelete( true );
- setMouseTracking( TRUE );
- viewport()->setMouseTracking( TRUE );
+ setMouseTracking( true );
+ viewport()->setMouseTracking( true );
connect( d->updateTimer, TQ_SIGNAL(timeout()),
this, TQ_SLOT(refreshSlot()) );
@@ -1269,7 +1269,7 @@ TQListBox::~TQListBox()
void TQListBox::setFont( const TQFont &font )
{
TQScrollView::setFont( font );
- triggerUpdate( TRUE );
+ triggerUpdate( true );
}
@@ -1453,7 +1453,7 @@ void TQListBox::insertItem( const TQListBoxItem *lbi, int index )
item->n = d->head;
item->p = 0;
d->head = item;
- item->dirty = TRUE;
+ item->dirty = true;
if ( item->n )
item->n->p = item;
} else {
@@ -1482,7 +1482,7 @@ void TQListBox::insertItem( const TQListBoxItem *lbi, int index )
emit highlighted( index );
}
- triggerUpdate( TRUE );
+ triggerUpdate( true );
}
/*!
@@ -1512,7 +1512,7 @@ void TQListBox::insertItem( const TQListBoxItem *lbi, const TQListBoxItem *after
item->n = d->head;
item->p = 0;
d->head = item;
- item->dirty = TRUE;
+ item->dirty = true;
if ( item->n )
item->n->p = item;
} else {
@@ -1538,7 +1538,7 @@ void TQListBox::insertItem( const TQListBoxItem *lbi, const TQListBoxItem *after
emit highlighted( index( d->current ) );
}
- triggerUpdate( TRUE );
+ triggerUpdate( true );
}
/*!
@@ -1604,7 +1604,7 @@ void TQListBox::removeItem( int index )
{
bool wasVisible = itemVisible( currentItem() );
delete item( index );
- triggerUpdate( TRUE );
+ triggerUpdate( true );
if ( wasVisible )
ensureCurrentVisible();
}
@@ -1620,8 +1620,8 @@ void TQListBox::clear()
{
setContentsPos( 0, 0 );
bool blocked = signalsBlocked();
- blockSignals( TRUE );
- d->clearing = TRUE;
+ blockSignals( true );
+ d->clearing = true;
d->current = 0;
d->tmpCurrent = 0;
TQListBoxItem * i = d->head;
@@ -1644,9 +1644,9 @@ void TQListBox::clear()
d->selectable.clear();
clearSelection();
blockSignals( blocked );
- triggerUpdate( TRUE );
+ triggerUpdate( true );
d->last = 0;
- d->clearing = FALSE;
+ d->clearing = false;
}
@@ -1845,21 +1845,21 @@ void TQListBox::setCurrentItem( TQListBoxItem * i )
TQRect mfrect = itemRect( i );
if ( mfrect.isValid() )
- setMicroFocusHint( mfrect.x(), mfrect.y(), mfrect.width(), mfrect.height(), FALSE );
+ setMicroFocusHint( mfrect.x(), mfrect.y(), mfrect.width(), mfrect.height(), false );
TQListBoxItem * o = d->current;
d->current = i;
int ind = index( i );
if ( i && selectionMode() == Single ) {
- bool changed = FALSE;
+ bool changed = false;
if ( o && o->s ) {
- changed = TRUE;
- o->s = FALSE;
+ changed = true;
+ o->s = false;
}
if ( i && !i->s && d->selectionMode != NoSelection && i->isSelectable() ) {
- i->s = TRUE;
- changed = TRUE;
+ i->s = true;
+ changed = true;
emit selectionChanged( i );
#if defined(QT_ACCESSIBILITY_SUPPORT)
TQAccessible::updateAccessibility( viewport(), ind+1, TQAccessible::StateChanged );
@@ -1880,7 +1880,7 @@ void TQListBox::setCurrentItem( TQListBoxItem * i )
if ( i )
updateItem( i );
// scroll after the items are redrawn
- d->visibleTimer->start( 1, TRUE );
+ d->visibleTimer->start( 1, true );
TQString tmp;
if ( i )
@@ -1978,22 +1978,23 @@ int TQListBox::index( const TQListBoxItem * lbi ) const
/*!
- Returns TRUE if the item at position \a index is at least partly
- visible; otherwise returns FALSE.
+ Returns true if the item at position \a index is at least partly
+ visible; otherwise returns false.
*/
bool TQListBox::itemVisible( int index )
{
TQListBoxItem * i = item( index );
- return i ? itemVisible( i ) : FALSE;
+ return i ? itemVisible( i ) : false;
+ return i && itemVisible( i );
}
/*!
\overload
- Returns TRUE if \a item is at least partly visible; otherwise
- returns FALSE.
+ Returns true if \a item is at least partly visible; otherwise
+ returns false.
*/
bool TQListBox::itemVisible( const TQListBoxItem * item )
@@ -2020,7 +2021,7 @@ void TQListBox::mousePressEvent( TQMouseEvent *e )
void TQListBox::mousePressEventEx( TQMouseEvent *e )
{
- d->mouseInternalPress = TRUE;
+ d->mouseInternalPress = true;
TQListBoxItem * i = itemAt( e->pos() );
if ( !i && !d->current && d->head ) {
@@ -2032,7 +2033,7 @@ void TQListBox::mousePressEventEx( TQMouseEvent *e )
&& !( e->state() & ControlButton ) )
clearSelection();
- d->select = d->selectionMode == Multi ? ( i ? !i->isSelected() : FALSE ) : TRUE;
+ d->select = d->selectionMode != Multi || ( i && !i->isSelected())
d->pressedSelected = i && i->s;
if ( i )
@@ -2043,7 +2044,7 @@ void TQListBox::mousePressEventEx( TQMouseEvent *e )
case Single:
if ( !i->s || i != d->current ) {
if ( i->isSelectable() )
- setSelected( i, TRUE );
+ setSelected( i, true );
else
setCurrentItem( i );
}
@@ -2054,34 +2055,34 @@ void TQListBox::mousePressEventEx( TQMouseEvent *e )
!(e->state() & TQMouseEvent::ControlButton) ) {
if ( !i->isSelected() ) {
bool b = signalsBlocked();
- blockSignals( TRUE );
+ blockSignals( true );
clearSelection();
blockSignals( b );
}
- setSelected( i, TRUE );
- d->dragging = TRUE; // always assume dragging
+ setSelected( i, true );
+ d->dragging = true; // always assume dragging
} else if ( e->state() & ShiftButton ) {
- d->pressedSelected = FALSE;
+ d->pressedSelected = false;
TQListBoxItem *oldCurrent = item( currentItem() );
bool down = index( oldCurrent ) < index( i );
TQListBoxItem *lit = down ? oldCurrent : i;
bool select = d->select;
bool blocked = signalsBlocked();
- blockSignals( TRUE );
+ blockSignals( true );
for ( ;; lit = lit->n ) {
if ( !lit ) {
- triggerUpdate( FALSE );
+ triggerUpdate( false );
break;
}
if ( down && lit == i ) {
setSelected( i, select );
- triggerUpdate( FALSE );
+ triggerUpdate( false );
break;
}
if ( !down && lit == oldCurrent ) {
setSelected( oldCurrent, select );
- triggerUpdate( FALSE );
+ triggerUpdate( false );
break;
}
setSelected( lit, select );
@@ -2090,7 +2091,7 @@ void TQListBox::mousePressEventEx( TQMouseEvent *e )
emit selectionChanged();
} else if ( e->state() & ControlButton ) {
setSelected( i, !i->isSelected() );
- d->pressedSelected = FALSE;
+ d->pressedSelected = false;
}
setCurrentItem( i );
}
@@ -2105,7 +2106,7 @@ void TQListBox::mousePressEventEx( TQMouseEvent *e )
break;
}
} else {
- bool unselect = TRUE;
+ bool unselect = true;
if ( e->button() == LeftButton ) {
if ( d->selectionMode == Multi ||
d->selectionMode == Extended ) {
@@ -2118,8 +2119,8 @@ void TQListBox::mousePressEventEx( TQMouseEvent *e )
d->rubber = new TQRect( e->x(), e->y(), 0, 0 );
if ( d->selectionMode == Extended && !( e->state() & ControlButton ) )
- selectAll( FALSE );
- unselect = FALSE;
+ selectAll( false );
+ unselect = false;
}
if ( unselect && ( e->button() == RightButton ||
( selectionMode() == Multi || selectionMode() == Extended ) ) )
@@ -2137,7 +2138,7 @@ void TQListBox::mousePressEventEx( TQMouseEvent *e )
d->mousePressColumn = -1;
d->mousePressRow = -1;
}
- d->ignoreMoves = FALSE;
+ d->ignoreMoves = false;
d->pressedItem = i;
@@ -2155,7 +2156,7 @@ void TQListBox::mouseReleaseEvent( TQMouseEvent *e )
{
if ( d->selectionMode == Extended &&
d->dragging ) {
- d->dragging = FALSE;
+ d->dragging = false;
if (d->current != d->pressedItem) {
updateSelection(); // when we drag, we get an update after we release
}
@@ -2172,16 +2173,16 @@ void TQListBox::mouseReleaseEvent( TQMouseEvent *e )
mouseMoveEvent( e );
delete d->scrollTimer;
d->scrollTimer = 0;
- d->ignoreMoves = FALSE;
+ d->ignoreMoves = false;
if ( d->selectionMode == Extended &&
d->current == d->pressedItem &&
d->pressedSelected && d->current ) {
bool block = signalsBlocked();
- blockSignals( TRUE );
+ blockSignals( true );
clearSelection();
blockSignals( block );
- d->current->s = TRUE;
+ d->current->s = true;
emit selectionChanged();
}
@@ -2191,7 +2192,7 @@ void TQListBox::mouseReleaseEvent( TQMouseEvent *e )
d->pressedItem = 0;
d->mousePressRow = -1;
d->mousePressColumn = -1;
- d->mouseInternalPress = FALSE;
+ d->mouseInternalPress = false;
if ( emitClicked ) {
emit clicked( i );
emit clicked( i, e->globalPos() );
@@ -2206,12 +2207,12 @@ void TQListBox::mouseReleaseEvent( TQMouseEvent *e )
void TQListBox::mouseDoubleClickEvent( TQMouseEvent *e )
{
- bool ok = TRUE;
+ bool ok = true;
TQListBoxItem *i = itemAt( e->pos() );
if ( !i || selectionMode() == NoSelection )
- ok = FALSE;
+ ok = false;
- d->ignoreMoves = TRUE;
+ d->ignoreMoves = true;
if ( d->current && ok ) {
TQListBoxItem * i = d->current;
@@ -2309,7 +2310,7 @@ void TQListBox::mouseMoveEvent( TQMouseEvent *e )
d->scrollTimer = new TQTimer( this );
connect( d->scrollTimer, TQ_SIGNAL(timeout()),
this, TQ_SLOT(doAutoScroll()) );
- d->scrollTimer->start( 100, FALSE );
+ d->scrollTimer->start( 100, false );
doAutoScroll();
} else if ( !d->scrollTimer ) {
// or just select the required bits
@@ -2336,14 +2337,14 @@ void TQListBox::updateSelection()
( d->current == d->pressedItem && d->pressedSelected ) ||
(d->dirtyDrag && !d->dragging) ) ) {
if (d->dirtyDrag && !d->dragging) // emit after dragging stops
- d->dirtyDrag = FALSE;
+ d->dirtyDrag = false;
else
clearSelection(); // dont reset drag-selected items
d->pressedItem = 0;
if ( i && i->isSelectable() ) {
bool block = signalsBlocked();
- blockSignals( TRUE );
- i->s = TRUE;
+ blockSignals( true );
+ i->s = true;
blockSignals( block );
emit selectionChanged();
#if defined(QT_ACCESSIBILITY_SUPPORT)
@@ -2352,13 +2353,13 @@ void TQListBox::updateSelection()
TQAccessible::updateAccessibility( viewport(), ind+1, TQAccessible::SelectionAdd );
#endif
}
- triggerUpdate( FALSE );
+ triggerUpdate( false );
} else {
int c = TQMIN( d->mouseMoveColumn, d->mousePressColumn );
int r = TQMIN( d->mouseMoveRow, d->mousePressRow );
int c2 = TQMAX( d->mouseMoveColumn, d->mousePressColumn );
int r2 = TQMAX( d->mouseMoveRow, d->mousePressRow );
- bool changed = FALSE;
+ bool changed = false;
while( c <= c2 ) {
TQListBoxItem * i = item( c*numRows()+r );
int rtmp = r;
@@ -2369,8 +2370,8 @@ void TQListBox::updateSelection()
TQAccessible::updateAccessibility( viewport(), ind+1, TQAccessible::StateChanged );
TQAccessible::updateAccessibility( viewport(), ind+1, d->select ? TQAccessible::SelectionAdd : TQAccessible::SelectionRemove );
#endif
- i->dirty = TRUE;
- d->dirtyDrag = changed = TRUE;
+ i->dirty = true;
+ d->dirtyDrag = changed = true;
}
i = i->n;
rtmp++;
@@ -2383,7 +2384,7 @@ void TQListBox::updateSelection()
#if defined(QT_ACCESSIBILITY_SUPPORT)
TQAccessible::updateAccessibility( viewport(), 0, TQAccessible::Selection );
#endif
- triggerUpdate( FALSE );
+ triggerUpdate( false );
}
}
if ( i )
@@ -2453,12 +2454,12 @@ void TQListBox::keyPressEvent( TQKeyEvent *e )
if ( !old ) {
setCurrentItem( d->head );
if ( d->selectionMode == Single )
- setSelected( d->head, TRUE );
+ setSelected( d->head, true );
e->ignore();
return;
}
- bool selectCurrent = FALSE;
+ bool selectCurrent = false;
switch ( e->key() ) {
case Key_Up:
{
@@ -2559,7 +2560,7 @@ void TQListBox::keyPressEvent( TQKeyEvent *e )
break;
case Key_Prior:
{
- selectCurrent = TRUE;
+ selectCurrent = true;
d->currInputString = TQString::null;
int i;
if ( numColumns() == 1 ) {
@@ -2583,7 +2584,7 @@ void TQListBox::keyPressEvent( TQKeyEvent *e )
break;
case Key_Space:
{
- selectCurrent = TRUE;
+ selectCurrent = true;
d->currInputString = TQString::null;
toggleCurrentItem();
if ( selectionMode() == Extended && d->current->isSelected() )
@@ -2595,7 +2596,7 @@ void TQListBox::keyPressEvent( TQKeyEvent *e )
case Key_Return:
case Key_Enter:
{
- selectCurrent = TRUE;
+ selectCurrent = true;
d->currInputString = TQString::null;
if ( currentItem() >= 0 && selectionMode() != NoSelection ) {
TQString tmp = item( currentItem() )->text();
@@ -2611,7 +2612,7 @@ void TQListBox::keyPressEvent( TQKeyEvent *e )
break;
case Key_Home:
{
- selectCurrent = TRUE;
+ selectCurrent = true;
d->currInputString = TQString::null;
setCurrentItem( 0 );
handleItemChange( old, e->state() & ShiftButton, e->state() & ControlButton );
@@ -2621,7 +2622,7 @@ void TQListBox::keyPressEvent( TQKeyEvent *e )
break;
case Key_End:
{
- selectCurrent = TRUE;
+ selectCurrent = true;
d->currInputString = TQString::null;
int i = (int)count() - 1;
setCurrentItem( i );
@@ -2652,27 +2653,27 @@ void TQListBox::keyPressEvent( TQKeyEvent *e )
if ( curItem >= 0 )
setCurrentItem( curItem );
if ( curItem >= 0 && selectionMode() == TQListBox::Extended ) {
- bool changed = FALSE;
+ bool changed = false;
bool block = signalsBlocked();
- blockSignals( TRUE );
- selectAll( FALSE );
+ blockSignals( true );
+ selectAll( false );
blockSignals( block );
TQListBoxItem *i = item( curItem );
if ( !i->s && i->isSelectable() ) {
- changed = TRUE;
- i->s = TRUE;
+ changed = true;
+ i->s = true;
updateItem( i );
}
if ( changed )
emit selectionChanged();
}
- d->inputTimer->start( 400, TRUE );
+ d->inputTimer->start( 400, true );
} else {
d->currInputString = TQString::null;
if ( e->state() & ControlButton ) {
switch ( e->key() ) {
case Key_A:
- selectAll( TRUE );
+ selectAll( true );
break;
}
} else {
@@ -2685,7 +2686,7 @@ void TQListBox::keyPressEvent( TQKeyEvent *e )
if (selfCheck && selectCurrent && selectionMode() == Single &&
d->current && !d->current->s ) {
updateItem( d->current );
- setSelected( d->current, TRUE );
+ setSelected( d->current, true );
}
}
@@ -2696,7 +2697,7 @@ void TQListBox::focusInEvent( TQFocusEvent* )
{
d->mousePressRow = -1;
d->mousePressColumn = -1;
- d->inMenuMode = FALSE;
+ d->inMenuMode = false;
if ( TQFocusEvent::reason() != TQFocusEvent::Mouse && !d->current && d->head ) {
d->current = d->head;
TQListBoxItem *i = d->current;
@@ -2717,7 +2718,7 @@ void TQListBox::focusInEvent( TQFocusEvent* )
updateItem( currentItem() );
TQRect mfrect = itemRect( d->current );
if ( mfrect.isValid() )
- setMicroFocusHint( mfrect.x(), mfrect.y(), mfrect.width(), mfrect.height(), FALSE );
+ setMicroFocusHint( mfrect.x(), mfrect.y(), mfrect.width(), mfrect.height(), false );
}
}
@@ -2767,8 +2768,8 @@ void TQListBox::updateItem( TQListBoxItem * i )
{
if ( !i )
return;
- i->dirty = TRUE;
- d->updateTimer->start( 0, TRUE );
+ i->dirty = true;
+ d->updateTimer->start( 0, true );
}
@@ -2791,11 +2792,11 @@ void TQListBox::setSelectionMode( SelectionMode mode )
&& ( mode == TQListBox::Single || mode == TQListBox::NoSelection ) ){
clearSelection();
if ( ( mode == TQListBox::Single ) && currentItem() )
- setSelected( currentItem(), TRUE );
+ setSelected( currentItem(), true );
}
d->selectionMode = mode;
- triggerUpdate( TRUE );
+ triggerUpdate( true );
}
@@ -2813,11 +2814,11 @@ TQListBox::SelectionMode TQListBox::selectionMode() const
Consider using the \l TQListBox::selectionMode property instead of
this property.
- When setting this property, Multi selection mode is used if set to TRUE and
- to Single selection mode if set to FALSE.
+ When setting this property, Multi selection mode is used if set to true and
+ to Single selection mode if set to false.
- When getting this property, TRUE is returned if the list box is in
- Multi selection mode or Extended selection mode, and FALSE if it is
+ When getting this property, true is returned if the list box is in
+ Multi selection mode or Extended selection mode, and false if it is
in Single selection mode or NoSelection mode.
\sa selectionMode
@@ -2865,7 +2866,7 @@ void TQListBox::toggleCurrentItem()
/*!
\overload
- If \a select is TRUE the item at position \a index is selected;
+ If \a select is true the item at position \a index is selected;
otherwise the item is deselected.
*/
@@ -2876,14 +2877,14 @@ void TQListBox::setSelected( int index, bool select )
/*!
- Selects \a item if \a select is TRUE or unselects it if \a select
- is FALSE, and repaints the item appropriately.
+ Selects \a item if \a select is true or unselects it if \a select
+ is false, and repaints the item appropriately.
If the list box is a \c Single selection list box and \a select is
- TRUE, setSelected() calls setCurrentItem().
+ true, setSelected() calls setCurrentItem().
If the list box is a \c Single selection list box, \a select is
- FALSE, setSelected() calls clearSelection().
+ false, setSelected() calls clearSelection().
\sa setMultiSelection(), setCurrentItem(), clearSelection(), currentItem()
*/
@@ -2901,7 +2902,7 @@ void TQListBox::setSelected( TQListBoxItem * item, bool select )
if ( d->current != item ) {
TQListBoxItem *o = d->current;
if ( d->current && d->current->s )
- d->current->s = FALSE;
+ d->current->s = false;
d->current = item;
#if defined(QT_ACCESSIBILITY_SUPPORT)
TQAccessible::updateAccessibility( viewport(), ind+1, TQAccessible::Focus );
@@ -2945,17 +2946,17 @@ void TQListBox::setSelected( TQListBoxItem * item, bool select )
/*!
- Returns TRUE if item \a i is selected; otherwise returns FALSE.
+ Returns true if item \a i is selected; otherwise returns false.
*/
bool TQListBox::isSelected( int i ) const
{
if ( selectionMode() == Single && i != currentItem() )
- return FALSE;
+ return false;
TQListBoxItem * lbi = item( i );
if ( !lbi )
- return FALSE; // should not happen
+ return false; // should not happen
return lbi->s;
}
@@ -2963,13 +2964,13 @@ bool TQListBox::isSelected( int i ) const
/*!
\overload
- Returns TRUE if item \a i is selected; otherwise returns FALSE.
+ Returns true if item \a i is selected; otherwise returns false.
*/
bool TQListBox::isSelected( const TQListBoxItem * i ) const
{
if ( !i )
- return FALSE;
+ return false;
return i->s;
}
@@ -3002,13 +3003,13 @@ TQListBoxItem* TQListBox::selectedItem() const
void TQListBox::clearSelection()
{
- selectAll( FALSE );
+ selectAll( false );
}
/*!
In \c Multi and \c Extended modes, this function sets all items to
- be selected if \a select is TRUE, and to be unselected if \a
- select is FALSE.
+ be selected if \a select is true, and to be unselected if \a
+ select is false.
In \c Single and \c NoSelection modes, this function only changes
the selection status of currentItem().
@@ -3018,7 +3019,7 @@ void TQListBox::selectAll( bool select )
{
if ( selectionMode() == Multi || selectionMode() == Extended ) {
bool b = signalsBlocked();
- blockSignals( TRUE );
+ blockSignals( true );
for ( int i = 0; i < (int)count(); i++ )
setSelected( i, select );
blockSignals( b );
@@ -3041,7 +3042,7 @@ void TQListBox::invertSelection()
return;
bool b = signalsBlocked();
- blockSignals( TRUE );
+ blockSignals( true );
for ( int i = 0; i < (int)count(); i++ )
setSelected( i, !item( i )->isSelected() );
blockSignals( b );
@@ -3106,15 +3107,15 @@ TQSize TQListBox::minimumSizeHint() const
/*!
Ensures that a single paint event will occur at the end of the
- current event loop iteration. If \a doLayout is TRUE, the layout
+ current event loop iteration. If \a doLayout is true, the layout
is also redone.
*/
void TQListBox::triggerUpdate( bool doLayout )
{
if ( doLayout )
- d->layoutDirty = d->mustPaintAll = TRUE;
- d->updateTimer->start( 0, TRUE );
+ d->layoutDirty = d->mustPaintAll = true;
+ d->updateTimer->start( 0, true );
}
@@ -3122,9 +3123,9 @@ void TQListBox::setColumnMode( LayoutMode mode )
{
if ( mode == Variable )
return;
- d->rowModeWins = FALSE;
+ d->rowModeWins = false;
d->columnMode = mode;
- triggerUpdate( TRUE );
+ triggerUpdate( true );
}
@@ -3134,17 +3135,17 @@ void TQListBox::setColumnMode( int columns )
columns = 1;
d->columnMode = FixedNumber;
d->numColumns = columns;
- d->rowModeWins = FALSE;
- triggerUpdate( TRUE );
+ d->rowModeWins = false;
+ triggerUpdate( true );
}
void TQListBox::setRowMode( LayoutMode mode )
{
if ( mode == Variable )
return;
- d->rowModeWins = TRUE;
+ d->rowModeWins = true;
d->rowMode = mode;
- triggerUpdate( TRUE );
+ triggerUpdate( true );
}
@@ -3154,8 +3155,8 @@ void TQListBox::setRowMode( int rows )
rows = 1;
d->rowMode = FixedNumber;
d->numRows = rows;
- d->rowModeWins = TRUE;
- triggerUpdate( TRUE );
+ d->rowModeWins = true;
+ triggerUpdate( true );
}
/*!
@@ -3339,7 +3340,7 @@ void TQListBox::doLayout() const
break;
}
- d->layoutDirty = FALSE;
+ d->layoutDirty = false;
int w = d->columnPos[(int)d->columnPos.size()-1];
int h = d->rowPos[(int)d->rowPos.size()-1];
TQSize s( viewportSize( w, h ) );
@@ -3442,7 +3443,7 @@ int TQListBox::currentRow() const
if ( !d->current )
return -1;
if ( d->currentRow < 0 )
- d->layoutDirty = TRUE;
+ d->layoutDirty = true;
if ( d->layoutDirty )
doLayout();
return d->currentRow;
@@ -3459,7 +3460,7 @@ int TQListBox::currentColumn() const
if ( !d->current )
return -1;
if ( d->currentColumn < 0 )
- d->layoutDirty = TRUE;
+ d->layoutDirty = true;
if ( d->layoutDirty )
doLayout();
return d->currentColumn;
@@ -3678,7 +3679,7 @@ void TQListBox::setVariableHeight( bool enable )
return;
d->variableHeight = enable;
- triggerUpdate( TRUE );
+ triggerUpdate( true );
}
@@ -3706,7 +3707,7 @@ void TQListBox::setVariableWidth( bool enable )
return;
d->variableWidth = enable;
- triggerUpdate( TRUE );
+ triggerUpdate( true );
}
@@ -3717,7 +3718,7 @@ void TQListBox::refreshSlot()
{
if ( d->mustPaintAll ||
d->layoutDirty ) {
- d->mustPaintAll = FALSE;
+ d->mustPaintAll = false;
bool currentItemVisible = itemVisible( currentItem() );
doLayout();
if ( hasFocus() &&
@@ -3729,7 +3730,7 @@ void TQListBox::refreshSlot()
d->rowPos[d->currentRow] < contentsY() ||
d->rowPos[d->currentRow+1] > contentsY()+visibleHeight() ) )
ensureCurrentVisible();
- viewport()->repaint( FALSE );
+ viewport()->repaint( false );
return;
}
@@ -3764,9 +3765,9 @@ void TQListBox::refreshSlot()
}
if ( r.isEmpty() )
- viewport()->repaint( FALSE );
+ viewport()->repaint( false );
else
- viewport()->repaint( r, FALSE );
+ viewport()->repaint( r, false );
}
@@ -3828,7 +3829,7 @@ void TQListBox::viewportPaintEvent( TQPaintEvent * e )
if ( i->dirty ) {
// reset dirty flag only if the entire item was painted
if ( itemPaintRegion == TQRegion( itemRect ) )
- i->dirty = FALSE;
+ i->dirty = false;
}
i = i->n;
}
@@ -4037,11 +4038,11 @@ void TQListBox::resizeEvent( TQResizeEvent *e )
if ( currentItemVisible )
ensureCurrentVisible();
if ( d->current )
- viewport()->repaint( itemRect( d->current ), FALSE );
+ viewport()->repaint( itemRect( d->current ), false );
} else if ( ( d->columnMode == FitToWidth || d->rowMode == FitToHeight ) && !(isVisible()) ) {
TQScrollView::resizeEvent( e );
} else if ( d->layoutDirty ) {
- d->resizeTimer->start( 100, TRUE );
+ d->resizeTimer->start( 100, true );
resizeContents( contentsWidth() - ( e->oldSize().width() - e->size().width() ),
contentsHeight() - ( e->oldSize().height() - e->size().height() ) );
TQScrollView::resizeEvent( e );
@@ -4056,7 +4057,7 @@ void TQListBox::resizeEvent( TQResizeEvent *e )
void TQListBox::adjustItems()
{
- triggerUpdate( TRUE );
+ triggerUpdate( true );
ensureCurrentVisible();
}
@@ -4137,10 +4138,10 @@ long TQListBox::maxItemWidth() const
void TQListBox::showEvent( TQShowEvent * )
{
- d->ignoreMoves = FALSE;
+ d->ignoreMoves = false;
d->mousePressRow = -1;
d->mousePressColumn = -1;
- d->mustPaintAll = FALSE;
+ d->mustPaintAll = false;
ensureCurrentVisible();
}
@@ -4150,7 +4151,7 @@ void TQListBox::showEvent( TQShowEvent * )
\obsolete
Returns the vertical pixel-coordinate in \a *yPos, of the list box
- item at position \a index in the list. Returns FALSE if the item is
+ item at position \a index in the list. Returns false if the item is
outside the visible area.
*/
bool TQListBox::itemYPos( int index, int *yPos ) const
@@ -4158,10 +4159,10 @@ bool TQListBox::itemYPos( int index, int *yPos ) const
tqObsolete( "TQListBox", "itemYPos" );
TQListBoxItem* i = item(index);
if ( !i )
- return FALSE;
+ return false;
if ( yPos )
*yPos = i->y;
- return TRUE;
+ return true;
}
#endif
@@ -4169,7 +4170,7 @@ bool TQListBox::itemYPos( int index, int *yPos ) const
/*!
\fn bool TQListBoxItem::isSelected() const
- Returns TRUE if the item is selected; otherwise returns FALSE.
+ Returns true if the item is selected; otherwise returns false.
\sa TQListBox::isSelected(), isCurrent()
*/
@@ -4180,8 +4181,8 @@ bool TQListBox::itemYPos( int index, int *yPos ) const
*/
/*!
- Returns TRUE if the item is the current item; otherwise returns
- FALSE.
+ Returns true if the item is the current item; otherwise returns
+ false.
\sa TQListBox::currentItem(), TQListBox::item(), isSelected()
*/
@@ -4260,7 +4261,7 @@ void TQListBox::takeItem( const TQListBoxItem * item )
if ( item->s )
emit selectionChanged();
((TQListBoxItem *)item)->lbox = 0;
- triggerUpdate( TRUE );
+ triggerUpdate( true );
}
/*!
@@ -4404,20 +4405,20 @@ void TQListBox::doRubberSelection( const TQRect &old, const TQRect &rubber )
{
TQListBoxItem *i = d->head;
TQRect ir, pr;
- bool changed = FALSE;
+ bool changed = false;
for ( ; i; i = i->n ) {
ir = itemRect( i );
if ( ir == TQRect( 0, 0, -1, -1 ) )
continue;
if ( i->isSelected() && !ir.intersects( rubber ) && ir.intersects( old ) ) {
- i->s = FALSE;
+ i->s = false;
pr = pr.unite( ir );
- changed = TRUE;
+ changed = true;
} else if ( !i->isSelected() && ir.intersects( rubber ) ) {
if ( i->isSelectable() ) {
- i->s = TRUE;
+ i->s = true;
pr = pr.unite( ir );
- changed = TRUE;
+ changed = true;
}
}
}
@@ -4427,13 +4428,13 @@ void TQListBox::doRubberSelection( const TQRect &old, const TQRect &rubber )
TQAccessible::updateAccessibility( viewport(), 0, TQAccessible::Selection );
#endif
}
- viewport()->repaint( pr, TRUE );
+ viewport()->repaint( pr, true );
}
/*!
- Returns TRUE if the user is selecting items using a rubber band
- rectangle; otherwise returns FALSE.
+ Returns true if the user is selecting items using a rubber band
+ rectangle; otherwise returns false.
*/
bool TQListBox::isRubberSelecting() const
@@ -4500,7 +4501,7 @@ static int cmpListBoxItems( const void *n1, const void *n2 )
#endif
/*!
- If \a ascending is TRUE sorts the items in ascending order;
+ If \a ascending is true sorts the items in ascending order;
otherwise sorts in descending order.
To compare the items, the text (TQListBoxItem::text()) of the items
@@ -4530,7 +4531,7 @@ void TQListBox::sort( bool ascending )
item = items[ i ].item;
if ( item ) {
item->p = prev;
- item->dirty = TRUE;
+ item->dirty = true;
if ( item->p )
item->p->n = item;
item->n = 0;
@@ -4544,7 +4545,7 @@ void TQListBox::sort( bool ascending )
item = items[ i ].item;
if ( item ) {
item->p = prev;
- item->dirty = TRUE;
+ item->dirty = true;
if ( item->p )
item->p->n = item;
item->n = 0;
@@ -4573,17 +4574,17 @@ void TQListBox::handleItemChange( TQListBoxItem *old, bool shift, bool control )
} else if ( d->selectionMode == Extended ) {
if ( shift ) {
selectRange( d->selectAnchor ? d->selectAnchor : old,
- d->current, FALSE, TRUE, d->selectAnchor && !control );
+ d->current, false, true, d->selectAnchor && !control );
} else if ( !control ) {
bool block = signalsBlocked();
- blockSignals( TRUE );
- selectAll( FALSE );
+ blockSignals( true );
+ selectAll( false );
blockSignals( block );
- setSelected( d->current, TRUE );
+ setSelected( d->current, true );
}
} else if ( d->selectionMode == Multi ) {
if ( shift )
- selectRange( old, d->current, TRUE, FALSE );
+ selectRange( old, d->current, true, false );
}
}
@@ -4615,19 +4616,19 @@ void TQListBox::selectRange( TQListBoxItem *from, TQListBoxItem *to, bool invert
from = from->next();
}
- bool changed = FALSE;
+ bool changed = false;
if ( clearSel ) {
for ( i = d->head; i && i != from; i = i->n ) {
if ( i->s ) {
- i->s = FALSE;
- changed = TRUE;
+ i->s = false;
+ changed = true;
updateItem( i );
}
}
for ( i = to->n; i; i = i->n ) {
if ( i->s ) {
- i->s = FALSE;
- changed = TRUE;
+ i->s = false;
+ changed = true;
updateItem( i );
}
}
@@ -4636,15 +4637,15 @@ void TQListBox::selectRange( TQListBoxItem *from, TQListBoxItem *to, bool invert
for ( i = from; i; i = i->next() ) {
if ( !invert ) {
if ( !i->s && i->isSelectable() ) {
- i->s = TRUE;
- changed = TRUE;
+ i->s = true;
+ changed = true;
updateItem( i );
}
} else {
bool sel = !i->s;
if ( ( (bool)i->s != sel && sel && i->isSelectable() ) || !sel ) {
i->s = sel;
- changed = TRUE;
+ changed = true;
updateItem( i );
}
}