incorrect behaviour for CEGUI subscribeEvent

39 zobrazení
Preskočiť na prvú neprečítanú správu

Aleh Arol

neprečítané,
7. 10. 2012, 5:16:187. 10. 2012
komu: python-ogre...@googlegroups.com
Hi,

I faced a problem when subscribing (only) for event means that I handled
it in anyway. In other words it doesn't matter what I return from
onKeyDown(for example) True (handled) or False(not handled) CEGUI always
think I handled the event.

Error case is when I want to override some keys in MultilineEditBox,
while I'd like other to keep working as expected they don't work just
because I subscribed for KeyDown.

I did investigation and found out that:
1) no matter what I return from python handler True/False/None - CEGUI
always get true (I debugged down to the wrapper code)
2) I'm not very strong in py++, but I found (in
code_generators/cegui/hand_made_wrappers.py line 126) the following:

class EventCallback
{
public:

....

bool operator() (const CEGUI::EventArgs &args) const
{
....

else if (dynamic_cast<CEGUI::KeyEventArgs *>((CEGUI::EventArgs
*)&args))
if (mMethod.length() > 0 )
boost::python::call_method<void>(mSubscriber,
mMethod.c_str(),
static_cast<const
CEGUI::KeyEventArgs&>(args) );
else
boost::python::call<void>(mSubscriber,
static_cast<const
CEGUI::KeyEventArgs&>(args) );

....

return true;
}

which rendered to EventSet.pypp.cpp:78 in the generated code.
As you can see it doesn't respect callback's return value because always
returning true and even using boost::python::call with R parametrized
with void...

I'm not quite strong with py++ yet, so can anyone give me a clue how to
fix this? Is it enough to manually rewrite the code in the comment in
the hand_made_wrappers.py and regen/rebuild then?

ps. yes I know 1.8 wrappers are pending,(i'm using 1.7.2 rev.1150).


--
Best regards,
Aleh Arol

Aleh Arol

neprečítané,
8. 10. 2012, 17:32:378. 10. 2012
komu: python-ogre...@googlegroups.com
Sorry, not 1.7.2 - 1.7.1 and svn rev.1150.
CEGUI 0.7.5

07.10.2012 12:16, Aleh Arol пишет:
Odpovedať všetkým
Odpovedať autorovi
Poslať ďalej
0 nových správ