2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2002-09-26 11:44:02 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2014-02-18 01:34:20 +00:00
|
|
|
*
|
2002-09-26 11:44:02 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MESSAGE_DIALOG_H
|
|
|
|
#define MESSAGE_DIALOG_H
|
|
|
|
|
2003-11-01 20:52:41 +00:00
|
|
|
#include "gui/dialog.h"
|
2004-02-05 00:19:57 +00:00
|
|
|
#include "common/str.h"
|
2002-09-26 11:44:02 +00:00
|
|
|
|
2003-11-10 23:40:48 +00:00
|
|
|
namespace GUI {
|
|
|
|
|
2011-04-24 08:34:27 +00:00
|
|
|
class CommandSender;
|
|
|
|
|
2004-08-11 21:49:58 +00:00
|
|
|
enum {
|
|
|
|
kMessageOK = 1,
|
|
|
|
kMessageCancel = 0
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2003-11-01 22:20:14 +00:00
|
|
|
/**
|
|
|
|
* Simple message dialog ("alert box"): presents a text message in a dialog with up to two buttons.
|
|
|
|
*/
|
2002-09-26 11:44:02 +00:00
|
|
|
class MessageDialog : public Dialog {
|
|
|
|
public:
|
GUI: U32: Downscale changes of U32, fix review issues
This commit addresses a range of changes, within scummvm subproject.
- Audio files, like mididrv, remove U32String based name and identifier, because ASCII only.
- mididrv.cpp had some wrong format for warning messages, fix those
- Message dialogs were modified to use default arguments more often, but reverting back to the orignal to minimize changes.
- SetTooltip has a fake constructor that takes in a string, and use it.
- U32Format had some break statements missing, add those.
- RemapWidget: Use fake constructor for setLabel and setTooltip, to make minimal changes
- SDL: setting text in clipboard no longer uses SDL_iconv_string
- TTS: Override base class "say" with strings, so tts->say can be used with normal strings too.
- About dialog: fix incorrect code for u32string variables
- Fix some extra brackets
- Some buttons were incorrectly removed from using translated labels, revert those
- Message Dialog: Pass default and alt buttons as const references
- Saveload Dialog: Use translations in missing places, use const-references. Also, use translations in a correct manner.
- Use const references for tooltip in GraphicsWidget, EditTextWidget, error.cpp
- DomainEditTextWidget: Use U32String for text
2020-07-20 12:36:37 +00:00
|
|
|
MessageDialog(const Common::U32String &message, const Common::U32String &defaultButton = Common::U32String("OK"), const Common::U32String &altButton = Common::U32String(""), Graphics::TextAlign alignment = Graphics::kTextAlignCenter, const char *url = nullptr);
|
2020-08-21 08:20:43 +00:00
|
|
|
MessageDialog(const Common::String &message, const Common::String &defaultButton = "OK", const Common::String &altButton = "", Graphics::TextAlign alignment = Graphics::kTextAlignCenter, const char *url = nullptr);
|
2003-11-01 20:52:41 +00:00
|
|
|
|
2020-01-05 16:48:04 +00:00
|
|
|
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
|
2020-08-26 15:26:50 +00:00
|
|
|
private:
|
|
|
|
const char *_url;
|
2020-08-29 06:56:13 +00:00
|
|
|
void init(const Common::U32String &message, const Common::U32String &defaultButton, const Common::U32String &altButton, Graphics::TextAlign alignment, const char *url);
|
2003-11-01 20:52:41 +00:00
|
|
|
};
|
|
|
|
|
2003-11-01 22:20:14 +00:00
|
|
|
/**
|
|
|
|
* Timed message dialog: displays a message to the user for brief time period.
|
|
|
|
*/
|
2003-11-01 20:52:41 +00:00
|
|
|
class TimedMessageDialog : public MessageDialog {
|
|
|
|
public:
|
2020-06-13 16:42:25 +00:00
|
|
|
TimedMessageDialog(const Common::U32String &message, uint32 duration);
|
2003-11-01 20:52:41 +00:00
|
|
|
|
2020-01-05 16:48:04 +00:00
|
|
|
void handleTickle() override;
|
2002-12-21 11:57:24 +00:00
|
|
|
|
2003-11-01 20:52:41 +00:00
|
|
|
protected:
|
|
|
|
uint32 _timer;
|
2002-09-26 11:44:02 +00:00
|
|
|
};
|
|
|
|
|
2020-08-26 15:26:50 +00:00
|
|
|
/**
|
|
|
|
* Message dialog with button to open a specified URL
|
|
|
|
*/
|
|
|
|
class MessageDialogWithURL : public MessageDialog {
|
|
|
|
public:
|
|
|
|
MessageDialogWithURL(const Common::String &message, const char *url, const char *defaultButton = "OK", Graphics::TextAlign alignment = Graphics::kTextAlignCenter);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
2003-11-10 23:40:48 +00:00
|
|
|
} // End of namespace GUI
|
2003-11-01 20:52:41 +00:00
|
|
|
|
2002-09-26 11:44:02 +00:00
|
|
|
#endif
|