X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7577ac4b5c56d384441b995b4cea3b24d5fc441e..f6388667682be59eb1f8bbcb82fd489889358aad:/src/xrc/xh_radbx.cpp diff --git a/src/xrc/xh_radbx.cpp b/src/xrc/xh_radbx.cpp index 83be9a2d29..2b5a066b1d 100644 --- a/src/xrc/xh_radbx.cpp +++ b/src/xrc/xh_radbx.cpp @@ -21,10 +21,9 @@ #ifndef WX_PRECOMP #include "wx/intl.h" + #include "wx/radiobox.h" #endif -#include "wx/radiobox.h" - IMPLEMENT_DYNAMIC_CLASS(wxRadioBoxXmlHandler, wxXmlResourceHandler) wxRadioBoxXmlHandler::wxRadioBoxXmlHandler() @@ -81,37 +80,53 @@ wxObject *wxRadioBoxXmlHandler::DoCreateResource() SetupWindow(control); -#if wxUSE_TOOLTIPS const unsigned count = labels.size(); for( unsigned i = 0; i < count; i++ ) { +#if wxUSE_TOOLTIPS if ( !tooltips[i].empty() ) control->SetItemToolTip(i, tooltips[i]); - } #endif // wxUSE_TOOLTIPS +#if wxUSE_HELP + if ( helptextSpecified[i] ) + control->SetItemHelpText(i, helptexts[i]); +#endif // wxUSE_HELP + } labels.clear(); // dump the strings + tooltips.clear(); // dump the tooltips + helptexts.clear(); // dump the helptexts + helptextSpecified.clear(); + return control; } else // inside the radiobox element { - // we handle Label constructs here + // we handle handle Label constructs here wxString str = GetNodeContent(m_node); + wxString tooltip; m_node->GetPropVal(wxT("tooltip"), &tooltip); + wxString helptext; + bool hasHelptext = m_node->GetPropVal(wxT("helptext"), &helptext); + if (m_resource->GetFlags() & wxXRC_USE_LOCALE) { str = wxGetTranslation(str); if ( !tooltip.empty() ) tooltip = wxGetTranslation(tooltip); + if ( hasHelptext ) + helptext = wxGetTranslation(helptext); } labels.push_back(str); tooltips.push_back(tooltip); + helptexts.push_back(helptext); + helptextSpecified.push_back(hasHelptext); return NULL; }