summaryrefslogtreecommitdiffstats
path: root/src/widgets/tqiconview.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/tqiconview.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/tqiconview.cpp')
-rw-r--r--src/widgets/tqiconview.cpp818
1 files changed, 407 insertions, 411 deletions
diff --git a/src/widgets/tqiconview.cpp b/src/widgets/tqiconview.cpp
index fa705ccc8..c2fa5dfbc 100644
--- a/src/widgets/tqiconview.cpp
+++ b/src/widgets/tqiconview.cpp
@@ -123,7 +123,7 @@ static TQPixmap *qiv_buffer_pixmap = 0;
#if !defined(TQ_WS_X11)
static TQPixmap *qiv_selection = 0;
#endif
-static bool optimize_layout = FALSE;
+static bool optimize_layout = false;
static TQCleanupHandler<TQPixmap> qiv_cleanup_pixmap;
@@ -268,7 +268,7 @@ public:
struct ItemContainer {
ItemContainer( ItemContainer *pr, ItemContainer *nx, const TQRect &r )
: p( pr ), n( nx ), rect( r ) {
- items.setAutoDelete( FALSE );
+ items.setAutoDelete( false );
if ( p )
p->n = this;
if ( n )
@@ -339,8 +339,8 @@ void TQIconViewToolTip::maybeTip( const TQPoint &pos )
if ( !item || item->tmpText == item->itemText )
return;
- TQRect r( item->textRect( FALSE ) );
- TQRect r2 = item->pixmapRect( FALSE );
+ TQRect r( item->textRect( false ) );
+ TQRect r2 = item->pixmapRect( false );
/* this probably should be | r, but TQToolTip does not handle that
* well */
@@ -399,7 +399,7 @@ TQIconViewItemLineEdit::TQIconViewItemLineEdit( const TQString &text, TQWidget *
setWrapColumnOrWidth( item->iconView()->maxItemWidth() -
( item->iconView()->itemTextPos() == TQIconView::Bottom ?
0 : item->pixmapRect().width() ) );
- document()->formatter()->setAllowBreakInWords( TRUE );
+ document()->formatter()->setAllowBreakInWords( true );
resize( 200, 200 ); // ### some size, there should be a forceReformat()
setTextFormat( PlainText );
setText( text );
@@ -640,21 +640,19 @@ TQByteArray TQIconDrag::encodedData( const char* mime ) const
}
/*!
- Returns TRUE if \a e can be decoded by the TQIconDrag, otherwise
- return FALSE.
+ Returns true if \a e can be decoded by the TQIconDrag, otherwise
+ return false.
*/
bool TQIconDrag::canDecode( TQMimeSource* e )
{
- if ( e->provides( "application/x-qiconlist" ) )
- return TRUE;
- return FALSE;
+ return e->provides( "application/x-qiconlist" );
}
/*!
Decodes the data which is stored (encoded) in \a e and, if
successful, fills the \a list of icon drag items with the decoded
- data. Returns TRUE if there was some data, FALSE otherwise.
+ data. Returns true if there was some data, false otherwise.
*/
bool TQIconDragPrivate::decode( TQMimeSource* e, TQValueList<TQIconDragDataItem> &lst )
@@ -698,10 +696,10 @@ bool TQIconDragPrivate::decode( TQMimeSource* e, TQValueList<TQIconDragDataItem>
if ( i > 8 )
i = 0;
}
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
TQIconDragData::TQIconDragData()
@@ -761,7 +759,7 @@ void TQIconDragData::setTextRect( const TQRect &r )
\endcode
By default the text of an icon view item may not be edited by the
- user but calling setRenameEnabled(TRUE) will allow the user to
+ user but calling setRenameEnabled(true) will allow the user to
perform in-place editing of the item's text.
When the icon view is deleted all items in it are deleted
@@ -928,12 +926,12 @@ void TQIconViewItem::init( TQIconViewItem *after
d->container1 = 0;
d->container2 = 0;
prev = next = 0;
- allow_rename = FALSE;
- allow_drag = TRUE;
- allow_drop = TRUE;
- visible = TRUE;
- selected = FALSE;
- selectable = TRUE;
+ allow_rename = false;
+ allow_drag = true;
+ allow_drop = true;
+ visible = true;
+ selected = false;
+ selectable = true;
#ifndef TQT_NO_TEXTEDIT
renameBox = 0;
#endif
@@ -942,8 +940,8 @@ void TQIconViewItem::init( TQIconViewItem *after
#endif
if ( view ) {
itemKey = itemText;
- dirty = TRUE;
- wordWrapDirty = TRUE;
+ dirty = true;
+ wordWrapDirty = true;
itemRect = TQRect( -1, -1, 0, 0 );
calcRect();
view->insertItem( this, after );
@@ -988,7 +986,7 @@ int TQIconViewItem::rtti() const
}
/*!
- If \a b is TRUE, the item is made visible; otherwise it is hidden.
+ If \a b is true, the item is made visible; otherwise it is hidden.
*/
void TQIconViewItem::setVisible( bool b )
@@ -1004,7 +1002,7 @@ void TQIconViewItem::setVisible( bool b )
}
/*!
- Returns TRUE if the item is visible; otherwise returns FALSE.
+ Returns true if the item is visible; otherwise returns false.
\sa setVisible()
*/
@@ -1026,7 +1024,7 @@ void TQIconViewItem::setText( const TQString &text )
if ( text == itemText )
return;
- wordWrapDirty = TRUE;
+ wordWrapDirty = true;
itemText = text;
if ( itemKey.isEmpty() )
itemKey = itemText;
@@ -1040,7 +1038,7 @@ void TQIconViewItem::setText( const TQString &text )
view->visibleWidthSB(), view->visibleHeightSB() ).
intersects( oR ) )
view->repaintContents( oR.x() - 1, oR.y() - 1,
- oR.width() + 2, oR.height() + 2, FALSE );
+ oR.width() + 2, oR.height() + 2, false );
}
}
@@ -1073,7 +1071,7 @@ void TQIconViewItem::setKey( const TQString &k )
void TQIconViewItem::setPixmap( const TQPixmap &icon )
{
- if (isVisible() == FALSE)
+ if (isVisible() == false)
return;
if ( itemIcon && itemIcon == unknown_icon )
@@ -1092,7 +1090,7 @@ void TQIconViewItem::setPixmap( const TQPixmap &icon )
view->visibleWidthSB(), view->visibleHeightSB() ).
intersects( oR ) )
view->repaintContents( oR.x() - 1, oR.y() - 1,
- oR.width() + 2, oR.height() + 2, FALSE );
+ oR.width() + 2, oR.height() + 2, false );
}
}
@@ -1128,7 +1126,7 @@ void TQIconViewItem::setPicture( const TQPicture &icon )
view->visibleWidthSB(), view->visibleHeightSB() ).
intersects( oR ) )
view->repaintContents( oR.x() - 1, oR.y() - 1,
- oR.width() + 2, oR.height() + 2, FALSE );
+ oR.width() + 2, oR.height() + 2, false );
}
}
#endif
@@ -1137,7 +1135,7 @@ void TQIconViewItem::setPicture( const TQPicture &icon )
\overload
Sets \a text as the text of the icon view item. If \a recalc is
- TRUE, the icon view's layout is recalculated. If \a redraw is TRUE
+ true, the icon view's layout is recalculated. If \a redraw is true
(the default), the icon view is repainted.
\sa text()
@@ -1148,7 +1146,7 @@ void TQIconViewItem::setText( const TQString &text, bool recalc, bool redraw )
if ( text == itemText )
return;
- wordWrapDirty = TRUE;
+ wordWrapDirty = true;
itemText = text;
if ( recalc )
@@ -1161,7 +1159,7 @@ void TQIconViewItem::setText( const TQString &text, bool recalc, bool redraw )
\overload
Sets \a icon as the item's icon in the icon view. If \a recalc is
- TRUE, the icon view's layout is recalculated. If \a redraw is TRUE
+ true, the icon view's layout is recalculated. If \a redraw is true
(the default), the icon view is repainted.
<b>Note:</b> Pixmaps with individual dimensions larger than 300 pixels may
@@ -1174,7 +1172,7 @@ void TQIconViewItem::setText( const TQString &text, bool recalc, bool redraw )
void TQIconViewItem::setPixmap( const TQPixmap &icon, bool recalc, bool redraw )
{
- if (isVisible() == FALSE)
+ if (isVisible() == false)
return;
if ( itemIcon && itemIcon == unknown_icon )
@@ -1196,7 +1194,7 @@ void TQIconViewItem::setPixmap( const TQPixmap &icon, bool recalc, bool redraw )
view->visibleWidthSB(), view->visibleHeightSB() ).
intersects( oR ) )
view->repaintContents( oR.x() - 1, oR.y() - 1,
- oR.width() + 2, oR.height() + 2, FALSE );
+ oR.width() + 2, oR.height() + 2, false );
}
} else {
repaint();
@@ -1207,9 +1205,9 @@ void TQIconViewItem::setPixmap( const TQPixmap &icon, bool recalc, bool redraw )
}
/*!
- If \a allow is TRUE, the user can rename the icon view item by
+ If \a allow is true, the user can rename the icon view item by
clicking on the text (or pressing F2) while the item is selected
- (in-place renaming). If \a allow is FALSE, in-place renaming is
+ (in-place renaming). If \a allow is false, in-place renaming is
not possible.
*/
@@ -1219,9 +1217,9 @@ void TQIconViewItem::setRenameEnabled( bool allow )
}
/*!
- If \a allow is TRUE, the icon view permits the user to drag the
+ If \a allow is true, the icon view permits the user to drag the
icon view item either to another position within the icon view or
- to somewhere outside of it. If \a allow is FALSE, the item cannot
+ to somewhere outside of it. If \a allow is false, the item cannot
be dragged.
*/
@@ -1231,7 +1229,7 @@ void TQIconViewItem::setDragEnabled( bool allow )
}
/*!
- If \a allow is TRUE, the icon view lets the user drop something on
+ If \a allow is true, the icon view lets the user drop something on
this icon view item.
*/
@@ -1306,8 +1304,8 @@ TQPicture *TQIconViewItem::picture() const
#endif
/*!
- Returns TRUE if the item can be renamed by the user with in-place
- renaming; otherwise returns FALSE.
+ Returns true if the item can be renamed by the user with in-place
+ renaming; otherwise returns false.
\sa setRenameEnabled()
*/
@@ -1318,8 +1316,8 @@ bool TQIconViewItem::renameEnabled() const
}
/*!
- Returns TRUE if the user is allowed to drag the icon view item;
- otherwise returns FALSE.
+ Returns true if the user is allowed to drag the icon view item;
+ otherwise returns false.
\sa setDragEnabled()
*/
@@ -1330,8 +1328,8 @@ bool TQIconViewItem::dragEnabled() const
}
/*!
- Returns TRUE if the user is allowed to drop something onto the
- item; otherwise returns FALSE.
+ Returns true if the user is allowed to drop something onto the
+ item; otherwise returns false.
\sa setDropEnabled()
*/
@@ -1402,12 +1400,12 @@ int TQIconViewItem::index() const
\overload
This variant is equivalent to calling the other variant with \e cb
- set to FALSE.
+ set to false.
*/
void TQIconViewItem::setSelected( bool s )
{
- setSelected( s, FALSE );
+ setSelected( s, false );
}
/*!
@@ -1415,21 +1413,21 @@ void TQIconViewItem::setSelected( bool s )
unselect other items, depending on TQIconView::selectionMode() and
\a cb.
- If \a s is FALSE, the item is unselected.
+ If \a s is false, the item is unselected.
- If \a s is TRUE and TQIconView::selectionMode() is \c Single, the
+ If \a s is true and TQIconView::selectionMode() is \c Single, the
item is selected and the item previously selected is unselected.
- If \a s is TRUE and TQIconView::selectionMode() is \c Extended, the
- item is selected. If \a cb is TRUE, the selection state of the
- other items is left unchanged. If \a cb is FALSE (the default) all
+ If \a s is true and TQIconView::selectionMode() is \c Extended, the
+ item is selected. If \a cb is true, the selection state of the
+ other items is left unchanged. If \a cb is false (the default) all
other items are unselected.
- If \a s is TRUE and TQIconView::selectionMode() is \c Multi, the
+ If \a s is true and TQIconView::selectionMode() is \c Multi, the
item is selected.
Note that \a cb is used only if TQIconView::selectionMode() is \c
- Extended; cb defaults to FALSE.
+ Extended; cb defaults to false.
All items whose selection status changes repaint themselves.
*/
@@ -1444,7 +1442,7 @@ void TQIconViewItem::setSelected( bool s, bool cb )
if ( view->d->selectionMode == TQIconView::Single && this != view->d->currentItem ) {
TQIconViewItem *o = view->d->currentItem;
if ( o && o->selected )
- o->selected = FALSE;
+ o->selected = false;
view->d->currentItem = this;
if ( o )
o->repaint();
@@ -1452,16 +1450,16 @@ void TQIconViewItem::setSelected( bool s, bool cb )
}
if ( !s ) {
- selected = FALSE;
+ selected = false;
} else {
if ( view->d->selectionMode == TQIconView::Single && view->d->currentItem ) {
- view->d->currentItem->selected = FALSE;
+ view->d->currentItem->selected = false;
}
if ( ( view->d->selectionMode == TQIconView::Extended && !cb ) ||
view->d->selectionMode == TQIconView::Single ) {
bool b = view->signalsBlocked();
- view->blockSignals( TRUE );
- view->selectAll( FALSE );
+ view->blockSignals( true );
+ view->selectAll( false );
view->blockSignals( b );
}
selected = s;
@@ -1479,8 +1477,8 @@ void TQIconViewItem::setSelected( bool s, bool cb )
}
/*!
- Sets this item to be selectable if \a enable is TRUE (the default)
- or unselectable if \a enable is FALSE.
+ Sets this item to be selectable if \a enable is true (the default)
+ or unselectable if \a enable is false.
The user is unable to select a non-selectable item using either
the keyboard or the mouse. (The application programmer can select
@@ -1495,7 +1493,7 @@ void TQIconViewItem::setSelectable( bool enable )
}
/*!
- Returns TRUE if the item is selected; otherwise returns FALSE.
+ Returns true if the item is selected; otherwise returns false.
\sa setSelected()
*/
@@ -1506,7 +1504,7 @@ bool TQIconViewItem::isSelected() const
}
/*!
- Returns TRUE if the item is selectable; otherwise returns FALSE.
+ Returns true if the item is selectable; otherwise returns false.
\sa setSelectable()
*/
@@ -1534,12 +1532,12 @@ void TQIconViewItem::repaint()
bool TQIconViewItem::move( int x, int y )
{
if ( x == this->x() && y == this->y() )
- return FALSE;
+ return false;
itemRect.setRect( x, y, itemRect.width(), itemRect.height() );
checkRect();
if ( view )
view->updateItemContainer( this );
- return TRUE;
+ return true;
}
/*!
@@ -1644,9 +1642,9 @@ TQPoint TQIconViewItem::pos() const
/*!
Returns the bounding rectangle of the item's text.
- If \a relative is TRUE, (the default), the returned rectangle is
+ If \a relative is true, (the default), the returned rectangle is
relative to the origin of the item's rectangle. If \a relative is
- FALSE, the returned rectangle is relative to the origin of the
+ false, the returned rectangle is relative to the origin of the
icon view's contents coordinate system.
*/
@@ -1661,8 +1659,8 @@ TQRect TQIconViewItem::textRect( bool relative ) const
/*!
Returns the bounding rectangle of the item's icon.
- If \a relative is TRUE, (the default), the rectangle is relative to
- the origin of the item's rectangle. If \a relative is FALSE, the
+ If \a relative is true, (the default), the rectangle is relative to
+ the origin of the item's rectangle. If \a relative is false, the
returned rectangle is relative to the origin of the icon view's
contents coordinate system.
*/
@@ -1676,14 +1674,14 @@ TQRect TQIconViewItem::pixmapRect( bool relative ) const
}
/*!
- Returns TRUE if the item contains the point \a pnt (in contents
- coordinates); otherwise returns FALSE.
+ Returns true if the item contains the point \a pnt (in contents
+ coordinates); otherwise returns false.
*/
bool TQIconViewItem::contains( const TQPoint& pnt ) const
{
- TQRect textArea = textRect( FALSE );
- TQRect pixmapArea = pixmapRect( FALSE );
+ TQRect textArea = textRect( false );
+ TQRect pixmapArea = pixmapRect( false );
if ( iconView()->itemTextPos() == TQIconView::Bottom )
textArea.setTop( pixmapArea.bottom() );
else
@@ -1692,29 +1690,29 @@ bool TQIconViewItem::contains( const TQPoint& pnt ) const
}
/*!
- Returns TRUE if the item intersects the rectangle \a r (in
- contents coordinates); otherwise returns FALSE.
+ Returns true if the item intersects the rectangle \a r (in
+ contents coordinates); otherwise returns false.
*/
bool TQIconViewItem::intersects( const TQRect& r ) const
{
- return ( textRect( FALSE ).intersects( r ) ||
- pixmapRect( FALSE ).intersects( r ) );
+ return ( textRect( false ).intersects( r ) ||
+ pixmapRect( false ).intersects( r ) );
}
/*!
\fn bool TQIconViewItem::acceptDrop( const TQMimeSource *mime ) const
- Returns TRUE if you can drop things with a TQMimeSource of \a mime
- onto this item; otherwise returns FALSE.
+ Returns true if you can drop things with a TQMimeSource of \a mime
+ onto this item; otherwise returns false.
- The default implementation always returns FALSE. You must subclass
+ The default implementation always returns false. You must subclass
TQIconViewItem and reimplement acceptDrop() to accept drops.
*/
bool TQIconViewItem::acceptDrop( const TQMimeSource * ) const
{
- return FALSE;
+ return false;
}
#ifndef TQT_NO_TEXTEDIT
@@ -1738,7 +1736,7 @@ void TQIconViewItem::rename()
oldRect = rect();
renameBox = new TQIconViewItemLineEdit( itemText, view->viewport(), this, "qt_renamebox" );
iconView()->ensureItemVisible( this );
- TQRect tr( textRect( FALSE ) );
+ TQRect tr( textRect( false ) );
view->addChild( renameBox, tr.x() + ( tr.width() / 2 - renameBox->width() / 2 ), tr.y() - 3 );
renameBox->selectAll();
view->viewport()->setFocusProxy( renameBox );
@@ -1786,13 +1784,13 @@ void TQIconViewItem::renameItem()
return;
if ( !view->d->wordWrapIconText ) {
- wordWrapDirty = TRUE;
+ wordWrapDirty = true;
calcRect();
}
TQRect r = itemRect;
setText( renameBox->text() );
- view->repaintContents( oldRect.x() - 1, oldRect.y() - 1, oldRect.width() + 2, oldRect.height() + 2, FALSE );
- view->repaintContents( r.x() - 1, r.y() - 1, r.width() + 2, r.height() + 2, FALSE );
+ view->repaintContents( oldRect.x() - 1, oldRect.y() - 1, oldRect.width() + 2, oldRect.height() + 2, false );
+ view->repaintContents( r.x() - 1, r.y() - 1, r.width() + 2, r.height() + 2, false );
removeRenameBox();
view->emitRenamed( this );
@@ -1809,8 +1807,8 @@ void TQIconViewItem::cancelRenameItem()
TQRect r = itemRect;
calcRect();
- view->repaintContents( oldRect.x() - 1, oldRect.y() - 1, oldRect.width() + 2, oldRect.height() + 2, FALSE );
- view->repaintContents( r.x() - 1, r.y() - 1, r.width() + 2, r.height() + 2, FALSE );
+ view->repaintContents( oldRect.x() - 1, oldRect.y() - 1, oldRect.width() + 2, oldRect.height() + 2, false );
+ view->repaintContents( r.x() - 1, r.y() - 1, r.width() + 2, r.height() + 2, false );
if ( !renameBox )
return;
@@ -1854,7 +1852,7 @@ void TQIconViewItem::calcRect( const TQString &text_ )
if ( !view ) // #####
return;
- wordWrapDirty = TRUE;
+ wordWrapDirty = true;
int pw = 0;
int ph = 0;
@@ -1970,30 +1968,30 @@ void TQIconViewItem::paintItem( TQPainter *p, const TQColorGroup &cg )
if ( isSelected() ) {
p->setBrush( TQBrush( cg.highlight(), TQBrush::Dense4Pattern ) );
p->setPen( TQPen( cg.highlight(), TQBrush::Dense4Pattern ) );
- p->drawRoundRect( pixmapRect( FALSE ),
- 1000 / pixmapRect( FALSE ).width(),
- 1000 / pixmapRect( FALSE ).height() );
+ p->drawRoundRect( pixmapRect( false ),
+ 1000 / pixmapRect( false ).width(),
+ 1000 / pixmapRect( false ).height() );
}
p->drawPicture( x()-pic->boundingRect().x(), y()-pic->boundingRect().y(), *pic );
if ( isSelected() ) {
p->setBrush( TQBrush( cg.highlight() ) );
p->setPen( TQPen( cg.highlight() ) );
- p->drawRoundRect( textRect( FALSE ),
- 1000 / textRect( FALSE ).width(),
- 1000 / textRect( FALSE ).height() );
+ p->drawRoundRect( textRect( false ),
+ 1000 / textRect( false ).width(),
+ 1000 / textRect( false ).height() );
p->setPen( TQPen( cg.highlightedText() ) );
} else if ( view->d->itemTextBrush != NoBrush ) {
p->setBrush( view->d->itemTextBrush );
p->setPen( TQPen( view->d->itemTextBrush.color() ) );
- p->drawRoundRect( textRect( FALSE ),
- 1000 / textRect( FALSE ).width(),
- 1000 / textRect( FALSE ).height() );
+ p->drawRoundRect( textRect( false ),
+ 1000 / textRect( false ).width(),
+ 1000 / textRect( false ).height() );
}
int align = view->itemTextPos() == TQIconView::Bottom ? AlignHCenter : AlignAuto;
if ( view->d->wordWrapIconText )
align |= WordBreak | BreakAnywhere;
- p->drawText( textRect( FALSE ), align, view->d->wordWrapIconText ? itemText : tmpText );
+ p->drawText( textRect( false ), align, view->d->wordWrapIconText ? itemText : tmpText );
p->restore();
return;
}
@@ -2048,22 +2046,22 @@ void TQIconViewItem::paintItem( TQPainter *p, const TQColorGroup &cg )
if ( isSelected() ) {
p->setBrush( TQBrush( cg.highlight() ) );
p->setPen( TQPen( cg.highlight() ) );
- p->drawRoundRect( textRect( FALSE ),
- 1000 / textRect( FALSE ).width(),
- 1000 / textRect( FALSE ).height() );
+ p->drawRoundRect( textRect( false ),
+ 1000 / textRect( false ).width(),
+ 1000 / textRect( false ).height() );
p->setPen( TQPen( cg.highlightedText() ) );
} else if ( view->d->itemTextBrush != NoBrush ) {
p->setBrush( view->d->itemTextBrush );
p->setPen( TQPen( view->d->itemTextBrush.color() ) );
- p->drawRoundRect( textRect( FALSE ),
- 1000 / textRect( FALSE ).width(),
- 1000 / textRect( FALSE ).height() );
+ p->drawRoundRect( textRect( false ),
+ 1000 / textRect( false ).width(),
+ 1000 / textRect( false ).height() );
}
int align = AlignHCenter;
if ( view->d->wordWrapIconText )
align |= WordBreak | BreakAnywhere;
- p->drawText( textRect( FALSE ), align,
+ p->drawText( textRect( false ), align,
view->d->wordWrapIconText ? itemText : tmpText );
p->restore();
@@ -2185,7 +2183,7 @@ void TQIconViewItem::calcTmpText()
{
if ( !view || view->d->wordWrapIconText || !wordWrapDirty )
return;
- wordWrapDirty = FALSE;
+ wordWrapDirty = false;
int w = iconView()->maxItemWidth() - ( iconView()->itemTextPos() == TQIconView::Bottom ? 0 :
pixmapRect().width() );
@@ -2216,14 +2214,14 @@ void TQIconViewItem::checkRect()
int w = itemRect.width();
int h = itemRect.height();
- bool changed = FALSE;
+ bool changed = false;
if ( x < 0 ) {
x = 0;
- changed = TRUE;
+ changed = true;
}
if ( y < 0 ) {
y = 0;
- changed = TRUE;
+ changed = true;
}
if ( changed )
@@ -2274,7 +2272,7 @@ void TQIconViewItem::checkRect()
populate, along with the label text and a TQPixmap.
When an item is inserted the TQIconView allocates a position for it.
- Existing items are rearranged if autoArrange() is TRUE. The
+ Existing items are rearranged if autoArrange() is true. The
default arrangement is \c LeftToRight -- the TQIconView fills
the \e top-most row from left to right, then moves one row \e down
and fills that row from left to right and so on. The
@@ -2376,9 +2374,7 @@ void TQIconViewItem::checkRect()
\code
bool MyIconViewItem::acceptDrop( const TQMimeSource *mime ) const
{
- if ( mime->provides( "text/plain" ) )
- return TRUE;
- return FALSE;
+ return mime->provides( "text/plain" );
}
void MyIconViewItem::dropped( TQDropEvent *evt, const TQValueList<TQIconDragItem>& )
@@ -2723,29 +2719,29 @@ TQIconView::TQIconView( TQWidget *parent, const char *name, WFlags f )
}
d = new TQIconViewPrivate;
- d->dragging = FALSE;
+ d->dragging = false;
d->firstItem = 0;
d->lastItem = 0;
d->count = 0;
- d->mousePressed = FALSE;
+ d->mousePressed = false;
d->selectionMode = Single;
d->currentItem = 0;
d->highlightedItem = 0;
d->rubber = 0;
- d->canStartRubber = FALSE;
+ d->canStartRubber = false;
d->backBuffer = 0;
d->scrollTimer = 0;
d->startDragItem = 0;
d->tmpCurrentItem = 0;
d->rastX = d->rastY = -1;
d->spacing = 5;
- d->cleared = FALSE;
+ d->cleared = false;
d->arrangement = LeftToRight;
d->resizeMode = Fixed;
- d->dropped = FALSE;
+ d->dropped = false;
d->adjustTimer = new TQTimer( this, "iconview adjust timer" );
- d->isIconDrag = FALSE;
- d->inMenuMode = FALSE;
+ d->isIconDrag = false;
+ d->inMenuMode = false;
#ifndef TQT_NO_DRAGANDDROP
d->iconDragData.clear();
#endif
@@ -2756,31 +2752,31 @@ TQIconView::TQIconView( TQWidget *parent, const char *name, WFlags f )
d->maxItemTextLength = 255;
d->inputTimer = new TQTimer( this, "iconview input timer" );
d->currInputString = TQString::null;
- d->dirty = FALSE;
- d->rearrangeEnabled = TRUE;
+ d->dirty = false;
+ d->rearrangeEnabled = true;
d->itemTextPos = Bottom;
- d->reorderItemsWhenInsert = TRUE;
+ d->reorderItemsWhenInsert = true;
#ifndef TQT_NO_CURSOR
d->oldCursor = arrowCursor;
#endif
- d->resortItemsWhenInsert = FALSE;
- d->sortDirection = TRUE;
- d->wordWrapIconText = TRUE;
+ d->resortItemsWhenInsert = false;
+ d->sortDirection = true;
+ d->wordWrapIconText = true;
d->cachedContentsX = d->cachedContentsY = -1;
- d->clearing = FALSE;
+ d->clearing = false;
d->fullRedrawTimer = new TQTimer( this, "iconview full redraw timer" );
d->itemTextBrush = NoBrush;
- d->drawAllBack = TRUE;
+ d->drawAllBack = true;
d->fm = new TQFontMetrics( font() );
d->minLeftBearing = d->fm->minLeftBearing();
d->minRightBearing = d->fm->minRightBearing();
d->firstContainer = d->lastContainer = 0;
- d->containerUpdateLocked = FALSE;
- d->firstSizeHint = FALSE;
+ d->containerUpdateLocked = false;
+ d->firstSizeHint = false;
d->selectAnchor = 0;
d->renamingItem = 0;
- d->drawActiveSelection = TRUE;
- d->drawDragShapes = FALSE;
+ d->drawActiveSelection = true;
+ d->drawDragShapes = false;
d->backrubber = 0;
connect( d->adjustTimer, TQ_SIGNAL( timeout() ),
@@ -2792,11 +2788,11 @@ TQIconView::TQIconView( TQWidget *parent, const char *name, WFlags f )
connect( this, TQ_SIGNAL( contentsMoving(int,int) ),
this, TQ_SLOT( movedContents(int,int) ) );
- setAcceptDrops( TRUE );
- viewport()->setAcceptDrops( TRUE );
+ setAcceptDrops( true );
+ viewport()->setAcceptDrops( true );
- setMouseTracking( TRUE );
- viewport()->setMouseTracking( TRUE );
+ setMouseTracking( true );
+ viewport()->setMouseTracking( true );
viewport()->setBackgroundMode( PaletteBase);
setBackgroundMode( PaletteBackground, PaletteBase );
@@ -2806,7 +2802,7 @@ TQIconView::TQIconView( TQWidget *parent, const char *name, WFlags f )
#ifndef TQT_NO_TOOLTIP
d->toolTip = new TQIconViewToolTip( viewport(), this );
#endif
- d->showTips = TRUE;
+ d->showTips = true;
}
/*!
@@ -2822,7 +2818,7 @@ void TQIconView::styleChange( TQStyle& old )
TQIconViewItem *item = d->firstItem;
for ( ; item; item = item->next ) {
- item->wordWrapDirty = TRUE;
+ item->wordWrapDirty = true;
item->calcRect();
}
@@ -2845,7 +2841,7 @@ void TQIconView::setFont( const TQFont & f )
TQIconViewItem *item = d->firstItem;
for ( ; item; item = item->next ) {
- item->wordWrapDirty = TRUE;
+ item->wordWrapDirty = true;
item->calcRect();
}
}
@@ -2863,7 +2859,7 @@ void TQIconView::setPalette( const TQPalette & p )
TQIconViewItem *item = d->firstItem;
for ( ; item; item = item->next ) {
- item->wordWrapDirty = TRUE;
+ item->wordWrapDirty = true;
item->calcRect();
}
}
@@ -2875,7 +2871,7 @@ void TQIconView::setPalette( const TQPalette & p )
TQIconView::~TQIconView()
{
TQIconViewItem *tmp, *item = d->firstItem;
- d->clearing = TRUE;
+ d->clearing = true;
TQIconViewPrivate::ItemContainer *c = d->firstContainer, *tmpc;
while ( c ) {
tmpc = c->n;
@@ -2958,7 +2954,7 @@ void TQIconView::insertItem( TQIconViewItem *item, TQIconViewItem *after )
d->cachedW = TQMAX( d->cachedW, item->x() + item->width() );
d->cachedH = TQMAX( d->cachedH, item->y() + item->height() );
- d->updateTimer->start( 0, TRUE );
+ d->updateTimer->start( 0, true );
} else {
insertInGrid( item );
@@ -2967,11 +2963,11 @@ void TQIconView::insertItem( TQIconViewItem *item, TQIconViewItem *after )
item->width(), item->height());
}
} else if ( !autoArrange() ) {
- item->dirty = FALSE;
+ item->dirty = false;
}
d->count++;
- d->dirty = TRUE;
+ d->dirty = true;
}
/*!
@@ -3033,10 +3029,10 @@ void TQIconView::slotUpdate()
w += d->spacing;
else
h += d->spacing;
- viewport()->setUpdatesEnabled( FALSE );
+ viewport()->setUpdatesEnabled( false );
resizeContents( w, h );
- viewport()->setUpdatesEnabled( TRUE );
- viewport()->repaint( FALSE );
+ viewport()->setUpdatesEnabled( true );
+ viewport()->repaint( false );
}
int cx = d->cachedContentsX == -1 ? contentsX() : d->cachedContentsX;
@@ -3089,7 +3085,7 @@ void TQIconView::takeItem( TQIconViewItem *item )
}
}
if ( item->isSelected() ) {
- item->selected = FALSE;
+ item->selected = false;
emit selectionChanged();
}
@@ -3115,7 +3111,7 @@ void TQIconView::takeItem( TQIconViewItem *item )
d->selectAnchor = d->currentItem;
if ( !d->clearing )
- repaintContents( r.x(), r.y(), r.width(), r.height(), TRUE );
+ repaintContents( r.x(), r.y(), r.width(), r.height(), true );
item->view = 0;
item->prev = 0;
@@ -3211,20 +3207,20 @@ void TQIconView::setCurrentItem( TQIconViewItem *item )
if ( !item || item == d->currentItem )
return;
- setMicroFocusHint( item->x(), item->y(), item->width(), item->height(), FALSE );
+ setMicroFocusHint( item->x(), item->y(), item->width(), item->height(), false );
TQIconViewItem *old = d->currentItem;
d->currentItem = item;
emit currentChanged( d->currentItem );
if ( d->selectionMode == Single ) {
- bool changed = FALSE;
+ bool changed = false;
if ( old && old->selected ) {
- old->selected = FALSE;
- changed = TRUE;
+ old->selected = false;
+ changed = true;
}
if ( item && !item->selected && item->isSelectable() && d->selectionMode != NoSelection ) {
- item->selected = TRUE;
- changed = TRUE;
+ item->selected = true;
+ changed = true;
emit selectionChanged( item );
}
if ( changed )
@@ -3241,21 +3237,21 @@ void TQIconView::setCurrentItem( TQIconViewItem *item )
unselect other items, depending on TQIconView::selectionMode() and
\a cb.
- If \a s is FALSE, \a item is unselected.
+ If \a s is false, \a item is unselected.
- If \a s is TRUE and TQIconView::selectionMode() is \c Single, \a
+ If \a s is true and TQIconView::selectionMode() is \c Single, \a
item is selected, and the item which was selected is unselected.
- If \a s is TRUE and TQIconView::selectionMode() is \c Extended, \a
- item is selected. If \a cb is TRUE, the selection state of the
- icon view's other items is left unchanged. If \a cb is FALSE (the
+ If \a s is true and TQIconView::selectionMode() is \c Extended, \a
+ item is selected. If \a cb is true, the selection state of the
+ icon view's other items is left unchanged. If \a cb is false (the
default) all other items are unselected.
- If \a s is TRUE and TQIconView::selectionMode() is \c Multi \a item
+ If \a s is true and TQIconView::selectionMode() is \c Multi \a item
is selected.
Note that \a cb is used only if TQIconView::selectionMode() is \c
- Extended. \a cb defaults to FALSE.
+ Extended. \a cb defaults to false.
All items whose selection status is changed repaint themselves.
*/
@@ -3297,34 +3293,34 @@ void TQIconView::doAutoScroll()
int minx = contentsWidth(), miny = contentsHeight();
int maxx = 0, maxy = 0;
- bool changed = FALSE;
+ bool changed = false;
bool block = signalsBlocked();
TQRect rr;
- blockSignals( TRUE );
- viewport()->setUpdatesEnabled( FALSE );
- bool alreadyIntersected = FALSE;
+ blockSignals( true );
+ viewport()->setUpdatesEnabled( false );
+ bool alreadyIntersected = false;
TQRect nr = d->rubber->normalize();
TQRect rubberUnion = nr.unite( oldRubber.normalize() );
TQIconViewPrivate::ItemContainer *c = d->firstContainer;
for ( ; c; c = c->n ) {
if ( c->rect.intersects( rubberUnion ) ) {
- alreadyIntersected = TRUE;
+ alreadyIntersected = true;
TQIconViewItem *item = c->items.first();
for ( ; item; item = c->items.next() ) {
if ( d->selectedItems.find( item ) )
continue;
if ( !item->intersects( nr ) ) {
if ( item->isSelected() ) {
- item->setSelected( FALSE );
- changed = TRUE;
+ item->setSelected( false );
+ changed = true;
rr = rr.unite( item->rect() );
}
} else if ( item->intersects( nr ) ) {
if ( !item->isSelected() && item->isSelectable() ) {
- item->setSelected( TRUE, TRUE );
- changed = TRUE;
+ item->setSelected( true, true );
+ changed = true;
rr = rr.unite( item->rect() );
}
@@ -3339,7 +3335,7 @@ void TQIconView::doAutoScroll()
break;
}
}
- viewport()->setUpdatesEnabled( TRUE );
+ viewport()->setUpdatesEnabled( true );
blockSignals( block );
// static bool drawAll;
@@ -3366,7 +3362,7 @@ void TQIconView::doAutoScroll()
allRect = TQRect( point.x(), point.y(), allRect.width(), allRect.height() );
allRect &= viewport()->rect();
- d->dragging = FALSE;
+ d->dragging = false;
TQPainter p( d->backrubber );
p.translate( -contentsX(), -contentsY() );
@@ -3406,7 +3402,7 @@ void TQIconView::doAutoScroll()
p.end();
// drawAll = false;
- d->dragging = TRUE;
+ d->dragging = true;
bitBlt( viewport(), allRect.topLeft(), d->backrubber, allRect );
if ( changed ) {
@@ -3421,7 +3417,7 @@ void TQIconView::doAutoScroll()
connect( d->scrollTimer, TQ_SIGNAL( timeout() ),
this, TQ_SLOT( doAutoScroll() ) );
- d->scrollTimer->start( 100, FALSE );
+ d->scrollTimer->start( 100, false );
} else if ( TQRect( 50, 50, viewport()->width()-100, viewport()->height()-100 ).contains( vp ) &&
d->scrollTimer ) {
disconnect( d->scrollTimer, TQ_SIGNAL( timeout() ),
@@ -3444,7 +3440,7 @@ void TQIconView::drawContents( TQPainter *p, int cx, int cy, int cw, int ch )
TQIconViewPrivate::ItemContainer *c = d->firstContainer;
TQRegion remaining( TQRect( cx, cy, cw, ch ) );
- bool alreadyIntersected = FALSE;
+ bool alreadyIntersected = false;
while ( c ) {
if ( c->rect.intersects( r ) ) {
p->save();
@@ -3487,7 +3483,7 @@ void TQIconView::drawContents( TQPainter *p, int cx, int cy, int cw, int ch )
p->restore();
}
}
- alreadyIntersected = TRUE;
+ alreadyIntersected = true;
} else {
if ( alreadyIntersected )
break;
@@ -3534,7 +3530,7 @@ void TQIconView::drawContents( TQPainter *p, int cx, int cy, int cw, int ch )
function. If you want to sort or rearrange the items, use
iconview->sort(iconview->sortDirection()).
- If \a update is TRUE (the default), the viewport is repainted as
+ If \a update is true (the default), the viewport is repainted as
well.
\sa TQIconView::setGridX(), TQIconView::setGridY(), TQIconView::sort()
@@ -3545,15 +3541,15 @@ void TQIconView::arrangeItemsInGrid( bool update )
if ( !d->firstItem || !d->lastItem )
return;
- d->containerUpdateLocked = TRUE;
+ d->containerUpdateLocked = true;
int w = 0, h = 0, y = d->spacing;
TQIconViewItem *item = d->firstItem;
- while (item && (item->isVisible() == FALSE)) {
+ while (item && (item->isVisible() == false)) {
item = item->next;
}
- bool changedLayout = FALSE;
+ bool changedLayout = false;
while ( item ) {
bool changed;
TQIconViewItem *next = makeRowLayout( item, y, changed );
@@ -3570,14 +3566,14 @@ void TQIconView::arrangeItemsInGrid( bool update )
break;
item = item->next;
- while (item && (item->isVisible() == FALSE)) {
+ while (item && (item->isVisible() == false)) {
item = item->next;
}
}
if ( d->lastItem && d->arrangement == TopToBottom ) {
item = d->lastItem;
- while (item && (item->isVisible() == FALSE)) {
+ while (item && (item->isVisible() == false)) {
item = item->prev;
}
int x = 0;
@@ -3587,15 +3583,15 @@ void TQIconView::arrangeItemsInGrid( bool update )
w = TQMAX( w, item->x() + item->width() );
h = TQMAX( h, item->y() + item->height() );
item = item->prev;
- while (item && (item->isVisible() == FALSE)) {
+ while (item && (item->isVisible() == false)) {
item = item->prev;
}
}
}
- d->containerUpdateLocked = FALSE;
+ d->containerUpdateLocked = false;
TQIconViewItem *lastVisibleItem = d->lastItem;
- while (lastVisibleItem->prev && (lastVisibleItem->isVisible() == FALSE)) {
+ while (lastVisibleItem->prev && (lastVisibleItem->isVisible() == false)) {
lastVisibleItem = lastVisibleItem->prev;
}
@@ -3608,22 +3604,22 @@ void TQIconView::arrangeItemsInGrid( bool update )
h += d->spacing;
bool ue = isUpdatesEnabled();
- viewport()->setUpdatesEnabled( FALSE );
+ viewport()->setUpdatesEnabled( false );
int vw = visibleWidth();
int vh = visibleHeight();
resizeContents( w, h );
- bool doAgain = FALSE;
+ bool doAgain = false;
if ( d->arrangement == LeftToRight )
doAgain = visibleWidth() != vw;
if ( d->arrangement == TopToBottom )
doAgain = visibleHeight() != vh;
if ( doAgain ) // in the case that the visibleExtend changed because of the resizeContents (scrollbar show/hide), redo layout again
- arrangeItemsInGrid( FALSE );
+ arrangeItemsInGrid( false );
viewport()->setUpdatesEnabled( ue );
d->dirty = !isVisible();
rebuildContainers();
if ( update && ( !optimize_layout || changedLayout ) )
- repaintContents( contentsX(), contentsY(), viewport()->width(), viewport()->height(), FALSE );
+ repaintContents( contentsX(), contentsY(), viewport()->width(), viewport()->height(), false );
}
/*!
@@ -3631,12 +3627,12 @@ void TQIconView::arrangeItemsInGrid( bool update )
grid is invalid (see TQSize::isValid()), arrangeItemsInGrid()
calculates a valid grid itself and uses that.
- If \a update is TRUE (the default) the viewport is repainted.
+ If \a update is true (the default) the viewport is repainted.
*/
void TQIconView::arrangeItemsInGrid( const TQSize &grid, bool update )
{
- d->containerUpdateLocked = TRUE;
+ d->containerUpdateLocked = true;
TQSize grid_( grid );
if ( !grid_.isValid() ) {
int w = 0, h = 0;
@@ -3659,14 +3655,14 @@ void TQIconView::arrangeItemsInGrid( const TQSize &grid, bool update )
ny * grid_.height() );
w = TQMAX( w, item->x() + item->width() );
h = TQMAX( h, item->y() + item->height() );
- item->dirty = FALSE;
+ item->dirty = false;
}
- d->containerUpdateLocked = FALSE;
+ d->containerUpdateLocked = false;
resizeContents( w, h );
rebuildContainers();
if ( update )
- repaintContents( contentsX(), contentsY(), viewport()->width(), viewport()->height(), FALSE );
+ repaintContents( contentsX(), contentsY(), viewport()->width(), viewport()->height(), false );
}
/*!
@@ -3696,7 +3692,7 @@ void TQIconView::showEvent( TQShowEvent * )
if ( d->resortItemsWhenInsert )
sort( d->sortDirection );
if ( autoArrange() )
- arrangeItemsInGrid( FALSE );
+ arrangeItemsInGrid( false );
}
TQScrollView::show();
}
@@ -3828,13 +3824,13 @@ TQIconViewItem *TQIconView::findItem( const TQString &text, ComparisonFlags comp
void TQIconView::clearSelection()
{
- selectAll( FALSE );
+ selectAll( false );
}
/*!
In Multi and Extended modes, this function sets all items to be
- selected if \a select is TRUE, and to be unselected if \a select
- is FALSE.
+ selected if \a select is true, and to be unselected if \a select
+ is false.
In Single and NoSelection modes, this function only changes the
selection status of currentItem().
@@ -3852,25 +3848,25 @@ void TQIconView::selectAll( bool select )
}
bool b = signalsBlocked();
- blockSignals( TRUE );
+ blockSignals( true );
TQIconViewItem *item = d->firstItem;
TQIconViewItem *i = d->currentItem;
- bool changed = FALSE;
+ bool changed = false;
bool ue = viewport()->isUpdatesEnabled();
- viewport()->setUpdatesEnabled( FALSE );
+ viewport()->setUpdatesEnabled( false );
TQRect rr;
for ( ; item; item = item->next ) {
if (item->isVisible()) {
if ( select != item->isSelected() ) {
- item->setSelected( select, TRUE );
+ item->setSelected( select, true );
rr = rr.unite( item->rect() );
- changed = TRUE;
+ changed = true;
}
}
else {
- if ( FALSE != item->isSelected() ) {
- item->setSelected( FALSE, TRUE );
- changed = TRUE;
+ if ( false != item->isSelected() ) {
+ item->setSelected( false, true );
+ changed = true;
}
}
}
@@ -3898,15 +3894,15 @@ void TQIconView::invertSelection()
return;
bool b = signalsBlocked();
- blockSignals( TRUE );
+ blockSignals( true );
TQIconViewItem *item = d->firstItem;
for ( ; item; item = item->next ) {
if (item->isVisible()) {
- item->setSelected( !item->isSelected(), TRUE );
+ item->setSelected( !item->isSelected(), true );
}
else {
- if ( FALSE != item->isSelected() ) {
- item->setSelected( FALSE, TRUE );
+ if ( false != item->isSelected() ) {
+ item->setSelected( false, true );
}
}
}
@@ -3925,7 +3921,7 @@ void TQIconView::repaintItem( TQIconViewItem *item )
if ( TQRect( contentsX(), contentsY(), visibleWidth(), visibleHeight() ).
intersects( TQRect( item->x() - 1, item->y() - 1, item->width() + 2, item->height() + 2 ) ) )
- repaintContents( item->x() - 1, item->y() - 1, item->width() + 2, item->height() + 2, FALSE );
+ repaintContents( item->x() - 1, item->y() - 1, item->width() + 2, item->height() + 2, false );
}
/*!
@@ -3994,10 +3990,10 @@ TQIconViewItem* TQIconView::findFirstVisibleItem( const TQRect &r ) const
{
TQIconViewPrivate::ItemContainer *c = d->firstContainer;
TQIconViewItem *i = 0;
- bool alreadyIntersected = FALSE;
+ bool alreadyIntersected = false;
for ( ; c; c = c->n ) {
if ( c->rect.intersects( r ) ) {
- alreadyIntersected = TRUE;
+ alreadyIntersected = true;
TQIconViewItem *item = c->items.first();
for ( ; item; item = c->items.next() ) {
if ( r.intersects( item->rect() ) ) {
@@ -4035,10 +4031,10 @@ TQIconViewItem* TQIconView::findLastVisibleItem( const TQRect &r ) const
{
TQIconViewPrivate::ItemContainer *c = d->firstContainer;
TQIconViewItem *i = 0;
- bool alreadyIntersected = FALSE;
+ bool alreadyIntersected = false;
for ( ; c; c = c->n ) {
if ( c->rect.intersects( r ) ) {
- alreadyIntersected = TRUE;
+ alreadyIntersected = true;
TQIconViewItem *item = c->items.first();
for ( ; item; item = c->items.next() ) {
if ( r.intersects( item->rect() ) ) {
@@ -4071,16 +4067,16 @@ TQIconViewItem* TQIconView::findLastVisibleItem( const TQRect &r ) const
void TQIconView::clear()
{
setContentsPos( 0, 0 );
- d->clearing = TRUE;
+ d->clearing = true;
bool block = signalsBlocked();
- blockSignals( TRUE );
+ blockSignals( true );
clearSelection();
blockSignals( block );
setContentsPos( 0, 0 );
d->currentItem = 0;
if ( !d->firstItem ) {
- d->clearing = FALSE;
+ d->clearing = false;
return;
}
@@ -4104,14 +4100,14 @@ void TQIconView::clear()
setCurrentItem( 0 );
d->highlightedItem = 0;
d->tmpCurrentItem = 0;
- d->drawDragShapes = FALSE;
+ d->drawDragShapes = false;
resizeContents( 0, 0 );
// maybe we don�t need this update, so delay it
- d->fullRedrawTimer->start( 0, TRUE );
+ d->fullRedrawTimer->start( 0, true );
- d->cleared = TRUE;
- d->clearing = FALSE;
+ d->cleared = true;
+ d->clearing = false;
}
/*!
@@ -4187,11 +4183,11 @@ void TQIconView::setItemTextPos( ItemTextPos pos )
TQIconViewItem *item = d->firstItem;
for ( ; item; item = item->next ) {
- item->wordWrapDirty = TRUE;
+ item->wordWrapDirty = true;
item->calcRect();
}
- arrangeItemsInGrid( TRUE );
+ arrangeItemsInGrid( true );
}
TQIconView::ItemTextPos TQIconView::itemTextPos() const
@@ -4232,10 +4228,10 @@ void TQIconView::setArrangement( Arrangement am )
d->arrangement = am;
- viewport()->setUpdatesEnabled( FALSE );
+ viewport()->setUpdatesEnabled( false );
resizeContents( viewport()->width(), viewport()->height() );
- viewport()->setUpdatesEnabled( TRUE );
- arrangeItemsInGrid( TRUE );
+ viewport()->setUpdatesEnabled( true );
+ arrangeItemsInGrid( true );
}
TQIconView::Arrangement TQIconView::arrangement() const
@@ -4308,7 +4304,7 @@ int TQIconView::maxItemTextLength() const
\property TQIconView::itemsMovable
\brief whether the user is allowed to move items around in the icon view
- The default is TRUE.
+ The default is true.
*/
void TQIconView::setItemsMovable( bool b )
@@ -4325,7 +4321,7 @@ bool TQIconView::itemsMovable() const
\property TQIconView::autoArrange
\brief whether the icon view rearranges its items when a new item is inserted.
- The default is TRUE.
+ The default is true.
Note that if the icon view is not visible at the time of
insertion, TQIconView defers all position-related work until it is
@@ -4343,14 +4339,14 @@ bool TQIconView::autoArrange() const
}
/*!
- If \a sort is TRUE, this function sets the icon view to sort items
- when a new item is inserted. If \a sort is FALSE, the icon view
+ If \a sort is true, this function sets the icon view to sort items
+ when a new item is inserted. If \a sort is false, the icon view
will not be sorted.
- Note that autoArrange() must be TRUE for sorting to take place.
+ Note that autoArrange() must be true for sorting to take place.
- If \a ascending is TRUE (the default), items are sorted in
- ascending order. If \a ascending is FALSE, items are sorted in
+ If \a ascending is true (the default), items are sorted in
+ ascending order. If \a ascending is false, items are sorted in
descending order.
TQIconViewItem::compare() is used to compare pairs of items. The
@@ -4371,7 +4367,7 @@ void TQIconView::setSorting( bool sort, bool ascending )
\property TQIconView::sorting
\brief whether the icon view sorts on insertion
- The default is FALSE, i.e. no sorting on insertion.
+ The default is false, i.e. no sorting on insertion.
To set the sorting, use setSorting().
*/
@@ -4385,8 +4381,8 @@ bool TQIconView::sorting() const
\property TQIconView::sortDirection
\brief whether the sort direction for inserting new items is ascending;
- The default is TRUE (i.e. ascending). This sort direction is only
- meaningful if both sorting() and autoArrange() are TRUE.
+ The default is true (i.e. ascending). This sort direction is only
+ meaningful if both sorting() and autoArrange() are true.
To set the sort direction, use setSorting()
*/
@@ -4400,9 +4396,9 @@ bool TQIconView::sortDirection() const
\property TQIconView::wordWrapIconText
\brief whether the item text will be word-wrapped if it is too long
- The default is TRUE.
+ The default is true.
- If this property is FALSE, icon text that is too long is
+ If this property is false, icon text that is too long is
truncated, and an ellipsis (...) appended to indicate that
truncation has occurred. The full text can still be seen by the
user if they hover the mouse because the full text is shown in a
@@ -4416,10 +4412,10 @@ void TQIconView::setWordWrapIconText( bool b )
d->wordWrapIconText = b;
for ( TQIconViewItem *item = d->firstItem; item; item = item->next ) {
- item->wordWrapDirty = TRUE;
+ item->wordWrapDirty = true;
item->calcRect();
}
- arrangeItemsInGrid( TRUE );
+ arrangeItemsInGrid( true );
}
bool TQIconView::wordWrapIconText() const
@@ -4431,8 +4427,8 @@ bool TQIconView::wordWrapIconText() const
\property TQIconView::showToolTips
\brief whether the icon view will display a tool tip with the complete text for any truncated item text
- The default is TRUE. Note that this has no effect if
- setWordWrapIconText() is TRUE, as it is by default.
+ The default is true. Note that this has no effect if
+ setWordWrapIconText() is true, as it is by default.
*/
void TQIconView::setShowToolTips( bool b )
@@ -4460,8 +4456,8 @@ void TQIconView::contentsMousePressEventEx( TQMouseEvent *e )
delete d->rubber;
d->rubber = 0;
- repaintContents( r, FALSE );
- d->dragging = FALSE;
+ repaintContents( r, false );
+ d->dragging = false;
delete d->backrubber;
d->backrubber = 0;
@@ -4498,10 +4494,10 @@ void TQIconView::contentsMousePressEventEx( TQMouseEvent *e )
if ( e->button() == LeftButton && !( e->state() & ShiftButton ) &&
!( e->state() & ControlButton ) && item && item->isSelected() &&
- item->textRect( FALSE ).contains( e->pos() ) ) {
+ item->textRect( false ).contains( e->pos() ) ) {
if ( !item->renameEnabled() ) {
- d->mousePressed = TRUE;
+ d->mousePressed = true;
#ifndef TQT_NO_TEXTEDIT
} else {
ensureItemVisible( item );
@@ -4516,17 +4512,17 @@ void TQIconView::contentsMousePressEventEx( TQMouseEvent *e )
if ( item && item->isSelectable() ) {
if ( d->selectionMode == Single )
- item->setSelected( TRUE, e->state() & ControlButton );
+ item->setSelected( true, e->state() & ControlButton );
else if ( d->selectionMode == Multi )
item->setSelected( !item->isSelected(), e->state() & ControlButton );
else if ( d->selectionMode == Extended ) {
if ( e->state() & ShiftButton ) {
- d->pressedSelected = FALSE;
+ d->pressedSelected = false;
bool block = signalsBlocked();
- blockSignals( TRUE );
- viewport()->setUpdatesEnabled( FALSE );
+ blockSignals( true );
+ viewport()->setUpdatesEnabled( false );
TQRect r;
- bool select = TRUE;
+ bool select = true;
if ( d->currentItem )
r = TQRect( TQMIN( d->currentItem->x(), item->x() ),
TQMIN( d->currentItem->y(), item->y() ),
@@ -4544,16 +4540,16 @@ void TQIconView::contentsMousePressEventEx( TQMouseEvent *e )
r.setHeight( d->currentItem->y() - item->y() + d->currentItem->height() );
r = r.normalize();
TQIconViewPrivate::ItemContainer *c = d->firstContainer;
- bool alreadyIntersected = FALSE;
+ bool alreadyIntersected = false;
TQRect redraw;
for ( ; c; c = c->n ) {
if ( c->rect.intersects( r ) ) {
- alreadyIntersected = TRUE;
+ alreadyIntersected = true;
TQIconViewItem *i = c->items.first();
for ( ; i; i = c->items.next() ) {
if ( r.intersects( i->rect() ) ) {
redraw = redraw.unite( i->rect() );
- i->setSelected( select, TRUE );
+ i->setSelected( select, true );
}
}
} else {
@@ -4562,35 +4558,35 @@ void TQIconView::contentsMousePressEventEx( TQMouseEvent *e )
}
}
redraw = redraw.unite( item->rect() );
- viewport()->setUpdatesEnabled( TRUE );
- repaintContents( redraw, FALSE );
+ viewport()->setUpdatesEnabled( true );
+ repaintContents( redraw, false );
}
blockSignals( block );
- viewport()->setUpdatesEnabled( TRUE );
- item->setSelected( select, TRUE );
+ viewport()->setUpdatesEnabled( true );
+ item->setSelected( select, true );
emit selectionChanged();
} else if ( e->state() & ControlButton ) {
- d->pressedSelected = FALSE;
+ d->pressedSelected = false;
item->setSelected( !item->isSelected(), e->state() & ControlButton );
} else {
- item->setSelected( TRUE, e->state() & ControlButton );
+ item->setSelected( true, e->state() & ControlButton );
}
}
} else if ( ( d->selectionMode != Single || e->button() == RightButton )
&& !( e->state() & ControlButton ) )
- selectAll( FALSE );
+ selectAll( false );
setCurrentItem( item );
- d->canStartRubber = FALSE;
+ d->canStartRubber = false;
if ( e->button() == LeftButton ) {
if ( !item && ( d->selectionMode == Multi || d->selectionMode == Extended ) ) {
- d->canStartRubber = TRUE;
+ d->canStartRubber = true;
d->rubberStartX = e->x();
d->rubberStartY = e->y();
}
- d->mousePressed = TRUE;
+ d->mousePressed = true;
}
emit_signals:
@@ -4619,7 +4615,7 @@ void TQIconView::contentsContextMenuEvent( TQContextMenuEvent *e )
TQRect r = item ? item->rect() : TQRect( 0, 0, visibleWidth(), visibleHeight() );
emit contextMenuRequested( item, viewport()->mapToGlobal( contentsToViewport( r.center() ) ) );
} else {
- d->mousePressed = FALSE;
+ d->mousePressed = false;
TQIconViewItem *item = findItem( e->pos() );
emit contextMenuRequested( item, e->globalPos() );
}
@@ -4634,21 +4630,21 @@ void TQIconView::contentsMouseReleaseEvent( TQMouseEvent *e )
TQIconViewItem *item = findItem( e->pos() );
d->selectedItems.clear();
- bool emitClicked = TRUE;
- d->mousePressed = FALSE;
+ bool emitClicked = true;
+ d->mousePressed = false;
d->startDragItem = 0;
- d->canStartRubber = FALSE;
+ d->canStartRubber = false;
if ( d->rubber ) {
TQRect r(d->rubber->normalize());
if ( ( d->rubber->topLeft() - d->rubber->bottomRight() ).manhattanLength() >
TQApplication::startDragDistance() )
- emitClicked = FALSE;
+ emitClicked = false;
delete d->rubber;
d->rubber = 0;
- repaintContents(r, FALSE);
- d->dragging = FALSE;
+ repaintContents(r, false);
+ d->dragging = false;
delete d->backrubber;
d->backrubber = 0;
d->currentItem = d->tmpCurrentItem;
@@ -4668,11 +4664,11 @@ void TQIconView::contentsMouseReleaseEvent( TQMouseEvent *e )
d->currentItem == d->pressedItem &&
d->pressedSelected && d->currentItem ) {
bool block = signalsBlocked();
- blockSignals( TRUE );
+ blockSignals( true );
clearSelection();
blockSignals( block );
if ( d->currentItem->isSelectable() ) {
- d->currentItem->selected = TRUE;
+ d->currentItem->selected = true;
repaintItem( d->currentItem );
}
emit selectionChanged();
@@ -4704,7 +4700,7 @@ void TQIconView::contentsMouseMoveEvent( TQMouseEvent *e )
}
if ( d->mousePressed && e->state() == NoButton )
- d->mousePressed = FALSE;
+ d->mousePressed = false;
if ( d->startDragItem )
item = d->startDragItem;
@@ -4712,12 +4708,12 @@ void TQIconView::contentsMouseMoveEvent( TQMouseEvent *e )
if ( d->mousePressed && item && item == d->currentItem &&
( item->isSelected() || d->selectionMode == NoSelection ) && item->dragEnabled() ) {
if ( !d->startDragItem ) {
- d->currentItem->setSelected( TRUE, TRUE );
+ d->currentItem->setSelected( true, true );
d->startDragItem = item;
}
if ( ( d->dragStartPos - e->pos() ).manhattanLength() > TQApplication::startDragDistance() ) {
- d->mousePressed = FALSE;
- d->cleared = FALSE;
+ d->mousePressed = false;
+ d->cleared = false;
#ifndef TQT_NO_DRAGANDDROP
startDrag();
#endif
@@ -4726,7 +4722,7 @@ void TQIconView::contentsMouseMoveEvent( TQMouseEvent *e )
}
} else if ( d->mousePressed && ((!d->currentItem && d->rubber) || d->canStartRubber) ) {
if ( d->canStartRubber ) {
- d->canStartRubber = FALSE;
+ d->canStartRubber = false;
d->tmpCurrentItem = d->currentItem;
d->currentItem = 0;
repaintItem( d->tmpCurrentItem );
@@ -4752,8 +4748,8 @@ void TQIconView::contentsMouseDoubleClickEvent( TQMouseEvent *e )
{
TQIconViewItem *item = findItem( e->pos() );
if ( item ) {
- selectAll( FALSE );
- item->setSelected( TRUE, TRUE );
+ selectAll( false );
+ item->setSelected( true, true );
emit doubleClicked( item );
}
}
@@ -4765,14 +4761,14 @@ void TQIconView::contentsMouseDoubleClickEvent( TQMouseEvent *e )
#ifndef TQT_NO_DRAGANDDROP
void TQIconView::contentsDragEnterEvent( TQDragEnterEvent *e )
{
- d->dragging = TRUE;
- d->drawDragShapes = TRUE;
+ d->dragging = true;
+ d->drawDragShapes = true;
d->tmpCurrentItem = 0;
initDragEnter( e );
d->oldDragPos = e->pos();
- d->oldDragAcceptAction = FALSE;
+ d->oldDragAcceptAction = false;
drawDragShapes( e->pos() );
- d->dropped = FALSE;
+ d->dropped = false;
}
/*!
@@ -4790,7 +4786,7 @@ void TQIconView::contentsDragMoveEvent( TQDragMoveEvent *e )
}
drawDragShapes( d->oldDragPos );
- d->dragging = FALSE;
+ d->dragging = false;
TQIconViewItem *old = d->tmpCurrentItem;
d->tmpCurrentItem = 0;
@@ -4807,10 +4803,10 @@ void TQIconView::contentsDragMoveEvent( TQDragMoveEvent *e )
if ( !item->rect().contains(d->oldDragPos) )
item->dragEntered();
if (item->acceptDrop(e) || (item->isSelected() && e->source() == viewport())) {
- d->oldDragAcceptAction = TRUE;
+ d->oldDragAcceptAction = true;
e->acceptAction();
} else {
- d->oldDragAcceptAction = FALSE;
+ d->oldDragAcceptAction = false;
e->ignore();
}
@@ -4822,7 +4818,7 @@ void TQIconView::contentsDragMoveEvent( TQDragMoveEvent *e )
p.end();
} else {
e->acceptAction();
- d->oldDragAcceptAction = TRUE;
+ d->oldDragAcceptAction = true;
if ( old ) {
old->dragLeft();
repaintItem( old );
@@ -4831,7 +4827,7 @@ void TQIconView::contentsDragMoveEvent( TQDragMoveEvent *e )
d->oldDragPos = e->pos();
drawDragShapes( e->pos() );
- d->dragging = TRUE;
+ d->dragging = true;
}
/*!
@@ -4842,7 +4838,7 @@ void TQIconView::contentsDragLeaveEvent( TQDragLeaveEvent * )
{
if ( !d->dropped )
drawDragShapes( d->oldDragPos );
- d->dragging = FALSE;
+ d->dragging = false;
if ( d->tmpCurrentItem ) {
repaintItem( d->tmpCurrentItem );
@@ -4850,7 +4846,7 @@ void TQIconView::contentsDragLeaveEvent( TQDragLeaveEvent * )
}
d->tmpCurrentItem = 0;
- d->isIconDrag = FALSE;
+ d->isIconDrag = false;
d->iconDragData.clear();
}
@@ -4860,8 +4856,8 @@ void TQIconView::contentsDragLeaveEvent( TQDragLeaveEvent * )
void TQIconView::contentsDropEvent( TQDropEvent *e )
{
- d->dropped = TRUE;
- d->dragging = FALSE;
+ d->dropped = true;
+ d->dragging = false;
drawDragShapes( d->oldDragPos );
if ( d->tmpCurrentItem )
@@ -4880,7 +4876,7 @@ void TQIconView::contentsDropEvent( TQDropEvent *e )
int h = d->currentItem->y() + d->currentItem->height() + 1;
repaintItem( d->currentItem );
- repaintContents( r.x(), r.y(), r.width(), r.height(), FALSE );
+ repaintContents( r.x(), r.y(), r.width(), r.height(), false );
int dx = d->currentItem->x() - r.x();
int dy = d->currentItem->y() - r.y();
@@ -4896,11 +4892,11 @@ void TQIconView::contentsDropEvent( TQDropEvent *e )
w = TQMAX( w, item->x() + item->width() + 1 );
h = TQMAX( h, item->y() + item->height() + 1 );
}
- repaintContents( rr, FALSE );
- bool fullRepaint = FALSE;
+ repaintContents( rr, false );
+ bool fullRepaint = false;
if ( w > contentsWidth() ||
h > contentsHeight() )
- fullRepaint = TRUE;
+ fullRepaint = true;
int oldw = contentsWidth();
int oldh = contentsHeight();
@@ -4909,8 +4905,8 @@ void TQIconView::contentsDropEvent( TQDropEvent *e )
if ( fullRepaint ) {
- repaintContents( oldw, 0, contentsWidth() - oldw, contentsHeight(), FALSE );
- repaintContents( 0, oldh, contentsWidth(), contentsHeight() - oldh, FALSE );
+ repaintContents( oldw, 0, contentsWidth() - oldw, contentsHeight(), false );
+ repaintContents( 0, oldh, contentsWidth(), contentsHeight() - oldh, false );
}
e->acceptAction();
} else if ( !i && ( e->source() != viewport() || d->cleared ) ) {
@@ -4934,7 +4930,7 @@ void TQIconView::contentsDropEvent( TQDropEvent *e )
}
i->dropped( e, lst );
}
- d->isIconDrag = FALSE;
+ d->isIconDrag = false;
}
#endif
@@ -4987,14 +4983,14 @@ void TQIconView::resizeEvent( TQResizeEvent* e )
{
TQScrollView::resizeEvent( e );
if ( d->resizeMode == Adjust ) {
- optimize_layout = TRUE;
+ optimize_layout = true;
adjustItems();
- optimize_layout = FALSE;
+ optimize_layout = false;
#if 0 // no need for timer delay anymore
d->oldSize = e->oldSize();
if ( d->adjustTimer->isActive() )
d->adjustTimer->stop();
- d->adjustTimer->start( 0, TRUE );
+ d->adjustTimer->start( 0, true );
#endif
}
}
@@ -5008,7 +5004,7 @@ void TQIconView::adjustItems()
{
d->adjustTimer->stop();
if ( d->resizeMode == Adjust )
- arrangeItemsInGrid( TRUE );
+ arrangeItemsInGrid( true );
}
/*!
@@ -5023,11 +5019,11 @@ void TQIconView::keyPressEvent( TQKeyEvent *e )
if ( !d->currentItem ) {
setCurrentItem( d->firstItem );
if ( d->selectionMode == Single )
- d->currentItem->setSelected( TRUE, TRUE );
+ d->currentItem->setSelected( true, true );
return;
}
- bool selectCurrent = TRUE;
+ bool selectCurrent = true;
switch ( e->key() ) {
case Key_Escape:
@@ -5048,7 +5044,7 @@ void TQIconView::keyPressEvent( TQKeyEvent *e )
if ( !d->firstItem )
break;
- selectCurrent = FALSE;
+ selectCurrent = false;
TQIconViewItem *item = 0;
TQIconViewPrivate::ItemContainer *c = d->firstContainer;
@@ -5062,15 +5058,15 @@ void TQIconView::keyPressEvent( TQKeyEvent *e )
if ( d->arrangement == LeftToRight ) {
// we use pixmap so the items textlength are ignored
// find topmost, leftmost item
- if ( i->pixmapRect( FALSE ).y() < item->pixmapRect( FALSE ).y() ||
- ( i->pixmapRect( FALSE ).y() == item->pixmapRect( FALSE ).y() &&
- i->pixmapRect( FALSE ).x() < item->pixmapRect( FALSE ).x() ) )
+ if ( i->pixmapRect( false ).y() < item->pixmapRect( false ).y() ||
+ ( i->pixmapRect( false ).y() == item->pixmapRect( false ).y() &&
+ i->pixmapRect( false ).x() < item->pixmapRect( false ).x() ) )
item = i;
} else {
// find leftmost, topmost item
- if ( i->pixmapRect( FALSE ).x() < item->pixmapRect( FALSE ).x() ||
- ( i->pixmapRect( FALSE ).x() == item->pixmapRect( FALSE ).x() &&
- i->pixmapRect( FALSE ).y() < item->pixmapRect( FALSE ).y() ) )
+ if ( i->pixmapRect( false ).x() < item->pixmapRect( false ).x() ||
+ ( i->pixmapRect( false ).x() == item->pixmapRect( false ).x() &&
+ i->pixmapRect( false ).y() < item->pixmapRect( false ).y() ) )
item = i;
}
}
@@ -5084,7 +5080,7 @@ void TQIconView::keyPressEvent( TQKeyEvent *e )
setCurrentItem( item );
ensureItemVisible( item );
handleItemChange( old, e->state() & ShiftButton,
- e->state() & ControlButton, TRUE );
+ e->state() & ControlButton, true );
}
} break;
@@ -5093,7 +5089,7 @@ void TQIconView::keyPressEvent( TQKeyEvent *e )
if ( !d->lastItem )
break;
- selectCurrent = FALSE;
+ selectCurrent = false;
TQIconViewItem *item = 0;
TQIconViewPrivate::ItemContainer *c = d->lastContainer;
@@ -5106,15 +5102,15 @@ void TQIconView::keyPressEvent( TQKeyEvent *e )
} else {
if ( d->arrangement == LeftToRight ) {
// find bottommost, rightmost item
- if ( i->pixmapRect( FALSE ).bottom() > item->pixmapRect( FALSE ).bottom() ||
- ( i->pixmapRect( FALSE ).bottom() == item->pixmapRect( FALSE ).bottom() &&
- i->pixmapRect( FALSE ).right() > item->pixmapRect( FALSE ).right() ) )
+ if ( i->pixmapRect( false ).bottom() > item->pixmapRect( false ).bottom() ||
+ ( i->pixmapRect( false ).bottom() == item->pixmapRect( false ).bottom() &&
+ i->pixmapRect( false ).right() > item->pixmapRect( false ).right() ) )
item = i;
} else {
// find rightmost, bottommost item
- if ( i->pixmapRect( FALSE ).right() > item->pixmapRect( FALSE ).right() ||
- ( i->pixmapRect( FALSE ).right() == item->pixmapRect( FALSE ).right() &&
- i->pixmapRect( FALSE ).bottom() > item->pixmapRect( FALSE ).bottom() ) )
+ if ( i->pixmapRect( false ).right() > item->pixmapRect( false ).right() ||
+ ( i->pixmapRect( false ).right() == item->pixmapRect( false ).right() &&
+ i->pixmapRect( false ).bottom() > item->pixmapRect( false ).bottom() ) )
item = i;
}
}
@@ -5128,7 +5124,7 @@ void TQIconView::keyPressEvent( TQKeyEvent *e )
setCurrentItem( item );
ensureItemVisible( item );
handleItemChange( old, e->state() & ShiftButton,
- e->state() & ControlButton, TRUE );
+ e->state() & ControlButton, true );
}
} break;
@@ -5137,7 +5133,7 @@ void TQIconView::keyPressEvent( TQKeyEvent *e )
if ( d->selectionMode == Single)
break;
- d->currentItem->setSelected( !d->currentItem->isSelected(), TRUE );
+ d->currentItem->setSelected( !d->currentItem->isSelected(), true );
} break;
case Key_Enter:
@@ -5148,7 +5144,7 @@ void TQIconView::keyPressEvent( TQKeyEvent *e )
case Key_Right: {
d->currInputString = TQString::null;
- selectCurrent = FALSE;
+ selectCurrent = false;
Direction dir = DirRight;
TQIconViewItem *item = findItem(dir, d->currentItem);
if (item) {
@@ -5161,7 +5157,7 @@ void TQIconView::keyPressEvent( TQKeyEvent *e )
case Key_Left: {
d->currInputString = TQString::null;
- selectCurrent = FALSE;
+ selectCurrent = false;
Direction dir = DirLeft;
TQIconViewItem *item = findItem(dir, d->currentItem);
if (item) {
@@ -5174,7 +5170,7 @@ void TQIconView::keyPressEvent( TQKeyEvent *e )
case Key_Down: {
d->currInputString = TQString::null;
- selectCurrent = FALSE;
+ selectCurrent = false;
Direction dir = DirDown;
TQIconViewItem *item = findItem(dir, d->currentItem);
if (item) {
@@ -5187,7 +5183,7 @@ void TQIconView::keyPressEvent( TQKeyEvent *e )
case Key_Up: {
d->currInputString = TQString::null;
- selectCurrent = FALSE;
+ selectCurrent = false;
Direction dir = DirUp;
TQIconViewItem *item = findItem(dir, d->currentItem);
if (item) {
@@ -5200,7 +5196,7 @@ void TQIconView::keyPressEvent( TQKeyEvent *e )
case Key_Next: {
d->currInputString = TQString::null;
- selectCurrent = FALSE;
+ selectCurrent = false;
TQRect r;
if ( d->arrangement == LeftToRight )
r = TQRect( 0, d->currentItem->y() + visibleHeight(), contentsWidth(), visibleHeight() );
@@ -5223,7 +5219,7 @@ void TQIconView::keyPressEvent( TQKeyEvent *e )
case Key_Prior: {
d->currInputString = TQString::null;
- selectCurrent = FALSE;
+ selectCurrent = false;
TQRect r;
if ( d->arrangement == LeftToRight )
r = TQRect( 0, d->currentItem->y() - visibleHeight(), contentsWidth(), visibleHeight() );
@@ -5246,7 +5242,7 @@ void TQIconView::keyPressEvent( TQKeyEvent *e )
default:
if ( !e->text().isEmpty() && e->text()[ 0 ].isPrint() ) {
- selectCurrent = FALSE;
+ selectCurrent = false;
TQIconViewItem *i = d->currentItem;
if ( !i )
i = d->firstItem;
@@ -5272,28 +5268,28 @@ void TQIconView::keyPressEvent( TQKeyEvent *e )
if ( i ) {
setCurrentItem( i );
if ( d->selectionMode == Extended ) {
- bool changed = FALSE;
+ bool changed = false;
bool block = signalsBlocked();
- blockSignals( TRUE );
- selectAll( FALSE );
+ blockSignals( true );
+ selectAll( false );
blockSignals( block );
if ( !i->selected && i->isSelectable() ) {
- changed = TRUE;
- i->selected = TRUE;
+ changed = true;
+ i->selected = true;
repaintItem( i );
}
if ( changed )
emit selectionChanged();
}
}
- d->inputTimer->start( 400, TRUE );
+ d->inputTimer->start( 400, true );
} else {
- selectCurrent = FALSE;
+ selectCurrent = false;
d->currInputString = TQString::null;
if ( e->state() & ControlButton ) {
switch ( e->key() ) {
case Key_A:
- selectAll( TRUE );
+ selectAll( true );
break;
}
}
@@ -5307,7 +5303,7 @@ void TQIconView::keyPressEvent( TQKeyEvent *e )
if ( d->currentItem && !d->currentItem->isSelected() &&
d->selectionMode == Single && selectCurrent ) {
- d->currentItem->setSelected( TRUE );
+ d->currentItem->setSelected( true );
}
ensureItemVisible( d->currentItem );
@@ -5509,8 +5505,8 @@ TQIconViewItem* TQIconView::findItem(Direction dir, const TQIconViewItem *fromIt
void TQIconView::focusInEvent( TQFocusEvent* )
{
- d->mousePressed = FALSE;
- d->inMenuMode = FALSE;
+ d->mousePressed = false;
+ d->inMenuMode = false;
if ( d->currentItem ) {
repaintItem( d->currentItem );
} else if ( d->firstItem && TQFocusEvent::reason() != TQFocusEvent::Mouse ) {
@@ -5523,7 +5519,7 @@ void TQIconView::focusInEvent( TQFocusEvent* )
repaintSelectedItems();
if ( d->currentItem )
- setMicroFocusHint( d->currentItem->x(), d->currentItem->y(), d->currentItem->width(), d->currentItem->height(), FALSE );
+ setMicroFocusHint( d->currentItem->x(), d->currentItem->y(), d->currentItem->width(), d->currentItem->height(), false );
}
/*!
@@ -5586,21 +5582,21 @@ TQDragObject *TQIconView::dragObject()
if ( d->selectionMode == NoSelection ) {
TQIconViewItem *item = d->currentItem;
drag->append( TQIconDragItem(),
- TQRect( item->pixmapRect( FALSE ).x() - orig.x(),
- item->pixmapRect( FALSE ).y() - orig.y(),
+ TQRect( item->pixmapRect( false ).x() - orig.x(),
+ item->pixmapRect( false ).y() - orig.y(),
item->pixmapRect().width(), item->pixmapRect().height() ),
- TQRect( item->textRect( FALSE ).x() - orig.x(),
- item->textRect( FALSE ).y() - orig.y(),
+ TQRect( item->textRect( false ).x() - orig.x(),
+ item->textRect( false ).y() - orig.y(),
item->textRect().width(), item->textRect().height() ) );
} else {
for ( TQIconViewItem *item = d->firstItem; item; item = item->next ) {
if ( item->isSelected() ) {
drag->append( TQIconDragItem(),
- TQRect( item->pixmapRect( FALSE ).x() - orig.x(),
- item->pixmapRect( FALSE ).y() - orig.y(),
+ TQRect( item->pixmapRect( false ).x() - orig.x(),
+ item->pixmapRect( false ).y() - orig.y(),
item->pixmapRect().width(), item->pixmapRect().height() ),
- TQRect( item->textRect( FALSE ).x() - orig.x(),
- item->textRect( FALSE ).y() - orig.y(),
+ TQRect( item->textRect( false ).x() - orig.x(),
+ item->textRect( false ).y() - orig.y(),
item->textRect().width(), item->textRect().height() ) );
}
}
@@ -5622,7 +5618,7 @@ void TQIconView::startDrag()
d->dragStart = TQPoint( orig.x() - d->startDragItem->x(),
orig.y() - d->startDragItem->y() );
d->startDragItem = 0;
- d->mousePressed = FALSE;
+ d->mousePressed = false;
d->pressedItem = 0;
d->pressedSelected = 0;
@@ -5653,7 +5649,7 @@ void TQIconView::insertInGrid( TQIconViewItem *item )
// #### make this efficient - but it's not too dramatic
int y = d->spacing;
- item->dirty = FALSE;
+ item->dirty = false;
if ( item == d->firstItem ) {
bool dummy;
makeRowLayout( item, y, dummy );
@@ -5671,7 +5667,7 @@ void TQIconView::insertInGrid( TQIconViewItem *item )
begin = begin->next;
}
- item->dirty = FALSE;
+ item->dirty = false;
} else {
TQRegion r( TQRect( 0, 0, TQMAX( contentsWidth(), visibleWidthSB() ),
TQMAX( contentsHeight(), visibleHeightSB() ) ) );
@@ -5685,7 +5681,7 @@ void TQIconView::insertInGrid( TQIconViewItem *item )
TQMemArray<TQRect> rects = r.rects();
TQMemArray<TQRect>::Iterator it = rects.begin();
- bool foundPlace = FALSE;
+ bool foundPlace = false;
for ( ; it != rects.end(); ++it ) {
TQRect rect = *it;
if ( rect.width() >= item->width() &&
@@ -5696,7 +5692,7 @@ void TQIconView::insertInGrid( TQIconViewItem *item )
if ( rect.height() >= item->height() + d->spacing )
sy = d->spacing;
item->move( rect.x() + sx, rect.y() + sy );
- foundPlace = TRUE;
+ foundPlace = true;
break;
}
}
@@ -5706,7 +5702,7 @@ void TQIconView::insertInGrid( TQIconViewItem *item )
resizeContents( TQMAX( contentsWidth(), item->x() + item->width() ),
TQMAX( contentsHeight(), item->y() + item->height() ) );
- item->dirty = FALSE;
+ item->dirty = false;
}
}
@@ -5749,7 +5745,7 @@ void TQIconView::drawDragShapes( const TQPoint &pos )
return;
if ( !d->drawDragShapes ) {
- d->drawDragShapes = TRUE;
+ d->drawDragShapes = true;
return;
}
@@ -5801,7 +5797,7 @@ void TQIconView::initDragEnter( TQDropEvent *e )
{
if ( TQIconDrag::canDecode( e ) ) {
TQIconDragPrivate::decode( e, d->iconDragData );
- d->isIconDrag = TRUE;
+ d->isIconDrag = true;
} else if ( TQUriDrag::canDecode( e ) ) {
TQStrList lst;
TQUriDrag::decode( e, lst );
@@ -5839,13 +5835,13 @@ bool TQIconView::eventFilter( TQObject * o, TQEvent * e )
switch( e->type() ) {
case TQEvent::FocusIn:
focusInEvent( (TQFocusEvent*)e );
- return TRUE;
+ return true;
case TQEvent::FocusOut:
focusOutEvent( (TQFocusEvent*)e );
- return TRUE;
+ return true;
case TQEvent::Enter:
enterEvent( e );
- return TRUE;
+ return true;
case TQEvent::Paint:
if ( o == viewport() ) {
if ( d->dragging ) {
@@ -5858,7 +5854,7 @@ bool TQIconView::eventFilter( TQObject * o, TQEvent * e )
bufferedPaintEvent( (TQPaintEvent*)e );
}
}
- return TRUE;
+ return true;
default:
// nothing
break;
@@ -5920,12 +5916,12 @@ TQIconViewItem *TQIconView::makeRowLayout( TQIconViewItem *begin, int &y, bool &
TQIconViewItem *end = 0;
// Find the first visible item
- while (begin->next && (begin->isVisible() == FALSE)) {
+ while (begin->next && (begin->isVisible() == false)) {
begin = begin->next;
}
bool reverse = TQApplication::reverseLayout();
- changed = FALSE;
+ changed = false;
if ( d->arrangement == LeftToRight ) {
@@ -5939,7 +5935,7 @@ TQIconViewItem *TQIconView::makeRowLayout( TQIconViewItem *begin, int &y, bool &
x += d->spacing + item->width();
if ( x > visibleWidthSB() && item != begin ) {
item = item->prev;
- while (item && (item->isVisible() == FALSE)) {
+ while (item && (item->isVisible() == false)) {
item = item->prev;
}
break;
@@ -5948,7 +5944,7 @@ TQIconViewItem *TQIconView::makeRowLayout( TQIconViewItem *begin, int &y, bool &
ih = TQMAX( ih, item->pixmapRect().height() );
TQIconViewItem *old = item;
item = item->next;
- while (item && (item->isVisible() == FALSE)) {
+ while (item && (item->isVisible() == false)) {
item = item->next;
}
if ( !item ) {
@@ -5964,7 +5960,7 @@ TQIconViewItem *TQIconView::makeRowLayout( TQIconViewItem *begin, int &y, bool &
// now move the items
item = begin;
for (;;) {
- item->dirty = FALSE;
+ item->dirty = false;
int x;
if ( item == begin ) {
if ( reverse )
@@ -6006,7 +6002,7 @@ TQIconViewItem *TQIconView::makeRowLayout( TQIconViewItem *begin, int &y, bool &
}
if ( x > visibleWidthSB() && item != begin ) {
item = item->prev;
- while (item && (item->isVisible() == FALSE)) {
+ while (item && (item->isVisible() == false)) {
item = item->prev;
}
break;
@@ -6015,7 +6011,7 @@ TQIconViewItem *TQIconView::makeRowLayout( TQIconViewItem *begin, int &y, bool &
ih = TQMAX( ih, item->pixmapRect().height() );
TQIconViewItem *old = item;
item = item->next;
- while (item && (item->isVisible() == FALSE)) {
+ while (item && (item->isVisible() == false)) {
item = item->next;
}
if ( !item ) {
@@ -6033,7 +6029,7 @@ TQIconViewItem *TQIconView::makeRowLayout( TQIconViewItem *begin, int &y, bool &
i = 0;
sp = 0;
for (;;) {
- item->dirty = FALSE;
+ item->dirty = false;
int r = calcGridNum( item->width(), d->rastX );
if ( item == begin ) {
if ( d->itemTextPos == Bottom )
@@ -6058,7 +6054,7 @@ TQIconViewItem *TQIconView::makeRowLayout( TQIconViewItem *begin, int &y, bool &
if ( item == end )
break;
item = item->next;
- while (item && (item->isVisible() == FALSE)) {
+ while (item && (item->isVisible() == false)) {
item = item->next;
}
}
@@ -6078,7 +6074,7 @@ TQIconViewItem *TQIconView::makeRowLayout( TQIconViewItem *begin, int &y, bool &
y += d->spacing + item->height();
if ( y > visibleHeightSB() && item != begin ) {
item = item->prev;
- while (item && (item->isVisible() == FALSE)) {
+ while (item && (item->isVisible() == false)) {
item = item->prev;
}
break;
@@ -6086,7 +6082,7 @@ TQIconViewItem *TQIconView::makeRowLayout( TQIconViewItem *begin, int &y, bool &
w = TQMAX( w, item->width() );
TQIconViewItem *old = item;
item = item->next;
- while (item && (item->isVisible() == FALSE)) {
+ while (item && (item->isVisible() == false)) {
item = item->next;
}
if ( !item ) {
@@ -6103,7 +6099,7 @@ TQIconViewItem *TQIconView::makeRowLayout( TQIconViewItem *begin, int &y, bool &
item = begin;
TQIconViewItem *prevVisibleItem = NULL;
for (;;) {
- item->dirty = FALSE;
+ item->dirty = false;
if ( d->itemTextPos == Bottom ) {
if ( item == begin )
changed = item->move( x + ( w - item->width() ) / 2, d->spacing ) || changed;
@@ -6120,7 +6116,7 @@ TQIconViewItem *TQIconView::makeRowLayout( TQIconViewItem *begin, int &y, bool &
break;
prevVisibleItem = item;
item = item->next;
- while (item && (item->isVisible() == FALSE)) {
+ while (item && (item->isVisible() == false)) {
item = item->next;
}
}
@@ -6160,7 +6156,7 @@ TQIconViewItem *TQIconView::rowBegin( TQIconViewItem * ) const
/*!
Sorts and rearranges all the items in the icon view. If \a
- ascending is TRUE, the items are sorted in increasing order,
+ ascending is true, the items are sorted in increasing order,
otherwise they are sorted in decreasing order.
TQIconViewItem::compare() is used to compare pairs of items. The
@@ -6225,7 +6221,7 @@ void TQIconView::sort( bool ascending )
delete [] items;
- arrangeItemsInGrid( TRUE );
+ arrangeItemsInGrid( true );
}
/*!
@@ -6243,11 +6239,11 @@ TQSize TQIconView::sizeHint() const
( (TQIconView*)this )->resizeContents( TQMAX( 400, contentsWidth() ),
TQMAX( 400, contentsHeight() ) );
if ( autoArrange() )
- ( (TQIconView*)this )->arrangeItemsInGrid( FALSE );
- d->firstSizeHint = FALSE;
+ ( (TQIconView*)this )->arrangeItemsInGrid( false );
+ d->firstSizeHint = false;
}
- d->dirty = TRUE; // ######## warwick: I'm sure this is wrong. Fixed in 2.3.
+ d->dirty = true; // ######## warwick: I'm sure this is wrong. Fixed in 2.3.
int extra = style().pixelMetric(TQStyle::PM_ScrollBarExtent,
verticalScrollBar()) + 2*frameWidth();
TQSize s( TQMIN(400, contentsWidth() + extra),
@@ -6310,7 +6306,7 @@ void TQIconView::updateItemContainer( TQIconViewItem *item )
}
const TQRect irect = item->rect();
- bool contains = FALSE;
+ bool contains = false;
for (;;) {
if ( c->rect.intersects( irect ) ) {
contains = c->rect.contains( irect );
@@ -6460,33 +6456,33 @@ void TQIconView::handleItemChange( TQIconViewItem *old, bool shift,
{
if ( d->selectionMode == Single ) {
bool block = signalsBlocked();
- blockSignals( TRUE );
+ blockSignals( true );
if ( old )
- old->setSelected( FALSE );
+ old->setSelected( false );
blockSignals( block );
- d->currentItem->setSelected( TRUE, TRUE );
+ d->currentItem->setSelected( true, true );
} else if ( d->selectionMode == Extended ) {
if ( shift ) {
if ( !d->selectAnchor ) {
if ( old && !old->selected && old->isSelectable() ) {
- old->selected = TRUE;
+ old->selected = true;
repaintItem( old );
}
- d->currentItem->setSelected( TRUE, TRUE );
+ d->currentItem->setSelected( true, true );
} else {
TQIconViewItem *from = d->selectAnchor, *to = d->currentItem;
if ( !from || !to )
return;
// checking if it's downwards and if we span rows
- bool downwards = FALSE;
- bool spanning = FALSE;
+ bool downwards = false;
+ bool spanning = false;
if ( d->arrangement == LeftToRight) {
if ( from->rect().center().y() < to->rect().center().y() )
- downwards = TRUE;
+ downwards = true;
} else {
if ( from->rect().center().x() < to->rect().center().x() )
- downwards = TRUE;
+ downwards = true;
}
TQRect fr = from->rect();
@@ -6494,11 +6490,11 @@ void TQIconView::handleItemChange( TQIconViewItem *old, bool shift,
if ( d->arrangement == LeftToRight ) {
fr.moveTopLeft( TQPoint( tr.x(), fr.y() ) );
if ( !tr.intersects( fr ) )
- spanning = TRUE;
+ spanning = true;
} else {
fr.moveTopLeft( TQPoint( fr.x(), tr.y() ) );
if ( !tr.intersects( fr ) )
- spanning = TRUE;
+ spanning = true;
}
@@ -6532,31 +6528,31 @@ void TQIconView::handleItemChange( TQIconViewItem *old, bool shift,
// finding contained items and selecting them
TQIconViewItem *item = 0;
- bool changed = FALSE;
+ bool changed = false;
bool midValid = midRect.isValid();
bool topValid = topRect.isValid();
bool bottomValid = bottomRect.isValid();
TQRect selectedRect, unselectedRect;
for ( item = d->firstItem; item; item = item->next ) {
- bool contained = FALSE;
+ bool contained = false;
TQPoint itemCenter = item->rect().center();
if ( midValid && midRect.contains( itemCenter ) )
- contained = TRUE;
+ contained = true;
if ( !contained && topValid && topRect.contains( itemCenter ) )
- contained = TRUE;
+ contained = true;
if ( !contained && bottomValid && bottomRect.contains( itemCenter ) )
- contained = TRUE;
+ contained = true;
if ( contained ) {
if ( !item->selected && item->isSelectable() ) {
- changed = TRUE;
- item->selected = TRUE;
+ changed = true;
+ item->selected = true;
selectedRect = selectedRect.unite( item->rect() );
}
} else if ( item->selected && !control ) {
- item->selected = FALSE;
+ item->selected = false;
unselectedRect = unselectedRect.unite( item->rect() );
- changed = TRUE;
+ changed = true;
}
}
@@ -6580,14 +6576,14 @@ void TQIconView::handleItemChange( TQIconViewItem *old, bool shift,
emit selectionChanged();
}
} else if ( !control ) {
- blockSignals( TRUE );
- selectAll( FALSE );
- blockSignals( FALSE );
- d->currentItem->setSelected( TRUE, TRUE );
+ blockSignals( true );
+ selectAll( false );
+ blockSignals( false );
+ d->currentItem->setSelected( true, true );
}
} else {
if ( shift )
- d->currentItem->setSelected( !d->currentItem->isSelected(), TRUE );
+ d->currentItem->setSelected( !d->currentItem->isSelected(), true );
}
}
@@ -6629,8 +6625,8 @@ void TQIconView::windowActivationChange( bool oldActive )
}
/*!
- Returns TRUE if an iconview item is being renamed; otherwise
- returns FALSE.
+ Returns true if an iconview item is being renamed; otherwise
+ returns false.
*/
bool TQIconView::isRenaming() const
@@ -6638,7 +6634,7 @@ bool TQIconView::isRenaming() const
#ifndef TQT_NO_TEXTEDIT
return d->renamingItem && d->renamingItem->renameBox;
#else
- return FALSE;
+ return false;
#endif
}