PCL
pcl::MessageBox Class Reference

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
 

Detailed Description

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.

See also
Dialog

Definition at line 161 of file MessageBox.h.

Member Typedef Documentation

◆ std_button

using pcl::MessageBox::std_button = StdButton::value_type

Represents a standard message box button.

Definition at line 173 of file MessageBox.h.

◆ std_icon

using pcl::MessageBox::std_icon = StdIcon::value_type

Represents a standard message box icon.

Definition at line 168 of file MessageBox.h.

Constructor & Destructor Documentation

◆ MessageBox()

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.

Parameters
textThe 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.
captionThe caption of the message box window. If an empty string is specified, the platform will assign a default caption.
iconThe message box icon. By default, no icon appears on a message box.
button0,button1,button2Specify 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.
defaultButtonIdxThe 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.
escapeButtonIdxThe 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.

◆ ~MessageBox()

virtual pcl::MessageBox::~MessageBox ( )
virtual

Virtual destructor.

Member Function Documentation

◆ Caption()

String pcl::MessageBox::Caption ( ) const

Returns the caption text of this message box.

◆ DefaultButtonIndex()

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.

◆ EscapeButtonIndex()

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.

◆ Execute()

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.

◆ FirstButton()

std_button pcl::MessageBox::FirstButton ( ) const

Returns the identifier of the first button on this message box.

◆ Icon()

std_icon pcl::MessageBox::Icon ( ) const

Returns the icon that will be shown on this message box.

◆ Result()

std_button pcl::MessageBox::Result ( ) const

Returns the last modal result, or StdButton::NoButton if this box has not been executed previously.

◆ SecondButton()

std_button pcl::MessageBox::SecondButton ( ) const

Returns the identifier of the second button on this message box.

◆ SetCaption()

void pcl::MessageBox::SetCaption ( const String text)

Sets the caption text of this message box.

◆ SetDefaultButtonIndex()

void pcl::MessageBox::SetDefaultButtonIndex ( int  index)

Sets the index, from 0 to 2, of the default button on this message box.

◆ SetEscapeButtonIndex()

void pcl::MessageBox::SetEscapeButtonIndex ( int  index)

Sets the index, from 0 to 2, of the escape button on this message box.

◆ SetFirstButton()

void pcl::MessageBox::SetFirstButton ( std_button  button)

Sets the first button on this message box.

◆ SetIcon()

void pcl::MessageBox::SetIcon ( std_icon  icon)

Sets the icon that will be shown on this message box.

◆ SetSecondButton()

void pcl::MessageBox::SetSecondButton ( std_button  button)

Sets the second button on this message box.

◆ SetText()

void pcl::MessageBox::SetText ( const String text)

Sets the text to be shown on the client area of this message box.

◆ SetThirdButton()

void pcl::MessageBox::SetThirdButton ( std_button  button)

Sets the third button on this message box.

◆ Text()

String pcl::MessageBox::Text ( ) const

Returns the text that this message box shows on its client area.

◆ ThirdButton()

std_button pcl::MessageBox::ThirdButton ( ) const

Returns the identifier of the third button on this message box.


The documentation for this class was generated from the following file: