+
+ if (m_dbImpl)
+ {
+ DataBrowserSetOption option = kDataBrowserItemsAdd;
+ if ( stateMask == wxLIST_STATE_SELECTED && state == 0 )
+ option = kDataBrowserItemsRemove;
+
+ if (item == -1)
+ {
+ if ( HasFlag(wxLC_VIRTUAL) )
+ {
+ wxMacDataItemBrowserSelectionSuppressor suppressor(m_dbImpl);
+ m_dbImpl->SetSelectedAllItems(option);
+ }
+ else
+ {
+ for(int i = 0; i < GetItemCount();i++)
+ {
+ wxListItem info;
+ info.m_itemId = i;
+ info.m_mask = wxLIST_MASK_STATE;
+ info.m_stateMask = stateMask;
+ info.m_state = state;
+ SetItem(info);
+ }
+ }
+ }
+ else
+ {
+ if ( HasFlag(wxLC_VIRTUAL) )
+ {
+ long itemID = item+1;
+ SetDataBrowserSelectedItems(m_dbImpl->GetControlRef(), 1, (DataBrowserItemID*)&itemID, option);
+ }
+ else
+ {
+ wxListItem info;
+ info.m_itemId = item;
+ info.m_mask = wxLIST_MASK_STATE;
+ info.m_stateMask = stateMask;
+ info.m_state = state;
+ return SetItem(info);
+ }
+ }
+ }
+ return true;