diff options
Diffstat (limited to 'kdgantt')
-rw-r--r-- | kdgantt/KDGanttMinimizeSplitter.cpp | 92 | ||||
-rw-r--r-- | kdgantt/KDGanttMinimizeSplitter.h | 10 | ||||
-rw-r--r-- | kdgantt/qlayoutengine_p.h | 2 |
3 files changed, 52 insertions, 52 deletions
diff --git a/kdgantt/KDGanttMinimizeSplitter.cpp b/kdgantt/KDGanttMinimizeSplitter.cpp index 82d6b0e81..77b01627a 100644 --- a/kdgantt/KDGanttMinimizeSplitter.cpp +++ b/kdgantt/KDGanttMinimizeSplitter.cpp @@ -297,7 +297,7 @@ public: class TQSplitterData { public: - TQSplitterData() : opaque( FALSE ), firstShow( TRUE ) {} + TQSplitterData() : opaque( false ), firstShow( true ) {} TQPtrList<KDGanttSplitterLayoutStruct> list; bool opaque; @@ -342,7 +342,7 @@ void kdganttGeomCalc( TQMemArray<TQLayoutStruct> &chain, int start, int count, i that a widget should keep its size when the splitter is resized. Although KDGanttMinimizeSplitter normally resizes the children only - at the end of a resize operation, if you call setOpaqueResize( TRUE + at the end of a resize operation, if you call setOpaqueResize( true ) the widgets are resized as often as possible. The initial distribution of size between the widgets is determined @@ -406,7 +406,7 @@ KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( TQt::Orientation o, TQWidget * */ KDGanttMinimizeSplitter::~KDGanttMinimizeSplitter() { - data->list.setAutoDelete( TRUE ); + data->list.setAutoDelete( true ); delete data; } @@ -460,11 +460,11 @@ void KDGanttMinimizeSplitter::resizeEvent( TQResizeEvent * ) /* Inserts the widget \a w at the end (or at the beginning if \a first - is TRUE) of the splitter's list of widgets. + is true) of the splitter's list of widgets. It is the responsibility of the caller of this function to make sure that \a w is not already in the splitter and to call recalcId if - needed. (If \a first is TRUE, then recalcId is very probably + needed. (If \a first is true, then recalcId is very probably needed.) */ KDGanttSplitterLayoutStruct *KDGanttMinimizeSplitter::addWidget( TQWidget *w, bool first ) @@ -479,7 +479,7 @@ KDGanttSplitterLayoutStruct *KDGanttMinimizeSplitter::addWidget( TQWidget *w, bo newHandle = new KDGanttSplitterHandle( orientation(), this, tmp.latin1() ); s->wid = newHandle; newHandle->setId(data->list.count()); - s->isSplitter = TRUE; + s->isSplitter = true; s->sizer = pick( newHandle->sizeHint() ); if ( first ) data->list.insert( 0, s ); @@ -493,7 +493,7 @@ KDGanttSplitterLayoutStruct *KDGanttMinimizeSplitter::addWidget( TQWidget *w, bo s->sizer = pick( w->sizeHint() ); else s->sizer = pick( w->size() ); - s->isSplitter = FALSE; + s->isSplitter = false; if ( first ) data->list.insert( 0, s ); else @@ -587,7 +587,7 @@ bool KDGanttMinimizeSplitter::event( TQEvent *e ) if ( e->type() == TQEvent::LayoutHint || ( e->type() == TQEvent::Show && data->firstShow ) ) { recalc( isVisible() ); if ( e->type() == TQEvent::Show ) - data->firstShow = FALSE; + data->firstShow = false; } return TQWidget::event( e ); } @@ -617,12 +617,12 @@ void KDGanttMinimizeSplitter::drawSplitter( TQPainter *p, int KDGanttMinimizeSplitter::idAfter( TQWidget* w ) const { KDGanttSplitterLayoutStruct *s = data->list.first(); - bool seen_w = FALSE; + bool seen_w = false; while ( s ) { if ( s->isSplitter && seen_w ) return data->list.at(); if ( !s->isSplitter && s->wid == w ) - seen_w = TRUE; + seen_w = true; s = data->list.next(); } return 0; @@ -698,11 +698,11 @@ void KDGanttMinimizeSplitter::moveBefore( int pos, int id, bool upLeft ) pos1 = pos2 + 1; } if ( upLeft ) { - setG( w, pos1, dd, TRUE ); + setG( w, pos1, dd, true ); moveBefore( pos2, id-1, upLeft ); } else { moveBefore( pos2, id-1, upLeft ); - setG( w, pos1, dd, TRUE ); + setG( w, pos1, dd, true ); } } else { int dd, newLeft, nextPos; @@ -717,7 +717,7 @@ void KDGanttMinimizeSplitter::moveBefore( int pos, int id, bool upLeft ) newLeft = pos-dd+1; nextPos = newLeft - 1; } - setG( w, newLeft, dd, TRUE ); + setG( w, newLeft, dd, true ); moveBefore( nextPos, id-1, upLeft ); } } @@ -751,11 +751,11 @@ void KDGanttMinimizeSplitter::moveAfter( int pos, int id, bool upLeft ) pos2 = pos + dd; } if ( upLeft ) { - setG( w, pos1, dd, TRUE ); + setG( w, pos1, dd, true ); moveAfter( pos2, id+1, upLeft ); } else { moveAfter( pos2, id+1, upLeft ); - setG( w, pos1, dd, TRUE ); + setG( w, pos1, dd, true ); } } else { int left = pick( w->pos() ); @@ -773,7 +773,7 @@ void KDGanttMinimizeSplitter::moveAfter( int pos, int id, bool upLeft ) newLeft = pos; nextPos = newLeft + dd; } - setG( w, newLeft, dd, TRUE ); + setG( w, newLeft, dd, true ); /*if( right != newRight )*/ moveAfter( nextPos, id+1, upLeft ); } @@ -886,23 +886,23 @@ void KDGanttMinimizeSplitter::doResize() } else if ( s->isSplitter ) { a[i].stretch = 0; a[i].sizeHint = a[i].minimumSize = a[i].maximumSize = s->sizer; - a[i].empty = FALSE; + a[i].empty = false; } else if ( s->mode == KeepSize ) { a[i].stretch = 0; a[i].minimumSize = pick( minSize(s->wid) ); a[i].sizeHint = s->sizer; a[i].maximumSize = pick( s->wid->maximumSize() ); - a[i].empty = FALSE; + a[i].empty = false; } else if ( s->mode == FollowSizeHint ) { a[i].stretch = 0; a[i].minimumSize = a[i].sizeHint = pick( s->wid->sizeHint() ); a[i].maximumSize = pick( s->wid->maximumSize() ); - a[i].empty = FALSE; + a[i].empty = false; } else { //proportional a[i].stretch = s->sizer; a[i].maximumSize = pick( s->wid->maximumSize() ); a[i].sizeHint = a[i].minimumSize = pick( minSize(s->wid) ); - a[i].empty = FALSE; + a[i].empty = false; } } @@ -924,7 +924,7 @@ void KDGanttMinimizeSplitter::recalc( bool update ) int maxt = TQWIDGETSIZE_MAX; int mint = fi; int n = data->list.count(); - bool first = TRUE; + bool first = true; /* The splitter before a hidden widget is always hidden. The splitter before the first visible widget is hidden. @@ -940,15 +940,15 @@ void KDGanttMinimizeSplitter::recalc( bool update ) else p->wid->show(); //may trigger new recalc if ( !s->wid->isHidden() ) - first = FALSE; + first = false; } } - bool empty=TRUE; + bool empty=true; for ( int j = 0; j< n; j++ ) { KDGanttSplitterLayoutStruct *s = data->list.at(j); if ( !s->wid->isHidden() ) { - empty = FALSE; + empty = false; if ( s->isSplitter ) { minl += s->sizer; maxl += s->sizer; @@ -1005,13 +1005,13 @@ void KDGanttMinimizeSplitter::setResizeMode( TQWidget *w, ResizeMode mode ) } s = data->list.next(); } - s = addWidget( w, TRUE ); + s = addWidget( w, true ); s->mode = mode; } /*! - Returns TRUE if opaque resize is on; otherwise returns FALSE. + Returns true if opaque resize is on; otherwise returns false. \sa setOpaqueResize() */ @@ -1023,7 +1023,7 @@ bool KDGanttMinimizeSplitter::opaqueResize() const /*! - If \a on is TRUE then opaque resizing is turned on; otherwise + If \a on is true then opaque resizing is turned on; otherwise opaque resizing is turned off. Opaque resizing is initially turned off. @@ -1043,11 +1043,11 @@ void KDGanttMinimizeSplitter::setOpaqueResize( bool on ) void KDGanttMinimizeSplitter::moveToFirst( TQWidget *w ) { processChildEvents(); - bool found = FALSE; + bool found = false; KDGanttSplitterLayoutStruct *s = data->list.first(); while ( s ) { if ( s->wid == w ) { - found = TRUE; + found = true; KDGanttSplitterLayoutStruct *p = data->list.prev(); if ( p ) { // not already at first place data->list.take(); //take p @@ -1060,7 +1060,7 @@ void KDGanttMinimizeSplitter::moveToFirst( TQWidget *w ) s = data->list.next(); } if ( !found ) - addWidget( w, TRUE ); + addWidget( w, true ); recalcId(); } @@ -1072,11 +1072,11 @@ void KDGanttMinimizeSplitter::moveToFirst( TQWidget *w ) void KDGanttMinimizeSplitter::moveToLast( TQWidget *w ) { processChildEvents(); - bool found = FALSE; + bool found = false; KDGanttSplitterLayoutStruct *s = data->list.first(); while ( s ) { if ( s->wid == w ) { - found = TRUE; + found = true; data->list.take(); // take s KDGanttSplitterLayoutStruct *p = data->list.current(); if ( p ) { // the splitter handle after s @@ -1181,7 +1181,7 @@ void KDGanttMinimizeSplitter::storeSizes() #if 0 // ### remove this code ASAP /*! - Hides \a w if \a hide is TRUE and updates the splitter. + Hides \a w if \a hide is true and updates the splitter. \warning Due to a limitation in the current implementation, calling TQWidget::hide() will not work. @@ -1203,7 +1203,7 @@ void KDGanttMinimizeSplitter::setHidden( TQWidget *w, bool hide ) w->hide(); else w->show(); - recalc( TRUE ); + recalc( true ); } @@ -1221,7 +1221,7 @@ bool KDGanttMinimizeSplitter::isHidden( TQWidget *w ) const else tqWarning( "KDGanttMinimizeSplitter::isHidden(), unknown widget" ); #endif - return FALSE; + return false; } #endif @@ -1360,12 +1360,12 @@ void kdganttGeomCalc( TQMemArray<TQLayoutStruct> &chain, int start, int count, i int sumStretch = 0; int spacerCount = 0; - bool wannaGrow = FALSE; // anyone who really wants to grow? - // bool canShrink = FALSE; // anyone who could be persuaded to shrink? + bool wannaGrow = false; // anyone who really wants to grow? + // bool canShrink = false; // anyone who could be persuaded to shrink? int i; for ( i = start; i < start + count; i++ ) { - chain[i].done = FALSE; + chain[i].done = false; cHint += chain[i].sizeHint; cMin += chain[i].minimumSize; cMax += chain[i].maximumSize; @@ -1382,7 +1382,7 @@ void kdganttGeomCalc( TQMemArray<TQLayoutStruct> &chain, int start, int count, i // tqDebug("not enough space"); for ( i = start; i < start+count; i++ ) { chain[i].size = chain[i].minimumSize; - chain[i].done = TRUE; + chain[i].done = true; } } else if ( space < cHint + spacerCount*spacer ) { // Less space than sizeHint, but more than minimum. @@ -1395,7 +1395,7 @@ void kdganttGeomCalc( TQMemArray<TQLayoutStruct> &chain, int start, int count, i for ( i = start; i < start+count; i++ ) { if ( !chain[i].done && chain[i].minimumSize >= chain[i].sizeHint) { chain[i].size = chain[i].sizeHint; - chain[i].done = TRUE; + chain[i].done = true; space_left -= chain[i].sizeHint; // sumStretch -= chain[i].stretch; n--; @@ -1403,7 +1403,7 @@ void kdganttGeomCalc( TQMemArray<TQLayoutStruct> &chain, int start, int count, i } bool finished = n == 0; while ( !finished ) { - finished = TRUE; + finished = true; fixed fp_over = toFixed( overdraft ); fixed fp_w = 0; @@ -1418,9 +1418,9 @@ void kdganttGeomCalc( TQMemArray<TQLayoutStruct> &chain, int start, int count, i chain[i].size = chain[i].sizeHint - w; fp_w -= toFixed( w ); //give the difference to the next if ( chain[i].size < chain[i].minimumSize ) { - chain[i].done = TRUE; + chain[i].done = true; chain[i].size = chain[i].minimumSize; - finished = FALSE; + finished = false; overdraft -= chain[i].sizeHint - chain[i].minimumSize; // sumStretch -= chain[i].stretch; n--; @@ -1436,7 +1436,7 @@ void kdganttGeomCalc( TQMemArray<TQLayoutStruct> &chain, int start, int count, i if ( !chain[i].done && (chain[i].maximumSize <= chain[i].sizeHint || wannaGrow && !chain[i].expansive) ) { chain[i].size = chain[i].sizeHint; - chain[i].done = TRUE; + chain[i].done = true; space_left -= chain[i].sizeHint; sumStretch -= chain[i].stretch; n--; @@ -1481,7 +1481,7 @@ void kdganttGeomCalc( TQMemArray<TQLayoutStruct> &chain, int start, int count, i if ( !chain[i].done && chain[i].size < chain[i].sizeHint ) { chain[i].size = chain[i].sizeHint; - chain[i].done = TRUE; + chain[i].done = true; space_left -= chain[i].sizeHint; sumStretch -= chain[i].stretch; n--; @@ -1494,7 +1494,7 @@ void kdganttGeomCalc( TQMemArray<TQLayoutStruct> &chain, int start, int count, i if ( !chain[i].done && chain[i].size > chain[i].maximumSize ) { chain[i].size = chain[i].maximumSize; - chain[i].done = TRUE; + chain[i].done = true; space_left -= chain[i].maximumSize; sumStretch -= chain[i].stretch; n--; diff --git a/kdgantt/KDGanttMinimizeSplitter.h b/kdgantt/KDGanttMinimizeSplitter.h index b70c51818..3a60c8b12 100644 --- a/kdgantt/KDGanttMinimizeSplitter.h +++ b/kdgantt/KDGanttMinimizeSplitter.h @@ -65,13 +65,13 @@ public: Direction minimizeDirection() const; virtual void setResizeMode( TQWidget *w, ResizeMode ); - virtual void setOpaqueResize( bool = TRUE ); + virtual void setOpaqueResize( bool = true ); bool opaqueResize() const; void moveToFirst( TQWidget * ); void moveToLast( TQWidget * ); - void refresh() { recalc( TRUE ); } + void refresh() { recalc( true ); } virtual TQSize sizeHint() const; virtual TQSize minimumSizeHint() const; @@ -97,15 +97,15 @@ protected: private: void init(); - void recalc( bool update = FALSE ); + void recalc( bool update = false ); void doResize(); void storeSizes(); void processChildEvents(); - KDGanttSplitterLayoutStruct *addWidget( TQWidget*, bool first = FALSE ); + KDGanttSplitterLayoutStruct *addWidget( TQWidget*, bool first = false ); void recalcId(); void moveBefore( int pos, int id, bool upLeft ); void moveAfter( int pos, int id, bool upLeft ); - void setG( TQWidget *w, int p, int s, bool isSplitter = FALSE ); + void setG( TQWidget *w, int p, int s, bool isSplitter = false ); TQCOORD pick( const TQPoint &p ) const { return orient ==TQt::Horizontal ? p.x() : p.y(); } diff --git a/kdgantt/qlayoutengine_p.h b/kdgantt/qlayoutengine_p.h index 1aa73652b..479232406 100644 --- a/kdgantt/qlayoutengine_p.h +++ b/kdgantt/qlayoutengine_p.h @@ -59,7 +59,7 @@ struct QLayoutStruct { void initParameters() { minimumSize = sizeHint = 0; - maximumSize = TQWIDGETSIZE_MAX; expansive = FALSE; empty = TRUE; } + maximumSize = TQWIDGETSIZE_MAX; expansive = false; empty = true; } void init() { stretch = 0; initParameters(); } //permanent storage: int stretch; |