[SOLVED] Making the CSX Window's Close Button Work

MindCalamity

13-08-2011 05:06:50

Can anyone please give me a snippet, I was looking through the code of the console demo, but I couldn't notice the right lines.

Actually I did find it, but I get an error and a warning with this code:

MyGUI::Window* wMenu = mGUI->findWidget<MyGUI::Window>("wMenu");
wMenu->eventWindowButtonPressed += MyGUI::newDelegate(this, &App::manageUIEvents);


and in the manageUIEvents method I handle the events for separate widgets by name:

if (_sender->getName() == "wMenu")
_sender->setVisible(false);


1>src\App.cpp(765): warning C4996: 'MyGUI::EventPair<EventObsolete,Event>::operator +=': use : signature : Event::IDelegate * _delegate
1> with
1> [
1> EventObsolete=MyGUI::EventHandle_WidgetString,
1> Event=MyGUI::EventHandle_WindowPtrCStringRef
1> ]
1> d:\libraries\mygui\myguiengine\include\MyGUI_EventPair.h(52) : see declaration of 'MyGUI::EventPair<EventObsolete,Event>::operator +='
1> with
1> [
1> EventObsolete=MyGUI::EventHandle_WidgetString,
1> Event=MyGUI::EventHandle_WindowPtrCStringRef
1> ]
1>d:\libraries\mygui\myguiengine\include\MyGUI_EventPair.h(54): error C2679: binary '+=' : no operator found which takes a right-hand operand of type 'MyGUI::delegates::IDelegate1<TP1> *' (or there is no acceptable conversion)
1> with
1> [
1> TP1=MyGUI::Widget *
1> ]
1> d:\libraries\mygui\myguiengine\include\MyGUI_DelegateImplement.h(285): could be 'MyGUI::delegates::CMultiDelegate2<TP1,TP2> &MyGUI::delegates::CMultiDelegate2<TP1,TP2>::operator +=(MyGUI::delegates::IDelegate2<TP1,TP2> *)'
1> with
1> [
1> TP1=MyGUI::Widget *,
1> TP2=const std::string &
1> ]
1> while trying to match the argument list '(MyGUI::EventHandle_WidgetString, MyGUI::delegates::IDelegate1<TP1> *)'
1> with
1> [
1> TP1=MyGUI::Widget *
1> ]
1> src\App.cpp(765) : see reference to function template instantiation 'void MyGUI::EventPair<EventObsolete,Event>::operator +=<MyGUI::delegates::IDelegate1<TP1>>(T *)' being compiled
1> with
1> [
1> EventObsolete=MyGUI::EventHandle_WidgetString,
1> Event=MyGUI::EventHandle_WindowPtrCStringRef,
1> TP1=MyGUI::Widget *,
1> T=MyGUI::delegates::IDelegate1<MyGUI::Widget *>
1> ]

Altren

13-08-2011 16:17:31

Your method have wrong siganature - it should have Window* and std::string as its parameters.
http://www.ogre3d.org/tikiwiki/tiki-ind ... WindowSkin