wxWidgets: interface/wx/msgdlg.h File Reference

| Version: 3.1.7

Loading...
Searching...
No Matches
Classes | Functions | Variables
msgdlg.h File Reference

## Classes
class | wxMessageDialog
| This class represents a dialog that shows a single or multi-line message, with a choice of OK, Yes, No and Cancel buttons. More...
class | wxMessageDialog::ButtonLabel
| Helper class allowing to use either stock id or string labels. More...

## Functions
int | wxMessageBox (const wxString &message, const wxString &caption=wxMessageBoxCaptionStr, int style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
| Show a general purpose message dialog.

## Variables
const char | wxMessageBoxCaptionStr [] = "Message"
| Default message box caption string.

## Function Documentation

## ◆ wxMessageBox()

int wxMessageBox | ( | const wxString & | message,
|  | const wxString & | caption = wxMessageBoxCaptionStr,
|  | int | style = wxOK|wxCENTRE,
|  | wxWindow * | parent = NULL,
|  | int | x = wxDefaultCoord,
|  | int | y = wxDefaultCoord )

Show a general purpose message dialog.

This is a convenient function which is usually used instead of using wxMessageDialog directly. Notice however that some of the features, such as extended text and custom labels for the message box buttons, are not provided by this function but only by wxMessageDialog.

The return value is one of: `wxYES`, `wxNO`, `wxCANCEL`, `wxOK` or `wxHELP` (notice that this return value is different from the return value of wxMessageDialog::ShowModal()).

For example:

int answer = wxMessageBox("Quit program?", "Confirm",
wxYES_NO | wxCANCEL, main_frame);
if (answer == wxYES)
main_frame->Close();
wxCANCEL
#define wxCANCEL
Definition defs.h:455
wxYES_NO
#define wxYES_NO
Definition defs.h:454
wxYES
#define wxYES
Definition defs.h:451
wxMessageBox
int wxMessageBox(const wxString &message, const wxString &caption=wxMessageBoxCaptionStr, int style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
Show a general purpose message dialog.

message may contain newline characters, in which case the message will be split into separate lines, to cater for large messages.

Parameters

  message | Message to show in the dialog.
  caption | The dialog title.
  parent | Parent window.
  style | Combination of style flags described in wxMessageDialog documentation.
  x | Horizontal dialog position (ignored under MSW). Use wxDefaultCoord for x and y to let the system position the window.
  y | Vertical dialog position (ignored under MSW).

Include file:

    #include <wx/msgdlg.h>

## Variable Documentation

## ◆ wxMessageBoxCaptionStr

const char wxMessageBoxCaptionStr[] = "Message"

Default message box caption string.