diff options
Diffstat (limited to 'kregexpeditor/multicontainerwidget.cpp')
-rw-r--r-- | kregexpeditor/multicontainerwidget.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/kregexpeditor/multicontainerwidget.cpp b/kregexpeditor/multicontainerwidget.cpp index d8bef97..bd578d2 100644 --- a/kregexpeditor/multicontainerwidget.cpp +++ b/kregexpeditor/multicontainerwidget.cpp @@ -27,8 +27,8 @@ MultiContainerWidget::MultiContainerWidget( RegExpEditorWindow* editorWindow, void MultiContainerWidget::append( RegExpWidget* child ) { child->reparent( this, TQPoint(0,0), false ); - _tqchildren.append( child ); - _tqchildren.append( new DragAccepter( _editorWindow, this ) ); + _children.append( child ); + _children.append( new DragAccepter( _editorWindow, this ) ); } bool MultiContainerWidget::hasSelection() const @@ -36,7 +36,7 @@ bool MultiContainerWidget::hasSelection() const if ( _isSelected ) return true; - TQPtrListIterator<RegExpWidget> it(_tqchildren); + TQPtrListIterator<RegExpWidget> it(_children); ++it; // Move past the first dragAccepter for ( ; *it; it += 2 ) { if ( (*it)->hasSelection() ) { @@ -49,8 +49,8 @@ bool MultiContainerWidget::hasSelection() const void MultiContainerWidget::clearSelection() { _isSelected = false; - for ( unsigned int i = 0; i< _tqchildren.count(); i++ ) { - _tqchildren.at(i)->clearSelection(); + for ( unsigned int i = 0; i< _children.count(); i++ ) { + _children.at(i)->clearSelection(); } } @@ -58,15 +58,15 @@ void MultiContainerWidget::clearSelection() void MultiContainerWidget::deleteSelection() { // run from the back to the front (which we do since we delete items on the run) - // When deleting tqchildren, delete the drag accepter to its right. - for ( int i = (int) _tqchildren.count()-2; i > 0; i -=2 ) { + // When deleting children, delete the drag accepter to its right. + for ( int i = (int) _children.count()-2; i > 0; i -=2 ) { - RegExpWidget* child = _tqchildren.at( i ); + RegExpWidget* child = _children.at( i ); if ( child->isSelected() ) { - delete _tqchildren.at( i+1 ); - _tqchildren.remove( i+1 ); + delete _children.at( i+1 ); + _children.remove( i+1 ); delete child; - _tqchildren.remove(i); + _children.remove(i); } else if ( child->hasSelection() ) { child->deleteSelection(); @@ -78,16 +78,16 @@ void MultiContainerWidget::deleteSelection() void MultiContainerWidget::addNewChild(DragAccepter *accepter, RegExpWidget *child) { - for ( unsigned int i=0; i<_tqchildren.count(); i+= 2 ) { - RegExpWidget *ch = _tqchildren.at( i ); + for ( unsigned int i=0; i<_children.count(); i+= 2 ) { + RegExpWidget *ch = _children.at( i ); if ( ch == accepter ) { // Insert the new child - _tqchildren.insert( i+1, child ); + _children.insert( i+1, child ); // Insert an accepter as the next element. DragAccepter *accepter = new DragAccepter( _editorWindow, this ); - _tqchildren.insert( i+2, accepter ); + _children.insert( i+2, accepter ); // These two show's must come here otherwise a paintevent // will be invoked, where the invariant, that a accepter is located at @@ -107,11 +107,11 @@ bool MultiContainerWidget::updateSelection(bool parentSelected) { bool changed = false; bool isSel = _isSelected; - TQMemArray<bool> oldState(_tqchildren.count()); - TQMemArray<bool> newState(_tqchildren.count()); + TQMemArray<bool> oldState(_children.count()); + TQMemArray<bool> newState(_children.count()); - for (int i = 0; i< (int)_tqchildren.count();i++) { - oldState[i] = _tqchildren.at(i)->isSelected(); + for (int i = 0; i< (int)_children.count();i++) { + oldState[i] = _children.at(i)->isSelected(); } RegExpWidget::updateSelection( parentSelected ); @@ -120,8 +120,8 @@ bool MultiContainerWidget::updateSelection(bool parentSelected) int last; // scan for the first selected item. - for (first = 1; first < (int) _tqchildren.count(); first+= 2 ) { - RegExpWidget* child = _tqchildren.at(first); + for (first = 1; first < (int) _children.count(); first+= 2 ) { + RegExpWidget* child = _children.at(first); changed = child->updateSelection( _isSelected ) || changed; newState[first] = child->isSelected(); if ( child->isSelected() ) @@ -129,8 +129,8 @@ bool MultiContainerWidget::updateSelection(bool parentSelected) } // scan for the last selected item - for (last = _tqchildren.count()-2; last>first; last -= 2) { - RegExpWidget* child = _tqchildren.at(last); + for (last = _children.count()-2; last>first; last -= 2) { + RegExpWidget* child = _children.at(last); changed = child->updateSelection( _isSelected ) || changed; newState[last] = child->isSelected(); if ( child->isSelected() ) @@ -139,17 +139,17 @@ bool MultiContainerWidget::updateSelection(bool parentSelected) // everything between first and last must be selected. for (int j = first+2; j<last; j+=2) { - RegExpWidget* child = _tqchildren.at(j); + RegExpWidget* child = _children.at(j); changed = child->updateSelection( true ) || changed; newState[j] = true; } // update drag accepters. - for (int k = 0; k< (int) _tqchildren.count(); k+=2) { - RegExpWidget* child = _tqchildren.at(k); + for (int k = 0; k< (int) _children.count(); k+=2) { + RegExpWidget* child = _children.at(k); bool select; - if ( k == 0 || k == (int)_tqchildren.count()-1) { + if ( k == 0 || k == (int)_children.count()-1) { // The elements at the border is only selected if the parent is selected. select = _isSelected; } @@ -164,12 +164,12 @@ bool MultiContainerWidget::updateSelection(bool parentSelected) if (accepter) accepter->_isSelected = select; if ( select != isChildSel ) - child->tqrepaint(); + child->repaint(); } changed = changed || isSel != _isSelected; if ( changed ) { - tqrepaint(); + repaint(); } return changed; @@ -183,7 +183,7 @@ TQRect MultiContainerWidget::selectionRect() const return TQRect( mapToGlobal( TQPoint(0,0) ), size() ); else { TQRect res; - TQPtrListIterator<RegExpWidget> it(_tqchildren); + TQPtrListIterator<RegExpWidget> it(_children); ++it; // Move past the first dragAccepter for ( ; *it; it +=2 ) { if ( (*it)->hasSelection() ) { @@ -216,8 +216,8 @@ RegExpWidget* MultiContainerWidget::widgetUnderPoint( TQPoint globalPos, bool ju incr = 1; } - for ( unsigned int i = start; i < _tqchildren.count(); i+=incr ) { - RegExpWidget* wid = _tqchildren.at(i)->widgetUnderPoint( globalPos, justVisibleWidgets ); + for ( unsigned int i = start; i < _children.count(); i+=incr ) { + RegExpWidget* wid = _children.at(i)->widgetUnderPoint( globalPos, justVisibleWidgets ); if ( wid ) return wid; } @@ -230,8 +230,8 @@ RegExpWidget* MultiContainerWidget::widgetUnderPoint( TQPoint globalPos, bool ju RegExpWidget* MultiContainerWidget::findWidgetToEdit( TQPoint globalPos ) { - for ( unsigned int i = 1; i < _tqchildren.count(); i+=2 ) { - RegExpWidget* wid = _tqchildren.at(i)->findWidgetToEdit( globalPos ); + for ( unsigned int i = 1; i < _children.count(); i+=2 ) { + RegExpWidget* wid = _children.at(i)->findWidgetToEdit( globalPos ); if ( wid ) return wid; } @@ -241,7 +241,7 @@ RegExpWidget* MultiContainerWidget::findWidgetToEdit( TQPoint globalPos ) void MultiContainerWidget::selectWidget( bool sel ) { RegExpWidget::selectWidget( sel ); - TQPtrListIterator<RegExpWidget> it(_tqchildren); + TQPtrListIterator<RegExpWidget> it(_children); for ( ; *it ; ++it ) { (*it)->selectWidget( sel ); } @@ -250,7 +250,7 @@ void MultiContainerWidget::selectWidget( bool sel ) void MultiContainerWidget::updateAll() { - for ( TQPtrListIterator<RegExpWidget> it(_tqchildren); *it ; ++it ) { + for ( TQPtrListIterator<RegExpWidget> it(_children); *it ; ++it ) { (*it)->updateAll(); } RegExpWidget::updateAll(); @@ -258,8 +258,8 @@ void MultiContainerWidget::updateAll() void MultiContainerWidget::updateCursorRecursively() { - for ( TQPtrListIterator<RegExpWidget> it(_tqchildren); *it ; ++it ) { + for ( TQPtrListIterator<RegExpWidget> it(_children); *it ; ++it ) { (*it)->updateCursorRecursively(); } - updatetqCursorShape(); + updateCursorShape(); } |