Add MessageBox class to GUI namespace, since it conflicts with Windows messagebox.

Eventually, this will have to be done for all GUI elements.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2601 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2013-02-10 22:26:06 +00:00
parent fb56105a85
commit ec77f9d1b5
9 changed files with 24 additions and 15 deletions

View File

@ -157,9 +157,9 @@ void DebuggerDialog::showFatalMessage(const string& msg)
delete myFatalError;
myFatalError =
new MessageBox(this, instance().consoleFont(), msg,
r.width(), r.height(), kDDExitFatalCmd,
"Exit ROM", "Continue");
new GUI::MessageBox(this, instance().consoleFont(), msg,
r.width(), r.height(), kDDExitFatalCmd,
"Exit ROM", "Continue");
myFatalError->show();
}

View File

@ -36,9 +36,9 @@ class EditTextWidget;
class TiaInfoWidget;
class TiaOutputWidget;
class TiaZoomWidget;
class MessageBox;
#include "Dialog.hxx"
#include "MessageBox.hxx"
class DebuggerDialog : public Dialog
{
@ -83,7 +83,7 @@ class DebuggerDialog : public Dialog
RomWidget* myRom;
EditTextWidget* myMessageBox;
ButtonWidget* myRewindButton;
MessageBox* myFatalError;
GUI::MessageBox* myFatalError;
private:
void addTiaArea();

View File

@ -251,8 +251,8 @@ void LauncherDialog::loadConfig()
msg.push_back("");
msg.push_back("Click 'OK' to select a default ROM directory,");
msg.push_back("or 'Cancel' to browse the filesystem manually.");
myFirstRunMsg = new MessageBox(this, instance().font(), msg,
_w, _h, kFirstRunMsgChosenCmd);
myFirstRunMsg = new GUI::MessageBox(this, instance().font(), msg,
_w, _h, kFirstRunMsgChosenCmd);
}
myFirstRunMsg->show();
}

View File

@ -34,7 +34,6 @@ class BrowserDialog;
class OptionsDialog;
class GlobalPropsDialog;
class LauncherFilterDialog;
class MessageBox;
class OSystem;
class Properties;
class EditTextWidget;
@ -46,6 +45,7 @@ class StringListWidget;
#include "FSNode.hxx"
#include "StringList.hxx"
#include "Stack.hxx"
#include "MessageBox.hxx"
// These must be accessible from dialogs created by this class
enum {
@ -118,8 +118,8 @@ class LauncherDialog : public Dialog
GlobalPropsDialog* myGlobalProps;
LauncherFilterDialog* myFilters;
MessageBox* myFirstRunMsg;
BrowserDialog* myRomDir;
GUI::MessageBox* myFirstRunMsg;
BrowserDialog* myRomDir;
int mySelectedItem;
int myRomInfoSize;

View File

@ -25,6 +25,8 @@
#include "MessageBox.hxx"
namespace GUI {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MessageBox::MessageBox(GuiObject* boss, const GUI::Font& font,
const StringList& text, int max_w, int max_h, int cmd,
@ -107,3 +109,5 @@ void MessageBox::handleCommand(CommandSender* sender, int cmd, int data, int id)
break;
}
}
} // namespace GUI

View File

@ -27,6 +27,8 @@ class StaticTextWidget;
#include "Command.hxx"
#include "DialogContainer.hxx"
namespace GUI {
/**
* Show a simple message box containing the given text, with buttons
* prompting the user to accept or reject. If the user selects 'OK',
@ -54,4 +56,6 @@ class MessageBox : public Dialog, public CommandSender
int myCmd;
};
} // namespace GUI
#endif

View File

@ -166,6 +166,6 @@ struct Rect
}
};
} // End of namespace Common
} // End of namespace GUI
#endif

View File

@ -190,8 +190,9 @@ void RomAuditDialog::handleCommand(CommandSender* sender, int cmd,
msg.push_back("If you're sure you want to proceed with the");
msg.push_back("audit, click 'OK', otherwise click 'Cancel'.");
myConfirmMsg =
new MessageBox(this, instance().font(), msg, myMaxWidth, myMaxHeight,
kConfirmAuditCmd);
new GUI::MessageBox(this, instance().font(), msg,
myMaxWidth, myMaxHeight,
kConfirmAuditCmd);
}
myConfirmMsg->show();
break;

View File

@ -29,11 +29,11 @@ class DialogContainer;
class BrowserDialog;
class EditTextWidget;
class StaticTextWidget;
class MessageBox;
#include "Dialog.hxx"
#include "Command.hxx"
#include "FSNode.hxx"
#include "MessageBox.hxx"
class RomAuditDialog : public Dialog
{
@ -68,7 +68,7 @@ class RomAuditDialog : public Dialog
BrowserDialog* myBrowser;
// Show a message about the dangers of using this function
MessageBox* myConfirmMsg;
GUI::MessageBox* myConfirmMsg;
// Maximum width and height for this dialog
int myMaxWidth, myMaxHeight;