Problem with mouse in GUI

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

User avatar
Ludi
Quite a regular
Quite a regular
Posts: 59
Joined: Sun Aug 13, 2006 12:33

Problem with mouse in GUI

Postby Ludi » Wed Aug 16, 2006 18:54

Hi,

I'm using the return value of System::injectMousePosition to determine, if the cursor is currently in the gui. But there's a problem with that.

When the cursor is e.g. on the title bar, the method returns false. In this case, I can't move the windows, because of the conditional logic in my game. I test, if the mouse in the gui and send button clicks to the CEGUI, otherwise I let the game handle it. Same, when an e.g. empty static image is on a window.

Am I doing something wrong? I'm using the layout editor to create the layouts.

Greetings

User avatar
Ludi
Quite a regular
Quite a regular
Posts: 59
Joined: Sun Aug 13, 2006 12:33

Postby Ludi » Wed Aug 16, 2006 19:45

Okay, I solved this by disabeling the widgets.

But that's crazy, I have to disable all widgets, except the windows via lua :?

And I don't know how to disable the title bar.

User avatar
Ludi
Quite a regular
Quite a regular
Posts: 59
Joined: Sun Aug 13, 2006 12:33

Postby Ludi » Wed Aug 16, 2006 20:05

I like talking to myself :wink:

Well, I can't disable the widgets, because I can't use DnD with them. If I disable them, the gui doesn't react on DnD. If I don't disable them, I get the result, that the mouse is not within the gui so I don't send the inject event to cegui and I can't do DnD too.

Damn :(

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Wed Aug 16, 2006 20:25

You might change your logic by calling this method from your mouse move handler, so that you don't always "inject".

Code: Select all

Window* getTargetChildAtPosition (const Vector2 &position) const 


This is a method of Window, which you can call on your root window, since it works recursively.

HTH.

User avatar
Ludi
Quite a regular
Quite a regular
Posts: 59
Joined: Sun Aug 13, 2006 12:33

Postby Ludi » Wed Aug 16, 2006 20:33

Okay, thank you.

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Wed Aug 16, 2006 20:46

Gee,

do you have an F5 macro? :lol:

User avatar
Ludi
Quite a regular
Quite a regular
Posts: 59
Joined: Sun Aug 13, 2006 12:33

Postby Ludi » Wed Aug 16, 2006 20:53

scriptkid wrote:Gee,

do you have an F5 macro? :lol:


You not ;)


Return to “Help”

Who is online

Users browsing this forum: No registered users and 31 guests