X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3c7789014106c9269b0f4ecc1a3071b14f351d3f..eea4d01c65f9b29baa1193db762b4c6b8144af24:/src/common/headerctrlcmn.cpp diff --git a/src/common/headerctrlcmn.cpp b/src/common/headerctrlcmn.cpp index 1299bb9a37..4e32625c6b 100644 --- a/src/common/headerctrlcmn.cpp +++ b/src/common/headerctrlcmn.cpp @@ -45,6 +45,8 @@ const unsigned int wxNO_COLUMN = static_cast(-1); // wxHeaderColumnsRearrangeDialog: dialog for customizing our columns // ---------------------------------------------------------------------------- +#if wxUSE_REARRANGECTRL + class wxHeaderColumnsRearrangeDialog : public wxRearrangeDialog { public: @@ -63,6 +65,8 @@ public: } }; +#endif // wxUSE_REARRANGECTRL + } // anonymous namespace // ============================================================================ @@ -110,8 +114,15 @@ void wxHeaderCtrlBase::SetColumnCount(unsigned int count) void wxHeaderCtrlBase::OnSeparatorDClick(wxHeaderCtrlEvent& event) { const unsigned col = event.GetColumn(); + const wxHeaderColumn& column = GetColumn(col); + + if ( !column.IsResizeable() ) + { + event.Skip(); + return; + } - int w = wxWindowBase::GetTextExtent(GetColumn(col).GetTitle()).x; + int w = wxWindowBase::GetTextExtent(column.GetTitle()).x; w += 4*GetCharWidth(); // add some arbitrary margins around text if ( !UpdateColumnWidthToFit(col, w) )