diff options
Diffstat (limited to 'kexi/formeditor/container.cpp')
-rw-r--r-- | kexi/formeditor/container.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/kexi/formeditor/container.cpp b/kexi/formeditor/container.cpp index d1275adc..366f6a6d 100644 --- a/kexi/formeditor/container.cpp +++ b/kexi/formeditor/container.cpp @@ -23,7 +23,7 @@ #include <tqrect.h> #include <tqevent.h> #include <tqvaluevector.h> -#include <tqlayout.h> +#include <layout.h> #include <tqcursor.h> #include <kdebug.h> @@ -73,7 +73,7 @@ EventEater::eventFilter(TQObject *, TQEvent *ev) } } // else if(ev->type() == TQEvent::ChildInserted) { - // widget's tqchildren have changed, we need to reinstall filter + // widget's children have changed, we need to reinstall filter // installRecursiveEventFilter(m_widget, this); // } @@ -180,7 +180,7 @@ Container::eventFilter(TQObject *s, TQEvent *e) unSelectWidget(m_moving); else // the widget is the only selected, so it means we want to copy it { - //m_copyRect = m_moving->tqgeometry(); + //m_copyRect = m_moving->geometry(); m_state = CopyingWidget; if(m_form->formWidget()) m_form->formWidget()->initBuffer(); @@ -333,7 +333,7 @@ Container::eventFilter(TQObject *s, TQEvent *e) return false; } - case TQEvent::Resize: // we are resizing a widget, so we set m_move to true -> the tqlayout will be reloaded when releasing mouse + case TQEvent::Resize: // we are resizing a widget, so we set m_move to true -> the layout will be reloaded when releasing mouse { if(m_form->interactiveMode()) m_state = MovingWidget; @@ -408,7 +408,7 @@ Container::eventFilter(TQObject *s, TQEvent *e) ObjectTreeItem *item = form()->objectTree()->lookup(form()->selectedWidgets()->first()->name()); if(!item || !item->parent()) return true; - ObjectTreeList *list = item->parent()->tqchildren(); + ObjectTreeList *list = item->parent()->children(); if(list->count() == 1) return true; int index = list->findRef(item); @@ -525,7 +525,7 @@ Container::handleMouseReleaseEvent(TQObject *s, TQMouseEvent *mev) //m_initialPos = TQPoint(); } - else if(m_state == MovingWidget) // one widget has been moved, so we need to update the tqlayout + else if(m_state == MovingWidget) // one widget has been moved, so we need to update the layout reloadLayout(); // cancel copying as user released Ctrl before releasing mouse button @@ -639,7 +639,7 @@ Container::setLayout(LayoutType type) return; } } - m_container->setGeometry(m_container->tqgeometry()); // just update tqlayout + m_container->setGeometry(m_container->geometry()); // just update layout m_layout->activate(); } @@ -654,14 +654,14 @@ Container::reloadLayout() void Container::createBoxLayout(WidgetList *list) { - TQBoxLayout *tqlayout = static_cast<TQBoxLayout*>(m_layout); + TQBoxLayout *layout = static_cast<TQBoxLayout*>(m_layout); - for(ObjectTreeItem *tree = m_tree->tqchildren()->first(); tree; tree = m_tree->tqchildren()->next()) + for(ObjectTreeItem *tree = m_tree->children()->first(); tree; tree = m_tree->children()->next()) list->append( tree->widget()); list->sort(); for(TQWidget *obj = list->first(); obj; obj = list->next()) - tqlayout->addWidget(obj); + layout->addWidget(obj); delete list; } @@ -669,7 +669,7 @@ void Container::createFlowLayout() { KexiFlowLayout *flow = dynamic_cast<KexiFlowLayout*>(m_layout); - if(!flow || m_tree->tqchildren()->isEmpty()) + if(!flow || m_tree->children()->isEmpty()) return; const int offset = 15; @@ -684,7 +684,7 @@ Container::createFlowLayout() } // fill the list - for(ObjectTreeItem *tree = m_tree->tqchildren()->first(); tree; tree = m_tree->tqchildren()->next()) + for(ObjectTreeItem *tree = m_tree->children()->first(); tree; tree = m_tree->children()->next()) list->append( tree->widget()); list->sort(); @@ -741,11 +741,11 @@ Container::createGridLayout(bool testOnly) int end=-1000; bool same = false; - for(ObjectTreeItem *tree = m_tree->tqchildren()->first(); tree; tree = m_tree->tqchildren()->next()) + for(ObjectTreeItem *tree = m_tree->children()->first(); tree; tree = m_tree->children()->next()) vlist->append( tree->widget()); vlist->sort(); - for(ObjectTreeItem *tree = m_tree->tqchildren()->first(); tree; tree = m_tree->tqchildren()->next()) + for(ObjectTreeItem *tree = m_tree->children()->first(); tree; tree = m_tree->children()->next()) hlist->append( tree->widget()); hlist->sort(); @@ -759,30 +759,30 @@ Container::createGridLayout(bool testOnly) for(; it2.current() != 0; ++it2) { TQWidget *nextw = it2.current(); - if((w->y() >= nextw->y()) || (nextw->y() >= w->tqgeometry().bottom())) + if((w->y() >= nextw->y()) || (nextw->y() >= w->geometry().bottom())) break; - if(!w->tqgeometry().intersects(nextw->tqgeometry())) + if(!w->geometry().intersects(nextw->geometry())) break; // If the geometries of the two widgets intersect each other, // we move one of the widget to the rght or bottom of the other if((nextw->y() - w->y()) > abs(nextw->x() - w->x())) - nextw->move(nextw->x(), w->tqgeometry().bottom()+1); + nextw->move(nextw->x(), w->geometry().bottom()+1); else if(nextw->x() >= w->x()) - nextw->move(w->tqgeometry().right()+1, nextw->y()); + nextw->move(w->geometry().right()+1, nextw->y()); else - w->move(nextw->tqgeometry().right()+1, nextw->y()); + w->move(nextw->geometry().right()+1, nextw->y()); } } } - // Then we count the number of rows in the tqlayout, and set their beginnings + // Then we count the number of rows in the layout, and set their beginnings for(WidgetListIterator it(*vlist); it.current() != 0; ++it) { TQWidget *w = it.current(); WidgetListIterator it2 = it; if(!same) { // this widget will make a new row - end = w->tqgeometry().bottom(); + end = w->geometry().bottom(); rows.append(w->y()); } @@ -796,9 +796,9 @@ Container::createGridLayout(bool testOnly) if(nextw->y() >= end) same = false; else { - same = !(same && (nextw->y() >= w->tqgeometry().bottom())); + same = !(same && (nextw->y() >= w->geometry().bottom())); if(!same) - end = w->tqgeometry().bottom(); + end = w->geometry().bottom(); } } kdDebug() << "the new grid will have n rows: n == " << rows.size() << endl; @@ -811,7 +811,7 @@ Container::createGridLayout(bool testOnly) TQWidget *w = it.current(); WidgetListIterator it2 = it; if(!same) { - end = w->tqgeometry().right(); + end = w->geometry().right(); cols.append(w->x()); } @@ -823,25 +823,25 @@ Container::createGridLayout(bool testOnly) if(nextw->x() >= end) same = false; else { - same = !(same && (nextw->x() >= w->tqgeometry().right())); + same = !(same && (nextw->x() >= w->geometry().right())); if(!same) - end = w->tqgeometry().right(); + end = w->geometry().right(); } } kdDebug() << "the new grid will have n columns: n == " << cols.size() << endl; - // We create the tqlayout .. - TQGridLayout *tqlayout=0; + // We create the layout .. + TQGridLayout *layout=0; if(!testOnly) { - tqlayout = new TQGridLayout(m_container, rows.size(), cols.size(), m_margin, m_spacing, "grid"); - m_layout = (TQLayout*)tqlayout; + layout = new TQGridLayout(m_container, rows.size(), cols.size(), m_margin, m_spacing, "grid"); + m_layout = (TQLayout*)layout; } // .. and we fill it with widgets for(WidgetListIterator it(*vlist); it.current() != 0; ++it) { TQWidget *w = it.current(); - TQRect r = w->tqgeometry(); + TQRect r = w->geometry(); uint wcol=0, wrow=0, endrow=0, endcol=0; uint i = 0; @@ -901,14 +901,14 @@ Container::createGridLayout(bool testOnly) ObjectTreeItem *item = m_form->objectTree()->lookup(w->name()); if(!endrow && !endcol) { if(!testOnly) - tqlayout->addWidget(w, wrow, wcol); + layout->addWidget(w, wrow, wcol); item->setGridPos(wrow, wcol, 0, 0); } else { if(!endcol) endcol = wcol; if(!endrow) endrow = wrow; if(!testOnly) - tqlayout->addMultiCellWidget(w, wrow, endrow, wcol, endcol); + layout->addMultiCellWidget(w, wrow, endrow, wcol, endcol); item->setGridPos(wrow, wcol, endrow-wrow+1, endcol-wcol+1); } } @@ -971,7 +971,7 @@ Container::drawConnection(TQMouseEvent *mev) { FormManager::self()->createdConnection()->setReceiver(m_moving->name()); FormManager::self()->createSlotMenu(m_moving); - m_container->tqrepaint(); + m_container->repaint(); return; } // the user clicked outside the menu, we cancel the connection @@ -997,12 +997,12 @@ Container::drawSelectionRect(TQMouseEvent *mev) setSelectedWidget(m_container, false); TQWidget *widgetToSelect = 0; // We check which widgets are in the rect and select them - for(ObjectTreeItem *item = m_tree->tqchildren()->first(); item; item = m_tree->tqchildren()->next()) + for(ObjectTreeItem *item = m_tree->children()->first(); item; item = m_tree->children()->next()) { TQWidget *w = item->widget(); if(!w) continue; - if(w->tqgeometry().intersects(r) && w != m_container) { + if(w->geometry().intersects(r) && w != m_container) { if (widgetToSelect) setSelectedWidget(widgetToSelect, true/*add*/, false/*raise*/, true/*moreWillBeSelected*/); widgetToSelect = w; //select later @@ -1013,7 +1013,7 @@ Container::drawSelectionRect(TQMouseEvent *mev) m_insertRect = TQRect(); m_state = DoingNothing; - m_container->tqrepaint(); + m_container->repaint(); } void @@ -1070,7 +1070,7 @@ Container::drawCopiedWidgetRect(TQMouseEvent *mev) //FormManager::self()->undo(); // undo last moving //m_moving->move(m_initialPos); if(m_form->formWidget()) { - m_container->tqrepaint(); + m_container->repaint(); m_form->formWidget()->initBuffer(); } m_state = CopyingWidget; @@ -1081,7 +1081,7 @@ Container::drawCopiedWidgetRect(TQMouseEvent *mev) if(m_form->formWidget()) { TQValueList<TQRect> rectList; for(TQWidget *w = m_form->selectedWidgets()->first(); w; w = m_form->selectedWidgets()->next()) { - TQRect drawRect = w->tqgeometry(); + TQRect drawRect = w->geometry(); TQPoint p = mev->pos() - m_grab; drawRect.moveBy(p.x(), p.y()); p = m_container->mapTo(m_form->widget(), TQPoint(0, 0)); |