From 0b59366faa1b3820dfc4f4ab130000f4e471e405 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 4 Mar 2012 00:29:07 +0000 Subject: [PATCH] Better documentation for the default parameters values. 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 | 82 +++++++++++++++++++++++++---------------- interface/wx/dirdlg.h | 15 ++++++++ interface/wx/filedlg.h | 13 +++++-- interface/wx/msgdlg.h | 6 +++ interface/wx/textdlg.h | 20 ++++++++-- interface/wx/tokenzr.h | 11 ++++-- 6 files changed, 104 insertions(+), 43 deletions(-) diff --git a/interface/wx/choicdlg.h b/interface/wx/choicdlg.h index ff49376afc..8358aa4bd7 100644 --- a/interface/wx/choicdlg.h +++ b/interface/wx/choicdlg.h @@ -6,6 +6,24 @@ // 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 @@ -314,11 +332,11 @@ 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, @@ -326,11 +344,11 @@ int wxGetSingleChoiceIndex(const wxString& message, 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); @@ -374,22 +392,22 @@ 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); @@ -427,11 +445,11 @@ 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, @@ -440,11 +458,11 @@ wxString wxGetSingleChoiceData(const wxString& message, 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, @@ -494,11 +512,11 @@ 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, @@ -506,11 +524,11 @@ int wxGetSelectedChoices(wxArrayInt& selections, 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); //@} diff --git a/interface/wx/dirdlg.h b/interface/wx/dirdlg.h index 2e0c607f07..b32b4c27b8 100644 --- a/interface/wx/dirdlg.h +++ b/interface/wx/dirdlg.h @@ -8,6 +8,21 @@ #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 diff --git a/interface/wx/filedlg.h b/interface/wx/filedlg.h index 63b6bbedd8..5ba0edbbfc 100644 --- a/interface/wx/filedlg.h +++ b/interface/wx/filedlg.h @@ -19,6 +19,13 @@ enum #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 @@ -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& wildcard = ".", + const wxString& wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0, wxWindow* parent = NULL, - int x = -1, - int y = -1); + int x = wxDefaultCoord, + int y = wxDefaultCoord); //@} diff --git a/interface/wx/msgdlg.h b/interface/wx/msgdlg.h index 845a060350..1dde94ee77 100644 --- a/interface/wx/msgdlg.h +++ b/interface/wx/msgdlg.h @@ -6,6 +6,12 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +/** + Default message box caption string. +*/ +const char wxMessageBoxCaptionStr[] = "Message"; + + /** @class wxMessageDialog diff --git a/interface/wx/textdlg.h b/interface/wx/textdlg.h index a1ddf2e6ec..043145ca89 100644 --- a/interface/wx/textdlg.h +++ b/interface/wx/textdlg.h @@ -6,6 +6,18 @@ // 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 @@ -45,7 +57,7 @@ public: 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); }; @@ -87,7 +99,7 @@ public: 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); /** @@ -139,7 +151,7 @@ public: @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, @@ -154,7 +166,7 @@ wxString wxGetTextFromUser(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, diff --git a/interface/wx/tokenzr.h b/interface/wx/tokenzr.h index 3614ae1a1a..f27ba1a5f6 100644 --- a/interface/wx/tokenzr.h +++ b/interface/wx/tokenzr.h @@ -59,6 +59,9 @@ enum wxStringTokenizerMode wxTOKEN_STRTOK }; +/// Default wxStringTokenizer delimiters are the usual white space characters. +#define wxDEFAULT_DELIMITERS " \t\r\n" + /** @class wxStringTokenizer @@ -106,7 +109,7 @@ public: @see SetString() */ wxStringTokenizer(const wxString& str, - const wxString& delims = " \t\r\n", + const wxString& delims = wxDEFAULT_DELIMITERS, wxStringTokenizerMode mode = wxTOKEN_DEFAULT); /** @@ -154,8 +157,8 @@ public: 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); }; @@ -178,5 +181,5 @@ wxArrayString wxStringTokenize(const wxString& str, const wxString& delims = wxDEFAULT_DELIMITERS, wxStringTokenizerMode mode = wxTOKEN_DEFAULT); - + //@} -- 2.45.2