wxWindow与wxSizer
每个wxWindow都有一个m_contaningSizer(包含这个wxWindow窗口),还有一个m_windowSizer(这个窗口所包含的顶层wxSizer)。
设置包含这个window的sizer
设置这个窗口包含的顶层sizer
每个wxWindow都有一个m_contaningSizer(包含这个wxWindow窗口),还有一个m_windowSizer(这个窗口所包含的顶层wxSizer)。
设置包含这个window的sizer
void wxWindowBase::SetContainingSizer(wxSizer* sizer)
{
// adding a window to a sizer twice is going to result in fatal and
// hard to debug problems later because when deleting the second
// associated wxSizerItem we're going to dereference a dangling
// pointer; so try to detect this as early as possible
wxASSERT_MSG( !sizer || m_containingSizer != sizer,
_T("Adding a window to the same sizer twice?") );
m_containingSizer = sizer;
}
设置这个窗口包含的顶层sizer
void wxWindowBase::SetSizer(wxSizer *sizer, bool deleteOld)
{
if ( sizer == m_windowSizer)
return;</em>
if ( m_windowSizer )
{
m_windowSizer->