Page 1 of 1

MousePassThroughEnabled Property

Posted: Mon Nov 23, 2009 13:39
by hadesfury
Hello,

I had a problem to figure why my click didn't pass through the DefaultWindow ... and finally found the MousePassThroughEnabled Property on your forum

I write a little post because there is some strange behavior that drive me toward bad conclusion.

When the MousePassThroughEnabled Property is disable, I can make the click Pass Through by double clicking ... and I really wonder why it's working

So my problem is fixed until the next one :D but I wanted to warn you about that if you are not aware of it

Best regards

Re: MousePassThroughEnabled Property

Posted: Mon Nov 23, 2009 17:13
by Jamarr
You did not tell us what version of CEGUI you are running?

Re: MousePassThroughEnabled Property

Posted: Mon Nov 23, 2009 17:46
by hadesfury
I was on the svn souce trunk version (it did it ) ... then test the Svn 0.7 ( so I suppose it is the 0.7.1 :D ) and it did it too

Re: MousePassThroughEnabled Property

Posted: Thu Dec 03, 2009 10:18
by CrazyEddie
Not sure why this should happen, but thanks for the report. I will test it out.

CE.

Re: MousePassThroughEnabled Property

Posted: Mon Dec 07, 2009 09:32
by CrazyEddie
I've tried to reproduce this issue without success :?

What I did was to create a FrameWindow and subscribe a handler to hear about the mouse button events, then I covered this with a DefaultWindow with mouse pass through disabled, and had at it - clicking away above the frame window - but no events were ever fired.

If you could post a minimal code or XML layout example that we can use to reproduce the issue, that would be most appreciated.

Thanks,

CE.

Re: MousePassThroughEnabled Property

Posted: Tue Mar 23, 2010 12:33
by hadesfury
Sorry about the time between your request ... without the MousePassThroughEnabled Property

so this is my layout

Code: Select all

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

<GUILayout >
    <Window Type="DefaultWindow" Name="editor_mode" >
        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
        <Window Type="TaharezLook/Button" Name="add_button" >
            <Property Name="Text" Value="Add" />
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="UnifiedAreaRect" Value="{{0.01,0},{0.95,0},{0.10,0},{1,0}}" />
        </Window>
        <Window Type="TaharezLook/Button" Name="save_button" >
            <Property Name="Text" Value="Save" />
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="UnifiedAreaRect" Value="{{0.11,0},{0.95,0},{0.20,0},{1,0}}" />
        </Window>
        <Window Type="TaharezLook/Button" Name="delete_button" >
            <Property Name="Text" Value="Delete" />
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="UnifiedAreaRect" Value="{{0.21,0},{0.95,0},{0.30,0},{1,0}}" />
        </Window>
        <Window Type="TaharezLook/Button" Name="layer_button" >
            <Property Name="Text" Value="Layer" />
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="UnifiedAreaRect" Value="{{0.31,0},{0.95,0},{0.40,0},{1,0}}" />
        </Window>
        <Window Type="TaharezLook/Button" Name="level_button" >
            <Property Name="Text" Value="Level" />
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="UnifiedAreaRect" Value="{{0.41,0},{0.95,0},{0.50,0},{1,0}}" />
        </Window>
        <Window Type="TaharezLook/StaticText" Name="debug_info" >
            <Property Name="Text" Value="Debug Info :" />
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="UnifiedAreaRect" Value="{{0.0,0},{0.0,30},{1.0,0},{0.1,0}}" />
            <Window Type="TaharezLook/StaticText" Name="debug_info_text" >
                <Property Name="Text" Value="" />
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.15,0},{0.1,0},{1.0,0},{0.9,0}}" />
            </Window>
        </Window>
       
    </Window>
</GUILayout>


this is the code that link between input and CEGUI

when I single click it always return true but when I double click it return false the second time

Code: Select all

Bool ManagerGui::MousePressed(
    const OIS::MouseState & mouse_event,
    OIS::MouseButtonID mouse_button_id
    )
{
    CEGUI::MouseButton
        mouse_button;

    if ( mouse_button_id == OIS::MB_Left )
    {
        Bool
            has_input_been_injected = False;

        mouse_button = CEGUI::LeftButton;

        has_input_been_injected = CEGUI::System::getSingleton().injectMouseButtonDown( mouse_button );

        return has_input_been_injected;
    }

    return False;
}

Re: MousePassThroughEnabled Property

Posted: Tue Mar 23, 2010 15:20
by CrazyEddie
Ah, right. I think there was some misunderstanding previously as regards to how we interpret 'pass through'. For our usage of the term in general, we mean that the mouse can pass through to CEGUI content beneath; it should not be thought of in the context of passing through to the underlying playfield or scene.

Basically, if that root window 'editor_mode' is set as the GUI sheet window, then to get reliable return results from the inject functions you must set the MousePassThroughEnabled property to True on that root window. If you do not do this, all kinds of strange behaviour will occur - such as what you experienced ;)

CE.

Re: MousePassThroughEnabled Property

Posted: Tue Mar 23, 2010 15:33
by hadesfury
Yes I've done that ( setting MousePassThroughEnabled to True ) and it works very well ... I just told it if it could help you as soon as I was thinking that it was a bug ;)

Best regards ;)