PCL
|
High-level interface to a PixInsight MessageBox object. More...
#include <MessageBox.h>
Public Types | |
using | std_button = StdButton::value_type |
using | std_icon = StdIcon::value_type |
Public Member Functions | |
MessageBox (const String &text=String(), const String &caption=String(), std_icon icon=StdIcon::NoIcon, std_button button0=StdButton::Ok, std_button button1=StdButton::NoButton, std_button button2=StdButton::NoButton, int defaultButtonIdx=0, int escapeButtonIdx=-1) | |
virtual | ~MessageBox () |
String | Caption () const |
int | DefaultButtonIndex () const |
int | EscapeButtonIndex () const |
std_button | Execute () |
std_button | FirstButton () const |
std_icon | Icon () const |
std_button | Result () const |
std_button | SecondButton () const |
void | SetCaption (const String &text) |
void | SetDefaultButtonIndex (int index) |
void | SetEscapeButtonIndex (int index) |
void | SetFirstButton (std_button button) |
void | SetIcon (std_icon icon) |
void | SetSecondButton (std_button button) |
void | SetText (const String &text) |
void | SetThirdButton (std_button button) |
String | Text () const |
std_button | ThirdButton () const |
A MessageBox object executes as a modal window relative to PixInsight's main window. Message boxes are useful to show brief messages, to notify errors, warnings and other special conditions, and to obtain simple answers (yes/no, ok/cancel, and so on) from the user.
Definition at line 161 of file MessageBox.h.
using pcl::MessageBox::std_button = StdButton::value_type |
Represents a standard message box button.
Definition at line 173 of file MessageBox.h.
using pcl::MessageBox::std_icon = StdIcon::value_type |
Represents a standard message box icon.
Definition at line 168 of file MessageBox.h.
pcl::MessageBox::MessageBox | ( | const String & | text = String() , |
const String & | caption = String() , |
||
std_icon | icon = StdIcon::NoIcon , |
||
std_button | button0 = StdButton::Ok , |
||
std_button | button1 = StdButton::NoButton , |
||
std_button | button2 = StdButton::NoButton , |
||
int | defaultButtonIdx = 0 , |
||
int | escapeButtonIdx = -1 |
||
) |
Constructs a MessageBox object.
text | The text that will be shown on the message box's client area. Can be either plain text or include basic HTML tags like <br>, <p></p>, <b></b>, <i></i>, <u></u>, etc. |
caption | The caption of the message box window. If an empty string is specified, the platform will assign a default caption. |
icon | The message box icon. By default, no icon appears on a message box. |
button0,button1,button2 | Specify up to three buttons that will be included on the bottom row of this message box. By default a message box includes just an Ok standard button. |
defaultButtonIdx | The button index (from 0 to 2) of the default button on this dialog box. The default button will be activated when the user presses the Return or Enter keys. |
escapeButtonIdx | The button index (from 0 to 2) of the button that will be activated when the user presses the Escape key, or when (s)he closes the message box window explicitly. If a value < 0 is specified (the default value), pressing the Esc key simply cancels the dialog and forces a return value of StdButton::Cancel. |
|
virtual |
Virtual destructor.
String pcl::MessageBox::Caption | ( | ) | const |
Returns the caption text of this message box.
int pcl::MessageBox::DefaultButtonIndex | ( | ) | const |
Returns the index, from 0 to 2, of the default button on this message box.
The default button will be activated if the user presses the Return or Enter keys.
int pcl::MessageBox::EscapeButtonIndex | ( | ) | const |
Returns the index, from 0 to 2, of the escape button on this message box.
The escape button will be activated if the user presses the Escape key, or if (s)he closes the message box's window explicitly.
std_button pcl::MessageBox::Execute | ( | ) |
Executes this message box modally. Returns a StdButton identifier corresponding to the button that the user activated to close the message box.
For example, when the user clicks on the Ok button (if that button has been included in this message box), this function returns StdButton::Ok.
std_button pcl::MessageBox::FirstButton | ( | ) | const |
Returns the identifier of the first button on this message box.
std_icon pcl::MessageBox::Icon | ( | ) | const |
Returns the icon that will be shown on this message box.
std_button pcl::MessageBox::Result | ( | ) | const |
Returns the last modal result, or StdButton::NoButton if this box has not been executed previously.
std_button pcl::MessageBox::SecondButton | ( | ) | const |
Returns the identifier of the second button on this message box.
void pcl::MessageBox::SetCaption | ( | const String & | text | ) |
Sets the caption text of this message box.
void pcl::MessageBox::SetDefaultButtonIndex | ( | int | index | ) |
Sets the index, from 0 to 2, of the default button on this message box.
void pcl::MessageBox::SetEscapeButtonIndex | ( | int | index | ) |
Sets the index, from 0 to 2, of the escape button on this message box.
void pcl::MessageBox::SetFirstButton | ( | std_button | button | ) |
Sets the first button on this message box.
void pcl::MessageBox::SetIcon | ( | std_icon | icon | ) |
Sets the icon that will be shown on this message box.
void pcl::MessageBox::SetSecondButton | ( | std_button | button | ) |
Sets the second button on this message box.
void pcl::MessageBox::SetText | ( | const String & | text | ) |
Sets the text to be shown on the client area of this message box.
void pcl::MessageBox::SetThirdButton | ( | std_button | button | ) |
Sets the third button on this message box.
String pcl::MessageBox::Text | ( | ) | const |
Returns the text that this message box shows on its client area.
std_button pcl::MessageBox::ThirdButton | ( | ) | const |
Returns the identifier of the third button on this message box.