How can I do this?

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

DaniGlaz
Just popping in
Just popping in
Posts: 2
Joined: Thu Jul 24, 2008 05:18

How can I do this?

Postby DaniGlaz » Thu Jul 24, 2008 05:35

Hi... I need to do this
Image

Instead of...

Image

Any ideas? I've changed some data in the looknfeel XML but is still on top the Windows instead of the left.

daves
Home away from home
Home away from home
Posts: 253
Joined: Thu Feb 02, 2006 20:12

Re: How can I do this?

Postby daves » Thu Jul 24, 2008 06:01

DaniGlaz wrote:Hi... I need to do this
Image

Instead of...

Image

Any ideas? I've changed some data in the looknfeel XML but is still on top the Windows instead of the left.


Well I think your in the right place if you are modifying the looknfeel. Post your looknfeel and perhaps we can help you to figure out how to do this.

One thing that I'm not sure of is whether CEGUI supports rotated text... I know you can do this in the underlying rendering engine (whatever that might be).. but in cegui.. ?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Thu Jul 24, 2008 08:57

Yeah, the looknfeel is definitely the right place to tinker. It's pretty easy to modify the location of the titlebar and close button - just change the areas specified in the <Child> elements within the FrameWindow specifiecation.

Rotated imagery and rotated text is not supported up to and including CEGUI 0.6.1.

CE

DaniGlaz
Just popping in
Just popping in
Posts: 2
Joined: Thu Jul 24, 2008 05:18

Postby DaniGlaz » Thu Jul 24, 2008 17:15

Hi, thank you.
The looknfeel is the same as Taharaz Looknfeel... I just want to rotate the titlebar on that position. Is it possible?
I presume that I can create a vertical font to simulate that font, can't I?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Fri Jul 25, 2008 08:44

Unfortunately vertical fonts are not supported. While that's quite shocking, what's more shocking is that nobody really mentioned it until now :shock:

It's possible to re-arrange the parts of the FrameWindow with a little work. I started a little test of this last night, but then ran out of time. Basically, I moved the titlebar to the left hand side - this involved 3 main changes to the definition for the TaharezLook/FrameWindow. First, change the Area specified in the <Child> element for the __auto_titlebar component. My modified version looks like this:

Code: Select all

        <Child type="TaharezLook/Titlebar" nameSuffix="__auto_titlebar__">
            <Area>
                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
                <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
                <Dim type="Width" ><FontDim type="HorzExtent" string=" X " /></Dim>
            </Area>
            <Property name="AlwaysOnTop" value="False" />
        </Child>

As you can see it changes the height from the height of the font + 8 to the full height of the window, and the width from the full width to the width of the string " X " using the current font.

The next change you need to make is to adjust the NamedArea specifications for the 'client' areas in various modes. My modified version for "ClientWithTitleWithFrame" looks like this:

Code: Select all

        <NamedArea name="ClientWithTitleWithFrame">
            <Area>
                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="WindowTopEdge" dimension="Height" /></Dim>
                <Dim type="LeftEdge" ><WidgetDim widget="__auto_titlebar__" dimension="RightEdge" /></Dim>
                <Dim type="RightEdge" >
                    <UnifiedDim scale="1" type="RightEdge">
                        <DimOperator op="Subtract">
                            <ImageDim imageset="TaharezLook" image="WindowTopRight" dimension="Width" />
                        </DimOperator>
                    </UnifiedDim>
                </Dim>
                <Dim type="BottomEdge" >
                    <UnifiedDim scale="1" type="BottomEdge">
                        <DimOperator op="Subtract">
                            <ImageDim imageset="TaharezLook" image="WindowBottomEdge" dimension="Height" />
                        </DimOperator>
                    </UnifiedDim>
                </Dim>
            </Area>
        </NamedArea>

Here I changed the top edge of the area to be just beneath the top-edge imagery, instead of the bottom edge of the titlebar (which is now on the left). The left edge was changed from being inside the imagery for the top-left corner to being equal to the right edge of the titlebar. Similar changes are required for the other named areas.

The last major changes are to the imagery specifications, these largely consist of similar changes made to the named areas. My changes for the imagery used when a titlebar and frame are present looks like this:

Code: Select all

        <ImagerySection name="withtitle_frame">
            <FrameComponent>
                <Area>
                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
                    <Dim type="LeftEdge" ><WidgetDim widget="__auto_titlebar__" dimension="RightEdge" /></Dim>
                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
                    <Dim type="RightEdge" ><UnifiedDim scale="1" type="RightEdge" /></Dim>
                </Area>
                <Image type="TopRightCorner" imageset="TaharezLook" image="WindowTopRight" />
                <Image type="BottomRightCorner" imageset="TaharezLook" image="WindowBottomRight" />
                <Image type="RightEdge" imageset="TaharezLook" image="WindowRightEdge" />
                <Image type="BottomEdge" imageset="TaharezLook" image="WindowBottomEdge" />
                <Image type="TopEdge" imageset="TaharezLook" image="WindowTopEdge" />
            </FrameComponent>
            <ImageryComponent>
                <Area>
                    <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="WindowTopEdge" dimension="Height" /></Dim>
                    <Dim type="LeftEdge" ><WidgetDim widget="__auto_titlebar__" dimension="RightEdge" /></Dim>
                    <Dim type="RightEdge" >
                        <UnifiedDim scale="1" type="Width">
                            <DimOperator op="Subtract">
                                <ImageDim imageset="TaharezLook" image="WindowTopRight" dimension="Width" />
                            </DimOperator>
                        </UnifiedDim>
                    </Dim>
                    <Dim type="BottomEdge" >
                        <UnifiedDim scale="1" type="Height">
                            <DimOperator op="Subtract">
                                <ImageDim imageset="TaharezLook" image="WindowBottomEdge" dimension="Height" />
                            </DimOperator>
                        </UnifiedDim>
                    </Dim>
                </Area>
                <Image imageset="TaharezLook" image="GenericBrush" />
                <ColourProperty name="ClientAreaColour" />
                <VertFormat type="Stretched" />
                <HorzFormat type="Stretched" />
            </ImageryComponent>
        </ImagerySection>


Here I basically move the top-edge back up to being the real top of the window instead of the bottom of the titlebar, and the left edge is again moved from being the 'real' left edge of the window to being aligned with the right edge of the titlebar (now on the left). I adjusted the parts used in the FrameComponent, since the original version did not include the upper corner pieces, this is changed to instead omit the corner pieces for the left edge. Finally, the client area was re-specified to again take into account the different imagery and new location of the titlebar.

Some things to note: The titlebar does not 'look' right now, but it functions as expected. To make it look right, you need to adjust the specification for "TaharezLook/Titlebar". I did not get around to moving the close button, but the approach is basically the same as shown in the first step here.

Hope this gives a few clues.

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 13 guests