Need help with Layers? (v3.2)?

Jad

01-06-2011 18:13:04

First off, awesome GUI!

Anyway, I have a menubar and a panel. The panel is just below the menubar. Whenever i click on a menu item, the popup is rendered below the panel no matter what layer i use. So i switched the menubar and panel in the xml file. Now the panel is rendered below the menu popups, but the texts from the panel and the menu seem to all be rendered at the same layer. (They get mixed up)...

What gives?

Altren

01-06-2011 19:51:13

Show your layout and I'll tell what's wrong.

Jad

01-06-2011 19:55:25

Here, i'm using the editor by the way, not hardcoding this in.

<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout" version="3.2.0">
<Widget type="MenuBar" skin="MenuBar" position="0 0 800 26" align="Stretch" layer="Overlapped" name="Menu">
<Widget type="MenuItem" skin="" position="0 0 40 21">
<Property key="Caption" value="File"/>
<Property key="MenuItemType" value="Popup"/>
<Property key="MenuItemId" value="File"/>
<Widget type="PopupMenu" skin="PopupMenu" position="2 26 108 115" style="Popup" layer="Popup">
<Property key="Alpha" value="1"/>
<Widget type="MenuItem" skin="" position="0 0 100 19">
<Property key="Caption" value="New"/>
</Widget>
<Widget type="MenuItem" skin="" position="0 19 100 19">
<Property key="Caption" value="Open..."/>
</Widget>
<Widget type="MenuItem" skin="" position="0 38 100 19">
<Property key="Caption" value="Save"/>
</Widget>
<Widget type="MenuItem" skin="" position="0 57 100 19">
<Property key="Caption" value="Save As..."/>
</Widget>
<Widget type="MenuItem" skin="" position="0 76 100 10">
<Property key="MenuItemType" value="Separator"/>
</Widget>
<Widget type="MenuItem" skin="" position="0 86 100 19">
<Property key="Caption" value="Exit"/>
</Widget>
</Widget>
</Widget>
<Widget type="MenuItem" skin="" position="46 0 45 21">
<Property key="Caption" value="Edit"/>
<Property key="MenuItemType" value="Popup"/>
<Widget type="PopupMenu" skin="PopupMenu" position="48 26 84 77" style="Popup">
<Widget type="MenuItem" skin="" position="0 0 76 19">
<Property key="Caption" value="Undo"/>
</Widget>
<Widget type="MenuItem" skin="" position="0 19 76 19">
<Property key="Caption" value="Redo"/>
</Widget>
<Widget type="MenuItem" skin="" position="0 38 76 10">
<Property key="MenuItemType" value="Separator"/>
</Widget>
<Widget type="MenuItem" skin="" position="0 48 76 19">
<Property key="Caption" value="Reset"/>
</Widget>
</Widget>
</Widget>
<Widget type="MenuItem" skin="" position="97 0 70 21">
<Property key="Caption" value="Options"/>
</Widget>
<Widget type="MenuItem" skin="" position="173 0 54 21">
<Property key="Caption" value="Mode"/>
</Widget>
</Widget>
<Widget type="Widget" skin="PanelSkin" position="0 25 190 526">
<Widget type="ListBox" skin="ListBox" position="10 10 170 115" name="Params">
<Property key="AddItem" value="General"/>
<Property key="AddItem" value="Level 0 - trunk(s)"/>
<Property key="AddItem" value="Level 1"/>
<Property key="AddItem" value="Level 2"/>
<Property key="AddItem" value="Level 3"/>
</Widget>
<Widget type="ListBox" skin="ListBox" position="10 125 170 115" name="General">
<Property key="AddItem" value="Tree shape"/>
<Property key="AddItem" value="Trunk radius"/>
<Property key="AddItem" value="Leaves"/>
<Property key="AddItem" value="Pruning"/>
<Property key="AddItem" value="Quality"/>
<Property key="Visible" value="false"/>
</Widget>
<Widget type="ListBox" skin="ListBox" position="10 125 170 115" name="Levels">
<Property key="AddItem" value="Length/Taper"/>
<Property key="AddItem" value="Curvature"/>
<Property key="AddItem" value="Splitting"/>
<Property key="AddItem" value="Branching"/>
<Property key="AddItem" value="Quality"/>
<Property key="Visible" value="false"/>
</Widget>
<Widget type="Widget" skin="PanelSkin" position="10 240 170 260">
<Property key="NeedToolTip" value="false"/>
<Widget type="TextBox" skin="TextBox" position="10 5 75 25">
<Property key="Caption" value="Shape"/>
<Property key="TextAlign" value="Left VCenter"/>
</Widget>
<Widget type="EditBox" skin="EditBox" position="85 5 80 25" name="Shape">
<Property key="Caption" value="0 - conical"/>
</Widget>
<Widget type="TextBox" skin="TextBox" position="10 30 75 25">
<Property key="Caption" value="Levels"/>
<Property key="TextAlign" value="Left VCenter"/>
</Widget>
<Widget type="EditBox" skin="EditBox" position="85 30 80 25" name="Levels">
<Property key="Caption" value="3"/>
<Property key="TextAlign" value="Right VCenter"/>
</Widget>
<Widget type="TextBox" skin="TextBox" position="10 55 75 25">
<Property key="Caption" value="Scale"/>
<Property key="TextAlign" value="Left VCenter"/>
</Widget>
<Widget type="EditBox" skin="EditBox" position="85 55 80 25" name="Scale">
<Property key="Caption" value="10"/>
<Property key="TextAlign" value="Right VCenter"/>
</Widget>
<Widget type="TextBox" skin="TextBox" position="10 80 75 25">
<Property key="Caption" value="ScaleV"/>
<Property key="TextAlign" value="Left VCenter"/>
</Widget>
<Widget type="EditBox" skin="EditBox" position="85 80 80 25" name="ScaleV">
<Property key="Caption" value="0"/>
<Property key="TextAlign" value="Right VCenter"/>
</Widget>
<Widget type="TextBox" skin="TextBox" position="10 115 75 25">
<Property key="Caption" value="BaseSize"/>
<Property key="TextAlign" value="Left VCenter"/>
</Widget>
<Widget type="EditBox" skin="EditBox" position="85 115 80 25" name="BaseSize">
<Property key="Caption" value="0.25"/>
<Property key="TextAlign" value="Right VCenter"/>
</Widget>
<Widget type="TextBox" skin="TextBox" position="10 140 75 25">
<Property key="Caption" value="0BaseSplits"/>
<Property key="TextAlign" value="Left VCenter"/>
</Widget>
<Widget type="EditBox" skin="EditBox" position="85 140 80 25" name="0BaseSplits">
<Property key="Caption" value="0.0"/>
<Property key="TextAlign" value="Right VCenter"/>
</Widget>
<Widget type="TextBox" skin="TextBox" position="10 165 75 25">
<Property key="Caption" value="RatioPower"/>
<Property key="TextAlign" value="Left VCenter"/>
</Widget>
<Widget type="EditBox" skin="EditBox" position="85 165 80 25" name="RatioPower">
<Property key="Caption" value="1.0"/>
<Property key="TextAlign" value="Right VCenter"/>
</Widget>
<Widget type="TextBox" skin="TextBox" position="10 190 75 25">
<Property key="Caption" value="AttractionUp"/>
<Property key="TextAlign" value="Left VCenter"/>
</Widget>
<Widget type="EditBox" skin="EditBox" position="85 190 80 25" name="AttractionUp">
<Property key="Caption" value="0.0"/>
<Property key="TextAlign" value="Right VCenter"/>
</Widget>
</Widget>
</Widget>
</MyGUI>

Jad

02-06-2011 19:54:31

Well the problem seems to be confined to the editor. The GUI popups work fine in my engine.

Also, a huge advice to users: ALWAYS ASSIGN A LAYER. The default doesn't work. If you try to render a widget with the [DEFAULT] layer, it won't.

Oh and here's the updated layout if anyone's interested:
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout" version="3.2.0">
<Widget type="MenuBar" skin="MenuBar" position="0 0 800 26" align="Stretch" layer="Overlapped" name="Menu">
<Widget type="MenuItem" skin="" position="0 0 40 21">
<Property key="Caption" value="File"/>
<Property key="MenuItemType" value="Popup"/>
<Property key="MenuItemId" value="File"/>
<Widget type="PopupMenu" skin="PopupMenu" position="2 26 108 115" style="Popup" layer="Popup">
<Property key="Alpha" value="1"/>
<Widget type="MenuItem" skin="" position="0 0 100 19">
<Property key="Caption" value="New"/>
</Widget>
<Widget type="MenuItem" skin="" position="0 19 100 19">
<Property key="Caption" value="Open..."/>
</Widget>
<Widget type="MenuItem" skin="" position="0 38 100 19">
<Property key="Caption" value="Save"/>
</Widget>
<Widget type="MenuItem" skin="" position="0 57 100 19">
<Property key="Caption" value="Save As..."/>
</Widget>
<Widget type="MenuItem" skin="" position="0 76 100 10">
<Property key="MenuItemType" value="Separator"/>
</Widget>
<Widget type="MenuItem" skin="" position="0 86 100 19">
<Property key="Caption" value="Exit"/>
</Widget>
</Widget>
</Widget>
<Widget type="MenuItem" skin="" position="46 0 45 21">
<Property key="Caption" value="Edit"/>
<Property key="MenuItemType" value="Popup"/>
<Property key="MenuItemId" value="Edit"/>
<Widget type="PopupMenu" skin="PopupMenu" position="48 26 84 77" style="Popup" layer="Popup">
<Widget type="MenuItem" skin="" position="0 0 76 19">
<Property key="Caption" value="Undo"/>
</Widget>
<Widget type="MenuItem" skin="" position="0 19 76 19">
<Property key="Caption" value="Redo"/>
</Widget>
<Widget type="MenuItem" skin="" position="0 38 76 10">
<Property key="MenuItemType" value="Separator"/>
</Widget>
<Widget type="MenuItem" skin="" position="0 48 76 19">
<Property key="Caption" value="Reset"/>
</Widget>
</Widget>
</Widget>
<Widget type="MenuItem" skin="" position="97 0 70 21">
<Property key="Caption" value="Options"/>
</Widget>
<Widget type="MenuItem" skin="" position="173 0 54 21">
<Property key="Caption" value="Mode"/>
</Widget>
</Widget>
<Widget type="Widget" skin="PanelSkin" position="0 25 190 526" layer="Overlapped">
<Widget type="ListBox" skin="ListBox" position="10 10 170 115" name="Params">
<Property key="AddItem" value="General"/>
<Property key="AddItem" value="Level 0 - trunk(s)"/>
<Property key="AddItem" value="Level 1"/>
<Property key="AddItem" value="Level 2"/>
<Property key="AddItem" value="Level 3"/>
</Widget>
<Widget type="ListBox" skin="ListBox" position="10 125 170 115" name="General">
<Property key="AddItem" value="Tree shape"/>
<Property key="AddItem" value="Trunk radius"/>
<Property key="AddItem" value="Leaves"/>
<Property key="AddItem" value="Pruning"/>
<Property key="AddItem" value="Quality"/>
<Property key="Visible" value="false"/>
</Widget>
<Widget type="ListBox" skin="ListBox" position="10 125 170 115" name="Levels">
<Property key="AddItem" value="Length/Taper"/>
<Property key="AddItem" value="Curvature"/>
<Property key="AddItem" value="Splitting"/>
<Property key="AddItem" value="Branching"/>
<Property key="AddItem" value="Quality"/>
<Property key="Visible" value="false"/>
</Widget>
<Widget type="Widget" skin="PanelSkin" position="10 240 170 260">
<Property key="NeedToolTip" value="false"/>
<Widget type="TextBox" skin="TextBox" position="10 5 75 25">
<Property key="Caption" value="Shape"/>
<Property key="TextAlign" value="Left VCenter"/>
</Widget>
<Widget type="EditBox" skin="EditBox" position="85 5 80 25" name="Shape">
<Property key="Caption" value="0 - conical"/>
</Widget>
<Widget type="TextBox" skin="TextBox" position="10 30 75 25">
<Property key="Caption" value="Levels"/>
<Property key="TextAlign" value="Left VCenter"/>
</Widget>
<Widget type="EditBox" skin="EditBox" position="85 30 80 25" name="Levels">
<Property key="Caption" value="3"/>
<Property key="TextAlign" value="Right VCenter"/>
</Widget>
<Widget type="TextBox" skin="TextBox" position="10 55 75 25">
<Property key="Caption" value="Scale"/>
<Property key="TextAlign" value="Left VCenter"/>
</Widget>
<Widget type="EditBox" skin="EditBox" position="85 55 80 25" name="Scale">
<Property key="Caption" value="10"/>
<Property key="TextAlign" value="Right VCenter"/>
</Widget>
<Widget type="TextBox" skin="TextBox" position="10 80 75 25">
<Property key="Caption" value="ScaleV"/>
<Property key="TextAlign" value="Left VCenter"/>
</Widget>
<Widget type="EditBox" skin="EditBox" position="85 80 80 25" name="ScaleV">
<Property key="Caption" value="0"/>
<Property key="TextAlign" value="Right VCenter"/>
</Widget>
<Widget type="TextBox" skin="TextBox" position="10 115 75 25">
<Property key="Caption" value="BaseSize"/>
<Property key="TextAlign" value="Left VCenter"/>
</Widget>
<Widget type="EditBox" skin="EditBox" position="85 115 80 25" name="BaseSize">
<Property key="Caption" value="0.25"/>
<Property key="TextAlign" value="Right VCenter"/>
</Widget>
<Widget type="TextBox" skin="TextBox" position="10 140 75 25">
<Property key="Caption" value="0BaseSplits"/>
<Property key="TextAlign" value="Left VCenter"/>
</Widget>
<Widget type="EditBox" skin="EditBox" position="85 140 80 25" name="0BaseSplits">
<Property key="Caption" value="0.0"/>
<Property key="TextAlign" value="Right VCenter"/>
</Widget>
<Widget type="TextBox" skin="TextBox" position="10 165 75 25">
<Property key="Caption" value="RatioPower"/>
<Property key="TextAlign" value="Left VCenter"/>
</Widget>
<Widget type="EditBox" skin="EditBox" position="85 165 80 25" name="RatioPower">
<Property key="Caption" value="1.0"/>
<Property key="TextAlign" value="Right VCenter"/>
</Widget>
<Widget type="TextBox" skin="TextBox" position="10 190 75 25">
<Property key="Caption" value="AttractionUp"/>
<Property key="TextAlign" value="Left VCenter"/>
</Widget>
<Widget type="EditBox" skin="EditBox" position="85 190 80 25" name="AttractionUp">
<Property key="Caption" value="0.0"/>
<Property key="TextAlign" value="Right VCenter"/>
</Widget>
</Widget>
</Widget>
</MyGUI>