X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/12f5e1e78fe906050ff2fee9529476db332633f0..3b8ec767b9ee788c6ec2af3fa9023762d8429f86:/interface/wx/choicdlg.h?ds=sidebyside diff --git a/interface/wx/choicdlg.h b/interface/wx/choicdlg.h index 2a04b8c070..118f09048f 100644 --- a/interface/wx/choicdlg.h +++ b/interface/wx/choicdlg.h @@ -66,6 +66,44 @@ public: int n, const wxString* choices, long style = wxCHOICEDLG_STYLE, const wxPoint& pos = wxDefaultPosition); + /** + Constructor taking an array of wxString choices. + + @param parent + Parent window. + @param message + Message to show on the dialog. + @param caption + The dialog caption. + @param choices + An array of strings, or a string list, containing the choices. + @param style + A dialog style (bitlist) containing flags chosen from standard + dialog style and the ones listed below. The default value is + equivalent to wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxOK | + wxCANCEL | wxCENTRE. + @param pos + Dialog position. Not Windows. + + @beginStyleTable + @style{wxOK} + Show an OK button. + @style{wxCANCEL} + Show a Cancel button. + @style{wxCENTRE} + Centre the message. Not Windows. + @endStyleTable + + @remarks Use ShowModal() to show the dialog. + + @beginWxPythonOnly + + For Python the two parameters @a n and @a choices are collapsed into a + multi parameter @a choices which is expected to be a Python list of + strings. + + @endWxPythonOnly + */ wxMultiChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, @@ -82,7 +120,7 @@ public: /** Sets selected items from the array of selected items' indexes. */ - void SetSelections(const wxArrayInt& selections) const; + void SetSelections(const wxArrayInt& selections); /** Shows the dialog, returning either wxID_OK or wxID_CANCEL. @@ -158,6 +196,48 @@ public: void** clientData = NULL, long style = wxCHOICEDLG_STYLE, const wxPoint& pos = wxDefaultPosition); + /** + Constructor, taking an array of wxString choices and optional client + data. + + @param parent + Parent window. + @param message + Message to show on the dialog. + @param caption + The dialog caption. + @param choices + An array of strings, or a string list, containing the choices. + @param clientData + An array of client data to be associated with the items. See + GetSelectionClientData(). + @param style + A dialog style (bitlist) containing flags chosen from standard + dialog styles and the ones listed below. The default value is + equivalent to wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxOK | + wxCANCEL | wxCENTRE. + @param pos + Dialog position. Not Windows. + + @beginStyleTable + @style{wxOK} + Show an OK button. + @style{wxCANCEL} + Show a Cancel button. + @style{wxCENTRE} + Centre the message. Not Windows. + @endStyleTable + + @remarks Use ShowModal() to show the dialog. + + @beginWxPythonOnly + + For Python the two parameters @a n and @a choices are collapsed into a + multi parameter @a choices which is expected to be a Python list of + strings. + + @endWxPythonOnly + */ wxSingleChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, @@ -185,7 +265,7 @@ public: /** Sets the index of the initially selected item. */ - void SetSelection(int selection) const; + void SetSelection(int selection); /** Shows the dialog, returning either wxID_OK or wxID_CANCEL. @@ -199,7 +279,7 @@ public: // Global functions/macros // ============================================================================ -/** @ingroup group_funcmacro_dialog */ +/** @addtogroup group_funcmacro_dialog */ //@{ /** @@ -230,7 +310,7 @@ int wxGetSingleChoiceIndex(const wxString& message, //@} -/** @ingroup group_funcmacro_dialog */ +/** @addtogroup group_funcmacro_dialog */ //@{ /** @@ -271,7 +351,7 @@ wxString wxGetSingleChoice(const wxString& message, //@} -/** @ingroup group_funcmacro_dialog */ +/** @addtogroup group_funcmacro_dialog */ //@{ /** @@ -306,7 +386,7 @@ wxString wxGetSingleChoiceData(const wxString& message, //@} -/** @ingroup group_funcmacro_dialog */ +/** @addtogroup group_funcmacro_dialog */ //@{ /** @@ -314,7 +394,8 @@ wxString wxGetSingleChoiceData(const wxString& message, multiple-selection listbox. The user may choose an arbitrary (including 0) number of items in the listbox whose indices will be returned in @c selections array. The initial contents of this array will be used to - select the items when the dialog is shown. + select the items when the dialog is shown. If the user cancels the dialog, + the function returns -1 and @c selections array is left unchanged. You may pass the list of strings to choose from either using @c choices which is an array of @a n strings for the listbox or by using a single @@ -325,7 +406,7 @@ wxString wxGetSingleChoiceData(const wxString& message, @header{wx/choicdlg.h} */ -size_t wxGetMultipleChoices(wxArrayInt& selections, +int wxGetSelectedChoices(wxArrayInt& selections, const wxString& message, const wxString& caption, const wxArrayString& aChoices, @@ -335,7 +416,7 @@ size_t wxGetMultipleChoices(wxArrayInt& selections, bool centre = true, int width = 150, int height = 200); -size_t wxGetMultipleChoices(wxArrayInt& selections, +int wxGetSelectedChoices(wxArrayInt& selections, const wxString& message, const wxString& caption, int n,