예제 #1
0
파일: descr.cpp 프로젝트: Oppen/einstein
void Description::deleteWidgets()
{
    for (WidgetsList::iterator i = widgets.begin(); 
            i != widgets.end(); i++)
        area.remove(*i);
    widgets.clear();
}
예제 #2
0
파일: listbox.cpp 프로젝트: 93i/aseprite
void ListBox::sortItems()
{
  WidgetsList widgets = getChildren();
  std::sort(widgets.begin(), widgets.end(), &sort_by_text);

  // Remove all children and add then again.
  removeAllChildren();
  for (Widget* child : widgets)
    addChild(child);
}
예제 #3
0
void Widget::getParents(bool ascendant, WidgetsList& parents)
{
  for (Widget* widget=this; widget; widget=widget->m_parent) {
    // append parents in tail
    if (ascendant)
      parents.push_back(widget);
    // append parents in head
    else
      parents.insert(parents.begin(), widget);
  }
}