diff options
Diffstat (limited to 'kdat/ktreeview.cpp')
-rw-r--r-- | kdat/ktreeview.cpp | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/kdat/ktreeview.cpp b/kdat/ktreeview.cpp index 516fb92..df68b3d 100644 --- a/kdat/ktreeview.cpp +++ b/kdat/ktreeview.cpp @@ -79,7 +79,7 @@ KTreeViewItem::KTreeViewItem(const TQString& theText, KTreeViewItem::~KTreeViewItem() { if (deleteChildren) { - // remove the tqchildren + // remove the children KTreeViewItem* i = child; while (i) { KTreeViewItem* d = i; @@ -121,7 +121,7 @@ TQRect KTreeViewItem::boundingRect(int indent) const } // returns the child item at the specified index -KTreeViewItem* KTreeViewItem::tqchildAt(int index) const +KTreeViewItem* KTreeViewItem::childAt(int index) const { if (!hasChild()) return 0; @@ -133,7 +133,7 @@ KTreeViewItem* KTreeViewItem::tqchildAt(int index) const return item; } -// returns the number of tqchildren this item has +// returns the number of children this item has uint KTreeViewItem::childCount() const { return numChildren; @@ -193,7 +193,7 @@ const TQString& KTreeViewItem::getText() const return text; } -// indicates whether this item has any tqchildren +// indicates whether this item has any children bool KTreeViewItem::hasChild() const { return child != 0; @@ -260,7 +260,7 @@ void KTreeViewItem::insertChild(int index, KTreeViewItem* newChild) // indicates whether this item is displayed expanded // NOTE: a TRUE response does not necessarily indicate the item -// has any tqchildren +// has any children bool KTreeViewItem::isExpanded() const { return expanded; @@ -333,14 +333,14 @@ void KTreeViewItem::paintExpandButton(TQPainter* p, int indent, int cellHeight) } // paint the highlight -void KTreeViewItem::paintHighlight(TQPainter* p, int indent, const TQColorGroup& tqcolorGroup, +void KTreeViewItem::paintHighlight(TQPainter* p, int indent, const TQColorGroup& colorGroup, bool hasFocus, TQt::GUIStyle style) const { TQColor fc; if (style == TQt::WindowsStyle) fc = TQt::darkBlue; /* hardcoded in TQt */ else - fc = tqcolorGroup.text(); + fc = colorGroup.text(); TQRect textRect = textBoundingRect(indent); int t,l,b,r; textRect.coords(&l, &t, &r, &b); @@ -372,7 +372,7 @@ void KTreeViewItem::paintText(TQPainter* p, int indent, int cellHeight, p->fontMetrics().leading()) / 2); if (highlighted) { paintHighlight(p, indent, cg, owner->hasFocus(), - (TQt::GUIStyle)owner->tqstyle().tqstyleHint(TQStyle::SH_GUIStyle)); // TQt3 doesn't make this easy ;) + (TQt::GUIStyle)owner->tqstyle().styleHint(TQStyle::SH_GUIStyle)); // TQt3 doesn't make this easy ;) p->setPen(cg.base()); p->setBackgroundColor(cg.text()); } @@ -403,7 +403,7 @@ void KTreeViewItem::paintTree(TQPainter* p, int indent, int cellHeight) const p->drawLine(parentLeaderX, cellCenterY, parentLeaderX, cellBottomY); /* - * If this item has tqchildren or siblings in the tree or is a child of + * If this item has children or siblings in the tree or is a child of * an item other than the root item then draw the little line from the * item out to the left. */ @@ -411,7 +411,7 @@ void KTreeViewItem::paintTree(TQPainter* p, int indent, int cellHeight) const parent->parent != 0 || /* * The following handles the case of an item at the end of the - * topmost level which doesn't have tqchildren. + * topmost level which doesn't have children. */ parent->getChild() != this) { @@ -435,7 +435,7 @@ void KTreeViewItem::paintTree(TQPainter* p, int indent, int cellHeight) const // removes the given (direct) child from the branch bool KTreeViewItem::removeChild(KTreeViewItem* theChild) { - // search item in list of tqchildren + // search item in list of children KTreeViewItem* prevItem = 0; KTreeViewItem* toRemove = getChild(); while (toRemove && toRemove != theChild) { @@ -599,7 +599,7 @@ KTreeView::KTreeView(TQWidget *parent, //case WindowsStyle: //case MotifStyle: setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken); - setBackgroundColor(tqcolorGroup().base()); + setBackgroundColor(colorGroup().base()); //break; /*default: setFrameStyle(TQFrame::Panel | TQFrame::Plain); @@ -646,7 +646,7 @@ void KTreeView::appendChildItem(const TQString & theText, const TQPixmap& thePix appendChildItem(item, thePath); } -// appends the given item to the tqchildren of the item at the given index +// appends the given item to the children of the item at the given index void KTreeView::appendChildItem(KTreeViewItem* newItem, int index) { /* find parent item and append new item to parent's sub tree */ @@ -656,7 +656,7 @@ void KTreeView::appendChildItem(KTreeViewItem* newItem, int index) appendChildItem(parentItem, newItem); } -// appends the given item to the tqchildren of the item at the end of the +// appends the given item to the children of the item at the end of the // given path void KTreeView::appendChildItem(KTreeViewItem* newItem, const KPath& thePath) { @@ -744,7 +744,7 @@ void KTreeView::clear() if(goingDown || TQApplication::closingDown()) return; if(autoU && isVisible()) - tqrepaint(); + repaint(); setAutoUpdate(autoU); } @@ -789,7 +789,7 @@ int KTreeView::expandLevel() const // expands or collapses the subtree rooted at the given item, // as approptiate -// if item has no tqchildren, does nothing +// if item has no children, does nothing void KTreeView::expandOrCollapseItem(int index) { KTreeViewItem *item = itemAt(index); @@ -813,7 +813,7 @@ bool KTreeView::forEveryItem(KForEvery func, void* user, KTreeViewItem* item) if ((*func)(item, user)) { return true; } - // visit the tqchildren (recursively) + // visit the children (recursively) if (item->hasChild()) { if (forEveryItem(func, user, item)) return true; @@ -833,7 +833,7 @@ bool KTreeView::forEveryVisibleItem(KForEvery func, void *user, if (item == 0) { item = treeRoot; } else { - // tqchildren are invisible (hence, nothing to do) + // children are invisible (hence, nothing to do) // if item is invisible or collapsed if (!item->isVisible() || !item->isExpanded()) { return false; @@ -847,7 +847,7 @@ bool KTreeView::forEveryVisibleItem(KForEvery func, void *user, if ((*func)(item, user)) { return true; } - // visit the tqchildren (recursively) + // visit the children (recursively) if (item->hasChild() && item->isExpanded()) { if (forEveryVisibleItem(func, user, item)) return true; @@ -1113,7 +1113,7 @@ void KTreeView::setExpandButtonDrawing(bool enable) drawExpandButton = enable; forEveryItem(&KTreeView::setItemExpandButtonDrawing, 0); if(autoUpdate() && isVisible()) - tqrepaint(); + repaint(); } // sets depth to which subtrees are automatically expanded, and @@ -1132,7 +1132,7 @@ void KTreeView::setExpandLevel(int level) } setCurrentItem(itemRow(item)); if(autoUpdate() && isVisible()) - tqrepaint(); + repaint(); } // sets the indent margin for all branches and repaints if auto update enabled @@ -1143,7 +1143,7 @@ void KTreeView::setIndentSpacing(int spacing) itemIndent = spacing; updateCellWidth(); if (autoUpdate() && isVisible()) - tqrepaint(); + repaint(); } // enables/disables vertical scrollbar @@ -1160,7 +1160,7 @@ void KTreeView::setShowItemText(bool enable) showText = enable; forEveryItem(&KTreeView::setItemShowText, 0); if(autoUpdate() && isVisible()) - tqrepaint(); + repaint(); } // indicates whether vertical scrolling is by pixel or row @@ -1177,7 +1177,7 @@ void KTreeView::setTreeDrawing(bool enable) drawTree = enable; forEveryItem(&KTreeView::setItemTreeDrawing, 0); if(autoUpdate() && isVisible()) - tqrepaint(); + repaint(); } // indicates whether item text keys are displayed @@ -1251,18 +1251,18 @@ void KTreeView::appendChildItem(KTreeViewItem* theParent, newItem->setExpanded(true); } - // fix up branch levels of any tqchildren that the new item may already have + // fix up branch levels of any children that the new item may already have if(newItem->hasChild()) { fixChildren(newItem); } - // if necessary, adjust cell width, number of rows and tqrepaint + // if necessary, adjust cell width, number of rows and repaint if (newItem->isVisible() || theParent->childCount() == 1) { bool autoU = autoUpdate(); setAutoUpdate(false); updateVisibleItems(); if(autoU && isVisible()) - tqrepaint(); + repaint(); setAutoUpdate(autoU); } } @@ -1302,7 +1302,7 @@ void KTreeView::collapseSubTree(KTreeViewItem* subRoot) } } // roland - tqrepaint(); + repaint(); setAutoUpdate(TRUE); // roland } @@ -1331,7 +1331,7 @@ void KTreeView::expandOrCollapse(KTreeViewItem* parent) emit expanded(parentIndex); } if (autoU && isVisible()) - tqrepaint(); + repaint(); setAutoUpdate(autoU); } @@ -1361,7 +1361,7 @@ void KTreeView::expandSubTree(KTreeViewItem* subRoot) } } // roland - tqrepaint(); + repaint(); setAutoUpdate(TRUE); // roland @@ -1493,7 +1493,7 @@ bool KTreeView::insertItem(KTreeViewItem* referenceItem, } else { // no reference item, append at end of visible tree - // need to tqrepaint + // need to repaint parentItem = treeRoot; parentItem->appendChild(newItem); } @@ -1502,18 +1502,18 @@ bool KTreeView::insertItem(KTreeViewItem* referenceItem, if (level(newItem) < expansion) newItem->setExpanded(true); - // fix up branch levels of any tqchildren + // fix up branch levels of any children if (newItem->hasChild()) fixChildren(newItem); - // if tqrepaint necessary, do it if visible and auto update + // if repaint necessary, do it if visible and auto update // enabled if (newItem->isVisible() || parentItem->childCount() == 1) { bool autoU = autoUpdate(); setAutoUpdate(FALSE); updateVisibleItems(); if(autoU && isVisible()) - tqrepaint(); + repaint(); setAutoUpdate(autoU); } return true; @@ -1545,7 +1545,7 @@ void KTreeView::join(KTreeViewItem *item) takeItem(item); insertItem(itemParent, item, FALSE); if(autoU && isVisible()) - tqrepaint(); + repaint(); setAutoUpdate(autoU); } } @@ -1649,9 +1649,9 @@ void KTreeView::lowerItem(KTreeViewItem *item) bool autoU = autoUpdate(); setAutoUpdate(FALSE); takeItem(item); - insertItem(itemParent->tqchildAt(itemChildIndex), item, FALSE); + insertItem(itemParent->childAt(itemChildIndex), item, FALSE); if(autoU && isVisible()) - tqrepaint(); + repaint(); setAutoUpdate(autoU); } } @@ -1859,7 +1859,7 @@ void KTreeView::paintCell(TQPainter* p, int row, int) return; p->setClipRect(cellRect(), TQPainter::CoordPainter ); - TQColorGroup cg = tqcolorGroup(); + TQColorGroup cg = colorGroup(); int indent = indentation(item); item->paint(p, indent, cg, current == row); /* highlighted */ @@ -1875,9 +1875,9 @@ void KTreeView::raiseItem(KTreeViewItem *item) bool autoU = autoUpdate(); setAutoUpdate(FALSE); takeItem(item); - insertItem(itemParent->tqchildAt(--itemChildIndex), item, TRUE); + insertItem(itemParent->childAt(--itemChildIndex), item, TRUE); if(autoU && isVisible()) - tqrepaint(); + repaint(); setAutoUpdate(autoU); } } @@ -1897,7 +1897,7 @@ KTreeViewItem* KTreeView::recursiveFind(KPath& path) return 0; /* - * Iterate through the parent's tqchildren searching for searchString. + * Iterate through the parent's children searching for searchString. */ KTreeViewItem* sibling = parent->getChild(); while (sibling != 0) { @@ -1961,9 +1961,9 @@ void KTreeView::split(KTreeViewItem *item) bool autoU = autoUpdate(); setAutoUpdate(FALSE); takeItem(item); - appendChildItem(itemParent->tqchildAt(--itemChildIndex), item); + appendChildItem(itemParent->childAt(--itemChildIndex), item); if(autoU && isVisible()) - tqrepaint(); + repaint(); setAutoUpdate(autoU); } @@ -2003,7 +2003,7 @@ void KTreeView::takeItem(KTreeViewItem* item) updateVisibleItems(); if (autoU && isVisible()) - tqrepaint(); + repaint(); setAutoUpdate(autoU); } @@ -2041,10 +2041,10 @@ void KTreeView::updateVisibleItemRec(KTreeViewItem* item, int& index, int& count } /* - * Record the tqchildren of item in the list of visible items. + * Record the children of item in the list of visible items. * * Don't register item itself, it's already in the list. Also only - * allocate new space for tqchildren. + * allocate new space for children. */ count += item->childCount(); if (count > itemCapacity) { @@ -2066,7 +2066,7 @@ void KTreeView::updateVisibleItemRec(KTreeViewItem* item, int& index, int& count visibleItems = newItems; itemCapacity = newCapacity; } - // insert tqchildren + // insert children for (KTreeViewItem* i = item->getChild(); i != 0; i = i->getSibling()) { visibleItems[index++] = i; updateVisibleItemRec(i, index, count); |