예제 #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
파일: Widget.cpp 프로젝트: Cruel/SFGUI
Widget::WidgetsList Widget::GetWidgetsByClass( const std::string& class_name ) {
	WidgetsList result;

	for( const auto& root_widget : root_widgets ) {
		if( root_widget->GetClass() == class_name ) {
			result.push_back( root_widget->shared_from_this() );
		}

		auto container = std::dynamic_pointer_cast<Container>(
			root_widget->shared_from_this()
		);

		if( container ) {
			auto container_result = SearchContainerForClass( container, class_name );

			// Splice the 2 vectors.
			if( !container_result.empty() ) {
				result.reserve( container_result.size() );
				result.insert( result.end(), container_result.begin(), container_result.end() );
			}
		}
	}

	return result;
}
예제 #3
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);
}
예제 #4
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);
  }
}
예제 #5
0
  virtual void onBroadcastMouseMessage(WidgetsList& targets) override
  {
    Window::onBroadcastMouseMessage(targets);

    // Add the editor as receptor of mouse events too.
    targets.push_back(View::getView(m_editor));
  }
예제 #6
0
파일: descr.cpp 프로젝트: Oppen/einstein
void Description::printPage()
{
    TextPage *page = text->getPage(currentPage);
    if (! page)
        return;
    int len = page->getWidgetsCount();
    for (int i = 0; i < len; i++) {
        Widget *w = page->getWidget(i);
        if (w) {
            widgets.push_back(w);
            area.add(w);
        }
    }
}
예제 #7
0
파일: workspace.cpp 프로젝트: 4144/aseprite
void Workspace::updateTabs()
{
  WidgetsList children = this->children();
  while (!children.empty()) {
    Widget* child = children.back();
    children.erase(--children.end());

    if (child->type() == WorkspacePanel::Type())
      static_cast<WorkspacePanel*>(child)->tabs()->updateTabs();

    for (auto subchild : child->children())
      children.push_back(subchild);
  }
}