summaryrefslogtreecommitdiffstats
path: root/src/kernel/qlayout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/qlayout.cpp')
-rw-r--r--src/kernel/qlayout.cpp114
1 files changed, 57 insertions, 57 deletions
diff --git a/src/kernel/qlayout.cpp b/src/kernel/qlayout.cpp
index c32689fff..6cfe214e1 100644
--- a/src/kernel/qlayout.cpp
+++ b/src/kernel/qlayout.cpp
@@ -148,7 +148,7 @@ public:
inline void setReversed( bool r, bool c ) { hReversed = c; vReversed = r; }
inline bool horReversed() const { return hReversed; }
inline bool verReversed() const { return vReversed; }
- inline void setDirty() { needRecalc = TRUE; hfw_width = -1; }
+ inline void setDirty() { needRecalc = true; hfw_width = -1; }
inline bool isDirty() const { return needRecalc; }
bool hasHeightForWidth( int space );
int heightForWidth( int, int, int );
@@ -167,7 +167,7 @@ private:
void addHfwData ( TQGridBox *box, int width );
void init();
TQSize findSize( TQCOORD TQLayoutStruct::*, int ) const;
- void addData( TQGridBox *b, bool r = TRUE, bool c = TRUE );
+ void addData( TQGridBox *b, bool r = true, bool c = true );
void setSize( int rows, int cols );
void setupLayoutData( int space );
void setupHfwLayoutData( int space );
@@ -210,11 +210,11 @@ TQGridLayoutData::TQGridLayoutData( int nRows, int nCols )
init();
if ( nRows < 0 ) {
nRows = 1;
- addVertical = FALSE;
+ addVertical = false;
}
if ( nCols < 0 ) {
nCols = 1;
- addVertical = TRUE;
+ addVertical = true;
}
setSize( nRows, nCols );
}
@@ -230,15 +230,15 @@ TQGridLayoutData::~TQGridLayoutData()
void TQGridLayoutData::init()
{
- addVertical = FALSE;
+ addVertical = false;
setDirty();
multi = 0;
rr = cc = 0;
nextR = nextC = 0;
hfwData = 0;
- things.setAutoDelete( TRUE );
- hReversed = FALSE;
- vReversed = FALSE;
+ things.setAutoDelete( true );
+ hReversed = false;
+ vReversed = false;
}
bool TQGridLayoutData::hasHeightForWidth( int spacing )
@@ -310,7 +310,7 @@ bool TQGridLayoutData::findWidget( TQWidget* w, int *row, int *col )
*row = box->row;
if ( col )
*col = box->col;
- return TRUE;
+ return true;
}
}
if ( multi ) {
@@ -324,12 +324,12 @@ bool TQGridLayoutData::findWidget( TQWidget* w, int *row, int *col )
*row = box->row;
if ( col )
*col = box->col;
- return TRUE;
+ return true;
}
}
}
- return FALSE;
+ return false;
}
TQSize TQGridLayoutData::findSize( TQCOORD TQLayoutStruct::*size, int spacer ) const
@@ -482,7 +482,7 @@ void TQGridLayoutData::add( TQGridBox *box, int row1, int row2, int col1,
TQGridMultiBox *mbox = new TQGridMultiBox( box, row2, col2 );
if ( !multi ) {
multi = new TQPtrList<TQGridMultiBox>;
- multi->setAutoDelete( TRUE );
+ multi->setAutoDelete( true );
}
multi->append( mbox );
setDirty();
@@ -543,9 +543,9 @@ void TQGridLayoutData::addData( TQGridBox *box, bool r, bool c )
// Empty boxes (i.e. spacers) do not get borders. This is
// hacky, but compatible.
if ( c )
- colData[box->col].empty = FALSE;
+ colData[box->col].empty = false;
if ( r )
- rowData[box->row].empty = FALSE;
+ rowData[box->row].empty = false;
}
}
@@ -562,7 +562,7 @@ static void distributeMultiBox( TQMemArray<TQLayoutStruct> &chain, int spacing,
w += chain[i].minimumSize;
wh += chain[i].sizeHint;
max += chain[i].maximumSize;
- chain[i].empty = FALSE;
+ chain[i].empty = false;
if ( stretchArray[i] == 0 )
chain[i].stretch = TQMAX(chain[i].stretch,stretch);
}
@@ -616,7 +616,7 @@ void TQGridLayoutData::setupLayoutData( int spacing )
if ( !needRecalc )
return;
#endif
- has_hfw = FALSE;
+ has_hfw = false;
int i;
for ( i = 0; i < rr; i++ )
@@ -650,17 +650,17 @@ void TQGridLayoutData::setupLayoutData( int spacing )
TQSize hint = box->sizeHint();
TQSize min = box->minimumSize();
if ( box->hasHeightForWidth() )
- has_hfw = TRUE;
+ has_hfw = true;
if ( r1 == r2 ) {
- addData( box, TRUE, FALSE );
+ addData( box, true, false );
} else {
distributeMultiBox( rowData, spacing, r1, r2,
min.height(), hint.height(),
rStretch, box->vStretch() );
}
if ( c1 == c2 ) {
- addData( box, FALSE, TRUE );
+ addData( box, false, true );
} else {
distributeMultiBox( colData, spacing, c1, c2,
min.width(), hint.width(),
@@ -673,7 +673,7 @@ void TQGridLayoutData::setupLayoutData( int spacing )
for ( i = 0; i < cc; i++ )
colData[i].expansive = colData[i].expansive || colData[i].stretch > 0;
- needRecalc = FALSE;
+ needRecalc = false;
}
void TQGridLayoutData::addHfwData( TQGridBox *box, int width )
@@ -849,7 +849,7 @@ public:
TQLayoutItem *next() {
idx++;
if ( !multi && idx >= (int)data->things.count() ) {
- multi = TRUE;
+ multi = true;
idx = 0;
}
return current();
@@ -1076,8 +1076,8 @@ TQSize TQGridLayout::maximumSize() const
}
/*!
- Returns TRUE if this layout's preferred height depends on its
- width; otherwise returns FALSE.
+ Returns true if this layout's preferred height depends on its
+ width; otherwise returns false.
*/
bool TQGridLayout::hasHeightForWidth() const
{
@@ -1103,7 +1103,7 @@ int TQGridLayout::minimumHeightForWidth( int w ) const
/*!
Searches for widget \a w in this layout (not including child
layouts). If \a w is found, it sets \c \a row and \c \a col to
- the row and column and returns TRUE; otherwise returns FALSE.
+ the row and column and returns true; otherwise returns false.
Note: if a widget spans multiple rows/columns, the top-left cell
is returned.
@@ -1157,7 +1157,7 @@ void TQGridLayout::expand( int nRows, int nCols )
*/
void TQGridLayout::init( int nRows, int nCols )
{
- setSupportsMargin( TRUE );
+ setSupportsMargin( true );
data = new TQGridLayoutData( nRows, nCols );
}
@@ -1209,8 +1209,8 @@ void TQGridLayout::addMultiCell( TQLayoutItem *item, int fromRow, int toRow,
}
/*
- Returns TRUE if the widget \a w can be added to the layout \a l;
- otherwise returns FALSE.
+ Returns true if the widget \a w can be added to the layout \a l;
+ otherwise returns false.
*/
static bool checkWidget( TQLayout *l, TQWidget *w )
{
@@ -1219,7 +1219,7 @@ static bool checkWidget( TQLayout *l, TQWidget *w )
tqWarning( "TQLayout: Cannot add null widget to %s/%s", l->className(),
l->name() );
#endif
- return FALSE;
+ return false;
}
if ( w->parentWidget() != l->mainWidget() && l->mainWidget() ) {
#if defined(QT_CHECK_STATE)
@@ -1233,9 +1233,9 @@ static bool checkWidget( TQLayout *l, TQWidget *w )
" %s/%s", w->className(), w->name(),
l->mainWidget()->className(), l->mainWidget()->name() );
#endif
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
/*!
@@ -1520,7 +1520,7 @@ TQLayoutIterator TQGridLayout::iterator()
struct TQBoxLayoutItem
{
TQBoxLayoutItem( TQLayoutItem *it, int stretch_ = 0 )
- : item( it ), stretch( stretch_ ), magic( FALSE ) { }
+ : item( it ), stretch( stretch_ ), magic( false ) { }
~TQBoxLayoutItem() { delete item; }
int hfw( int w ) {
@@ -1560,8 +1560,8 @@ struct TQBoxLayoutItem
class TQBoxLayoutData
{
public:
- TQBoxLayoutData() : geomArray( 0 ), hfwWidth( -1 ), dirty( TRUE )
- { list.setAutoDelete( TRUE ); }
+ TQBoxLayoutData() : geomArray( 0 ), hfwWidth( -1 ), dirty( true )
+ { list.setAutoDelete( true ); }
~TQBoxLayoutData() { delete geomArray; }
void setDirty() {
@@ -1569,7 +1569,7 @@ public:
geomArray = 0;
hfwWidth = -1;
hfwHeight = -1;
- dirty = TRUE;
+ dirty = true;
}
TQPtrList<TQBoxLayoutItem> list;
@@ -1736,7 +1736,7 @@ TQBoxLayout::TQBoxLayout( TQWidget *parent, Direction d,
{
data = new TQBoxLayoutData;
dir = d;
- setSupportsMargin( TRUE );
+ setSupportsMargin( true );
}
/*!
@@ -1753,7 +1753,7 @@ TQBoxLayout::TQBoxLayout( TQLayout *parentLayout, Direction d, int spacing,
{
data = new TQBoxLayoutData;
dir = d;
- setSupportsMargin( TRUE );
+ setSupportsMargin( true );
}
/*!
@@ -1769,7 +1769,7 @@ TQBoxLayout::TQBoxLayout( Direction d, int spacing, const char *name )
{
data = new TQBoxLayoutData;
dir = d;
- setSupportsMargin( TRUE );
+ setSupportsMargin( true );
}
/*!
@@ -1825,8 +1825,8 @@ TQSize TQBoxLayout::maximumSize() const
}
/*!
- Returns TRUE if this layout's preferred height depends on its width;
- otherwise returns FALSE.
+ Returns true if this layout's preferred height depends on its width;
+ otherwise returns false.
*/
bool TQBoxLayout::hasHeightForWidth() const
{
@@ -2005,7 +2005,7 @@ void TQBoxLayout::insertSpacing( int index, int size )
TQSizePolicy::Fixed );
TQBoxLayoutItem *it = new TQBoxLayoutItem( b );
- it->magic = TRUE;
+ it->magic = true;
data->list.insert( index, it );
invalidate();
}
@@ -2032,7 +2032,7 @@ void TQBoxLayout::insertStretch( int index, int stretch )
TQSizePolicy::Expanding );
TQBoxLayoutItem *it = new TQBoxLayoutItem( b, stretch );
- it->magic = TRUE;
+ it->magic = true;
data->list.insert( index, it );
invalidate();
}
@@ -2183,7 +2183,7 @@ void TQBoxLayout::addStrut( int size )
TQSizePolicy::Fixed );
TQBoxLayoutItem *it = new TQBoxLayoutItem( b );
- it->magic = TRUE;
+ it->magic = true;
data->list.append( it );
invalidate();
}
@@ -2206,8 +2206,8 @@ int TQBoxLayout::findWidget( TQWidget* w )
/*!
Sets the stretch factor for widget \a w to \a stretch and returns
- TRUE if \a w is found in this layout (not including child
- layouts); otherwise returns FALSE.
+ true if \a w is found in this layout (not including child
+ layouts); otherwise returns false.
*/
bool TQBoxLayout::setStretchFactor( TQWidget *w, int stretch )
{
@@ -2218,18 +2218,18 @@ bool TQBoxLayout::setStretchFactor( TQWidget *w, int stretch )
if ( box->item->widget() == w ) {
box->stretch = stretch;
invalidate();
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
/*!
\overload
Sets the stretch factor for the layout \a l to \a stretch and
- returns TRUE if \a l is found in this layout (not including child
- layouts); otherwise returns FALSE.
+ returns true if \a l is found in this layout (not including child
+ layouts); otherwise returns false.
*/
bool TQBoxLayout::setStretchFactor( TQLayout *l, int stretch )
{
@@ -2240,10 +2240,10 @@ bool TQBoxLayout::setStretchFactor( TQLayout *l, int stretch )
if ( box->item->layout() == l ) {
box->stretch = stretch;
invalidate();
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
/*!
@@ -2310,17 +2310,17 @@ void TQBoxLayout::setupGeom()
int hintw = 0;
int hinth = 0;
- bool horexp = FALSE;
- bool verexp = FALSE;
+ bool horexp = false;
+ bool verexp = false;
- data->hasHfw = FALSE;
+ data->hasHfw = false;
delete data->geomArray;
int n = data->list.count();
data->geomArray = new TQMemArray<TQLayoutStruct>( n );
TQMemArray<TQLayoutStruct>& a = *data->geomArray;
- bool first = TRUE;
+ bool first = true;
for ( int i = 0; i < n; i++ ) {
TQBoxLayoutItem *box = data->list.at( i );
TQSize max = box->item->maximumSize();
@@ -2384,7 +2384,7 @@ void TQBoxLayout::setupGeom()
.expandedTo( data->minSize )
.boundedTo( data->maxSize );
- data->dirty = FALSE;
+ data->dirty = false;
}
/*
@@ -2407,7 +2407,7 @@ void TQBoxLayout::calcHfw( int w )
} else {
TQPtrListIterator<TQBoxLayoutItem> it( data->list );
TQBoxLayoutItem *box;
- bool first = TRUE;
+ bool first = true;
while ( (box = it.current()) != 0 ) {
++it;
bool empty = box->item->isEmpty();
@@ -2448,7 +2448,7 @@ void TQBoxLayout::calcHfw( int w )
The simplest use of the class is like this:
\code
TQBoxLayout * l = new TQHBoxLayout( widget );
- l->setAutoAdd( TRUE );
+ l->setAutoAdd( true );
new TQSomeWidget( widget );
new TQSomeOtherWidget( widget );
new TQAnotherWidget( widget );