A working tab

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
J_A_X
Quite a regular
Quite a regular
Posts: 72
Joined: Wed Jun 29, 2005 13:18
Contact:

A working tab

Postby J_A_X » Fri Jul 22, 2005 18:45

I've searched through the forums, I tried to check the source and API and I even tried out what CE said to try to do with the defaultwindows, but for the life of me i can't get the tabbing to work properly.

I'm tring to make tabs in a framewindow and everything thing i try comes out all wrong. The Layout editor isn't helping me through this either.

If someone can give me some xml or some code to try to base myself on, it'll be appreciated.

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

Re: A working tab

Postby CrazyEddie » Sun Jul 24, 2005 09:29

Consider the following....

Code: Select all

<?xml version="1.0" ?>
<GUILayout>
    <Window Type="DefaultWindow" Name="root">

        <!--
        This creates the TabControl itself, just set the size and position
        as you would for other widgets
        -->
        <Window Type="TaharezLook/TabControl" Name="demoTabControl">
            <Property Name="Position" Value="x:0.2 y:0.2" />
            <Property Name="Size" Value="w:0.6 h:0.6" />

            <!--
            Here we embed a 'DefaultWindow' which will become the first page
            of the tab control content.  The text "Tab-1" will be set into
            the tab button at the top of the parent tab control
            -->
            <Window Type="DefaultWindow" Name="ContentPage1">
                <Property Name="Text" Value="Tab-1" />

                <!--
                Everything embedded on this DefaultWindow will appear
                as content on this page in the tab control.  In this
                case, a simple button.
                -->
                <Window Type="TaharezLook/Button" Name="button1">
                    <Property Name="Position" Value="x:0.25 y:0.2" />
                    <Property Name="Size" Value="w:0.5 h:0.2" />
                    <Property Name="Text" Value="Sample Button!" />
                </Window>

            </Window>

            <!--
            Another 'DefaultWindow' which will become the second page
            of the tab control content.  Again, you can see the text
            "Tab-2" which will be used as the label on the button for
            this pane.
            -->
            <Window Type="DefaultWindow" Name="ContentPage2">
                <Property Name="Text" Value="Tab-2" />

                <!--
                This tab page just contains an editbox.
                -->
                <Window Type="TaharezLook/Editbox" Name="editbox">
                    <Property Name="Position" Value="x:0.25 y:0.2" />
                    <Property Name="Size" Value="w:0.5 h:0.3" />
                    <Property Name="Text" Value="Some editable text!" />
                </Window>

            </Window>

        </Window>

    </Window>
</GUILayout>


HTH

CE.

User avatar
J_A_X
Quite a regular
Quite a regular
Posts: 72
Joined: Wed Jun 29, 2005 13:18
Contact:

Re: A working tab

Postby J_A_X » Mon Jul 25, 2005 14:37

I copy pasted the layout you just posted. Nothing appears on screen...

I was trying to place the tab control in a framewindow (that was my original intention), that didn't work so i just used the exact layout you gave an example of and the only thing I get is nothing. Nothing shows on screen, I'm looking over the imageset right now and everything seems to be there and in place...

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

Re: A working tab

Postby CrazyEddie » Mon Jul 25, 2005 18:25

I messed up the Size property specifications. I've edited the example XML and it will probably work now ;)

User avatar
J_A_X
Quite a regular
Quite a regular
Posts: 72
Joined: Wed Jun 29, 2005 13:18
Contact:

Re: A working tab

Postby J_A_X » Mon Jul 25, 2005 19:33

works now ;)

User avatar
DrPain
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Thu Mar 17, 2005 15:19

Re: A working tab

Postby DrPain » Tue Dec 06, 2005 18:19

Does this work with Falagard? I tried it and got errors:

06/12/2005 13:04:53 (InfL1) XercesParser::initialiseSchema - Attempting to load schema from file 'GUILayout.xsd'.
06/12/2005 13:04:53 (InfL1) XercesParser::initialiseSchema - XML schema file 'GUILayout.xsd' has been initialised.
06/12/2005 13:04:53 (Error) Exception: WindowManager::getWindow - A Window object with the name 'BuildBuild/TabControl__auto_TabPane__Buttons' does not exist within the system
06/12/2005 13:04:53 (Error) Exception: GUILayout_xmlHandler::startElement - layout loading has been aborted since no WindowFactory is available for 'TaharezLook/TabControl' objects.
06/12/2005 13:04:53 (Error) XercesParser::parseXMLFile - An unexpected error occurred while parsing XML file 'Build.layout'.
06/12/2005 13:04:53 (Error) WindowManager::loadWindowLayout - loading of layout from file 'Build.layout' failed.


It's been about a month or so since I updated to CVS, if that matters.

User avatar
xavier
Just popping in
Just popping in
Posts: 4
Joined: Sun Oct 16, 2005 20:47

Re: A working tab

Postby xavier » Wed Dec 28, 2005 06:09

Patch 1391727 at SF fixes this in CVS head.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 6 guests