Issue Re-opening a Popup [Solved]

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

TheWanderer
Not too shy to talk
Not too shy to talk
Posts: 31
Joined: Wed Feb 03, 2016 21:58

Issue Re-opening a Popup [Solved]

Postby TheWanderer » Wed Jul 13, 2016 18:06

Hi everyone,

I'm working on a context menu which appears when you right-click on the screen and am having an issue when I try to re-open it after it's been used. Specifically, my context menu has (currently) 3 layers of menus (Top, Sub, then Options) as specified below.

The menu disappears correctly when I choose one of the options, but when I open it again by right-clicking, the context menu appears with all sub-menus already open. It's like it's not resetting properly.

Is this due perhaps to how I'm re-opening it? (I set it to visible and enable it) Looking at the recursive call for MenuItem::closeAllMenuItemPopups(), I see that it finds the parent and then calls hide on it, which I assume doesn't really close the submenus. Can anyone tell me what I should be looking for in order to determine why the submenus don't collapse?

Thank you for the help.

Code: Select all

        <Window name="MainMenu"  type="TaharezLook/PopupMenu" >
           
            <Window name="Menu1" type="TaharezLook/MenuItem" >
                <Property name="Text" value="Menu 1" />
               
                <Window name="Menu1_Categories"  type="TaharezLook/PopupMenu" >
                   
                    <Window name="Menu1_Submenu1" type="TaharezLook/MenuItem" >
                        <Property name="Text" value="Submenu 1" />
                   
                        <Window name="Menu1_Submenu1_Categories_Popup"  type="TaharezLook/PopupMenu" >
                           
                            <Window name="Category1" type="TaharezLook/MenuItem" >
                                <Property name="Text" value="Category1" />
                            </Window>
                            <Window name="Category2" type="TaharezLook/MenuItem" >
                                <Property name="Text" value="Category2" />
                            </Window>
                            <Window name="Category3" type="TaharezLook/MenuItem" >
                                <Property name="Text" value="Category3" />
                            </Window>                             
                           
                        </Window>
                    </Window>
                </Window>
            </Window>                                   
        </Window>                                               


Code: Select all

[13:01:07] Cegui: ---- Version: 0.8.4 (Build: Jul 13 2016 Static Debug Microsoft Windows MSVC++ 11.0 32 bit) ----
[13:01:07] Cegui: ---- Renderer module is: CEGUI::OgreRenderer - Official OGRE based 2nd generation renderer module. ----
[13:01:07] Cegui: ---- XML Parser module is: CEGUI::RapidXMLParser - Official RapidXML based parser module for CEGUI ----
[13:01:07] Cegui: ---- Image Codec module is: OgreImageCodec - Integrated ImageCodec using the Ogre engine. ----
[13:01:07] Cegui: ---- Scripting module is: None ----
Last edited by TheWanderer on Thu Jul 14, 2016 18:41, edited 1 time in total.

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: Issue Re-opening a Popup

Postby YaronCT » Wed Jul 13, 2016 19:20

@TheWanderer: I'll do my best to help u. Note, however, that there's been a flood of issues from users recently, and part of the cegui team is on vacation, so it may take time. Sorry.

TheWanderer
Not too shy to talk
Not too shy to talk
Posts: 31
Joined: Wed Feb 03, 2016 21:58

Re: Issue Re-opening a Popup

Postby TheWanderer » Wed Jul 13, 2016 19:39

That's quite al'right, YaronCT. I appreciate you taking the time to look into it. If there's any information I can give or any avenue I can pursue to help diagnose the issue, just let me know.

TheWanderer
Not too shy to talk
Not too shy to talk
Posts: 31
Joined: Wed Feb 03, 2016 21:58

Re: Issue Re-opening a Popup [Solved]

Postby TheWanderer » Thu Jul 14, 2016 18:41

Or I can just spend a bit more time and figure it out...

The magic line is:

Code: Select all

 <Property name="AutoCloseNestedPopups" value="true" />


Tracing the code, I found that MenuBase::d_autoCloseNestedPopups, the variable controlling the collapse behaviour, defaults to false. I'm not entirely sure why it was collapsing properly when I was using only two layers of menus given I wasn't using the above property.

In any case, I'm glad I found it. One more item off your plate, YaronCT :)

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: Issue Re-opening a Popup [Solved]

Postby YaronCT » Thu Jul 14, 2016 18:42

:D

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: Issue Re-opening a Popup [Solved]

Postby YaronCT » Sat Jul 16, 2016 14:27

@TheWanderer: If you're interested, feel free to share with us about the project u work on (in the dedicated forum).


Return to “Help”

Who is online

Users browsing this forum: No registered users and 35 guests