I've created a pure windows look .layout file, however when i load it with
LOGIN_ROOT = WindowManager::getSingleton().loadWindowLayout("main.layout");
the logfile says that:
[source]
19/01/2007 17:14:43 (InfL1) Creating falagard mapping for type 'WindowsLook/ListboxItem' using base type 'CEGUI/ItemEntry', window renderer 'Falagard/ItemEntry' and Look'N'Feel 'WindowsLook/ListboxItem'.
19/01/2007 17:14:43 (Error) Exception: WindowFactoryManager::getFactory - A WindowFactory object, an alias, or mapping for 'WindowsLook/SystemButton' Window objects is not registered with the system.
19/01/2007 17:14:43 (Error) Exception: GUILayout_xmlHandler::startElement - layout loading has been aborted since no WindowFactory is available for 'WindowsLook/FrameWindow' objects.
19/01/2007 17:14:43 (Error) WindowManager::loadWindowLayout - loading of layout from file 'main.layout' failed.
[/source]
Here is my setup code:
[source]
rp->setResourceGroupDirectory("schemes", "./datafiles/schemes/");
rp->setResourceGroupDirectory("imagesets", "./datafiles/imagesets/");
rp->setResourceGroupDirectory("fonts", "./datafiles/fonts/");
rp->setResourceGroupDirectory("layouts", "./datafiles/layouts/");
rp->setResourceGroupDirectory("looknfeels", "./datafiles/looknfeel/");
rp->setResourceGroupDirectory("lua_scripts", "./datafiles/lua_scripts/");
// set the default resource groups to be used
Imageset::setDefaultResourceGroup("imagesets");
Font::setDefaultResourceGroup("fonts");
Scheme::setDefaultResourceGroup("schemes");
WidgetLookManager::setDefaultResourceGroup("looknfeels");
WindowManager::setDefaultResourceGroup("layouts");
ScriptModule::setDefaultResourceGroup("lua_scripts");
Imageset* WindowsImages = ImagesetManager::getSingleton().createImageset("WindowsLook.imageset");
System::getSingleton().setDefaultMouseCursor(&WindowsImages->getImage("MouseArrow"));
FontManager::getSingleton().createFont("DejaVuSans-10.font");
FontManager::getSingleton().createFont("Commonwealth-10.font");
WidgetLookManager::getSingleton().parseLookNFeelSpecification("WindowsLook.looknfeel");
SchemeManager::getSingleton().loadScheme("WindowsLookWidgets.scheme");
LOGIN_ROOT = WindowManager::getSingleton().loadWindowLayout("main.layout");
System::getSingleton().setGUISheet(LOGIN_ROOT);
[/source]
This is actually just Tahrez loading code from the tutorial converted to point to windows look files instead.
Thanks for reading.
problems loading windows look
Moderators: CEGUI MVP, CEGUI Team
After the rp->setResourceGroupDirectory() and the xxx::::setDefaultResourceGroup() calls I do:
Those are slightly different steps but theoretically you should be able to substitute the Taharez references for Windows ones.
Which tutorial are you referring to?
Note. My .layout files do not possess a root, which explains why I create one manually; I like to create one FrameWindow per .layout, as I usually need multiple data entry forms.
Code: Select all
WindowManager& winMgr = WindowManager::getSingleton();
SchemeManager::getSingleton().loadScheme("TaharezLook.scheme");
System::getSingleton().setDefaultMouseCursor("TaharezLook", "MouseArrow");
FontManager::getSingleton().createFont("Commonwealth-10.font");
Window* sheet = winMgr.createWindow("DefaultWindow", "root_wnd");
System::getSingleton().setGUISheet(sheet);
Window* guiLayout = winMgr.loadWindowLayout("DialogConfigurations.layout");
sheet->addChildWindow(guiLayout);
Those are slightly different steps but theoretically you should be able to substitute the Taharez references for Windows ones.
Which tutorial are you referring to?
Note. My .layout files do not possess a root, which explains why I create one manually; I like to create one FrameWindow per .layout, as I usually need multiple data entry forms.
Thanks Rackle, I was refering to the sample code when I said tutorial. I changed my code to be similar to the code you posted and it worked. I'm not sure why, but since I'll only need to do this once, I'm happy with it . Here is what I've used to load the windows theme (for anybody who needs to know later on)
DefaultResourceProvider* rp = static_cast<CEGUI::DefaultResourceProvider*>
(CEGUI::System::getSingleton().getResourceProvider());
rp->setResourceGroupDirectory("schemes", "./datafiles/schemes/");
rp->setResourceGroupDirectory("imagesets", "./datafiles/imagesets/");
rp->setResourceGroupDirectory("fonts", "./datafiles/fonts/");
rp->setResourceGroupDirectory("layouts", "./datafiles/layouts/");
rp->setResourceGroupDirectory("looknfeels", "./datafiles/looknfeel/");
rp->setResourceGroupDirectory("lua_scripts", "./datafiles/lua_scripts/");
// set the default resource groups to be used
Imageset::setDefaultResourceGroup("imagesets");
Font::setDefaultResourceGroup("fonts");
Scheme::setDefaultResourceGroup("schemes");
WidgetLookManager::setDefaultResourceGroup("looknfeels");
WindowManager::setDefaultResourceGroup("layouts");
ScriptModule::setDefaultResourceGroup("lua_scripts");
SchemeManager::getSingleton().loadScheme("WindowsLook.scheme");
System::getSingleton().setDefaultMouseCursor("WindowsLook", "MouseArrow");
FontManager::getSingleton().createFont("DejaVuSans-10.font");
LOGIN_ROOT = WindowManager::getSingleton().loadWindowLayout("main.layout");
System::getSingleton().setGUISheet(LOGIN_ROOT);
DefaultResourceProvider* rp = static_cast<CEGUI::DefaultResourceProvider*>
(CEGUI::System::getSingleton().getResourceProvider());
rp->setResourceGroupDirectory("schemes", "./datafiles/schemes/");
rp->setResourceGroupDirectory("imagesets", "./datafiles/imagesets/");
rp->setResourceGroupDirectory("fonts", "./datafiles/fonts/");
rp->setResourceGroupDirectory("layouts", "./datafiles/layouts/");
rp->setResourceGroupDirectory("looknfeels", "./datafiles/looknfeel/");
rp->setResourceGroupDirectory("lua_scripts", "./datafiles/lua_scripts/");
// set the default resource groups to be used
Imageset::setDefaultResourceGroup("imagesets");
Font::setDefaultResourceGroup("fonts");
Scheme::setDefaultResourceGroup("schemes");
WidgetLookManager::setDefaultResourceGroup("looknfeels");
WindowManager::setDefaultResourceGroup("layouts");
ScriptModule::setDefaultResourceGroup("lua_scripts");
SchemeManager::getSingleton().loadScheme("WindowsLook.scheme");
System::getSingleton().setDefaultMouseCursor("WindowsLook", "MouseArrow");
FontManager::getSingleton().createFont("DejaVuSans-10.font");
LOGIN_ROOT = WindowManager::getSingleton().loadWindowLayout("main.layout");
System::getSingleton().setGUISheet(LOGIN_ROOT);
Who is online
Users browsing this forum: No registered users and 15 guests