[SOLVED] Logical problem with focus "NeedMouse"


15-03-2009 22:58:56

I think I've got a logical problem with the focus property "NeedMouse".

I've got a layout which has as base parent widget something like this:
<Widget type="Widget" skin="Canvas" position="0 0 800 600" layer="Back" name="Base_pnlBackground">
The reason I'm using a canvas is because I want to resize my whole gui layout by just setting the size of this widget to for example 1024x768. All other widgets have their align properties set, so the lower right widget stays at the lower right corner of the screen. This works fine.

The problem now comes up with clicking the mouse: When I set the canvas' property "Widget_NeedMouse" to false none of my widgets receive any click -> that's because they all have the canvas as parent. Explicitly setting each widget's "Widget_NeedMouse" to true doesn't make any difference.

The other way round does have its disadvantage too: When the property "Widget_NeedMouse" of the canvas is set to true (or not set) all widgets respond like they should. The disadvantage now is that every call to injectMousePress or injectMouseRelease returns true because the canvas is always there! Therefore I can't tell if the user clicked on the gui or just on the scene. This makes my input handling very complicated.

So my question is: Is there any way to realign widgets on the screen when changing the resolution by not using a whole-screen-parent? Other solutions are welcome too ;-)
I noticed MyGUI::Gui::windowResized(Ogre::RenderWindow* rw); Does it help me at my issue? I don't know how.

PS: I'm currently using MyGUI 2.2


16-03-2009 00:14:02

Set Widget_NeedMouse false and Widget_InheritsPick false for parent widget.
By the way, for empty skin use Default. Because Canvas is skin for Canvas widget. Yes, right now it's empty, but who knows what will happen later :)


16-03-2009 22:42:03

I got it solved, thanks!

Altren's solution wasn't exactly right but it pointed me into the right direction ;-)
The property is named Widget_InheritsPeek and it has to be set to true.


16-03-2009 23:26:59

Right, there was typo in "pick" word, but now it is called pick, not peek :) (but if you'll update MyGUI your code will work)
And yes, it should be true :roll: