Skip to content

Commit

Permalink
Add support for "forceupper" attribute to wxTextCtrl in XRC
Browse files Browse the repository at this point in the history
Call ForceUpper() if this attribute is specified.

Currently this is done only for wxTextCtrl but could be extended to wxComboBox
later too if necessary.
  • Loading branch information
vadz committed Dec 8, 2015
1 parent 69b66e9 commit 60c2b96
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/doxygen/overviews/xrc_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -1900,6 +1900,9 @@ No additional properties.
Initial value of the control (default: empty).}
@row3col{maxlength, integer,
Maximum length of the text which can be entered by user (default: unlimited).}
@row3col{forceupper, @ref overview_xrcformat_type_bool,
If true, use wxTextEntry::ForceUpper() to force the control contents to be
upper case.}
@row3col{hint, @ref overview_xrcformat_type_text,
Hint shown in empty control (new since wxWidgets 3.0.1).}
@endTable
Expand Down
1 change: 1 addition & 0 deletions misc/schema/xrc_schema.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -1432,6 +1432,7 @@ wxTextCtrl =
stdWindowProperties &
[xrc:p="o"] element value {_, t_text }* &
[xrc:p="o"] element maxlength {_, t_integer }* &
[xrc:p="o"] element forceupper{_, t_bool }* &
[xrc:p="o"] element hint {_, t_text }*
}

Expand Down
2 changes: 2 additions & 0 deletions src/xrc/xh_text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ wxObject *wxTextCtrlXmlHandler::DoCreateResource()

if (HasParam(wxT("maxlength")))
text->SetMaxLength(GetLong(wxT("maxlength")));
if (GetBool(wxS("forceupper")))
text->ForceUpper();

const wxString hint = GetText(wxS("hint"));
if (!hint.empty())
Expand Down

0 comments on commit 60c2b96

Please sign in to comment.