Minor fixes to wxRichTextCtrlXmlHandler code and docs
Fix the example showing how to use it in the docs. Don't use "maxlength" property for this control, as it's ignored by it anyhow. Closes #22467.
This commit is contained in:
parent
5b078655ed
commit
d9f36adc8f
3 changed files with 7 additions and 11 deletions
|
|
@ -1930,19 +1930,17 @@ a single wxSizer child with non-ribbon windows in it.
|
|||
@hdr3col{property, type, description}
|
||||
@row3col{value, @ref overview_xrcformat_type_text,
|
||||
Initial value of the control (default: empty).}
|
||||
@row3col{maxlength, integer,
|
||||
Maximum length of the text entered (default: unlimited).}
|
||||
@endTable
|
||||
|
||||
Notice that wxRichTextCtrl support in XRC is available in wxWidgets 2.9.5 and
|
||||
later only and you need to explicitly register its handler using
|
||||
Notice that you need to explicitly register the handler using
|
||||
@code
|
||||
#include <wx/xrc/xh_richtext.h>
|
||||
|
||||
AddHandler(new wxRichTextCtrl);
|
||||
AddHandler(new wxRichTextCtrlXmlHandler);
|
||||
@endcode
|
||||
to use it.
|
||||
|
||||
@since 2.9.5
|
||||
|
||||
@subsubsection xrc_wxscrollbar wxScrollBar
|
||||
|
||||
|
|
|
|||
|
|
@ -1404,8 +1404,7 @@ wxRichTextCtrl =
|
|||
attribute class { "wxRichTextCtrl" } &
|
||||
stdObjectNodeAttributes &
|
||||
stdWindowProperties &
|
||||
[xrc:p="o"] element value {_, t_text }* &
|
||||
[xrc:p="o"] element maxlength {_, t_integer }*
|
||||
[xrc:p="o"] element value {_, t_text }*
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,9 @@ wxRichTextCtrlXmlHandler::wxRichTextCtrlXmlHandler() : wxXmlResourceHandler()
|
|||
XRC_ADD_STYLE(wxTE_PROCESS_TAB);
|
||||
XRC_ADD_STYLE(wxTE_MULTILINE);
|
||||
XRC_ADD_STYLE(wxTE_READONLY);
|
||||
XRC_ADD_STYLE(wxTE_AUTO_URL);
|
||||
|
||||
XRC_ADD_STYLE(wxRE_CENTRE_CARET);
|
||||
XRC_ADD_STYLE(wxRE_READONLY);
|
||||
|
||||
AddWindowStyles();
|
||||
}
|
||||
|
|
@ -43,9 +45,6 @@ wxObject *wxRichTextCtrlXmlHandler::DoCreateResource()
|
|||
|
||||
SetupWindow(text);
|
||||
|
||||
if (HasParam(wxT("maxlength")))
|
||||
text->SetMaxLength(GetLong(wxT("maxlength")));
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue