Skip to content

Commit

Permalink
Add support for "hint" property in wxTextCtrl XRC handler.
Browse files Browse the repository at this point in the history
It is convenient to allow specifying the hints directly in the resources.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76629 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
  • Loading branch information
vadz committed May 30, 2014
1 parent 60972cc commit 21fd108
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/doxygen/overviews/xrc_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -1864,6 +1864,8 @@ 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{hint, @ref overview_xrcformat_type_text,
Hint shown in empty control (new since wxWidgets 3.0.1).}
@endTable
Expand Down
3 changes: 2 additions & 1 deletion misc/schema/xrc_schema.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,8 @@ wxRichTextCtrl =
stdObjectNodeAttributes &
stdWindowProperties &
[xrc:p="o"] element value {_, t_text }* &
[xrc:p="o"] element maxlength {_, t_integer }*
[xrc:p="o"] element maxlength {_, t_integer }* &
[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 @@ -69,6 +69,8 @@ wxObject *wxTextCtrlXmlHandler::DoCreateResource()
if (HasParam(wxT("maxlength")))
text->SetMaxLength(GetLong(wxT("maxlength")));

text->SetHint(GetText(wxS("hint")));

return text;
}

Expand Down

0 comments on commit 21fd108

Please sign in to comment.