/////////////////////////////////////////////////////////////////////////////
-// Name: src/msw/listctrl.cpp
+// Name: src/mac/listctrl_mac.cpp
// Purpose: wxListCtrl
// Author: Julian Smart
// Modified by: Agron Selimaj
#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")
// 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;
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;
}
}
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;
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;