Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
Antares::Window::Message Class Referencefinal

Standard message Box for Antares. More...

#include <message.h>

Inheritance diagram for Antares::Window::Message:

Public Types

enum  DefaultButtonType {
  btnStartID = 100000 , btnOk , btnYes , btnNo ,
  btnRetry , btnDiscard , btnQuitWithoutSaving , btnSaveChanges ,
  btnCancel , btnSaveAs , btnUpgrade , btnContinue ,
  btnViewResults , btnQuit
}
 
using ItemList = std::vector<Component::Spotlight::IItem::Ptr>
 Array of items.
 

Public Member Functions

Constructor & Destructor
 Message (wxWindow *parent, const wxString &title, const wxString &subtitle=wxEmptyString, const wxString &msg=wxEmptyString, const char *icon="images/misc/book.png")
 Default Constructor.
 
virtual ~Message ()
 Destructor.
 
Buttons
void add (const wxString &caption, DefaultButtonType value, bool defaultButton=false, int space=3)
 Add a new custom button.
 
void add (DefaultButtonType btn, bool defaultButton=false, int space=3)
 Add a predefined button.
 
List
void add (Component::Spotlight::IItem::Ptr item)
 Add an item in the list.
 
void appendError (const AnyString &text)
 Add an error.
 
void appendWarning (const AnyString &text)
 Add a warning.
 
Messageoperator+= (Component::Spotlight::IItem::Ptr item)
 
Show
uint showModal ()
 Display the message box.
 
void showModalAsync ()
 Display the message box (async)
 

Extras

void recommendedWidth (uint w)
 Set the recommended width of the dialog box.
 

Detailed Description

Standard message Box for Antares.

// The main form
// Creating the message dialog
Window::Message message(&mainFrm, wxT("Title of the form"),
wxT("Main message (in bold)"),
wxT("Hello World !"));
// Adding some buttons
message.add(Window::Message::btnSaveAs, false, 15);
message.add(Window::Message::btnCancel, true);
// Display the message
switch (message.showModal())
{
case Window::Message::btnUpgrade: do something; break;
case Window::Message::btnSaveAs : ...; break;
}
Main Frame of the Antares UI application.
Definition main.h:50
static ApplWnd * Instance()
Get the instance of the main window.
Standard message Box for Antares.
Definition message.h:60
@ btnSaveAs
Standard button: Save as...
Definition message.h:83
@ btnCancel
Standard button: Cancel.
Definition message.h:81
@ btnUpgrade
Standard button: Upgrade.
Definition message.h:85
Note
The method showModal() should be used instead of ShowModal()

Member Enumeration Documentation

◆ DefaultButtonType

Enumerator
btnStartID 

constant

btnOk 

Standard button: Ok.

btnYes 

Standard button: Yes.

btnNo 

Standard button: No.

btnRetry 

Standard button: retry.

btnDiscard 

Standard button: Discard.

btnQuitWithoutSaving 

Quit without saving.

btnSaveChanges 

Standard button: Save changes.

btnCancel 

Standard button: Cancel.

btnSaveAs 

Standard button: Save as...

btnUpgrade 

Standard button: Upgrade.

btnContinue 

Standard button: continue.

btnViewResults 

Standard button: view simulation results.

btnQuit 

Standard button: quit.

Member Function Documentation

◆ add() [1/2]

void Antares::Window::Message::add ( const wxString & caption,
DefaultButtonType value,
bool defaultButton = false,
int space = 3 )

Add a new custom button.

Parameters
captionCaption of the button
valueAn arbitrary unique identifier for this button. It should be less than btnStartID.
defaultButtonTrue to make it the default result
spaceThe space to add after before this button

◆ add() [2/2]

void Antares::Window::Message::add ( DefaultButtonType btn,
bool defaultButton = false,
int space = 3 )
inline

Add a predefined button.

Parameters
btnThe predefined button ID
defaultButtonTrue to make it the default result
spaceThe space to add after before this button

◆ operator+=()

Message & Antares::Window::Message::operator+= ( Component::Spotlight::IItem::Ptr item)
inline

◆ recommendedWidth()

void Antares::Window::Message::recommendedWidth ( uint w)
inline

Set the recommended width of the dialog box.

A value of 0 means automatic. This value will be used only if the message list is not empty


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