Problem with load layout

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
lan
Just popping in
Just popping in
Posts: 10
Joined: Tue Oct 18, 2005 15:13

Problem with load layout

Postby lan » Fri Dec 09, 2005 17:40

I’m trying to load a new layout when the button is pressed. The codes are as follow...

wmgr.getWindow((CEGUI::utf8*)"MainWindow/ExpandMenu" )
->subscribeEvent(
CEGUI:: PushButton::EventClicked,
CEGUI::Event::Subscriber(&GuiApplication::handleMenu, this));

bool handleMenu(const CEGUI::EventArgs& e)
{
CEGUI Window* mExpandMenu =
CEGUI::WindowManager::getSingleton().loadWindowLayout(
(CEGUI::utf8*)"GuiDemo2.layout" );
return true;
}
It doesn't work. When it run, the layout didn't create and had an error. What did I do wrong? Causes or solutions are welcome. :D

User avatar
martignasse
Just can't stay away
Just can't stay away
Posts: 227
Joined: Thu Apr 14, 2005 08:10
Location: Lyon, FRANCE

Re: Problem with load layout

Postby martignasse » Sat Dec 10, 2005 12:49

hi,

give us the cegui.log file, coul'd help.

not sure, but by loading a layout like that (an entire one), it seem's you kill the layout you are working in, wich is bad.

User avatar
lan
Just popping in
Just popping in
Posts: 10
Joined: Tue Oct 18, 2005 15:13

Re: Problem with load layout

Postby lan » Sun Dec 11, 2005 15:21

This is my log file.....

11/12/2005 22:16:09 (InfL1) +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
11/12/2005 22:16:09 (InfL1) + Crazy Eddie's GUI System - Event log +
11/12/2005 22:16:09 (InfL1) + (http://www.cegui.org.uk/) +
11/12/2005 22:16:09 (InfL1) +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

11/12/2005 22:16:09 (InfL1) CEGUI::Logger singleton created.
11/12/2005 22:16:09 (InfL1) ---- Begining CEGUI System initialisation ----
11/12/2005 22:16:09 (InfL1) CEGUI::ImagesetManager singleton created
11/12/2005 22:16:09 (InfL1) CEGUI::FontManager singleton created.
11/12/2005 22:16:09 (InfL1) CEGUI::WindowFactoryManager singleton created
11/12/2005 22:16:09 (InfL1) CEGUI::WindowManager singleton created
11/12/2005 22:16:09 (InfL1) CEGUI::SchemeManager singleton created.
11/12/2005 22:16:09 (InfL1) CEGUI::MouseCursor singleton created.
11/12/2005 22:16:09 (InfL1) CEGUI::GlobalEventSet singleton created.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'DefaultWindow' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'DragContainer' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'ScrolledContainer' windows added.
11/12/2005 22:16:09 (InfL1) Window type alias named 'DefaultGUISheet' added for window type 'DefaultWindow'.
11/12/2005 22:16:09 (InfL1) CEGUI::System singleton created.
11/12/2005 22:16:09 (InfL1) ---- CEGUI System initialisation completed ----
11/12/2005 22:16:09 (InfL1) Attempting to load Scheme from file 'TaharezLook.scheme'.
11/12/2005 22:16:09 (InfL2) Started creation of Scheme 'TaharezLook' via XML file.
11/12/2005 22:16:09 (InfL2) Finished creation of Scheme 'TaharezLook' via XML file.
11/12/2005 22:16:09 (InfL2) Loaded GUI scheme 'TaharezLook' from data in file 'TaharezLook.scheme'.
11/12/2005 22:16:09 (InfL2) ---- Begining resource loading for GUI scheme 'TaharezLook' ----
11/12/2005 22:16:09 (InfL1) Attempting to create an Imageset from the information specified in file 'TaharezLook.imageset'.
11/12/2005 22:16:09 (InfL2) Started creation of Imageset 'TaharezLook' via XML file.
11/12/2005 22:16:09 (InfL2) Finished creation of Imageset 'TaharezLook' via XML file.
11/12/2005 22:16:09 (InfL1) Attempting to create Font from the information specified in file 'tahoma-12.font'.
11/12/2005 22:16:09 (InfL2) Started creation of Font 'Tahoma-12' via XML file.
11/12/2005 22:16:09 (InfL1) Attempting to create Imageset 'Tahoma-12_auto_glyph_images' with texture only.
11/12/2005 22:16:09 (InfL2) Font 'Tahoma-12' now has the following glyphs defined: ' !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~'.
11/12/2005 22:16:09 (InfL2) Finished creation of Font 'Tahoma-12' via XML file.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/AlternateProgressBar' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/Button' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/Checkbox' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/CloseButton' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/Combobox' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/ComboDropList' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/ComboEditbox' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/Editbox' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/FrameWindow' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/LargeVerticalScrollbar' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/LargeVerticalScrollbarThumb' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/Listbox' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/ListHeader' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/ListHeaderSegment' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/HorizontalScrollbar' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/HorizontalScrollbarThumb' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/MultiColumnList' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/MultiLineEditbox' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/ProgressBar' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/RadioButton' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/Slider' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/SliderThumb' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/StaticImage' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/StaticText' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/TabButton' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/TabControl' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/TabPane' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/Titlebar' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/VerticalScrollbar' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/VerticalScrollbarThumb' windows added.
11/12/2005 22:16:09 (InfL1) WindowFactory for 'TaharezLook/VUMeter' windows added.
11/12/2005 22:16:09 (InfL2) ---- Resource loading for GUI scheme 'TaharezLook' completed ----
11/12/2005 22:16:09 (InfL2) ---- Beginning loading of GUI layout from 'ogregui.layout' ----
11/12/2005 22:16:09 (InfL2) Window 'root' of type 'DefaultGUISheet' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/Controls/Editbox' of type 'TaharezLook/Editbox' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/Listbox__auto_vscrollbar____auto_thumb__' of type 'TaharezLook/VerticalScrollbarThumb' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/Listbox__auto_vscrollbar____auto_incbtn__' of type 'TaharezLook/Button' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/Listbox__auto_vscrollbar____auto_decbtn__' of type 'TaharezLook/Button' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/Listbox__auto_vscrollbar__' of type 'TaharezLook/VerticalScrollbar' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/Listbox__auto_hscrollbar____auto_thumb__' of type 'TaharezLook/HorizontalScrollbarThumb' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/Listbox__auto_hscrollbar____auto_incbtn__' of type 'TaharezLook/Button' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/Listbox__auto_hscrollbar____auto_decbtn__' of type 'TaharezLook/Button' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/Listbox__auto_hscrollbar__' of type 'TaharezLook/HorizontalScrollbar' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/Listbox' of type 'TaharezLook/Listbox' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/Controls/ExpandMenu' of type 'TaharezLook/Button' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/Controls/ColourSample' of type 'TaharezLook/StaticImage' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/TextExp__auto_vscrollbar____auto_thumb__' of type 'TaharezLook/VerticalScrollbarThumb' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/TextExp__auto_vscrollbar____auto_incbtn__' of type 'TaharezLook/Button' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/TextExp__auto_vscrollbar____auto_decbtn__' of type 'TaharezLook/Button' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/TextExp__auto_vscrollbar__' of type 'TaharezLook/VerticalScrollbar' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/TextExp__auto_hscrollbar____auto_thumb__' of type 'TaharezLook/HorizontalScrollbarThumb' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/TextExp__auto_hscrollbar____auto_incbtn__' of type 'TaharezLook/Button' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/TextExp__auto_hscrollbar____auto_decbtn__' of type 'TaharezLook/Button' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/TextExp__auto_hscrollbar__' of type 'TaharezLook/HorizontalScrollbar' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/TextExp' of type 'TaharezLook/StaticText' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/TextHp__auto_vscrollbar____auto_thumb__' of type 'TaharezLook/VerticalScrollbarThumb' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/TextHp__auto_vscrollbar____auto_incbtn__' of type 'TaharezLook/Button' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/TextHp__auto_vscrollbar____auto_decbtn__' of type 'TaharezLook/Button' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/TextHp__auto_vscrollbar__' of type 'TaharezLook/VerticalScrollbar' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/TextHp__auto_hscrollbar____auto_thumb__' of type 'TaharezLook/HorizontalScrollbarThumb' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/TextHp__auto_hscrollbar____auto_incbtn__' of type 'TaharezLook/Button' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/TextHp__auto_hscrollbar____auto_decbtn__' of type 'TaharezLook/Button' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/TextHp__auto_hscrollbar__' of type 'TaharezLook/HorizontalScrollbar' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/TextHp' of type 'TaharezLook/StaticText' has been created.
11/12/2005 22:16:09 (InfL2) Window 'Window1/Controls/Map' of type 'TaharezLook/StaticImage' has been created.
11/12/2005 22:16:09 (InfL1) ---- Successfully completed loading of GUI layout from 'ogregui.layout' ----
11/12/2005 22:16:11 (InfL2) ---- Beginning loading of GUI layout from 'ogregui1.layout' ----
11/12/2005 22:16:11 (InfL2) Window 'root1' of type 'DefaultGUISheet' has been created.
11/12/2005 22:16:11 (InfL2) Window 'Window2/Controls/Editbox' of type 'TaharezLook/Editbox' has been created.
11/12/2005 22:16:11 (InfL2) Window 'Window2/Listbox__auto_vscrollbar____auto_thumb__' of type 'TaharezLook/VerticalScrollbarThumb' has been created.
11/12/2005 22:16:11 (InfL2) Window 'Window2/Listbox__auto_vscrollbar____auto_incbtn__' of type 'TaharezLook/Button' has been created.
11/12/2005 22:16:11 (InfL2) Window 'Window2/Listbox__auto_vscrollbar____auto_decbtn__' of type 'TaharezLook/Button' has been created.
11/12/2005 22:16:11 (InfL2) Window 'Window2/Listbox__auto_vscrollbar__' of type 'TaharezLook/VerticalScrollbar' has been created.
11/12/2005 22:16:11 (InfL2) Window 'Window2/Listbox__auto_hscrollbar____auto_thumb__' of type 'TaharezLook/HorizontalScrollbarThumb' has been created.
11/12/2005 22:16:11 (InfL2) Window 'Window2/Listbox__auto_hscrollbar____auto_incbtn__' of type 'TaharezLook/Button' has been created.
11/12/2005 22:16:11 (InfL2) Window 'Window2/Listbox__auto_hscrollbar____auto_decbtn__' of type 'TaharezLook/Button' has been created.
11/12/2005 22:16:11 (InfL2) Window 'Window2/Listbox__auto_hscrollbar__' of type 'TaharezLook/HorizontalScrollbar' has been created.
11/12/2005 22:16:11 (InfL2) Window 'Window2/Listbox' of type 'TaharezLook/Listbox' has been created.
11/12/2005 22:16:11 (InfL1) ---- Successfully completed loading of GUI layout from 'ogregui1.layout' ----
11/12/2005 22:16:14 (InfL2) ---- Beginning loading of GUI layout from 'ogregui1.layout' ----
11/12/2005 22:16:14 (Error) Exception: WindowManager::createWindow - A Window object with the name 'root1' already exists within the system.
11/12/2005 22:16:14 (Error) Exception: GUILayout_xmlHandler::startElement - layout loading has been aborted since Window named 'root1' already exists.
11/12/2005 22:16:14 (Error) WindowManager::loadWindowLayout - loading of layout from file 'ogregui1.layout' failed.



Thank you for your help :D

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Re: Problem with load layout

Postby scriptkid » Mon Dec 12, 2005 07:57

Hi,

This is your error:

Exception: WindowManager::createWindow - A Window object with the name 'root1' already exists within the system.


Third line from the bottom. You are either trying to load your current layout again, or loading a layout with a same root-name. Maybe you did some copy/pasting?

Good luck! :-)

User avatar
lan
Just popping in
Just popping in
Posts: 10
Joined: Tue Oct 18, 2005 15:13

Re: Problem with load layout

Postby lan » Mon Dec 12, 2005 10:21

Thank you for the reply. I found my mistake and its reason. I understand it’s because I press the button twice. There was no response in the first time I press the button (no new layout displayed) so I thought I need to press it again. So I did and found the error message (because the new layout is loaded already).

The problem is the new layout is loaded but why I don’t see it? Are there codes I need to include? Any opinions are welcome.

Thank you.

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Re: Problem with load layout

Postby scriptkid » Mon Dec 12, 2005 13:11

lan wrote:
The problem is the new layout is loaded but why I don’t see it? Are there codes I need to include? Any opinions are welcome.
Thank you.


Hi,

you're almost there then :-)

You have to make it visible by calling "System::setGUISheet" with the pointer to your new layout, like:

CEGUI::System::getSingleton().setGUISheet(CEGUI::WindowManager::getSingleton().loadWindowLayout(
(CEGUI::utf8*)"GuiDemo2.layout" ));

There can only be one sheet/layout visible at once.

Good luck!

User avatar
lan
Just popping in
Just popping in
Posts: 10
Joined: Tue Oct 18, 2005 15:13

Re: Problem with load layout

Postby lan » Mon Dec 12, 2005 16:36

Is it really impossible to display 2 layouts simultaneously? :cry: Couldn't it be done with child windows?
Thank you for your help :)

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: Problem with load layout

Postby lindquist » Mon Dec 12, 2005 18:13

loadWindowLayout just returns a window. Nothing special there.
You can set it as the GUI sheet, or you can add it as a child of your existing GUI sheet (or any other window)


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 10 guests