Add wxTextEntry::ForceUpper()

Allow automatically converting lower-case letters entered into wxTextCtrl to
upper-case equivalents. Provide generic fallback and implement the method
natively for all the major platforms.

Also update the text sample to show it in action.
This commit is contained in:
Vadim Zeitlin
2015-11-25 03:40:40 +01:00
parent 99d9a81e28
commit 69b66e9e2e
14 changed files with 238 additions and 18 deletions

View File

@@ -138,10 +138,16 @@ public:
virtual void SetEditable(bool editable) = 0;
// input restrictions
// ------------------
// set the max number of characters which may be entered in a single line
// text control
virtual void SetMaxLength(unsigned long WXUNUSED(len)) { }
// convert any lower-case characters to upper-case on the fly in this entry
virtual void ForceUpper();
// hints
// -----
@@ -208,6 +214,10 @@ public:
SuppressTextChangedEvents();
}
// change the entry value to be in upper case only, if needed (i.e. if it's
// not already the case)
void ConvertToUpperCase();
protected:
// flags for DoSetValue(): common part of SetValue() and ChangeValue() and
// also used to implement WriteText() in wxMSW