subscribeEvent for CEGUI/MultiLineEditbox

Martins1

24-05-2007 12:55:09

Hello,

I have a MultiLineEditbox stored in inputWindow, and when I try to subscribe to an event I get an error. Subscribing to events for buttons works ok!

From what I have traced it looks that there is missing some wrapper for MultiLineEditbox in hand_made_wrappers.py.


inputWindow.subscribeEvent(CEGUI.Window.EventKeyDown, self, "onInputKeyDown")


gives me an error:

inputWindow.subscribeEvent(CEGUI.Window.EventKeyDown, self, "onInputKeyDown")
Boost.Python.ArgumentError: Python argument types in
EventSet.subscribeEvent(Editbox, String, instance, str)
did not match C++ signature:
subscribeEvent(class CEGUI::MultiColumnList *, class CEGUI::String, struct _object *, class CEGUI::String)
subscribeEvent(class CEGUI::DragContainer *, class CEGUI::String, struct _object *, class CEGUI::String)
subscribeEvent(class CEGUI::RadioButton *, class CEGUI::String, struct _object *, class CEGUI::String)
subscribeEvent(class CEGUI::Spinner *, class CEGUI::String, struct _object *, class CEGUI::String)
subscribeEvent(class CEGUI::Slider *, class CEGUI::String, struct _object *, class CEGUI::String)
subscribeEvent(class CEGUI::Thumb *, class CEGUI::String, struct _object *, class CEGUI::String)
subscribeEvent(class CEGUI::Editbox *, class CEGUI::String, struct _object *, class CEGUI::String)
subscribeEvent(class CEGUI::FrameWindow *, class CEGUI::String, struct _object *, class CEGUI::String)
subscribeEvent(class CEGUI::GUISheet *, class CEGUI::String, struct _object *, class CEGUI::String)
subscribeEvent(class CEGUI::Scrollbar *, class CEGUI::String, struct _object *, class CEGUI::String)
subscribeEvent(class CEGUI::Checkbox *, class CEGUI::String, struct _object *, class CEGUI::String)
subscribeEvent(class CEGUI::Combobox *, class CEGUI::String, struct _object *, class CEGUI::String)
subscribeEvent(class CEGUI::Listbox *, class CEGUI::String, struct _object *, class CEGUI::String)
subscribeEvent(class CEGUI::Titlebar *, class CEGUI::String, struct _object *, class CEGUI::String)
subscribeEvent(class CEGUI::PushButton *, class CEGUI::String, struct _object *, class CEGUI::String)
subscribeEvent(struct EventSet_wrapper {lvalue}, class CEGUI::String name, unsigned int group, class CEGUI::SubscriberSlot subscriber)
subscribeEvent(class CEGUI::EventSet {lvalue}, class CEGUI::String name, unsigned int group, class CEGUI::SubscriberSlot subscriber)
subscribeEvent(struct EventSet_wrapper {lvalue}, class CEGUI::String name, class CEGUI::SubscriberSlot subscriber)
subscribeEvent(class CEGUI::EventSet {lvalue}, class CEGUI::String name, class CEGUI::SubscriberSlot subscriber)


I even tried to change the type of object like this, but it did not help:

inputWindow.__class__ = CEGUI._cegui_.Editbox


Can anyone suggest a workaround?

andy

24-05-2007 14:04:22

It would be great if you could post a small example piece of code and I'll take a look at it..

I'm planning on another snapshot release this weekend so perhaps can get this in it..

Cheers

Andy

Martins1

24-05-2007 14:19:35

Hi andy, thanks for quick reply!

The code is approximately like this:

test.layout

<?xml version="1.0" encoding="UTF-8"?>

<GUILayout >
<Window Type="DefaultWindow" Name="Root" >
<Property Name="InheritsAlpha" Value="False" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
<Window Type="TaharezLook/FrameWindow" Name="Root/MainWindow" >
<Property Name="Font" Value="Commonwealth-10" />
<Property Name="Text" Value="Python Console" />
<Property Name="TitlebarFont" Value="Commonwealth-10" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="TitlebarEnabled" Value="True" />
<Property Name="UnifiedAreaRect" Value="{{0.172396,0},{0.0970626,0},{0.839931,0},{0.983908,0}}" />
<Window Type="TaharezLook/MultiLineEditbox" Name="Root/MainWindow/Input" >
<Property Name="Text" ></Property>
<Property Name="MaxTextLength" Value="1073741823" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0.013654,0},{0.059723,0},{0.98277,0},{1,-48}}" />
</Window>
</Window>
</Window>
</GUILayout>



win = CEGUI.WindowManager.getSingleton().loadWindowLayout("test.layout")
inputWindow = win.getChild("Root/MainWindow/Input")
inputWindow.subscribeEvent(CEGUI.Window.EventKeyDown, onKeyDown, "")


And on the last line I get the exception.

andy

24-05-2007 15:18:53

Are you running from the binary version or building from the SVN?

Andy

Martins1

24-05-2007 16:20:51

SVN version, around 5th of may.

andy

24-05-2007 23:39:38

The CEGUI fix is in the current SVN -- have a look and see if it solves your problem..

I did have to do some strange coding to select the correct object as for some reason getChild didn't work properly..
sheet = CEGUI.WindowManager.getSingleton().loadWindowLayout("test.layout")
inputWindow = sheet.getChild("Root/MainWindow")
inputWindow= inputWindow.getChildAtIdx(2)
inputWindow.subscribeEvent(CEGUI.Window.EventKeyDown, TestonKeyDown, "")


Cheers
Andy

Martins1

25-05-2007 07:39:40

Hey thanks a lot Andy!

I will try it and let you know.