tbx
0.7.6
|
Class to show a message in a window in the centre of the screen, resizing the window to fit the message if necessary. More...
#include <messagewindow.h>
Public Member Functions | |
MessageWindow (const std::string &msg) | |
Construct a message window with the give message. More... | |
void | sprite (const std::string &sprite_name) |
Set the name of the sprite to show in the message box. More... | |
![]() | |
TextDisplayWindow (const std::string &text, const char *buttons, int default_button=-1, int cancel_button=-1, int button_width=200) | |
Construct a text display window with the given text and buttons. More... | |
virtual | ~TextDisplayWindow () |
Destructor, delete close command if necessary. | |
void | title (const std::string &title) |
Set the title for the text display window. More... | |
tbx::Window | window () |
Get underlying window used for the message window. | |
void | delete_on_hide () |
Set up text display window to delete itself when it is hidden. More... | |
void | close_command (tbx::Command *close_command, bool delete_command=false) |
Set command to be run when message window is closed. More... | |
void | show () |
Show the text display window. More... | |
void | show_as_menu () |
Show the text display window as a menu. More... | |
![]() | |
virtual | ~Listener () |
Destroy the listener object. | |
Additional Inherited Members | |
![]() | |
Listener () | |
Construct the Listener object. | |
![]() | |
tbx::Window | _window |
Class to show a message in a window in the centre of the screen, resizing the window to fit the message if necessary.
To use this window you must have a template called "Message" in your resources with the following characteristics.
The visible area shown is the minimum size of the window. The extent of the window sets the maximum width and height of the window.
Gadgets: 0 - Button with the needs help flag set. This is used as a guide to position the message and is resized if necessary. 1 - Action button to close the window 2 - Button to show a sprite. 3 - Button with R2 validation to provide a rule between the text and the button.
A window you can copy to provide this is provided in TbxRes in the !Tbx directory.
If the depth or width of the window is changed due to the size of the text the button is moved to stay at the same relative position to the bottom right of the window and the rule is moved down to stay at the same relative position to the bottom of the window.
tbx::MessageWindow::MessageWindow | ( | const std::string & | msg | ) |
Construct a message window with the give message.
msg | The message for the window |
void tbx::MessageWindow::sprite | ( | const std::string & | sprite_name | ) |
Set the name of the sprite to show in the message box.
sprite_name | name of sprite shown in the message box. |