From: Vadim Zeitlin Date: Thu, 4 Apr 2013 00:11:03 +0000 (+0000) Subject: Document wxTextEntryDialog::SetTextValidator(). X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/7ed5247448973951b2accfe797386fe07c6a44f4?hp=42fe16e58be724a33c50fcf3911a7ae0fb753cb9 Document wxTextEntryDialog::SetTextValidator(). These methods exist since r15925 but were never documented. See #5420. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73775 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/interface/wx/textdlg.h b/interface/wx/textdlg.h index 04157bea53..0a8bb93d7d 100644 --- a/interface/wx/textdlg.h +++ b/interface/wx/textdlg.h @@ -135,6 +135,30 @@ public: */ wxString GetValue() const; + /** + Associate a validator with the text control used by the dialog. + + These methods can be used to limit the user entry to only some + characters, e.g. + @code + wxTextEntryDialog dlg(this, ...); + dlg.SetTextValidator(wxFILTER_ALPHA); + if ( dlg.ShowModal() == wxID_OK ) + { + // We can be certain that this string contains letters only. + wxString value = dlg.GetValue(); + } + @endcode + + The first overload uses the provided @a validator which can be of a + custom class derived from wxTextValidator while the second one creates + a wxTextValidator with the specified @a style. + */ + //@{ + void SetTextValidator(const wxTextValidator& validator); + void SetTextValidator(wxTextValidatorStyle style = wxFILTER_NONE); + //@} + /** Sets the default text value. */ @@ -143,6 +167,9 @@ public: /** Shows the dialog, returning wxID_OK if the user pressed OK, and wxID_CANCEL otherwise. + + Call GetValue() to retrieve the values of the string entered by the + user after showing the dialog. */ int ShowModal(); };