mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-18 01:19:45 +08:00
Improve documentation for convenience input functions
In wxDirSelector, provide the correct default argument for the wxDirDialog style parameter, change the path parameter name to match the implementation, and fix the example code. Provide information about wxFD_ flags used by wxLoadFileSelector() and wxSaveFileSelector(). Add missing default arguments for wxGetColourFromUser() and wxGetFontFromUser() parameters. Improve formatting by using @c where appropriate.
This commit is contained in:
@@ -158,8 +158,8 @@ wxEventType wxEVT_COLOUR_CHANGED;
|
||||
|
||||
@header{wx/colordlg.h}
|
||||
*/
|
||||
wxColour wxGetColourFromUser(wxWindow* parent,
|
||||
const wxColour& colInit,
|
||||
wxColour wxGetColourFromUser(wxWindow* parent = nullptr,
|
||||
const wxColour& colInit = wxNullColour,
|
||||
const wxString& caption = wxEmptyString,
|
||||
wxColourData* data = nullptr);
|
||||
|
||||
|
||||
@@ -167,13 +167,13 @@ public:
|
||||
/**
|
||||
Pops up a directory selector dialog. The arguments have the same meaning
|
||||
as those of wxDirDialog::wxDirDialog(). The message is displayed at the
|
||||
top, and the default_path, if specified, is set as the initial selection.
|
||||
top, and the @a defaultPath, if specified, is set as the initial selection.
|
||||
|
||||
The application must check for an empty return value (if the user pressed
|
||||
Cancel). For example:
|
||||
|
||||
@code
|
||||
const wxString& dir = wxDirSelector("Choose a folder");
|
||||
const wxString dir = wxDirSelector("Choose a folder");
|
||||
if ( !dir.empty() )
|
||||
{
|
||||
...
|
||||
@@ -183,8 +183,8 @@ public:
|
||||
@header{wx/dirdlg.h}
|
||||
*/
|
||||
wxString wxDirSelector(const wxString& message = wxDirSelectorPromptStr,
|
||||
const wxString& default_path = wxEmptyString,
|
||||
long style = 0,
|
||||
const wxString& defaultPath = wxEmptyString,
|
||||
long style = wxDD_DEFAULT_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
wxWindow* parent = nullptr);
|
||||
|
||||
|
||||
@@ -495,9 +495,9 @@ public:
|
||||
default filename will be supplied. The wildcard determines what files are
|
||||
displayed in the file selector, and file extension supplies a type
|
||||
extension for the required filename. Flags may be a combination of
|
||||
wxFD_OPEN, wxFD_SAVE, wxFD_OVERWRITE_PROMPT or wxFD_FILE_MUST_EXIST.
|
||||
@c wxFD_OPEN, @c wxFD_SAVE, @c wxFD_OVERWRITE_PROMPT or @c wxFD_FILE_MUST_EXIST.
|
||||
|
||||
@note wxFD_MULTIPLE can only be used with wxFileDialog and not here since
|
||||
@note @c wxFD_MULTIPLE can only be used with wxFileDialog and not here since
|
||||
this function only returns a single file name.
|
||||
|
||||
Both the Unix and Windows versions implement a wildcard filter. Typing a
|
||||
@@ -555,6 +555,8 @@ wxString wxFileSelectorEx(const wxString& message = wxFileSelectorPromptStr,
|
||||
/**
|
||||
Shows a file dialog asking the user for a file name for opening a file.
|
||||
|
||||
The file dialog will have @c wxFD_FILE_MUST_EXIST flag set.
|
||||
|
||||
@see wxFileSelector(), wxFileDialog
|
||||
|
||||
@header{wx/filedlg.h}
|
||||
@@ -567,6 +569,8 @@ wxString wxLoadFileSelector(const wxString& what,
|
||||
/**
|
||||
Shows a file dialog asking the user for a file name for saving a file.
|
||||
|
||||
The file dialog will not have @c wxFD_OVERWRITE_PROMPT flag set.
|
||||
|
||||
@see wxFileSelector(), wxFileDialog
|
||||
|
||||
@header{wx/filedlg.h}
|
||||
|
||||
@@ -97,8 +97,8 @@ public:
|
||||
|
||||
@header{wx/fontdlg.h}
|
||||
*/
|
||||
wxFont wxGetFontFromUser(wxWindow* parent,
|
||||
const wxFont& fontInit,
|
||||
wxFont wxGetFontFromUser(wxWindow* parent = nullptr,
|
||||
const wxFont& fontInit = wxNullFont,
|
||||
const wxString& caption = wxEmptyString);
|
||||
|
||||
///@}
|
||||
|
||||
Reference in New Issue
Block a user