星期五, 十二月 15, 2006

wxMessageBox

int wxMessageBox(const wxString& message, const wxString& caption = "Message", int style = wxOK, wxWindow *parent = NULL, int x = -1, int y = -1)



General purpose message dialog. style may be a bit list of the following identifiers:

wxYES_NO Puts Yes and No buttons on the message box. May be combined with wxCANCEL.
wxCANCEL Puts a Cancel button on the message box. May only be combined with wxYES_NO or wxOK.
wxOK Puts an Ok button on the message box. May be combined with wxCANCEL.
wxICON_EXCLAMATION Displays an exclamation mark symbol.
wxICON_HAND Displays an error symbol.
wxICON_ERROR Displays an error symbol - the same as wxICON_HAND.
wxICON_QUESTION Displays a question mark symbol.
wxICON_INFORMATION Displays an information symbol.

The return value is one of: wxYES, wxNO, wxCANCEL, wxOK.

For example:

  ...
int answer = wxMessageBox("Quit program?", "Confirm",
wxYES_NO | wxCANCEL, main_frame);
if (answer == wxYES)
main_frame->Close();
...
message may contain newline characters, in which case the message will be split into separate lines, to cater for large messages.




0 意見:

 
template hacks by: [ METAMUSE ]