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

@@ -14,6 +14,8 @@
#include "wx/combobox.h"
#include "wx/osx/private.h"
@class wxTextEntryFormatter;
// implementation exposed, so that search control can pull it
class wxNSTextFieldControl : public wxWidgetCocoaImpl, public wxTextWidgetImpl
@@ -29,7 +31,10 @@ public :
virtual bool CanClipMaxLength() const { return true; }
virtual void SetMaxLength(unsigned long len);
virtual bool CanForceUpper() { return true; }
virtual void ForceUpper();
virtual wxString GetStringValue() const ;
virtual void SetStringValue( const wxString &str) ;
virtual void Copy() ;
@@ -57,6 +62,9 @@ protected :
private:
// Common part of both ctors.
void Init(WXWidget w);
// Get our formatter, creating it if necessary.
wxTextEntryFormatter* GetFormatter();
};
class wxNSTextViewControl : public wxWidgetCocoaImpl, public wxTextWidgetImpl