MyGui::Edit delegate don't work

D3Vil

19-10-2011 12:16:52

Hi folks!
I've already read your tutorial, but I've got a problem with the edit delegation widget.

I'd like to capture a keyboard-press event, but when I delegate the function with MyGUI::newDelegate(....) my events are not catched.
all other events like eventKeyButtonRealesed or eventMouseButtonPressed doesn't work
if instead I use another widget: MyGUI::Button this work and when i click on the button it generates the output on screen correctly.


MyGUI::Gui::getInstance().findWidget<MyGUI::Edit>("textT")->eventKeyButtonPressed= MyGUI::newDelegate(this,&tGUI::prova);

void tGUI::prova(MyGUI::Widget* _sender,MyGUI::KeyCode _key , MyGUI::Char _char)
{
std::cout<<"hello world"<<std::endl;
}

Altren

19-10-2011 14:05:15

Use eventEditTextChange event (declared in Edit).

D3Vil

19-10-2011 15:09:09

i try but nothing , i can't write text in my edit widget when the program is run

can you post me a solution to catch the keyboar event

Altren

19-10-2011 19:06:22

Oh, you don't need to manually do such stuff. It seems that you don't call MyGUI::InputManager::getInstance().injectKeyPress or injectKeyRelease.
By default you don't any events for simple input.

D3Vil

19-10-2011 20:03:14

I'm solve the problem i forgot to add the keyboard setEventCallBack

sorry for the trouble a thanks a lot

now i'm ready to finish my thesis XDXD :D :D :D