aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorMax Horn2007-06-02 12:01:09 +0000
committerMax Horn2007-06-02 12:01:09 +0000
commitf85871b1fc9540c77b43d8ed200059e7d31948be (patch)
tree4d6dd5d68422dbcbb4af5595468d69e6229b756d /engines/scumm
parent8ca6751b2181fbc24a7fe0e56086d80c0700b638 (diff)
downloadscummvm-rg350-f85871b1fc9540c77b43d8ed200059e7d31948be.tar.gz
scummvm-rg350-f85871b1fc9540c77b43d8ed200059e7d31948be.tar.bz2
scummvm-rg350-f85871b1fc9540c77b43d8ed200059e7d31948be.zip
Make InfoDialog::setInfoText a bit more useful, by making it public & reusable
svn-id: r27050
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/dialogs.cpp15
-rw-r--r--engines/scumm/dialogs.h3
2 files changed, 13 insertions, 5 deletions
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index 15c22c2bed..7541edd0b4 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -749,21 +749,28 @@ void HelpDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
InfoDialog::InfoDialog(ScummEngine *scumm, int res)
: ScummDialog("scummDummyDialog"), _vm(scumm) { // dummy x and w
- setInfoText(queryResString(res));
+
+ _message = queryResString(res);
+
+ // Width and height are dummy
+ _text = new StaticTextWidget(this, 4, 4, 10, 10, _message, kTextAlignCenter);
}
InfoDialog::InfoDialog(ScummEngine *scumm, const String& message)
: ScummDialog("scummDummyDialog"), _vm(scumm) { // dummy x and w
- setInfoText(message);
-}
-void InfoDialog::setInfoText(const String& message) {
_message = message;
// Width and height are dummy
_text = new StaticTextWidget(this, 4, 4, 10, 10, _message, kTextAlignCenter);
}
+void InfoDialog::setInfoText(const String& message) {
+ _message = message;
+ _text->setLabel(_message);
+ //reflowLayout(); // FIXME: Should we call this here? Depends on the usage patterns, I guess...
+}
+
void InfoDialog::reflowLayout() {
const int screenW = g_system->getOverlayWidth();
const int screenH = g_system->getOverlayHeight();
diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h
index d3ee9dbc18..73c02ea32f 100644
--- a/engines/scumm/dialogs.h
+++ b/engines/scumm/dialogs.h
@@ -165,6 +165,8 @@ public:
// from resources
InfoDialog(ScummEngine *scumm, int res);
+ void setInfoText(const String& message);
+
virtual void handleMouseDown(int x, int y, int button, int clickCount) {
setResult(0);
close();
@@ -177,7 +179,6 @@ public:
virtual void reflowLayout();
protected:
- void setInfoText (const String& message);
// Query a string from the resources
const String queryResString(int stringno);