ListBoxPtr & TextBoxPtr?


22-06-2011 16:32:31


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 {
StateProfile(StateManager* stateManager);

void load();
void clear();



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.


22-06-2011 19:18:41

We removed that SomethingPtr typedefs and kept them only for backward capability. Use Button*, ListBox*, etc.


22-06-2011 20:15:23

Thank you! You're answering all of my questions around here :-).