WindowsLook/MenubarItem

Use this forum for:
- Discussion regarding unofficial CEGUI related tools, scripts and utilities.
- User to user help for the obsoleted CELayoutEditor and CEImagesetEditor tools.

Moderators: CEGUI MVP, CEGUI Team

jcwalker
Just popping in
Just popping in
Posts: 1
Joined: Thu Jun 08, 2006 14:49

WindowsLook/MenubarItem

Postby jcwalker » Thu Jun 08, 2006 16:55

I just started developing with Crazy Eddie's GUI system. I used CELayoutEditor to develop a basic GUI with a frame window, a menu bar, and menu items. I then took the generated XML file and renamed it to a .layout file. When I try loading it into an application, I use the code:

CEGUI::Window* myRoot = CEGUI::WindowManager::getSingleton().loadWindowLayout("testgui.layout");
CEGUI::System::getSingleton().setGUISheet(myRoot);

and when I run the application, I got the following warning:

Warn: 12:39:56:<BuildGUI>CEGUI::GUILayout_xmlHandler::startElement - layout loading has been aborted since no WindowFactory is available for 'WindowsLook/MenubarItem' objects.

and the GUI doesn't show up.

Here is the XML code:

<?xml version="1.0" encoding="UTF-8"?>
<GUILayout>
<Window Type="DefaultWindow" Name="Root" >
<Property Name="UnifiedAreaRect" Value="{{0.000000,0.000000},{0.000000,0.000000},{1.000000,0.000000},{1.000000,0.000000}}" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
<Window Type="WindowsLook/FrameWindow" Name="MainWindow" >
<Property Name="EWSizingCursorImage" Value="set:WindowsLook image:MouseEsWeCursor" />
<Property Name="Font" Value="Commonwealth-10" />
<Property Name="MouseCursorImage" Value="set:WindowsLook image:MouseArrow" />
<Property Name="NESWSizingCursorImage" Value="set:WindowsLook image:MouseNeSwCursor" />
<Property Name="NSSizingCursorImage" Value="set:WindowsLook image:MouseNoSoCursor" />
<Property Name="NWSESizingCursorImage" Value="set:WindowsLook image:MouseNwSeCursor" />
<Property Name="TitlebarEnabled" Value="True" />
<Property Name="TitlebarFont" Value="Commonwealth-10" />
<Property Name="UnifiedAreaRect" Value="{{0.100000,0.000000},{0.100000,0.000000},{0.350000,0.000000},{0.350000,0.000000}}" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
<Window Type="WindowsLook/Menubar" Name="MainWindow_Menubar" >
<Property Name="BackgroundColours" Value="tl:FFDFEFF5 tr:FFDFDFF5 bl:FFF4F3F5 br:FFF4F3F5" />
<Property Name="Font" Value="Commonwealth-10" />
<Property Name="UnifiedAreaRect" Value="{{0.017868,0.000000},{0.206354,0.000000},{0.970063,0.000000},{0.550000,0.000000}}" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
<Window Type="WindowsLook/MenubarItem" Name="MainWindow_MB_File" >
<Property Name="DisabledTextColour" Value="FF7F7F7F" />
<Property Name="Font" Value="Commonwealth-10" />
<Property Name="HoverColour" Value="FFA7C7FF" />
<Property Name="NormalTextColour" Value="FF000000" />
<Property Name="OpenedColour" Value="FFEFEFEF" />
<Property Name="PushedColour" Value="FF87A7DF" />
<Property Name="Text" Value="File" />
<Property Name="TextColour" Value="FF000000" />
<Property Name="TextFormatting" Value="HorzCentred" />
<Property Name="UnifiedAreaRect" Value="{{0.000000,5.000000},{0.000000,0.000000},{0.000000,45.000000},{0.000000,39.000000}}" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
<Property Name="VerticalAlignment" Value="Centre" />
<Property Name="WantsMultiClickEvents" Value="False" />
</Window>
<Window Type="WindowsLook/MenubarItem" Name="MainWindow_MB_Edit" >
<Property Name="DisabledTextColour" Value="FF7F7F7F" />
<Property Name="Font" Value="Commonwealth-10" />
<Property Name="HoverColour" Value="FFA7C7FF" />
<Property Name="NormalTextColour" Value="FF000000" />
<Property Name="OpenedColour" Value="FFEFEFEF" />
<Property Name="PushedColour" Value="FF87A7DF" />
<Property Name="Text" Value="Edit" />
<Property Name="TextColour" Value="FF000000" />
<Property Name="TextFormatting" Value="HorzCentred" />
<Property Name="UnifiedAreaRect" Value="{{0.000000,55.000000},{0.000000,0.000000},{0.000000,97.000000},{0.000000,39.000000}}" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
<Property Name="VerticalAlignment" Value="Centre" />
<Property Name="WantsMultiClickEvents" Value="False" />
</Window>
<Window Type="WindowsLook/MenubarItem" Name="MainWindow_MB_EVERYTHING_ELSE" >
<Property Name="DisabledTextColour" Value="FF7F7F7F" />
<Property Name="Font" Value="Commonwealth-10" />
<Property Name="HoverColour" Value="FFA7C7FF" />
<Property Name="NormalTextColour" Value="FF000000" />
<Property Name="OpenedColour" Value="FFEFEFEF" />
<Property Name="PushedColour" Value="FF87A7DF" />
<Property Name="Text" Value="EVERYTHING ELSE" />
<Property Name="TextColour" Value="FF000000" />
<Property Name="TextFormatting" Value="HorzCentred" />
<Property Name="UnifiedAreaRect" Value="{{0.000000,107.000000},{0.000000,0.000000},{0.000000,269.000000},{0.000000,39.000000}}" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
<Property Name="VerticalAlignment" Value="Centre" />
<Property Name="WantsMultiClickEvents" Value="False" />
</Window>
</Window>
</Window>
</Window>
</GUILayout>

I have successfully run CEGUI examples before, one of which loads a .layout file in the same manner that I did above.

Any ideas on what I may be doing wrong?

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:

Postby scriptkid » Thu Jun 08, 2006 20:42

Hello jcwalker,

thanks for choosing CEGUI :-)

I assume you are using the 0.4 version of the editor? The editor uses schemes which are empty, meaning that all default factories get loaded.

Without Falagard (not sure if you have already read about that) you can use the menu items, but you must modify your .scheme file, since those widgets are not loaded by default.

I'm curious in which sample you can see it, are you using some new code from SVN maybe?

Anyways, in order to use them, you can update the datafiles/schemes/windowslook.scheme file so that it looks like this (note the Menubar, MenubarItem and PopupMenu):

<?xml version="1.0" ?>
<GUIScheme Name="WindowsLook">
<Imageset Name="WindowsLook" Filename="../datafiles/imagesets/WindowsLook.imageset" />
<WindowSet Filename="CEGUIWindowsLook">
<WindowFactory Name="WindowsLook/Button" />
<WindowFactory Name="WindowsLook/Checkbox" />
<WindowFactory Name="WindowsLook/CloseButton" />
<WindowFactory Name="WindowsLook/Combobox" />
<WindowFactory Name="WindowsLook/ComboDropList" />
<WindowFactory Name="WindowsLook/Editbox" />
<WindowFactory Name="WindowsLook/FrameWindow" />
<WindowFactory Name="WindowsLook/HorizontalScrollbar" />
<WindowFactory Name="WindowsLook/HorizontalScrollbarThumb" />
<WindowFactory Name="WindowsLook/Listbox" />
<WindowFactory Name="WindowsLook/ListHeader" />
<WindowFactory Name="WindowsLook/ListHeaderSegment" />
<WindowFactory Name="WindowsLook/Menubar" />
<WindowFactory Name="WindowsLook/PopupMenu" />
<WindowFactory Name="WindowsLook/MenubarItem" />
<WindowFactory Name="WindowsLook/MultiColumnList" />
<WindowFactory Name="WindowsLook/MultiLineEditbox" />
<WindowFactory Name="WindowsLook/ProgressBar" />
<WindowFactory Name="WindowsLook/RadioButton" />
<WindowFactory Name="WindowsLook/Slider" />
<WindowFactory Name="WindowsLook/SliderThumb" />
<WindowFactory Name="WindowsLook/StaticImage" />
<WindowFactory Name="WindowsLook/StaticText" />
<WindowFactory Name="WindowsLook/TabButton" />
<WindowFactory Name="WindowsLook/TabControl" />
<WindowFactory Name="WindowsLook/TabPane" />
<WindowFactory Name="WindowsLook/Titlebar" />
<WindowFactory Name="WindowsLook/VerticalScrollbar" />
<WindowFactory Name="WindowsLook/VerticalScrollbarThumb" />
</WindowSet>
</GUIScheme>

(Of course, the same goes for the TaharezLook.) Now you can edit and view menu bars. Editing will be slightly less advanced, because the menubar does it's own aligning. But it won't crash when loading :-)

Within a few weeks we will release 0.5, which will make your live a bit easier on this side ;-)

Good luck!


Return to “Unofficial CEGUI-Related Tools”

Who is online

Users browsing this forum: No registered users and 1 guest