ok SO.
Negative. :[
This is what I did:
- got MSVC9.0 (2008) express
- got 0.4.1 for MSVC8.0 (2005) (there was no 2008)
- linked it all up
- got my program running (with the exception of the CEGUI interface code, which I have to comment out. more on this below..)
First problem:
Is there different syntax or something for creating a CEGUI menu in 2008? Because the syntax that works for me in MSVC6.0 doesn't work at all here.
the ->addChildWindow methods for menu items and tabcontrol stuff are causing errors.
like randomly half of my menu commands won't work.. the other half will. but that's not as important to me right now. Because the 2nd question...
Second problem:
If I just attach a pushbutton to the menubar (or root), it will run. however, subscribing an event to it crashes. However, this could be from the First Problem. Since like half the menu commands are crashing.
Also, the second reason I got 2008... I built these demo apps.
I got all of them to build (after a lot of work @_@) without problems.
Is there something more to be done with them? Anything that I can do with these to give you more information on what's going on?
ok, now here's my current interface code... take a look. This syntax works perfectly for me on MSVC6.0, but not at all on MSVC9.0. Not only that, I can't get it to work on MSVC9.0 for the life of me... I've tried changing a bunch of it, and none of it worked.
It crashes when I try to attach File (a MenuItem) to the Menubar window.
I can attach a pushbutton to the Menubar window. Stuff like that... certain things will attach, others won't, and none of the crashes that end on a ->addChildWindow leave anything in my CEGUI log.
Code: Select all
WindowManager& wmgr = WindowManager::getSingleton(); // Init pointer to Window Manager
Window* Root = wmgr.createWindow("DefaultWindow", "root"); // Create root window
System::getSingleton().setGUISheet(Root); // Set root window
Window* Menubar = wmgr.createWindow("WindowsLook/Menubar", "root/menubar");
Root->addChildWindow(Menubar);
Menubar->setSize(Size(1.0f, 0.06f));
MenuItem* File = static_cast<MenuItem*>(wmgr.createWindow("WindowsLook/MenubarItem", "root/menubar/file"));
File->setText("File");
Menubar->addChildWindow(File);
PopupMenu* FilePopup = static_cast<PopupMenu*>(wmgr.createWindow("WindowsLook/PopupMenu", "root/menubar/file/popup"));
File->addChildWindow(FilePopup);
FilePopup->setSize(Size(2.5f, 5.5f));
Window* FileNew = wmgr.createWindow("WindowsLook/MenubarItem", "root/menubar/file/popup/new");
FilePopup->addChildWindow(FileNew);
FileNew->setSize(Size(0.2f, 0.05f));
FileNew->setText("New");
Window* FileOpen = wmgr.createWindow("WindowsLook/MenubarItem", "root/menubar/file/popup/open");
FilePopup->addChildWindow(FileOpen);
FileOpen->setSize(Size(0.2f, 0.05f));
FileOpen->setText("Open");
Window* FileSave = wmgr.createWindow("WindowsLook/MenubarItem", "root/menubar/file/popup/save");
FilePopup->addChildWindow(FileSave);
FileSave->setSize(Size(0.2f, 0.05f));
FileSave->setText("Save");
Window* FileExit = wmgr.createWindow("WindowsLook/MenubarItem", "root/menubar/file/popup/exit");
FilePopup->addChildWindow(FileExit);
FileExit->setSize(Size(0.2f, 0.05f));
FileExit->setText("Exit");
Window* View = wmgr.createWindow("WindowsLook/MenubarItem", "root/menubar/view");
Menubar->addChildWindow(View);
View->setText("View");
PopupMenu* ViewPopup = static_cast<PopupMenu*>(wmgr.createWindow("WindowsLook/PopupMenu", "root/menubar/view/popup"));
View->addChildWindow(ViewPopup);
ViewPopup->setSize(Size(2.5f, 5.5f));
Window* ViewFullscreen = wmgr.createWindow("WindowsLook/MenubarItem", "root/menubar/view/popup/fullscreen");
ViewPopup->addChildWindow(ViewFullscreen);
ViewFullscreen->setText("Toggle Fullscreen");
//ViewFullscreen->subscribeEvent(MenuItem::EventClicked, Event::Subscriber(&Interface::EventFunctions::ViewFullscreen, &this->EventHandler));
TabControl* Tabs = static_cast<TabControl*>(wmgr.createWindow("WindowsLook/TabControl", "root/tabs"));
Root->addChildWindow(Tabs);
Tabs->setSize(Size(0.2f, 0.94f));
Tabs->setPosition(Vector2(0.8f,0.06f));
Window* TabTiles = wmgr.createWindow("DefaultWindow", "root/tabs/tiles");
TabTiles->setText("Tiles");
Tabs->addChildWindow(TabTiles);
Window* TabObjects = wmgr.createWindow("DefaultWindow", "root/tabs/objects");
TabObjects->setText("Objects");
TabControl* ObjectsTabs = static_cast<TabControl*>(wmgr.createWindow("WindowsLook/TabControl","root/tabs/objectstabs"));
TabObjects->addChildWindow(ObjectsTabs);
ObjectsTabs->setSize(Size(1.0f,1.0f));
ObjectsTabs->setPosition(Vector2(0,0));
Window* ObjectsTabStatics = wmgr.createWindow("DefaultWindow", "root/tabs/objects/statics");
ObjectsTabStatics->setText("Statics");
ObjectsTabs->addChildWindow(ObjectsTabStatics);
Window* ObjectsTabDynamics = wmgr.createWindow("DefaultWindow", "root/tabs/objects/dynamics");
ObjectsTabDynamics->setText("Dynamics");
ObjectsTabs->addChildWindow(ObjectsTabDynamics);
Tabs->addChildWindow(TabObjects);
Window* TabBeings = wmgr.createWindow("DefaultWindow", "root/tabs/beings");
TabBeings->setText("Beings");
TabControl* BeingsTabs = static_cast<TabControl*>(wmgr.createWindow("WindowsLook/TabControl","root/tabs/beingstabs"));
TabBeings->addChildWindow(BeingsTabs);
BeingsTabs->setSize(Size(1.0f,1.0f));
BeingsTabs->setPosition(Vector2(0,0));
Window* BeingsTabEnemies = wmgr.createWindow("DefaultWindow", "root/tabs/beings/enemies");
BeingsTabEnemies->setText("Enemies");
BeingsTabs->addChildWindow(BeingsTabEnemies);
Window* BeingsTabNPCs = wmgr.createWindow("DefaultWindow", "root/tabs/beings/npcs");
BeingsTabNPCs->setText("NPCs");
BeingsTabs->addChildWindow(BeingsTabNPCs);
Tabs->addChildWindow(TabBeings);
OK sorry for the INCREDIBLY long message... if you read all that, you are a god. O__o