X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b8d6be7f5789b6c3d53f98f7ee2e8620a227ca67..92c0fc34c104c8d7c12d6a3b78ea232690fc23f4:/interface/wx/textdlg.h diff --git a/interface/wx/textdlg.h b/interface/wx/textdlg.h index 04157bea53..04d4d6411b 100644 --- a/interface/wx/textdlg.h +++ b/interface/wx/textdlg.h @@ -2,7 +2,6 @@ // Name: textdlg.h // Purpose: interface of wxPasswordEntryDialog // Author: wxWidgets team -// RCS-ID: $Id$ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -135,6 +134,40 @@ 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); + //@} + + /** + This function sets the maximum number of characters the user can enter + into this dialog. + + @see wxTextEntry::SetMaxLength() + + @since 2.9.5 + */ + void SetMaxLength(unsigned long len); + /** Sets the default text value. */ @@ -143,6 +176,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(); };