本文整理汇总了C++中WidgetContainer类的典型用法代码示例。如果您正苦于以下问题:C++ WidgetContainer类的具体用法?C++ WidgetContainer怎么用?C++ WidgetContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WidgetContainer类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: notifyActionSkin
void PanelMainProperties::notifyActionSkin(const std::string& _type, const std::string& _value, bool _final)
{
if (_final)
{
WidgetContainer* widgetContainer = EditorWidgets::getInstance().find(mCurrentWidget);
widgetContainer->setSkin(_value);
if (isSkinExist(widgetContainer->getSkin()) || widgetContainer->getSkin().empty())
{
WidgetSelectorManager::getInstance().saveSelectedWidget();
MyGUI::xml::Document* savedDoc = EditorWidgets::getInstance().savexmlDocument();
EditorWidgets::getInstance().clear();
EditorWidgets::getInstance().loadxmlDocument(savedDoc);
delete savedDoc;
WidgetSelectorManager::getInstance().restoreSelectedWidget();
}
else
{
std::string mess = MyGUI::utility::toString("Skin '", widgetContainer->getSkin(), "' not found. This value will be saved.");
GroupMessage::getInstance().addMessage(mess, MyGUI::LogLevel::Error);
}
UndoManager::getInstance().addValue(PR_PROPERTIES);
}
}
开发者ID:Anomalous-Software,项目名称:mygui,代码行数:27,代码来源:PanelMainProperties.cpp
示例2: ASSERT_NULL
void WidgetContainer::OnInputPointerMove(const EventInputPointer *ev)
{
ASSERT_NULL(ev);
WidgetIterator it = vWidget.begin();
WidgetIterator end = vWidget.end();
for (; it != end; ++it)
{
IWidget *w = (*it);
ASSERT_NULL(w);
bEventConsumed = FALSE;
if (w->IsDisabled())
continue;
if (w->GetObjectType() == Seed::ObjectGuiWidgetContainer)
{
WidgetContainer *wc = reinterpret_cast<WidgetContainer *>(w);
wc->OnInputPointerMove(ev);
bEventConsumed = wc->IsEventConsumed();
if (bEventConsumed)
break;
}
bEventConsumed = this->UpdateStates(ev, w);
//if (UpdateStates(ev, w))
if (bEventConsumed)
break;
}
}
开发者ID:doorxp,项目名称:seed,代码行数:33,代码来源:WidgetContainer.cpp
示例3: onAction
void PropertyFieldPosition::onAction(const std::string& _value, bool _force)
{
EditorWidgets* ew = &EditorWidgets::getInstance();
WidgetContainer* widgetContainer = ew->find(mCurrentWidget);
bool goodData = onCheckValue();
if (goodData)
{
if (widgetContainer->getRelativeMode())
{
std::istringstream str(_value);
MyGUI::FloatCoord float_coord;
str >> float_coord;
float_coord.left = float_coord.left / 100;
float_coord.top = float_coord.top / 100;
float_coord.width = float_coord.width / 100;
float_coord.height = float_coord.height / 100;
MyGUI::IntCoord coord = MyGUI::CoordConverter::convertFromRelative(float_coord, mCurrentWidget->getParentSize());
mCurrentWidget->setCoord(coord);
EditorWidgets::getInstance().onSetWidgetCoord(mCurrentWidget, mCurrentWidget->getAbsoluteCoord(), "PropertiesPanelView");
}
else
{
开发者ID:retrydev,项目名称:MMO-Framework,代码行数:25,代码来源:PropertyFieldPosition.cpp
示例4: getCoordNewWidget
void WidgetCreatorManager::finishNewWidget(const MyGUI::IntPoint& _point)
{
if (mNewWidget != nullptr)
{
MyGUI::IntCoord coord = getCoordNewWidget(_point);
if (coord.width != 0 && coord.height != 0)
{
mNewWidget->setCoord(coord);
// создали виджет, все счастливы
WidgetContainer * widgetContainer = new WidgetContainer(mWidgetType, mWidgetSkin, mNewWidget);
if (mPopupMode)
widgetContainer->setStyle(mNewWidget->getWidgetStyle().print());
mNewWidget = nullptr;
EditorWidgets::getInstance().add(widgetContainer);
UndoManager::getInstance().addValue();
// чтобы выделился созданый виджет
resetAllCreatorInfo();
WidgetSelectorManager::getInstance().setSelectedWidget(widgetContainer->getWidget());
}
else
{
// не удалось создать, т.к. размер нулевой
resetWidget();
}
}
resetAllCreatorInfo();
eventChangeSelector(false, MyGUI::IntCoord());
}
开发者ID:fake-human,项目名称:HiveGame,代码行数:35,代码来源:WidgetCreatorManager.cpp
示例5: saveSelectedWidget
void WidgetSelectorManager::saveSelectedWidget()
{
if (mCurrentWidget != nullptr)
{
WidgetContainer* container = EditorWidgets::getInstance().find(mCurrentWidget);
if (container != nullptr)
container->setUserData(mStoreWidgetTag, mStoreWidgetTag);
}
}
开发者ID:Anomalous-Software,项目名称:mygui,代码行数:9,代码来源:WidgetSelectorManager.cpp
示例6: notifyActionName
void PanelMainProperties::notifyActionName(const std::string& _type, const std::string& _value, bool _final)
{
if (_final)
{
WidgetContainer* widgetContainer = EditorWidgets::getInstance().find(mCurrentWidget);
widgetContainer->setName(_value);
UndoManager::getInstance().addValue(PR_PROPERTIES);
}
}
开发者ID:Anomalous-Software,项目名称:mygui,代码行数:10,代码来源:PanelMainProperties.cpp
示例7: notifyAction
void PanelTemplateProperties::notifyAction(const std::string& _name, const std::string& _value, bool _final)
{
if (_final)
{
WidgetContainer* widgetContainer = EditorWidgets::getInstance().find(mCurrentWidget);
widgetContainer->setUserData(_name, _value);
UndoManager::getInstance().addValue(PR_PROPERTIES);
}
}
开发者ID:ak4hige,项目名称:myway3d,代码行数:10,代码来源:PanelTemplateProperties.cpp
示例8: notifyToggleRelativeMode
void PanelMainProperties::notifyToggleRelativeMode(MyGUI::WidgetPtr _sender)
{
if (current_widget) {
WidgetContainer * widgetContainer = EditorWidgets::getInstance().find(current_widget);
if (widgetContainer->relative_mode) mButtonRelativePosition->setCaption(localise("to_percents"));
else mButtonRelativePosition->setCaption(localise("to_pixels"));
widgetContainer->relative_mode = !widgetContainer->relative_mode;
eventSetPositionText(widgetContainer->position());
}
}
开发者ID:venkatarajasekhar,项目名称:viper,代码行数:10,代码来源:PanelMainProperties.cpp
示例9: notifyDeleteUserData
void PanelUserData::notifyDeleteUserData(MyGUI::Widget* _sender)
{
size_t item = mMultilist->getIndexSelected();
if (MyGUI::ITEM_NONE == item) return;
WidgetContainer* widgetContainer = EditorWidgets::getInstance().find(mCurrentWidget);
widgetContainer->clearUserData(mMultilist->getItemNameAt(item));
mMultilist->removeItemAt(item);
UndoManager::getInstance().addValue();
}
开发者ID:retrydev,项目名称:MMO-Framework,代码行数:10,代码来源:PanelUserData.cpp
示例10: notifyAddUserData
void PanelUserData::notifyAddUserData(MyGUI::Widget* _sender)
{
std::string key = mEditKey->getOnlyText();
std::string value = mEditValue->getOnlyText();
WidgetContainer* widgetContainer = EditorWidgets::getInstance().find(mCurrentWidget);
if (!widgetContainer->existUserData(key))
{
mMultilist->addItem(key);
}
mMultilist->setSubItemNameAt(1, mMultilist->findSubItemWith(0, key), MyGUI::TextIterator::toTagsString(value));
widgetContainer->setUserData(key, value);
UndoManager::getInstance().addValue();
}
开发者ID:retrydev,项目名称:MMO-Framework,代码行数:13,代码来源:PanelUserData.cpp
示例11: hidePropertyFields
void PanelMainProperties::update(MyGUI::Widget* _currentWidget)
{
hidePropertyFields();
mCurrentWidget = _currentWidget;
if (mCurrentWidget == nullptr)
return;
WidgetStyle* widgetType = WidgetTypes::getInstance().findWidgetStyle(mCurrentWidget->getTypeName());
WidgetContainer* widgetContainer = EditorWidgets::getInstance().find(mCurrentWidget);
bool existTargetType = widgetContainer->existUserData(mUserDataTargetType);
IPropertyField* field = getPropertyField(mWidgetClient, "Name", "Name");
field->setTarget(_currentWidget);
field->setValue(widgetContainer->getName());
if (widgetType->resizeable)
{
field = getPropertyField(mWidgetClient, "Position", "Position");
field->setTarget(_currentWidget);
field->setValue(widgetContainer->position());
}
field = getPropertyField(mWidgetClient, "Type", "Type");
field->setTarget(_currentWidget);
if (existTargetType)
{
std::string targetType = widgetContainer->getUserData(mUserDataTargetType);
field->setValue(targetType);
}
else
{
field->setValue(widgetContainer->getType());
}
field = getPropertyField(mWidgetClient, "Align", "Align");
field->setTarget(_currentWidget);
field->setValue(widgetContainer->getAlign());
if (mCurrentWidget->isRootWidget())
{
field = getPropertyField(mWidgetClient, "Layer", "Layer");
field->setTarget(_currentWidget);
field->setValue(widgetContainer->getLayerName());
field = getPropertyField(mWidgetClient, "Template", "Bool");
field->setTarget(_currentWidget);
field->setValue(existTargetType ? "true" : "false");
}
field = getPropertyField(mWidgetClient, "Skin", "Skin");
field->setTarget(_currentWidget);
field->setValue(widgetContainer->getSkin());
updateSize();
}
开发者ID:Anomalous-Software,项目名称:mygui,代码行数:56,代码来源:PanelMainProperties.cpp
示例12: getDescriptionString
std::string MainMenuControlLE::getDescriptionString(MyGUI::Widget* _widget, bool _print_name, bool _print_type, bool _print_skin)
{
WidgetContainer* widgetContainer = EditorWidgets::getInstance().find(_widget);
addUserTag("WidgetName", _print_name ? widgetContainer->getName() : "");
addUserTag("WidgetType", _print_type ? _widget->getTypeName() : "");
addUserTag("WidgetSkin", _print_skin ? widgetContainer->getSkin() : "");
addUserTag("FormatWidgetName", (_print_name && !widgetContainer->getName().empty()) ? "#{PatternWidgetName}" : "");
addUserTag("FormatWidgetType", _print_type ? "#{PatternWidgetType}" : "");
addUserTag("FormatWidgetSkin", _print_skin ? "#{PatternWidgetSkin}" : "");
return replaceTags("MenuItemWidgetInfo");
}
开发者ID:Anomalous-Software,项目名称:mygui,代码行数:14,代码来源:MainMenuControl.cpp
示例13: notifyAction
void PanelProperties::notifyAction(const std::string& _name, const std::string& _value, bool _final)
{
WidgetContainer* widgetContainer = EditorWidgets::getInstance().find(mCurrentWidget);
EditorWidgets::getInstance().tryToApplyProperty(widgetContainer->getWidget(), _name, _value);
if (_final)
{
if (_value.empty())
widgetContainer->clearProperty(_name);
else
widgetContainer->setProperty(_name, _value);
UndoManager::getInstance().addValue(PR_PROPERTIES);
}
}
开发者ID:fake-human,项目名称:HiveGame,代码行数:16,代码来源:PanelProperties.cpp
示例14: update
void PanelMainProperties::update(MyGUI::Widget* _currentWidget)
{
int y = 0;
mCurrentWidget = _currentWidget;
WidgetStyle* widgetType = WidgetTypes::getInstance().findWidgetStyle(mCurrentWidget->getTypeName());
WidgetContainer* widgetContainer = EditorWidgets::getInstance().find(mCurrentWidget);
eventCreatePair(mWidgetClient, "Name", widgetContainer->name, "Name", y);
y += mPropertyItemHeight;
if (widgetType->resizeable)
{
// update caption of LayoutEditor_buttonRelativePosition
mButtonRelativePosition->setVisible(true);
if (widgetContainer->relative_mode) mButtonRelativePosition->setCaption(replaceTags("to_pixels"));
else mButtonRelativePosition->setCaption(replaceTags("to_percents"));
eventCreatePair(mWidgetClient, "Position", widgetContainer->position(), "Position", y);
y += mPropertyItemHeight;
}
else
{
mButtonRelativePosition->setVisible(false);
}
eventCreatePair(mWidgetClient, "Align", widgetContainer->align, "Align", y);
y += mPropertyItemHeight;
if (nullptr == mCurrentWidget->getParent())
{
eventCreatePair(mWidgetClient, "Layer", widgetContainer->layer, "Layer", y);
y += mPropertyItemHeight;
}
if (widgetType->skin.size() > 1)
{
eventCreatePair(mWidgetClient, "Skin", widgetContainer->skin, "Skin", y);
y += mPropertyItemHeight;
}
mWidgetClient->_forcePeek(mButtonRelativePosition);
mPanelCell->setClientHeight(y);
}
开发者ID:siangzhang,项目名称:starworld,代码行数:44,代码来源:PanelMainProperties.cpp
示例15: notifyRectangleResize
void PropertiesPanelView::notifyRectangleResize(MyGUI::WindowPtr _sender)
{
if (!_sender->isVisible()) return;
// найдем соответствующий контейнер виджета и переместим/раст¤нем
WidgetContainer * widgetContainer = EditorWidgets::getInstance().find(current_widget);
if (WidgetTypes::getInstance().find(current_widget->getTypeName())->resizeable)
{
MyGUI::IntCoord coord = convertCoordToParentCoord(_sender->getCoord(), current_widget);
MyGUI::IntCoord old_coord = current_widget->getCoord();
// align to grid
if (!MyGUI::InputManager::getInstance().isShiftPressed() && !arrow_move){
if ((old_coord.width == coord.width) && (old_coord.height == coord.height)) // если только перемещаем
{
coord.left = toGrid(coord.left + grid_step-1 - old_coord.left) + old_coord.left;
coord.top = toGrid(coord.top + grid_step-1 - old_coord.top) + old_coord.top;
}
else // если раст¤гиваем
{
if (old_coord.left != coord.left){
coord.left = toGrid(coord.left + grid_step-1);
coord.width = old_coord.right() - coord.left;
}else if (old_coord.width != coord.width){
coord.width = toGrid(coord.width + old_coord.left) - old_coord.left;
}
if (old_coord.top != coord.top){
coord.top = toGrid(coord.top + grid_step-1);
coord.height = old_coord.bottom() - coord.top;
}else if (old_coord.height != coord.height){
coord.height = toGrid(coord.height + old_coord.top) - old_coord.top;
}
}
}
arrow_move = false;
current_widget->setCoord(coord);
// update coord because of current_widget can have MinMax size
coord = current_widget->getCoord();
setPositionText(widgetContainer->position());
UndoManager::getInstance().addValue(PR_POSITION);
}
current_widget_rectangle->setCoord(current_widget->getAbsoluteCoord());
}
开发者ID:venkatarajasekhar,项目名称:viper,代码行数:44,代码来源:PropertiesPanelView.cpp
示例16: update
void PanelUserData::update(MyGUI::Widget* _currentWidget)
{
mCurrentWidget = _currentWidget;
if (mCurrentWidget == nullptr)
return;
mMultilist->removeAllItems();
WidgetContainer* widgetContainer = EditorWidgets::getInstance().find(_currentWidget);
WidgetContainer::UserDataEnumerator userData = widgetContainer->getUserDataEnumerator();
while (userData.next())
{
if (checkUserData(widgetContainer, userData.current().first))
{
mMultilist->addItem(userData.current().first);
mMultilist->setSubItemNameAt(1, mMultilist->getItemCount() - 1, MyGUI::TextIterator::toTagsString(userData.current().second));
}
}
}
开发者ID:retrydev,项目名称:MMO-Framework,代码行数:19,代码来源:PanelUserData.cpp
示例17: notifyActionTemplate
void PanelMainProperties::notifyActionTemplate(const std::string& _type, const std::string& _value, bool _final)
{
if (_final)
{
WidgetContainer* widgetContainer = EditorWidgets::getInstance().find(mCurrentWidget);
if (_value == "true")
{
if (!widgetContainer->existUserData(mUserDataTargetType))
{
widgetContainer->setUserData(mUserDataTargetType, widgetContainer->getType());
widgetContainer->setType(MyGUI::Widget::getClassTypeName());
WidgetSelectorManager::getInstance().saveSelectedWidget();
MyGUI::xml::Document* savedDoc = EditorWidgets::getInstance().savexmlDocument();
EditorWidgets::getInstance().clear();
EditorWidgets::getInstance().loadxmlDocument(savedDoc);
delete savedDoc;
WidgetSelectorManager::getInstance().restoreSelectedWidget();
UndoManager::getInstance().addValue(PR_PROPERTIES);
}
}
else
{
if (widgetContainer->existUserData(mUserDataTargetType))
{
std::string targetType = widgetContainer->getUserData(mUserDataTargetType);
widgetContainer->clearUserData(mUserDataTargetType);
widgetContainer->setType(targetType);
WidgetSelectorManager::getInstance().saveSelectedWidget();
MyGUI::xml::Document* savedDoc = EditorWidgets::getInstance().savexmlDocument();
EditorWidgets::getInstance().clear();
EditorWidgets::getInstance().loadxmlDocument(savedDoc);
delete savedDoc;
WidgetSelectorManager::getInstance().restoreSelectedWidget();
UndoManager::getInstance().addValue(PR_PROPERTIES);
}
}
}
}
开发者ID:Anomalous-Software,项目名称:mygui,代码行数:46,代码来源:PanelMainProperties.cpp
示例18: ASSERT_NULL
void WidgetContainer::OnInputPointerPress(const EventInputPointer *ev)
{
ASSERT_NULL(ev);
WidgetIterator it = vWidget.begin();
WidgetIterator end = vWidget.end();
for (; it != end; ++it)
{
IWidget *w = (*it);
ASSERT_NULL(w);
bEventConsumed = FALSE;
if (w->IsDisabled())
continue;
f32 cX = ev->GetX();
f32 cY = ev->GetY();
if (!w->ContainsPoint(cX, cY))
continue;
if (w->GetObjectType() == Seed::ObjectGuiWidgetContainer)
{
WidgetContainer *wc = reinterpret_cast<WidgetContainer *>(w);
wc->OnInputPointerPress(ev);
bEventConsumed = wc->IsEventConsumed();
if (bEventConsumed)
break;
}
if (!(w->GetTrigger() & ev->GetPressed()))
continue;
u32 j = ev->GetJoystick();
//LOG("> PRESS [%d, %f, %f]", j, cX, cY);
if (w->GetState() == Seed::WidgetStateDrag)
{
continue;
}
const EventWidget newEvent(w, NULL, WidgetEventPressed, j, cX, cY, ev->GetPressed(), ev->GetHold(), ev->GetReleased());
LOG(">PRESSED_OVER [id: %d]", w->GetId());
// GetState eh o baseado em prioridade a partir de todos os inputs.
if (w->GetState() != Seed::WidgetStatePressedOver && w->GetPlayerState(j) != Seed::WidgetStatePressedOver)
{
// muda apenas o estado interno do widget
LOG("\tEstado WIDGET");
w->OnWidgetPress(&newEvent);
}
w->SetState(Seed::WidgetStatePressed);
w->SetPlayerState(Seed::WidgetStatePressedOver, j);
LOG("\tEstado PLAYER");
w->SendOnPress(&newEvent);
LOG("\tEvento");
//if (newEvent.IsConsumed())
bEventConsumed = newEvent.IsConsumed();
if (bEventConsumed)
break;
}
}
开发者ID:Patuti,项目名称:seed,代码行数:68,代码来源:WidgetContainer.cpp
注:本文中的WidgetContainer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论