raygeee
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:
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
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