]> git.saurik.com Git - wxWidgets.git/commitdiff
Better documentation for the default parameters values.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 4 Mar 2012 00:29:07 +0000 (00:29 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 4 Mar 2012 00:29:07 +0000 (00:29 +0000)
Use symbolic names for them and document them separately.

Closes #14051.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70791 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

interface/wx/choicdlg.h
interface/wx/dirdlg.h
interface/wx/filedlg.h
interface/wx/msgdlg.h
interface/wx/textdlg.h
interface/wx/tokenzr.h

index ff49376afcd425f88e698e2b0853aaf2a5045569..8358aa4bd7b10584b0e225d3deee32d4778ed3c2 100644 (file)
@@ -6,6 +6,24 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // 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
 
 /**
     @class wxMultiChoiceDialog
 
@@ -314,11 +332,11 @@ int wxGetSingleChoiceIndex(const wxString& message,
                            const wxString& caption,
                            const wxArrayString& aChoices,
                            wxWindow* parent = NULL,
                            const wxString& caption,
                            const wxArrayString& aChoices,
                            wxWindow* parent = NULL,
-                           int x = -1,
-                           int y = -1,
+                           int x = wxDefaultCoord,
+                           int y = wxDefaultCoord,
                            bool centre = true,
                            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,
                            int initialSelection = 0);
 
 int wxGetSingleChoiceIndex(const wxString& message,
@@ -326,11 +344,11 @@ int wxGetSingleChoiceIndex(const wxString& message,
                            int n,
                            const wxString& choices[],
                            wxWindow* parent = NULL,
                            int n,
                            const wxString& choices[],
                            wxWindow* parent = NULL,
-                           int x = -1,
-                           int y = -1,
+                           int x = wxDefaultCoord,
+                           int y = wxDefaultCoord,
                            bool centre = true,
                            bool centre = true,
-                           int width = 150,
-                           int height = 200,
+                           int width = wxCHOICE_WIDTH,
+                           int height = wxCHOICE_HEIGHT,
                            int initialSelection = 0);
 
 
                            int initialSelection = 0);
 
 
@@ -374,22 +392,22 @@ wxString wxGetSingleChoice(const wxString& message,
                            const wxString& caption,
                            const wxArrayString& aChoices,
                            wxWindow* parent = NULL,
                            const wxString& caption,
                            const wxArrayString& aChoices,
                            wxWindow* parent = NULL,
-                           int x = -1,
-                           int y = -1,
+                           int x = wxDefaultCoord,
+                           int y = wxDefaultCoord,
                            bool centre = true,
                            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 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,
                            bool centre = true,
-                           int width = 150,
-                           int height = 200
+                           int width = wxCHOICE_WIDTH,
+                           int height = wxCHOICE_HEIGHT,
                            int initialSelection = 0);
 
 
                            int initialSelection = 0);
 
 
@@ -427,11 +445,11 @@ wxString wxGetSingleChoiceData(const wxString& message,
                                const wxArrayString& aChoices,
                                const wxString& client_data[],
                                wxWindow* parent = NULL,
                                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,
                                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,
                                int initialSelection = 0);
 
 wxString wxGetSingleChoiceData(const wxString& message,
@@ -440,11 +458,11 @@ wxString wxGetSingleChoiceData(const wxString& message,
                                const wxString& choices[],
                                const wxString& client_data[],
                                wxWindow* parent = NULL,
                                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,
                                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,
                                int initialSelection = 0);
 
 void* wxGetSingleChoiceData(const wxString& message,
@@ -494,11 +512,11 @@ int wxGetSelectedChoices(wxArrayInt& selections,
                             const wxString& caption,
                             const wxArrayString& aChoices,
                             wxWindow* parent = NULL,
                             const wxString& caption,
                             const wxArrayString& aChoices,
                             wxWindow* parent = NULL,
-                            int x = -1,
-                            int y = -1,
+                            int x = wxDefaultCoord,
+                            int y = wxDefaultCoord,
                             bool centre = true,
                             bool centre = true,
-                            int width = 150,
-                            int height = 200);
+                            int width = wxCHOICE_WIDTH,
+                            int height = wxCHOICE_HEIGHT);
 
 int wxGetSelectedChoices(wxArrayInt& selections,
                             const wxString& message,
 
 int wxGetSelectedChoices(wxArrayInt& selections,
                             const wxString& message,
@@ -506,11 +524,11 @@ int wxGetSelectedChoices(wxArrayInt& selections,
                             int n,
                             const wxString& choices[],
                             wxWindow* parent = NULL,
                             int n,
                             const wxString& choices[],
                             wxWindow* parent = NULL,
-                            int x = -1,
-                            int y = -1,
+                            int x = wxDefaultCoord,
+                            int y = wxDefaultCoord,
                             bool centre = true,
                             bool centre = true,
-                            int width = 150,
-                            int height = 200);
+                            int width = wxCHOICE_WIDTH,
+                            int height = wxCHOICE_HEIGHT);
 
 //@}
 
 
 //@}
 
index 2e0c607f072a3421d45f86a5759a433ce591e1a1..b32b4c27b80dea8689f574ecfa0223e12d93bb9e 100644 (file)
@@ -8,6 +8,21 @@
 
 #define wxDD_DEFAULT_STYLE      (wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
 
 
 #define wxDD_DEFAULT_STYLE      (wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
 
+/**
+    Initial folder for generic directory dialog.
+*/
+const char wxDirDialogDefaultFolderStr[] = "/";
+
+/**
+    Default message for directory selector dialog.
+*/
+const char wxDirSelectorPromptStr[] = "Select a directory";
+
+/**
+    Default name for directory selector dialog.
+*/
+const char wxDirDialogNameStr[] = "wxDirCtrl";
+
 /**
     @class wxDirDialog
 
 /**
     @class wxDirDialog
 
index 63b6bbedd8d1a18b9af3d937f0ef83816bb799dd..5ba0edbbfc121b46ff19ae6973d8e383152bd929 100644 (file)
@@ -19,6 +19,13 @@ enum
 
 #define wxFD_DEFAULT_STYLE      wxFD_OPEN
 
 
 #define wxFD_DEFAULT_STYLE      wxFD_OPEN
 
+/**
+    Default wildcard string used in wxFileDialog corresponding to all files.
+
+    It is defined as "*.*" under MSW and OS/2 and "*" everywhere else.
+*/
+const char wxFileSelectorDefaultWildcardStr[];
+
 /**
     @class wxFileDialog
 
 /**
     @class wxFileDialog
 
@@ -360,11 +367,11 @@ wxString wxFileSelector(const wxString& message,
                         const wxString& default_path = wxEmptyString,
                         const wxString& default_filename = wxEmptyString,
                         const wxString& default_extension = wxEmptyString,
                         const wxString& default_path = wxEmptyString,
                         const wxString& default_filename = wxEmptyString,
                         const wxString& default_extension = wxEmptyString,
-                        const wxString& wildcard = ".",
+                        const wxString& wildcard = wxFileSelectorDefaultWildcardStr,
                         int flags = 0,
                         wxWindow* parent = NULL,
                         int flags = 0,
                         wxWindow* parent = NULL,
-                        int x = -1,
-                        int y = -1);
+                        int x = wxDefaultCoord,
+                        int y = wxDefaultCoord);
 
 //@}
 
 
 //@}
 
index 845a0603504c22c943a1979fc0cd075bb2faa057..1dde94ee778c7eb8816bcb03b5edfe5ace2e67c1 100644 (file)
@@ -6,6 +6,12 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
+/**
+    Default message box caption string.
+*/
+const char wxMessageBoxCaptionStr[] = "Message";
+
+
 /**
     @class wxMessageDialog
 
 /**
     @class wxMessageDialog
 
index a1ddf2e6ec95e48bbfe5fa71f98d237cbf5e05f0..043145ca8964b8170c4e2dab7d3d4292c6eb8d1e 100644 (file)
@@ -6,6 +6,18 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
+/**
+    Default text dialog style.
+*/
+#define wxTextEntryDialogStyle (wxOK | wxCANCEL | wxCENTRE | wxWS_EX_VALIDATE_RECURSIVELY)
+
+/// Default text dialog caption.
+const char wxGetTextFromUserPromptStr[] = "Input Text";
+
+/// Default password dialog caption.
+const char wxGetPasswordFromUserPromptStr[] = "Enter Password";
+
+
 /**
     @class wxPasswordEntryDialog
 
 /**
     @class wxPasswordEntryDialog
 
@@ -45,7 +57,7 @@ public:
     wxPasswordEntryDialog(wxWindow* parent, const wxString& message,
                           const wxString& caption = wxGetPasswordFromUserPromptStr,
                           const wxString& defaultValue = wxEmptyString,
     wxPasswordEntryDialog(wxWindow* parent, const wxString& message,
                           const wxString& caption = wxGetPasswordFromUserPromptStr,
                           const wxString& defaultValue = wxEmptyString,
-                          long style = wxOK | wxCANCEL | wxCENTRE,
+                          long style = wxTextEntryDialogStyle,
                           const wxPoint& pos = wxDefaultPosition);
 };
 
                           const wxPoint& pos = wxDefaultPosition);
 };
 
@@ -87,7 +99,7 @@ public:
     wxTextEntryDialog(wxWindow* parent, const wxString& message,
                       const wxString& caption = wxGetTextFromUserPromptStr,
                       const wxString& value = wxEmptyString,
     wxTextEntryDialog(wxWindow* parent, const wxString& message,
                       const wxString& caption = wxGetTextFromUserPromptStr,
                       const wxString& value = wxEmptyString,
-                      long style = wxOK | wxCANCEL | wxCENTRE,
+                      long style = wxTextEntryDialogStyle,
                       const wxPoint& pos = wxDefaultPosition);
 
     /**
                       const wxPoint& pos = wxDefaultPosition);
 
     /**
@@ -139,7 +151,7 @@ public:
     @header{wx/textdlg.h}
 */
 wxString wxGetTextFromUser(const wxString& message,
     @header{wx/textdlg.h}
 */
 wxString wxGetTextFromUser(const wxString& message,
-                           const wxString& caption = "Input text",
+                           const wxString& caption = wxGetTextFromUserPromptStr,
                            const wxString& default_value = wxEmptyString,
                            wxWindow* parent = NULL,
                            int x = wxDefaultCoord,
                            const wxString& default_value = wxEmptyString,
                            wxWindow* parent = NULL,
                            int x = wxDefaultCoord,
@@ -154,7 +166,7 @@ wxString wxGetTextFromUser(const wxString& message,
     @header{wx/textdlg.h}
 */
 wxString wxGetPasswordFromUser(const wxString& message,
     @header{wx/textdlg.h}
 */
 wxString wxGetPasswordFromUser(const wxString& message,
-                               const wxString& caption = "Input text",
+                               const wxString& caption = wxGetPasswordFromUserPromptStr,
                                const wxString& default_value = wxEmptyString,
                                wxWindow* parent = NULL,
                                int x = wxDefaultCoord,
                                const wxString& default_value = wxEmptyString,
                                wxWindow* parent = NULL,
                                int x = wxDefaultCoord,
index 3614ae1a1a2126078e0d32b5213d018a744dde90..f27ba1a5f62a0b5e3051ba7fdb20393707a971a1 100644 (file)
@@ -59,6 +59,9 @@ enum wxStringTokenizerMode
     wxTOKEN_STRTOK
 };
 
     wxTOKEN_STRTOK
 };
 
+/// Default wxStringTokenizer delimiters are the usual white space characters.
+#define wxDEFAULT_DELIMITERS " \t\r\n"
+
 /**
     @class wxStringTokenizer
 
 /**
     @class wxStringTokenizer
 
@@ -106,7 +109,7 @@ public:
         @see SetString()
    */
     wxStringTokenizer(const wxString& str,
         @see SetString()
    */
     wxStringTokenizer(const wxString& str,
-                      const wxString& delims = " \t\r\n",
+                      const wxString& delims = wxDEFAULT_DELIMITERS,
                       wxStringTokenizerMode mode = wxTOKEN_DEFAULT);
 
     /**
                       wxStringTokenizerMode mode = wxTOKEN_DEFAULT);
 
     /**
@@ -154,8 +157,8 @@ public:
         containing delimiters, and the @a mode specifying how the string
         should be tokenized.
     */
         containing delimiters, and the @a mode specifying how the string
         should be tokenized.
     */
-    void SetString(const wxString& to_tokenize,
-                   const wxString& delims = " \t\r\n",
+    void SetString(const wxString& str,
+                   const wxString& delims = wxDEFAULT_DELIMITERS,
                    wxStringTokenizerMode mode = wxTOKEN_DEFAULT);
 };
 
                    wxStringTokenizerMode mode = wxTOKEN_DEFAULT);
 };
 
@@ -178,5 +181,5 @@ wxArrayString
 wxStringTokenize(const wxString& str,
                  const wxString& delims = wxDEFAULT_DELIMITERS,
                  wxStringTokenizerMode mode = wxTOKEN_DEFAULT);
 wxStringTokenize(const wxString& str,
                  const wxString& delims = wxDEFAULT_DELIMITERS,
                  wxStringTokenizerMode mode = wxTOKEN_DEFAULT);
-                 
+
 //@}
 //@}