X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2571a33fd3292007bef177a5063736b128c52c8a..c4825ef73a5f190b8f39c59df098c3f39fa4464b:/src/generic/datavgen.cpp diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 23bc5ec610..fb301b760d 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -4093,6 +4093,10 @@ void wxDataViewCtrl::Init() { m_cols.DeleteContents(true); m_notifier = NULL; + + // No sorting column at start + m_sortingColumn = NULL; + m_headerArea = NULL; } bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, @@ -4102,14 +4106,14 @@ bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, if ( (style & wxBORDER_MASK) == 0) style |= wxBORDER_SUNKEN; + Init(); + if (!wxControl::Create( parent, id, pos, size, style | wxScrolledWindowStyle, validator)) return false; SetInitialSize(size); - Init(); - #ifdef __WXMAC__ MacSetClipChildren( true ); #endif @@ -4154,7 +4158,7 @@ WXLRESULT wxDataViewCtrl::MSWWindowProc(WXUINT nMsg, wxSize wxDataViewCtrl::GetSizeAvailableForScrollTarget(const wxSize& size) { wxSize newsize = size; - if (!HasFlag(wxDV_NO_HEADER)) + if (!HasFlag(wxDV_NO_HEADER) && (m_headerArea)) newsize.y -= m_headerArea->GetSize().y; return newsize;