garvek
22-12-2008 10:30:32
Hello,
I updated MyGUI and a function (getChilds) is no more available. Instead there is a getEnumerator, but the class doesn't offer functions to detect if the widget has childs or not. As a result when I try to access it the program fault with assertion failure (first == last).
Is there any function I didn't see ? Thanks in advance.
My old code:
new code:
I updated MyGUI and a function (getChilds) is no more available. Instead there is a getEnumerator, but the class doesn't offer functions to detect if the widget has childs or not. As a result when I try to access it the program fault with assertion failure (first == last).
Is there any function I didn't see ? Thanks in advance.
My old code:
void UiScriptEngine::bindDelcaredEventsForWidgets(MyGUI::VectorWidgetPtr& widgets) {
MyGUI::VectorWidgetPtr::iterator iter = widgets.begin();
for(; iter != widgets.end(); iter++) {
BindingMap::iterator bindingIter = m_bindingMap.begin();
for(; bindingIter != m_bindingMap.end(); bindingIter++) {
bindDeclaredEvent((*iter), (*bindingIter).first);
}
bindDelcaredEventsForWidgets((*iter)->getChilds());
}
}
new code:
void UiScriptEngine::bindDelcaredEventsForWidgets(MyGUI::EnumeratorWidgetPtr& widgets) {
MyGUI::WidgetPtr iter;
bool hasNext = true;
for(; hasNext, iter = widgets.current(); hasNext = widgets.next()) {
BindingMap::iterator bindingIter = m_bindingMap.begin();
for(; bindingIter != m_bindingMap.end(); bindingIter++) {
bindDeclaredEvent(iter, (*bindingIter).first);
}
bindDelcaredEventsForWidgets(iter->getEnumerator());
}
}