OpenCPN Partial API docs
Loading...
Searching...
No Matches
AlertDialog Class Reference

A modal message dialog with a cancel and confirmation button. More...

#include <dialog_alert.h>

Inheritance diagram for AlertDialog:
BaseDialog

Public Member Functions

 AlertDialog (wxWindow *parent, const std::string &title, const std::string &action)
 
void SetListener (IAlertConfirmation *listener)
 Listen for response.
 
void SetMessage (const std::string &msg)
 Set alert message.
 
- Public Member Functions inherited from BaseDialog
 BaseDialog (wxWindow *parent, const std::string &title, long style=wxDEFAULT_DIALOG_STYLE)
 
void SetInitialSize ()
 Initialize by display geometry.
 
int ShowModal () override
 Show dialog and return response.
 
void AddHtmlContent (const std::stringstream &html)
 Display HTML content.
 

Static Public Member Functions

static int GetConfirmation (wxWindow *parent, const std::string &title, const std::string &action, const std::string &msg)
 Helper that returns the dialog response.
 

Additional Inherited Members

- Protected Attributes inherited from BaseDialog
wxBoxSizer * m_layout
 
wxBoxSizer * m_content
 
- Static Protected Attributes inherited from BaseDialog
static const int kDialogPadding = 2
 

Detailed Description

A modal message dialog with a cancel and confirmation button.

Can be used with a listener to handle the response. Alternatively the static GetConfirmation function can be used without listener.

Definition at line 46 of file dialog_alert.h.

Member Function Documentation

◆ GetConfirmation()

static int AlertDialog::GetConfirmation ( wxWindow *  parent,
const std::string &  title,
const std::string &  action,
const std::string &  msg 
)
static

Helper that returns the dialog response.

Returns
YES/NO response.

◆ SetListener()

void AlertDialog::SetListener ( IAlertConfirmation listener)

Listen for response.

Parameters
listenerConfirmation listener.

◆ SetMessage()

void AlertDialog::SetMessage ( const std::string &  msg)

Set alert message.

Parameters
msgAlert message.

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