From 3ed1dc0add87e5685f1f506780723728bbd57a93 Mon Sep 17 00:00:00 2001 From: Kevin Ollivier Date: Mon, 2 Oct 2006 22:48:14 +0000 Subject: [PATCH] Remove the ability to sort by column in virtual wxListCtrl, and remove movable columns as we don't currently support it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41583 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/listctrl_mac.cpp | 15 +++++++++------ src/mac/carbon/utils.cpp | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/mac/carbon/listctrl_mac.cpp b/src/mac/carbon/listctrl_mac.cpp index 31c3638d6b..f41b579bc8 100644 --- a/src/mac/carbon/listctrl_mac.cpp +++ b/src/mac/carbon/listctrl_mac.cpp @@ -1217,15 +1217,18 @@ long wxListCtrl::InsertColumn(long col, wxListItem& item) } m_dbImpl->InsertColumn(col, type, item.GetText(), just, item.GetWidth()); + // set/remove options based on the wxListCtrl type. + DataBrowserTableViewColumnID id; + m_dbImpl->GetColumnIDFromIndex(col, &id); + DataBrowserPropertyFlags flags; + verify_noerr(m_dbImpl->GetPropertyFlags(id, &flags)); if (GetWindowStyleFlag() & wxLC_EDIT_LABELS) - { - DataBrowserTableViewColumnID id; - m_dbImpl->GetColumnIDFromIndex(col, &id); - DataBrowserPropertyFlags flags; - verify_noerr(m_dbImpl->GetPropertyFlags(id, &flags)); flags |= kDataBrowserPropertyIsEditable; - verify_noerr(m_dbImpl->SetPropertyFlags(id, flags)); + + if (GetWindowStyleFlag() & wxLC_VIRTUAL){ + flags &= ~kDataBrowserListViewSortableColumn; } + verify_noerr(m_dbImpl->SetPropertyFlags(id, flags)); } return col; diff --git a/src/mac/carbon/utils.cpp b/src/mac/carbon/utils.cpp index d2a07749ca..33f2e098ce 100644 --- a/src/mac/carbon/utils.cpp +++ b/src/mac/carbon/utils.cpp @@ -1900,7 +1900,7 @@ void wxMacDataItemBrowserControl::InsertColumn(int colId, DataBrowserPropertyTyp columnDesc.propertyDesc.propertyID = (kMinColumnId + colId); columnDesc.propertyDesc.propertyType = colType; - columnDesc.propertyDesc.propertyFlags = kDataBrowserListViewDefaultColumnFlags | kDataBrowserListViewTypeSelectColumn; + columnDesc.propertyDesc.propertyFlags = kDataBrowserListViewSortableColumn | kDataBrowserListViewTypeSelectColumn; #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 columnDesc.propertyDesc.propertyFlags |= kDataBrowserListViewNoGapForIconInHeaderButton; #endif -- 2.47.2