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

@@ -1093,6 +1093,10 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
wxSize size2 = m_limited->GetSizeFromTextSize(m_limited->GetTextExtent("WWWWWWWW"));
m_limited->SetSizeHints(size2, size2);
wxTextCtrl* upperOnly = new MyTextCtrl(this, wxID_ANY, "Only upper case",
wxDefaultPosition, wxDefaultSize);
upperOnly->ForceUpper();
// multi line text controls
wxString string3L("Read only\nMultiline\nFitted size");
@@ -1194,6 +1198,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
column1->Add( m_password, 0, wxALL | wxEXPAND, 10 );
column1->Add( m_readonly, 0, wxALL, 10 );
column1->Add( m_limited, 0, wxALL, 10 );
column1->Add( upperOnly, 0, wxALL, 10 );
column1->Add( m_horizontal, 1, wxALL | wxEXPAND, 10 );
wxBoxSizer *column2 = new wxBoxSizer(wxVERTICAL);