]> git.saurik.com Git - wxWidgets.git/blobdiff - interface/wx/choicdlg.h
Remove wrong const from wxMenu::GetMenuItems() documentation.
[wxWidgets.git] / interface / wx / choicdlg.h
index 534564455d75455b9380ab3ade7f6b2f3a5ab479..f98d147b728d098ec936f1eb7733f01cf1962500 100644 (file)
@@ -3,15 +3,42 @@
 // Purpose:     interface of wx[Multi|Single]ChoiceDialog
 // Author:      wxWidgets team
 // RCS-ID:      $Id$
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
+/**
+    Default width of the choice dialog.
+*/
+#define wxCHOICE_WIDTH 150
+
+/**
+    Default height of the choice dialog.
+*/
+#define wxCHOICE_HEIGHT 200
+
+/**
+    Default style of the choice dialog.
+
+    @remarks wxRESIZE_BORDER is not used under WinCE.
+*/
+#define wxCHOICEDLG_STYLE (wxDEFAULT_DIALOG_STYLE | wxOK | wxCANCEL | wxCENTRE | wxRESIZE_BORDER)
+
+
 /**
     @class wxMultiChoiceDialog
 
     This class represents a dialog that shows a list of strings, and allows the
     user to select one or more.
 
+    @beginStyleTable
+    @style{wxOK}
+        Show an OK button.
+    @style{wxCANCEL}
+        Show a Cancel button.
+    @style{wxCENTRE}
+        Centre the message. Not Windows.
+    @endStyleTable
+
     @library{wxbase}
     @category{cmndlg}
 
@@ -36,21 +63,12 @@ public:
             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.
+            dialog styles and the ones listed in the class documentation. 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
@@ -83,21 +101,12 @@ public:
             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.
+            dialog styles and the ones listed in the class documentation. 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
@@ -123,7 +132,7 @@ public:
     /**
         Returns array with indexes of selected items.
     */
-    wxArrayInt GetSelection() const;
+    wxArrayInt GetSelections() const;
 
     /**
         Sets selected items from the array of selected items' indexes.
@@ -145,6 +154,15 @@ public:
     user to select one. Double-clicking on a list item is equivalent to
     single-clicking and then pressing OK.
 
+    @beginStyleTable
+    @style{wxOK}
+        Show an OK button.
+    @style{wxCANCEL}
+        Show a Cancel button.
+    @style{wxCENTRE}
+        Centre the message. Not Windows.
+    @endStyleTable
+
     @library{wxbase}
     @category{cmndlg}
 
@@ -170,24 +188,15 @@ public:
             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().
+            GetSelectionData().
         @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.
+            dialog styles and the ones listed in the class documentation. 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
@@ -222,24 +231,15 @@ public:
             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().
+            GetSelectionData().
         @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.
+            dialog styles and the ones listed in the class documentation. 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
@@ -270,8 +270,10 @@ public:
 
     /**
         Returns the client data associated with the selection.
+
+        @since 2.9.4
     */
-    char* GetSelectionClientData() const;
+    void* GetSelectionData() const;
 
     /**
         Returns the selected string.
@@ -312,22 +314,37 @@ int wxGetSingleChoiceIndex(const wxString& message,
                            const wxString& caption,
                            const wxArrayString& aChoices,
                            wxWindow* parent = NULL,
-                           int x = -1,
-                           int y = -1,
+                           int x = wxDefaultCoord,
+                           int y = wxDefaultCoord,
                            bool centre = true,
-                           int width = 150,
-                           int height = 200);
+                           int width = wxCHOICE_WIDTH,
+                           int height = wxCHOICE_HEIGHT,
+                           int initialSelection = 0);
+
 int wxGetSingleChoiceIndex(const wxString& message,
                            const wxString& caption,
                            int n,
                            const wxString& choices[],
                            wxWindow* parent = NULL,
-                           int x = -1,
-                           int y = -1,
+                           int x = wxDefaultCoord,
+                           int y = wxDefaultCoord,
                            bool centre = true,
-                           int width = 150,
-                           int height = 200);
+                           int width = wxCHOICE_WIDTH,
+                           int height = wxCHOICE_HEIGHT,
+                           int initialSelection = 0);
 
+
+int wxGetSingleChoiceIndex(const wxString& message,
+                           const wxString& caption,
+                           const wxArrayString& choices,
+                           int initialSelection,
+                           wxWindow *parent = NULL);
+
+int wxGetSingleChoiceIndex(const wxString& message,
+                           const wxString& caption,
+                           int n, const wxString *choices,
+                           int initialSelection,
+                           wxWindow *parent = NULL);
 //@}
 
 /** @addtogroup group_funcmacro_dialog */
@@ -357,21 +374,36 @@ wxString wxGetSingleChoice(const wxString& message,
                            const wxString& caption,
                            const wxArrayString& aChoices,
                            wxWindow* parent = NULL,
-                           int x = -1,
-                           int y = -1,
+                           int x = wxDefaultCoord,
+                           int y = wxDefaultCoord,
                            bool centre = true,
-                           int width = 150,
-                           int height = 200);
+                           int width = wxCHOICE_WIDTH,
+                           int height = wxCHOICE_HEIGHT,
+                           int initialSelection = 0);
 wxString wxGetSingleChoice(const wxString& message,
                            const wxString& caption,
                            int n,
                            const wxString& choices[],
                            wxWindow* parent = NULL,
-                           int x = -1,
-                           int y = -1,
+                           int x = wxDefaultCoord,
+                           int y = wxDefaultCoord,
                            bool centre = true,
-                           int width = 150,
-                           int height = 200);
+                           int width = wxCHOICE_WIDTH,
+                           int height = wxCHOICE_HEIGHT,
+                           int initialSelection = 0);
+
+
+wxString wxGetSingleChoice(const wxString& message,
+                           const wxString& caption,
+                           const wxArrayString& choices,
+                           int initialSelection,
+                           wxWindow *parent = NULL);
+
+wxString wxGetSingleChoice(const wxString& message,
+                           const wxString& caption,
+                           int n, const wxString *choices,
+                           int initialSelection,
+                           wxWindow *parent = NULL);
 
 //@}
 
@@ -395,22 +427,39 @@ wxString wxGetSingleChoiceData(const wxString& message,
                                const wxArrayString& aChoices,
                                const wxString& client_data[],
                                wxWindow* parent = NULL,
-                               int x = -1,
-                               int y = -1,
+                               int x = wxDefaultCoord,
+                               int y = wxDefaultCoord,
                                bool centre = true,
-                               int width = 150,
-                               int height = 200);
+                               int width = wxCHOICE_WIDTH,
+                               int height = wxCHOICE_HEIGHT,
+                               int initialSelection = 0);
+
 wxString wxGetSingleChoiceData(const wxString& message,
                                const wxString& caption,
                                int n,
                                const wxString& choices[],
                                const wxString& client_data[],
                                wxWindow* parent = NULL,
-                               int x = -1,
-                               int y = -1,
+                               int x = wxDefaultCoord,
+                               int y = wxDefaultCoord,
                                bool centre = true,
-                               int width = 150,
-                               int height = 200);
+                               int width = wxCHOICE_WIDTH,
+                               int height = wxCHOICE_HEIGHT,
+                               int initialSelection = 0);
+
+void* wxGetSingleChoiceData(const wxString& message,
+                            const wxString& caption,
+                            const wxArrayString& choices,
+                            void **client_data,
+                            int initialSelection,
+                            wxWindow *parent = NULL);
+
+void* wxGetSingleChoiceData(const wxString& message,
+                            const wxString& caption,
+                            int n, const wxString *choices,
+                            void **client_data,
+                            int initialSelection,
+                            wxWindow *parent = NULL);
 
 //@}
 
@@ -445,22 +494,23 @@ int wxGetSelectedChoices(wxArrayInt& selections,
                             const wxString& caption,
                             const wxArrayString& aChoices,
                             wxWindow* parent = NULL,
-                            int x = -1,
-                            int y = -1,
+                            int x = wxDefaultCoord,
+                            int y = wxDefaultCoord,
                             bool centre = true,
-                            int width = 150,
-                            int height = 200);
+                            int width = wxCHOICE_WIDTH,
+                            int height = wxCHOICE_HEIGHT);
+
 int wxGetSelectedChoices(wxArrayInt& selections,
                             const wxString& message,
                             const wxString& caption,
                             int n,
                             const wxString& choices[],
                             wxWindow* parent = NULL,
-                            int x = -1,
-                            int y = -1,
+                            int x = wxDefaultCoord,
+                            int y = wxDefaultCoord,
                             bool centre = true,
-                            int width = 150,
-                            int height = 200);
+                            int width = wxCHOICE_WIDTH,
+                            int height = wxCHOICE_HEIGHT);
 
 //@}