Esempio n. 1
0
	void erase_widget(MyGUI::VectorWidgetPtr& _mass, MyGUI::Widget* _widget)
	{
		for (MyGUI::VectorWidgetPtr::iterator iter = _mass.begin(); iter != _mass.end(); ++iter)
		{
			if (*iter == _widget)
			{
				*iter = _mass.back();
				_mass.pop_back();
				return;
			}
		}
	}
Esempio n. 2
0
void EditorWidgets::remove(MyGUI::WidgetPtr _widget)
{
	// дети вперед
	MyGUI::VectorWidgetPtr childs = _widget->getChilds();
	for (MyGUI::VectorWidgetPtr::iterator iter = childs.begin(); iter != childs.end(); ++iter)
	{
		if (null != find(*iter)) remove(*iter);
	}
	WidgetContainer * _container = find(_widget);

	MyGUI::Gui::getInstance().destroyWidget(_widget);

	if (null != _container)
	{
		widgets.erase(std::find(widgets.begin(), widgets.end(), _container));
		delete _container;
	}
}
Esempio n. 3
0
    WindowPinnableBase::WindowPinnableBase(const std::string& parLayout)
      : WindowBase(parLayout), mPinned(false)
    {
        ExposedWindow* window = mMainWidget->castType<ExposedWindow>();
        mPinButton = window->getSkinWidget ("Button");

        mPinButton->eventMouseButtonPressed += MyGUI::newDelegate(this, &WindowPinnableBase::onPinButtonPressed);

        MyGUI::Button* button = NULL;
        MyGUI::VectorWidgetPtr widgets = window->getSkinWidgetsByName("Action");
        for (MyGUI::VectorWidgetPtr::iterator it = widgets.begin(); it != widgets.end(); ++it)
        {
            if ((*it)->isUserString("HideWindowOnDoubleClick"))
                button = (*it)->castType<MyGUI::Button>();
        }

        if (button)
            button->eventMouseButtonDoubleClick += MyGUI::newDelegate(this, &WindowPinnableBase::onDoubleClick);
    }
Esempio n. 4
0
void EditorWidgets::remove(MyGUI::WidgetPtr _widget)
{
	// дети вперед
	MyGUI::VectorWidgetPtr childs = _widget->getChilds();
	for (MyGUI::VectorWidgetPtr::iterator iter = childs.begin(); iter != childs.end(); ++iter)
	{
		if (null != find(*iter)) remove(*iter);
	}
	WidgetContainer * _container = find(_widget);

	MyGUI::WidgetPtr parent = _widget->getParent();
	// FIXME у таба все не как у людей
	if ((null != parent) && (parent->getWidgetType() == "Tab")) MyGUI::castWidget<MyGUI::Tab>(parent)->removeSheet(MyGUI::castWidget<MyGUI::Sheet>(_widget));
	else MyGUI::Gui::getInstance().destroyWidget(_widget);

	if (null != _container)
	{
		widgets.erase(std::find(widgets.begin(), widgets.end(), _container));
		delete _container;
	}
}