Also create the controls as children of the static box, not its siblings, to
make the tooltip work under wxGTK and because this is how we recommend doing
things now.
See #9859.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74755
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
if ( m_chkGeneric->GetValue() )
{
if ( m_chkGeneric->GetValue() )
{
- m_statText = new wxGenericStaticText(this, wxID_ANY,
+ m_statText = new wxGenericStaticText(staticBox, wxID_ANY,
m_textLabel->GetValue(),
wxDefaultPosition, wxDefaultSize,
flagsDummyText);
#if wxUSE_MARKUP
m_textLabel->GetValue(),
wxDefaultPosition, wxDefaultSize,
flagsDummyText);
#if wxUSE_MARKUP
- m_statMarkup = new wxGenericStaticText(this, wxID_ANY,
+ m_statMarkup = new wxGenericStaticText(staticBox, wxID_ANY,
wxString(),
wxDefaultPosition, wxDefaultSize,
flagsText);
wxString(),
wxDefaultPosition, wxDefaultSize,
flagsText);
}
else // use native versions
{
}
else // use native versions
{
- m_statText = new wxStaticText(this, wxID_ANY,
+ m_statText = new wxStaticText(staticBox, wxID_ANY,
m_textLabel->GetValue(),
wxDefaultPosition, wxDefaultSize,
flagsDummyText);
#if wxUSE_MARKUP
m_textLabel->GetValue(),
wxDefaultPosition, wxDefaultSize,
flagsDummyText);
#if wxUSE_MARKUP
- m_statMarkup = new wxStaticText(this, wxID_ANY,
+ m_statMarkup = new wxStaticText(staticBox, wxID_ANY,
wxString(),
wxDefaultPosition, wxDefaultSize,
flagsText);
#endif // wxUSE_MARKUP
}
wxString(),
wxDefaultPosition, wxDefaultSize,
flagsText);
#endif // wxUSE_MARKUP
}
+ m_statText->SetToolTip("Tooltip for a label inside the box");
+
#if wxUSE_MARKUP
m_statMarkup->SetLabelMarkup(m_textLabelWithMarkup->GetValue());
#if wxUSE_MARKUP
m_statMarkup->SetLabelMarkup(m_textLabelWithMarkup->GetValue());
#endif // wxUSE_MARKUP
#if wxUSE_STATLINE
#endif // wxUSE_MARKUP
#if wxUSE_STATLINE
- m_statLine = new wxStaticLine(this, wxID_ANY,
+ m_statLine = new wxStaticLine(staticBox, wxID_ANY,
wxDefaultPosition, wxDefaultSize,
isVert ? wxLI_VERTICAL : wxLI_HORIZONTAL);
#endif // wxUSE_STATLINE
wxDefaultPosition, wxDefaultSize,
isVert ? wxLI_VERTICAL : wxLI_HORIZONTAL);
#endif // wxUSE_STATLINE
- m_sizerStatBox->Add(m_statText, 1, wxGROW | wxALL, 5);
+ m_sizerStatBox->Add(m_statText, 0, wxGROW | wxALL, 5);
#if wxUSE_STATLINE
m_sizerStatBox->Add(m_statLine, 0, wxGROW | wxALL, 5);
#endif // wxUSE_STATLINE
#if wxUSE_MARKUP
#if wxUSE_STATLINE
m_sizerStatBox->Add(m_statLine, 0, wxGROW | wxALL, 5);
#endif // wxUSE_STATLINE
#if wxUSE_MARKUP
- m_sizerStatBox->Add(m_statMarkup, 1, wxGROW | wxALL, 5);
+ m_sizerStatBox->Add(m_statMarkup, 0, wxALL, 5);
- m_sizerStatic->Add(m_sizerStatBox, 1, wxGROW);
+ m_sizerStatic->Add(m_sizerStatBox, 0, wxGROW);