X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f42e073cda58271789b033c718a6723e8b9012c1..f43426c1b97fe120b04c9a65d855d6861404ac14:/src/mac/carbon/listctrl_mac.cpp diff --git a/src/mac/carbon/listctrl_mac.cpp b/src/mac/carbon/listctrl_mac.cpp index 6e5848c6a4..f41b579bc8 100644 --- a/src/mac/carbon/listctrl_mac.cpp +++ b/src/mac/carbon/listctrl_mac.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: src/msw/listctrl.cpp +// Name: src/mac/listctrl_mac.cpp // Purpose: wxListCtrl // Author: Julian Smart // Modified by: Agron Selimaj @@ -26,19 +26,15 @@ #if wxUSE_LISTCTRL +#include "wx/listctrl.h" + #ifndef WX_PRECOMP - #include "wx/app.h" #include "wx/intl.h" - #include "wx/log.h" - #include "wx/settings.h" - #include "wx/dcclient.h" - #include "wx/textctrl.h" #endif #include "wx/mac/uma.h" #include "wx/imaglist.h" -#include "wx/listctrl.h" #include "wx/sysopt.h" #define wxMAC_ALWAYS_USE_GENERIC_LISTCTRL wxT("mac.listctrl.always_use_generic") @@ -270,7 +266,7 @@ bool wxListCtrl::Create(wxWindow *parent, // Also, use generic list control in VIRTUAL mode. if ( (wxSystemOptions::HasOption( wxMAC_ALWAYS_USE_GENERIC_LISTCTRL ) && (wxSystemOptions::GetOptionInt( wxMAC_ALWAYS_USE_GENERIC_LISTCTRL ) == 1)) || - (style & wxLC_ICON) || (style & wxLC_SMALL_ICON) || (style & wxLC_LIST) || (style & wxLC_VIRTUAL) ) + (style & wxLC_ICON) || (style & wxLC_SMALL_ICON) || (style & wxLC_LIST) /* || (style & wxLC_VIRTUAL) */ ) { m_macIsUserPane = true; @@ -856,6 +852,18 @@ long wxListCtrl::GetNextItem(long item, int geom, int state) const if (m_genericImpl) return m_genericImpl->GetNextItem(item, geom, state); + if (m_dbImpl && geom == wxLIST_NEXT_ALL && state == wxLIST_STATE_SELECTED ) + { + long count = m_dbImpl->MacGetCount() ; + for ( long line = item + 1 ; line < count; line++ ) + { + wxMacDataItem* id = m_dbImpl->GetItemFromLine(line); + if ( m_dbImpl->IsItemSelected(id ) ) + return line; + } + return -1; + } + return 0; } @@ -1209,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; @@ -1487,7 +1498,10 @@ wxMacDataBrowserListCtrlControl::wxMacDataBrowserListCtrlControl( wxWindow *peer if ( style & wxLC_LIST || style & wxLC_NO_HEADER ) verify_noerr( SetHeaderButtonHeight( 0 ) ); - SetSortProperty( kMinColumnId ); + if ( m_isVirtual ) + SetSortProperty( kMinColumnId - 1 ); + else + SetSortProperty( kMinColumnId ); if ( style & wxLC_SORT_ASCENDING ) { m_sortOrder = SortOrder_Text_Ascending;