summaryrefslogtreecommitdiffstats
path: root/kexi/widget/utils/kexiflowlayout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kexi/widget/utils/kexiflowlayout.cpp')
-rw-r--r--kexi/widget/utils/kexiflowlayout.cpp88
1 files changed, 44 insertions, 44 deletions
diff --git a/kexi/widget/utils/kexiflowlayout.cpp b/kexi/widget/utils/kexiflowlayout.cpp
index e2397ede..e4bc4207 100644
--- a/kexi/widget/utils/kexiflowlayout.cpp
+++ b/kexi/widget/utils/kexiflowlayout.cpp
@@ -64,7 +64,7 @@ KexiFlowLayoutIterator::takeCurrent()
return (m_idx < (int)count()) ? m_list->take(m_idx) : 0;
}
-//// The layout itself
+//// The tqlayout itself
KexiFlowLayout::KexiFlowLayout(TQWidget *parent, int border, int space, const char *name)
: TQLayout(parent, border, space, name)
@@ -134,10 +134,10 @@ KexiFlowLayout::widgetList() const
}
void
-KexiFlowLayout::invalidate()
+KexiFlowLayout::tqinvalidate()
{
- TQLayout::invalidate();
- m_cached_sizeHint = TQSize();
+ TQLayout::tqinvalidate();
+ m_cached_tqsizeHint = TQSize();
m_cached_minSize = TQSize();
m_cached_width = 0;
}
@@ -169,22 +169,22 @@ KexiFlowLayout::heightForWidth(int w) const
}
TQSize
-KexiFlowLayout::sizeHint() const
+KexiFlowLayout::tqsizeHint() const
{
- if(m_cached_sizeHint.isEmpty()) {
+ if(m_cached_tqsizeHint.isEmpty()) {
KexiFlowLayout *mthis = (KexiFlowLayout*)this;
TQRect r = TQRect(0, 0, 2000, 2000);
mthis->simulateLayout(r);
}
- return m_cached_sizeHint;
+ return m_cached_tqsizeHint;
}
TQSize
-KexiFlowLayout::minimumSize() const
+KexiFlowLayout::tqminimumSize() const
{
-//js: do we really need to simulate layout here?
-// I commented this out because it was impossible to stretch layout conveniently.
-// Now, minimum size is computed automatically based on item's minimumSize...
+//js: do we really need to simulate tqlayout here?
+// I commented this out because it was impossible to stretch tqlayout conveniently.
+// Now, minimum size is computed automatically based on item's tqminimumSize...
#if 0
if(m_cached_minSize.isEmpty()) {
KexiFlowLayout *mthis = (KexiFlowLayout*)this;
@@ -234,7 +234,7 @@ KexiFlowLayout::doHorizontalLayout(const TQRect &r, bool testOnly)
TQPtrListIterator<TQLayoutItem> it(m_list);
TQPtrList<TQLayoutItem> currentLine;
TQLayoutItem *o;
- TQSize minSize, sizeHint(20, 20);
+ TQSize minSize, tqsizeHint(20, 20);
int minSizeHeight = 0 - spacing();
while ( (o = it.current()) != 0 ) {
@@ -244,20 +244,20 @@ KexiFlowLayout::doHorizontalLayout(const TQRect &r, bool testOnly)
}
// kdDebug() << "- doHorizontalLayout(): " << o->widget()->className() << " " << o->widget()->name() << endl;
- TQSize oSizeHint = o->sizeHint(); // we cache these ones because it can take a while to get it (eg for child layouts)
+ TQSize oSizeHint = o->tqsizeHint(); // we cache these ones because it can take a while to get it (eg for child layouts)
if ((x + oSizeHint.width()) > r.right() && h > 0) {
- // do the layout of current line
+ // do the tqlayout of current line
TQPtrListIterator<TQLayoutItem> it2(currentLine);
TQLayoutItem *item;
int wx = r.x();
int sizeHintWidth = 0 -spacing(), minSizeWidth=0 - spacing(), lineMinHeight=0;
while( (item = it2.current()) != 0 ) {
- TQSize itemSizeHint = item->sizeHint(); // we cache these ones because it can take
- TQSize itemMinSize = item->minimumSize(); // a while to get them
+ TQSize itemSizeHint = item->tqsizeHint(); // we cache these ones because it can take
+ TQSize itemMinSize = item->tqminimumSize(); // a while to get them
TQSize s;
if(m_justify) {
if(expandingWidgets != 0) {
- if(item->expanding() == TQSizePolicy::Horizontally || item->expanding() == TQSizePolicy::BothDirections)
+ if(item->expandingDirections() == TQSizePolicy::Horizontally || item->expandingDirections() == TQSizePolicy::BothDirections)
s = TQSize( TQMIN(itemSizeHint.width() + availableSpace / expandingWidgets
, r.width()), itemSizeHint.height() );
else
@@ -277,7 +277,7 @@ KexiFlowLayout::doHorizontalLayout(const TQRect &r, bool testOnly)
lineMinHeight = TQMAX( lineMinHeight, itemMinSize.height() );
++it2;
}
- sizeHint = sizeHint.expandedTo( TQSize(sizeHintWidth, 0) );
+ tqsizeHint = tqsizeHint.expandedTo( TQSize(sizeHintWidth, 0) );
minSize = minSize.expandedTo( TQSize(minSizeWidth, 0) );
minSizeHeight = minSizeHeight + spacing() + lineMinHeight;
// start a new line
@@ -292,24 +292,24 @@ KexiFlowLayout::doHorizontalLayout(const TQRect &r, bool testOnly)
x = x + spacing() + oSizeHint.width();
h = TQMAX( h, oSizeHint.height() );
currentLine.append(o);
- if(o->expanding() == TQSizePolicy::Horizontally || o->expanding() == TQSizePolicy::BothDirections)
+ if(o->expandingDirections() == TQSizePolicy::Horizontally || o->expandingDirections() == TQSizePolicy::BothDirections)
++expandingWidgets;
availableSpace = TQMAX(0, availableSpace - spacing() - oSizeHint.width());
++it;
}
- // don't forget to layout the last line
+ // don't forget to tqlayout the last line
TQPtrListIterator<TQLayoutItem> it2(currentLine);
TQLayoutItem *item;
int wx = r.x();
int sizeHintWidth = 0 -spacing(), minSizeWidth=0 - spacing(), lineMinHeight=0;
while( (item = it2.current()) != 0 ) {
- TQSize itemSizeHint = item->sizeHint(); // we cache these ones because it can take
- TQSize itemMinSize = item->minimumSize(); // a while to get them
+ TQSize itemSizeHint = item->tqsizeHint(); // we cache these ones because it can take
+ TQSize itemMinSize = item->tqminimumSize(); // a while to get them
TQSize s;
if(m_justify) {
if(expandingWidgets != 0) {
- if(item->expanding() == TQSizePolicy::Horizontally || item->expanding() == TQSizePolicy::BothDirections)
+ if(item->expandingDirections() == TQSizePolicy::Horizontally || item->expandingDirections() == TQSizePolicy::BothDirections)
s = TQSize( TQMIN(itemSizeHint.width() + availableSpace / expandingWidgets
, r.width()), itemSizeHint.height() );
else
@@ -329,12 +329,12 @@ KexiFlowLayout::doHorizontalLayout(const TQRect &r, bool testOnly)
lineMinHeight = TQMAX( lineMinHeight, itemMinSize.height() );
++it2;
}
- sizeHint = sizeHint.expandedTo( TQSize(sizeHintWidth, y + spacing() + h) );
+ tqsizeHint = tqsizeHint.expandedTo( TQSize(sizeHintWidth, y + spacing() + h) );
minSizeHeight = minSizeHeight + spacing() + lineMinHeight;
minSize = minSize.expandedTo( TQSize(minSizeWidth, minSizeHeight) );
- // store sizeHint() and minimumSize()
- m_cached_sizeHint = sizeHint + TQSize(2* margin(), 2*margin());
+ // store tqsizeHint() and tqminimumSize()
+ m_cached_tqsizeHint = tqsizeHint + TQSize(2* margin(), 2*margin());
m_cached_minSize = minSize + TQSize(2* margin() , 2*margin());
// return our height
return y + h - r.y();
@@ -351,7 +351,7 @@ KexiFlowLayout::doVerticalLayout(const TQRect &r, bool testOnly)
TQPtrListIterator<TQLayoutItem> it(m_list);
TQPtrList<TQLayoutItem> currentLine;
TQLayoutItem *o;
- TQSize minSize, sizeHint(20, 20);
+ TQSize minSize, tqsizeHint(20, 20);
int minSizeWidth = 0 - spacing();
while ( (o = it.current()) != 0 ) {
@@ -360,20 +360,20 @@ KexiFlowLayout::doVerticalLayout(const TQRect &r, bool testOnly)
continue;
}
- TQSize oSizeHint = o->sizeHint(); // we cache these ones because it can take a while to get it (eg for child layouts)
+ TQSize oSizeHint = o->tqsizeHint(); // we cache these ones because it can take a while to get it (eg for child layouts)
if (y + oSizeHint.height() > r.bottom() && w > 0) {
- // do the layout of current line
+ // do the tqlayout of current line
TQPtrListIterator<TQLayoutItem> it2(currentLine);
TQLayoutItem *item;
int wy = r.y();
int sizeHintHeight = 0 - spacing(), minSizeHeight = 0 - spacing(), colMinWidth=0;
while( (item = it2.current()) != 0 ) {
- TQSize itemSizeHint = item->sizeHint(); // we cache these ones because it can take
- TQSize itemMinSize = item->minimumSize(); // a while to get them
+ TQSize itemSizeHint = item->tqsizeHint(); // we cache these ones because it can take
+ TQSize itemMinSize = item->tqminimumSize(); // a while to get them
TQSize s;
if(m_justify) {
if(expandingWidgets != 0) {
- if(item->expanding() == TQSizePolicy::Vertically || item->expanding() == TQSizePolicy::BothDirections)
+ if(item->expandingDirections() == TQSizePolicy::Vertically || item->expandingDirections() == TQSizePolicy::BothDirections)
s = TQSize( itemSizeHint.width(), TQMIN(itemSizeHint.height() + availableSpace / expandingWidgets
, r.height()) );
else
@@ -393,7 +393,7 @@ KexiFlowLayout::doVerticalLayout(const TQRect &r, bool testOnly)
colMinWidth = TQMAX( colMinWidth, itemMinSize.width() );
++it2;
}
- sizeHint = sizeHint.expandedTo( TQSize(0, sizeHintHeight) );
+ tqsizeHint = tqsizeHint.expandedTo( TQSize(0, sizeHintHeight) );
minSize = minSize.expandedTo( TQSize(0, minSizeHeight) );
minSizeWidth = minSizeWidth + spacing() + colMinWidth;
// start a new column
@@ -408,24 +408,24 @@ KexiFlowLayout::doVerticalLayout(const TQRect &r, bool testOnly)
y = y + spacing() + oSizeHint.height();
w = TQMAX( w, oSizeHint.width() );
currentLine.append(o);
- if(o->expanding() == TQSizePolicy::Vertically || o->expanding() == TQSizePolicy::BothDirections)
+ if(o->expandingDirections() == TQSizePolicy::Vertically || o->expandingDirections() == TQSizePolicy::BothDirections)
++expandingWidgets;
availableSpace = TQMAX(0, availableSpace - spacing() - oSizeHint.height());
++it;
}
- // don't forget to layout the last line
+ // don't forget to tqlayout the last line
TQPtrListIterator<TQLayoutItem> it2(currentLine);
TQLayoutItem *item;
int wy = r.y();
int sizeHintHeight = 0 - spacing(), minSizeHeight = 0 - spacing(), colMinWidth=0;
while( (item = it2.current()) != 0 ) {
- TQSize itemSizeHint = item->sizeHint(); // we cache these ones because it can take
- TQSize itemMinSize = item->minimumSize(); // a while to get them
+ TQSize itemSizeHint = item->tqsizeHint(); // we cache these ones because it can take
+ TQSize itemMinSize = item->tqminimumSize(); // a while to get them
TQSize s;
if(m_justify) {
if(expandingWidgets != 0) {
- if(item->expanding() == TQSizePolicy::Vertically || item->expanding() == TQSizePolicy::BothDirections)
+ if(item->expandingDirections() == TQSizePolicy::Vertically || item->expandingDirections() == TQSizePolicy::BothDirections)
s = TQSize( itemSizeHint.width(), TQMIN(itemSizeHint.height() + availableSpace / expandingWidgets
, r.height()) );
else
@@ -445,12 +445,12 @@ KexiFlowLayout::doVerticalLayout(const TQRect &r, bool testOnly)
colMinWidth = TQMAX( colMinWidth, itemMinSize.width() );
++it2;
}
- sizeHint = sizeHint.expandedTo( TQSize( x + spacing() + w, sizeHintHeight) );
+ tqsizeHint = tqsizeHint.expandedTo( TQSize( x + spacing() + w, sizeHintHeight) );
minSizeWidth = minSizeWidth + spacing() + colMinWidth;
minSize = minSize.expandedTo( TQSize(minSizeWidth, minSizeHeight) );
- // store sizeHint() and minimumSize()
- m_cached_sizeHint = sizeHint + TQSize(2* margin(), 2*margin());
+ // store tqsizeHint() and tqminimumSize()
+ m_cached_tqsizeHint = tqsizeHint + TQSize(2* margin(), 2*margin());
m_cached_minSize = minSize + TQSize(2* margin(), 2*margin());
// return our width
return x + w - r.x();
@@ -468,7 +468,7 @@ int KexiFlowLayout::count() const {
\reimp
*/
TQLayoutItem* KexiFlowLayout::itemAt(int index) const {
- return index >= 0 && index < m_list.count() ? (const_cast<TQPtrList<TQLayoutItem>&>(m_list).at(index)) : 0;
+ return index >= 0 && index < m_list.count() ? (const_cast<TQPtrList<TQLayoutItem>&>(m_list).tqat(index)) : 0;
}
/*!
@@ -477,8 +477,8 @@ TQLayoutItem* KexiFlowLayout::itemAt(int index) const {
TQLayoutItem* KexiFlowLayout::takeAt(int index) {
if (index < 0 || index >= m_list.count())
return 0;
- TQLayoutItem *item = m_list.at(index);
- m_list.remove(m_list.at(index));
+ TQLayoutItem *item = m_list.tqat(index);
+ m_list.remove(m_list.tqat(index));
delete item;
invalidate();