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:
@@ -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
|
||||
|
Reference in New Issue
Block a user