Menubar in 0.8

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

Masadow
Just popping in
Just popping in
Posts: 5
Joined: Sun Dec 25, 2011 02:12

Menubar in 0.8

Postby Masadow » Mon Feb 11, 2019 17:46

Hey,

I'm looking forward to implement a Menubar, so to make things the easiest as possible, I'm using the TaharezLook where it's already implemented.

I've put in my layout the following :

Code: Select all

<?xml version="1.0" ?>
<GUILayout version="4">
    <Window type="TaharezLook/Menubar" name="building_menu" >
        <Property name="MaxSize" value="{{1,0},{1,0}}" />
        <Property name="Position" value="{ {0.3, 0}, {1, -30} }" />
        <Property name="Size" value="{ {0.7, -250}, {0, 30} }" />
        <Property name="ItemSpacing" value="10" />

        <Window type="TaharezLook/MenuItem" name="Root/FrameWindow/Menubar/Storage" >
            <Property name="Text" value="Storage" />
            <Property name="TooltipText" value="Buildings that can be used to store resources, equipment etc." />
            <Property name="MaxSize" value="{{1,0},{1,0}}" />
            <Property name="Area" value="{{0,7},{0,0},{0,30},{0,21}}" />
            <Property name="VerticalAlignment" value="Centre" />
            <Window type="TaharezLook/PopupMenu" name="Root/FrameWindow/Menubar/Storage/AutoPopup" >
                <Property name="Visible" value="False" />
                <Property name="FadeInTime" value="0" />
                <Property name="FadeOutTime" value="0" />
                <Property name="ItemSpacing" value="2" />
                <Property name="MaxSize" value="{{1,0},{1,0}}" />
                <Property name="ClippedByParent" value="False" />
                <Property name="Area" value="{{0,0},{0,-40},{0,42},{0,120}}" />
                <Property name="AutoResizeEnabled" value="True" />
                <Window type="TaharezLook/MenuItem" name="Root/FrameWindow/Menubar/Storage/Storage" >
                    <Property name="Text" value="Storage" />
                    <Property name="TooltipText" value="Basic general storage" />
                    <Property name="MaxSize" value="{{1,0},{1,0}}" />
                    <Property name="Area" value="{{0,2},{0,2},{0,39},{0,23}}" />
                </Window>
            </Window>
        </Window>
    </Window>
</GUILayout>


I've managed to get it working somehow even though the subitem placement is weird and I had to handle the mouse enter/leave behaviour by myself like in 0.5. Is there any better way to use it ? I can't figure out how does it works in the demo.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Menubar in 0.8

Postby Ident » Mon Feb 11, 2019 19:08

Why can't you figure it out based on the demo? Is something unclear there?
CrazyEddie: "I don't like GUIs"

Masadow
Just popping in
Just popping in
Posts: 5
Joined: Sun Dec 25, 2011 02:12

Re: Menubar in 0.8

Postby Masadow » Tue Feb 12, 2019 15:31

Well, I can figure out how the menubar should be layed out easily in the TaharezOverview sample, but then, in the code, I can't find where the logic lie to handle the mouse. I thought it would be automatic then but I can see in the wiki that in old 0.5, it had to be manually handled. However, 0.5 code is outdated and porting it kind of work but there's some glitches / functions that doesn't work (like openPopupMenu does nothing for me whereas getPopupMenu()->show() do show the menu.)

Then, I was wondering whether I was looking at the right place or not to get it working on my own.

I tried to look at samples_framework but didn't find a place where it would be handled.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Menubar in 0.8

Postby Ident » Tue Feb 12, 2019 20:21

I think there might not just be a better way. The menu bar has always been a bit odd, but functional.

If the demos do not show the usage sufficiently, a demo should be added.

I briefly looked and you are right, there is no specific usage in any of the demo files. For some reason I feel like this was never necessary though and you should be able to just register to click events of the actual menuitems to handle these. The rest should just work.

The hierarchy is:
Menubar > (1...*) MenuItem(s) > PopupMenu > (1...*) MenuItem(s)
which is the same as what you just have shown us.


On the default branch the TaharezLookOverview.layout file has this and it just works, I just tried it. No code needed to pop them open and close them.
CrazyEddie: "I don't like GUIs"

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Menubar in 0.8

Postby Ident » Tue Feb 12, 2019 20:24

Did you try compiling and running the samples framework?
CrazyEddie: "I don't like GUIs"

Masadow
Just popping in
Just popping in
Posts: 5
Joined: Sun Dec 25, 2011 02:12

Re: Menubar in 0.8

Postby Masadow » Tue Feb 12, 2019 22:00

Hmmm

I did not try to compile and run the demo, just copy pasted in a clean project but I'll try to build the demo then to see what I've missed.

Thanks for your help.

Btw, I might better start a new thread for that but is there any documentation on editing the looknfeel ?

I've ran into this article : http://cegui.org.uk/wiki/Create_a_CheckListboxItem but I feel like there is a lot of explanation missing as somes concepts seems to be quite obvious for the write. (For example what's <PropertyDefinition name="SelectionBrush" initialValue="set:WindowsLook image:Background" redrawOnWrite="true" /> this ?)

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Menubar in 0.8

Postby Ident » Wed Feb 13, 2019 07:26

new topic new thread :)
CrazyEddie: "I don't like GUIs"


Return to “Help”

Who is online

Users browsing this forum: No registered users and 32 guests