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
This commit is contained in:
Vadim Zeitlin
2012-03-04 00:29:07 +00:00
parent 3285e9a347
commit 0b59366faa
6 changed files with 104 additions and 43 deletions

View 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 wxString& caption,
const wxArrayString& aChoices, const wxArrayString& aChoices,
wxWindow* parent = NULL, wxWindow* parent = NULL,
int x = -1, int x = wxDefaultCoord,
int y = -1, int y = wxDefaultCoord,
bool centre = true, bool centre = true,
int width = 150, int width = wxCHOICE_WIDTH,
int height = 200, int height = wxCHOICE_HEIGHT,
int initialSelection = 0); int initialSelection = 0);
int wxGetSingleChoiceIndex(const wxString& message, int wxGetSingleChoiceIndex(const wxString& message,
@@ -326,11 +344,11 @@ int wxGetSingleChoiceIndex(const wxString& message,
int n, int n,
const wxString& choices[], const wxString& choices[],
wxWindow* parent = NULL, wxWindow* parent = NULL,
int x = -1, int x = wxDefaultCoord,
int y = -1, int y = wxDefaultCoord,
bool centre = true, bool centre = true,
int width = 150, int width = wxCHOICE_WIDTH,
int height = 200, int height = wxCHOICE_HEIGHT,
int initialSelection = 0); int initialSelection = 0);
@@ -374,22 +392,22 @@ wxString wxGetSingleChoice(const wxString& message,
const wxString& caption, const wxString& caption,
const wxArrayString& aChoices, const wxArrayString& aChoices,
wxWindow* parent = NULL, wxWindow* parent = NULL,
int x = -1, int x = wxDefaultCoord,
int y = -1, int y = wxDefaultCoord,
bool centre = true, bool centre = true,
int width = 150, int width = wxCHOICE_WIDTH,
int height = 200 int height = wxCHOICE_HEIGHT,
int initialSelection = 0); int initialSelection = 0);
wxString wxGetSingleChoice(const wxString& message, wxString wxGetSingleChoice(const wxString& message,
const wxString& caption, const wxString& caption,
int n, int n,
const wxString& choices[], const wxString& choices[],
wxWindow* parent = NULL, wxWindow* parent = NULL,
int x = -1, int x = wxDefaultCoord,
int y = -1, int y = wxDefaultCoord,
bool centre = true, bool centre = true,
int width = 150, int width = wxCHOICE_WIDTH,
int height = 200 int height = wxCHOICE_HEIGHT,
int initialSelection = 0); int initialSelection = 0);
@@ -427,11 +445,11 @@ wxString wxGetSingleChoiceData(const wxString& message,
const wxArrayString& aChoices, const wxArrayString& aChoices,
const wxString& client_data[], const wxString& client_data[],
wxWindow* parent = NULL, wxWindow* parent = NULL,
int x = -1, int x = wxDefaultCoord,
int y = -1, int y = wxDefaultCoord,
bool centre = true, bool centre = true,
int width = 150, int width = wxCHOICE_WIDTH,
int height = 200 int height = wxCHOICE_HEIGHT,
int initialSelection = 0); int initialSelection = 0);
wxString wxGetSingleChoiceData(const wxString& message, wxString wxGetSingleChoiceData(const wxString& message,
@@ -440,11 +458,11 @@ wxString wxGetSingleChoiceData(const wxString& message,
const wxString& choices[], const wxString& choices[],
const wxString& client_data[], const wxString& client_data[],
wxWindow* parent = NULL, wxWindow* parent = NULL,
int x = -1, int x = wxDefaultCoord,
int y = -1, int y = wxDefaultCoord,
bool centre = true, bool centre = true,
int width = 150, int width = wxCHOICE_WIDTH,
int height = 200 int height = wxCHOICE_HEIGHT,
int initialSelection = 0); int initialSelection = 0);
void* wxGetSingleChoiceData(const wxString& message, void* wxGetSingleChoiceData(const wxString& message,
@@ -494,11 +512,11 @@ int wxGetSelectedChoices(wxArrayInt& selections,
const wxString& caption, const wxString& caption,
const wxArrayString& aChoices, const wxArrayString& aChoices,
wxWindow* parent = NULL, wxWindow* parent = NULL,
int x = -1, int x = wxDefaultCoord,
int y = -1, int y = wxDefaultCoord,
bool centre = true, bool centre = true,
int width = 150, int width = wxCHOICE_WIDTH,
int height = 200); int height = wxCHOICE_HEIGHT);
int wxGetSelectedChoices(wxArrayInt& selections, int wxGetSelectedChoices(wxArrayInt& selections,
const wxString& message, const wxString& message,
@@ -506,11 +524,11 @@ int wxGetSelectedChoices(wxArrayInt& selections,
int n, int n,
const wxString& choices[], const wxString& choices[],
wxWindow* parent = NULL, wxWindow* parent = NULL,
int x = -1, int x = wxDefaultCoord,
int y = -1, int y = wxDefaultCoord,
bool centre = true, bool centre = true,
int width = 150, int width = wxCHOICE_WIDTH,
int height = 200); int height = wxCHOICE_HEIGHT);
//@} //@}

View 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

View 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_path = wxEmptyString,
const wxString& default_filename = wxEmptyString, const wxString& default_filename = wxEmptyString,
const wxString& default_extension = wxEmptyString, const wxString& default_extension = wxEmptyString,
const wxString& wildcard = ".", const wxString& wildcard = wxFileSelectorDefaultWildcardStr,
int flags = 0, int flags = 0,
wxWindow* parent = NULL, wxWindow* parent = NULL,
int x = -1, int x = wxDefaultCoord,
int y = -1); int y = wxDefaultCoord);
//@} //@}

View File

@@ -6,6 +6,12 @@
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
/**
Default message box caption string.
*/
const char wxMessageBoxCaptionStr[] = "Message";
/** /**
@class wxMessageDialog @class wxMessageDialog

View 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, wxPasswordEntryDialog(wxWindow* parent, const wxString& message,
const wxString& caption = wxGetPasswordFromUserPromptStr, const wxString& caption = wxGetPasswordFromUserPromptStr,
const wxString& defaultValue = wxEmptyString, 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, wxTextEntryDialog(wxWindow* parent, const wxString& message,
const wxString& caption = wxGetTextFromUserPromptStr, const wxString& caption = wxGetTextFromUserPromptStr,
const wxString& value = wxEmptyString, 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} @header{wx/textdlg.h}
*/ */
wxString wxGetTextFromUser(const wxString& message, wxString wxGetTextFromUser(const wxString& message,
const wxString& caption = "Input text", const wxString& caption = wxGetTextFromUserPromptStr,
const wxString& default_value = wxEmptyString, const wxString& default_value = wxEmptyString,
wxWindow* parent = NULL, wxWindow* parent = NULL,
int x = wxDefaultCoord, int x = wxDefaultCoord,
@@ -154,7 +166,7 @@ wxString wxGetTextFromUser(const wxString& message,
@header{wx/textdlg.h} @header{wx/textdlg.h}
*/ */
wxString wxGetPasswordFromUser(const wxString& message, wxString wxGetPasswordFromUser(const wxString& message,
const wxString& caption = "Input text", const wxString& caption = wxGetPasswordFromUserPromptStr,
const wxString& default_value = wxEmptyString, const wxString& default_value = wxEmptyString,
wxWindow* parent = NULL, wxWindow* parent = NULL,
int x = wxDefaultCoord, int x = wxDefaultCoord,

View 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() @see SetString()
*/ */
wxStringTokenizer(const wxString& str, 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 containing delimiters, and the @a mode specifying how the string
should be tokenized. should be tokenized.
*/ */
void SetString(const wxString& to_tokenize, void SetString(const wxString& str,
const wxString& delims = " \t\r\n", const wxString& delims = wxDEFAULT_DELIMITERS,
wxStringTokenizerMode mode = wxTOKEN_DEFAULT); wxStringTokenizerMode mode = wxTOKEN_DEFAULT);
}; };
@@ -178,5 +181,5 @@ wxArrayString
wxStringTokenize(const wxString& str, wxStringTokenize(const wxString& str,
const wxString& delims = wxDEFAULT_DELIMITERS, const wxString& delims = wxDEFAULT_DELIMITERS,
wxStringTokenizerMode mode = wxTOKEN_DEFAULT); wxStringTokenizerMode mode = wxTOKEN_DEFAULT);
//@} //@}