Move m_labelWin to wxStaticBoxBase itself
It will be reused by all platforms and is not specific to wxGTK. This also means WXDestroyWithoutChildren() doesn't need to be virtual any longer.
This commit is contained in:
@@ -31,6 +31,8 @@ extern WXDLLEXPORT_DATA(const char) wxStaticBoxNameStr[] = "groupBox";
|
||||
|
||||
wxStaticBoxBase::wxStaticBoxBase()
|
||||
{
|
||||
m_labelWin = NULL;
|
||||
|
||||
#ifndef __WXGTK__
|
||||
m_container.DisableSelfFocus();
|
||||
#endif
|
||||
@@ -46,7 +48,15 @@ void wxStaticBoxBase::WXDestroyWithoutChildren()
|
||||
i != children.end();
|
||||
++i )
|
||||
{
|
||||
(*i)->Reparent(parent);
|
||||
// The label window doesn't count as our child, it's really a part of
|
||||
// static box itself and it makes no sense to leave it alive when the
|
||||
// box is destroyed, so do it even when it's supposed to be destroyed
|
||||
// without destroying its children -- by not reparenting it, we ensure
|
||||
// that it's destroyed when this object itself is below.
|
||||
if ( *i != m_labelWin )
|
||||
{
|
||||
(*i)->Reparent(parent);
|
||||
}
|
||||
}
|
||||
|
||||
delete this;
|
||||
|
||||
Reference in New Issue
Block a user