now, realy deleted needless code.

pull/21/head
Sebastian Wick 14 years ago
parent 84c19a90ad
commit 56dc9ffcf3

@ -1,11 +1,12 @@
#include "messagebox.hpp"
//#include "window_manager.hpp"
using namespace MWGui;
void MessageBoxManager::createMessageBox (const std::string& message)
{
std::cout << "create non-interactive message box" << std::endl;
MessageBox *box = new MessageBox(*this, message);
mMessageBoxes.push_back(box);
}
void MessageBoxManager::createInteractiveMessageBox (const std::string& message, const std::vector<std::string>& buttons)
@ -13,3 +14,10 @@ void MessageBoxManager::createInteractiveMessageBox (const std::string& message,
std::cout << "create interactive message box" << std::endl;
std::copy (buttons.begin(), buttons.end(), std::ostream_iterator<std::string> (std::cout, ", "));
}
MessageBox::MessageBox(MessageBoxManager& parMessageBoxManager, const std::string& message)
: Layout("openmw_messagebox_layout.xml")
, mMessageBoxManager(parMessageBoxManager)
{
setText("message", message);
}

@ -1,25 +1,35 @@
#ifndef MWGUI_MESSAGE_BOX_H
#define MWGUI_MESSAGE_BOX_H
#include "window_base.hpp"
#include <openengine/gui/layout.hpp>
#include <MyGUI.h>
namespace MWGui
{
class WindowManager;
}
#include "window_base.hpp"
namespace MWGui
{
using namespace MyGUI;
class WindowManager;
class MessageBoxManager;
class MessageBox;
class MessageBoxManager
{
private:
std::vector<MessageBox*> mMessageBoxes;
public:
void createMessageBox (const std::string& message);
void createInteractiveMessageBox (const std::string& message, const std::vector<std::string>& buttons);
};
class MessageBox : public OEngine::GUI::Layout
{
public:
MessageBox(MessageBoxManager& parMessageBoxManager, const std::string& message);
void setMessage(const std::string& message);
protected:
MessageBoxManager& mMessageBoxManager;
};
}
#endif

@ -8,6 +8,7 @@
#include "dialogue.hpp"
#include "dialogue_history.hpp"
#include "stats_window.hpp"
#include "messagebox.hpp"
#include "../mwmechanics/mechanicsmanager.hpp"
#include "../mwinput/inputmanager.hpp"
@ -60,6 +61,7 @@ WindowManager::WindowManager(MyGUI::Gui *_gui, MWWorld::Environment& environment
inventory = new InventoryWindow ();
#endif
console = new Console(w,h, environment, extensions);
mMessageBoxManager = new MessageBoxManager();
// The HUD is always on
hud->setVisible(true);
@ -82,6 +84,7 @@ WindowManager::WindowManager(MyGUI::Gui *_gui, MWWorld::Environment& environment
WindowManager::~WindowManager()
{
delete console;
delete mMessageBoxManager;
delete hud;
delete map;
delete menu;
@ -446,13 +449,21 @@ void WindowManager::removeDialog(OEngine::GUI::Layout*dialog)
void WindowManager::messageBox (const std::string& message, const std::vector<std::string>& buttons)
{
std::cout << "message box: " << message << std::endl;
/*std::cout << "message box: " << message << std::endl;
if (!buttons.empty())
{
std::cout << "buttons: ";
std::copy (buttons.begin(), buttons.end(), std::ostream_iterator<std::string> (std::cout, ", "));
std::cout << std::endl;
}*/
if (buttons.empty())
{
mMessageBoxManager->createMessageBox(message);
}
else
{
mMessageBoxManager->createInteractiveMessageBox(message, buttons);
}
}

@ -62,6 +62,7 @@ namespace MWGui
class CreateClassDialog;
class BirthDialog;
class ReviewDialog;
class MessageBoxManager;
struct ClassPoint
{
@ -84,6 +85,7 @@ namespace MWGui
MapWindow *map;
MainMenu *menu;
StatsWindow *stats;
MessageBoxManager *mMessageBoxManager;
#if 0
InventoryWindow *inventory;
#endif
@ -245,7 +247,7 @@ namespace MWGui
void removeDialog(OEngine::GUI::Layout* dialog);
///< Hides dialog and schedules dialog to be deleted.
void messageBox (const std::string& message, const std::vector<std::string>& buttons);
/**

Loading…
Cancel
Save