tbx
0.7.6
|
Class to show a question in a window in the centre of the screen, resizing the window to fit the question if necessary. More...
#include <questionwindow.h>
Public Member Functions | |
QuestionWindow (const std::string &question) | |
Construct a question window with the give question. More... | |
void | delete_commands () |
Delete all commands added when dialog exits. More... | |
void | add_yes_command (tbx::Command *yes_command) |
Add a command to be run if the yes button is selected. More... | |
void | add_no_command (tbx::Command *no_command) |
Add a command to be run if the no button is selected. 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 question in a window in the centre of the screen, resizing the window to fit the question if necessary.
To use this window you must have a template called "Question" 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 - Yes action button 2 - No action 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 buttons are moved to stay at the same relative position to the bottom right of the window.
tbx::QuestionWindow::QuestionWindow | ( | const std::string & | question | ) |
Construct a question window with the give question.
question | The question for the window |
void tbx::QuestionWindow::add_no_command | ( | tbx::Command * | no_command | ) |
Add a command to be run if the no button is selected.
no_command | command to run if "No" is selected. |
void tbx::QuestionWindow::add_yes_command | ( | tbx::Command * | yes_command | ) |
Add a command to be run if the yes button is selected.
yes_command | command to run if "Yes" is selected. |
void tbx::QuestionWindow::delete_commands | ( | ) |
Delete all commands added when dialog exits.
Note: only command added after this call will be deleted