Make it simpler to use mnemonics for wxRadioBox items in XRC
Allow specifying label="1" attribute in wxRadioBox <item> tags to indicate that the usual translation of "_" to "&" should be done, as for all the other labels. This is still not the default behaviour to avoid breaking any existing XRC files using "_", even though using labels="1" by default would make more sense.
This commit is contained in:
@@ -981,9 +981,14 @@ GetNodeContentsKind(wxXmlNode& node, const wxString& contents)
|
||||
}
|
||||
|
||||
// This one is special: it is translated in XRC, but its contents is not
|
||||
// escaped.
|
||||
// escaped, except for the special case of wxRadioBox when it can be, if
|
||||
// "label" attribute is supplied.
|
||||
if ( node.GetName() == wxT("item") )
|
||||
return Contents_TransOnly;
|
||||
{
|
||||
return node.GetAttribute(wxT("label"), wxT("0")) == wxT("1")
|
||||
? Contents_Text
|
||||
: Contents_TransOnly;
|
||||
}
|
||||
|
||||
return Contents_NotTrans;
|
||||
}
|
||||
|
Reference in New Issue
Block a user