Page 1 of 1

Invalid Request Exception

Posted: Thu Nov 27, 2008 22:43
by geru
Hi,

I have reestructured my cegui implementation. I made that the class cegui is father of Class widget, and the constructor of Cegui is:

Code: Select all

Cegui::Cegui(Ogre::SceneManager *manager) {
  Ogre::RenderWindow *window = Ogre::Root::getSingleton().getAutoCreatedWindow();
  renderer = new CEGUI::OgreCEGUIRenderer(window, Ogre::RENDER_QUEUE_OVERLAY, false, 0, manager);
  system = new CEGUI::System(renderer);
  wmanager = CEGUI::WindowManager::getSingletonPtr();
}


The widget class inherits of this, and create one menu so that:

Code: Select all

Widget::Widget(Ogre::SceneManager *manager, widgetType type) : Cegui(manager) {
  if (type == MAIN_MENU) {
    mainMenu();
  } else if (type == SINGLETON_BUTTON) {
    drawButton();
  }
}

void Widget::mainMenu() {
     CEGUI::Window *menu = wmanager->loadWindowLayout((CEGUI::utf8*)"shadows.layout");
     system->setGUISheet(menu);
}


But, I receive this error:

Code: Select all

terminate called after throwing an instance of 'CEGUI::InvalidRequestException'
Aborted


And in cegui.log:

Code: Select all

27/11/2008 23:36:18 (Error)   Exception: WindowFactoryManager::getFactory - A WindowFactory object, an alias, or mapping for 'TaharezLook/FrameWindow' Window objects is not registered with the system.
27/11/2008 23:36:18 (Error)   Exception: GUILayout_xmlHandler::startElement - layout loading has been aborted since no WindowFactory is available for 'TaharezLook/FrameWindow' objects.
27/11/2008 23:36:18 (Error)   XercesParser::parseXMLFile - An unexpected error occurred while parsing XML file 'shadows.layout'.
27/11/2008 23:36:18 (Error)   WindowManager::loadWindowLayout - loading of layout from file 'shadows.layout' failed.


I don`t know what to do. Somebody can help me, please?

Thanks :-)

Posted: Fri Nov 28, 2008 09:48
by CrazyEddie
Hi,

It seems you're not loading the scheme file that creates the mappings for the widget types you're trying to use in the layout.

You need a line such as:

Code: Select all

CEGUI::SchemeManager::getSingleton().loadScheme( "TaharezLook.scheme" );

or similar (this would likely go in the Cegui class constructor with the rest of the initialisation code. You may also consider setting default mouse cursor image, fonts, and tooltips in there.

refer to: The Beginner Guide to Loading Data Files and Initialisation for more info.

CE.

Posted: Fri Nov 28, 2008 10:21
by geru
Ouch! :-S

Thanks you very much again CE. :-)