Create wxStaticBoxSizer elements as children of wxStaticBox in XRC.
As we now recommend creating the controls shown inside wxStaticBox as its children, and not siblings, follow our own recommendation by doing just this in XRC handler of wxStaticBoxSizer. Also add a test of using a tooltip with a wxStaticBoxSizer element to the XRC demo showing that tooltips do work now for them, unlike before. Closes #14431. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71886 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
a19d4096a9
commit
ff1aede620
@ -80,6 +80,7 @@
|
||||
<object class="sizeritem">
|
||||
<object class="wxStaticBitmap" name="first_row[0]">
|
||||
<bitmap>update.gif</bitmap>
|
||||
<tooltip>See the tooltip!</tooltip>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
|
@ -256,7 +256,16 @@ wxObject* wxSizerXmlHandler::Handle_sizer()
|
||||
m_isInside = true;
|
||||
m_isGBS = (m_class == wxT("wxGridBagSizer"));
|
||||
|
||||
CreateChildren(m_parent, true/*only this handler*/);
|
||||
wxObject* parent = m_parent;
|
||||
#if wxUSE_STATBOX
|
||||
// wxStaticBoxSizer's child controls should be parented by the box itself,
|
||||
// not its parent.
|
||||
wxStaticBoxSizer* const stsizer = wxDynamicCast(sizer, wxStaticBoxSizer);
|
||||
if ( stsizer )
|
||||
parent = stsizer->GetStaticBox();
|
||||
#endif // wxUSE_STATBOX
|
||||
|
||||
CreateChildren(parent, true/*only this handler*/);
|
||||
|
||||
// set growable rows and cols for sizers which support this
|
||||
if ( wxFlexGridSizer *flexsizer = wxDynamicCast(sizer, wxFlexGridSizer) )
|
||||
|
Loading…
Reference in New Issue
Block a user