siondream
22-06-2011 16:32:31
Hello,
I've recently started using MyGUI 3.2 RC1 and I have problems with some wigets. Some of them such as Button, have the ButtonPtr type to recover the widget using the findWidget method but others don't.
If I use simply ListBox or TextBox:
The compiler throws:
If use ListBoxPtr or TextBoxPtr it says the type doesn't exist in the MyGUI namespace.
Any clues? Thanks.
I've recently started using MyGUI 3.2 RC1 and I have problems with some wigets. Some of them such as Button, have the ButtonPtr type to recover the widget using the findWidget method but others don't.
If I use simply ListBox or TextBox:
class StateProfile: public State {
public:
StateProfile(StateManager* stateManager);
~StateProfile();
void load();
void clear();
...
private:
...
MyGUI::Gui* _myGUI;
MyGUI::VectorWidgetPtr _widgetLayout;
MyGUI::ButtonPtr _btnBack;
MyGUI::TextBox _lblErrorCreate;
MyGUI::ListBox _listProfiles;
...
};
void StateProfile::load() {
if (!_loaded) {
// Cargamos el layout
_widgetLayout = MyGUI::LayoutManager::getInstance().loadLayout("profile.layout");
_btnBack = _myGUI->findWidget<MyGUI::Button>("btnBack"); // OK
_btnBack->eventMouseButtonClick += MyGUI::newDelegate(this, &StateProfile::btnBackClicked);
_listProfiles = _myGUI->findWidget<MyGUI::ListBox>("listProfiles"); // ERROR!
_lblErrorCreate = _myGUI->findWidget<MyGUI::TextBox>("lblErrorCreate"); // ERROR!
...
_loaded = true;
}
}
The compiler throws:
src/stateProfile.cpp: In member function ‘virtual void StateProfile::load()’:
src/stateProfile.cpp:52: error: no match for ‘operator=’ in ‘((StateProfile*)this)->StateProfile::_listProfiles = ((StateProfile*)this)->StateProfile::_myGUI->MyGUI::Gui::findWidget [with T = MyGUI::ListBox](((const std::string&)(& std::basic_string<char, std::char_traits<char>, std::allocator<char> >(((const char*)"listProfiles"), ((const std::allocator<char>&)((const std::allocator<char>*)(& std::allocator<char>())))))), 1)’
/usr/local/include/MYGUI/MyGUI_ListBox.h:41: note: candidates are: MyGUI::ListBox& MyGUI::ListBox::operator=(const MyGUI::ListBox&)
If use ListBoxPtr or TextBoxPtr it says the type doesn't exist in the MyGUI namespace.
Any clues? Thanks.