Allow m_current to be used for the focused item, and reset the scroll position when removing all items from the data browser control.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@60485 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -620,7 +620,8 @@ void wxListCtrl::OnLeftDown(wxMouseEvent& event)
|
||||
|
||||
void wxListCtrl::OnDblClick(wxMouseEvent& event)
|
||||
{
|
||||
m_current = -1;
|
||||
if ( m_renameTimer->IsRunning() )
|
||||
m_renameTimer->Stop();
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
@@ -1659,6 +1660,9 @@ long wxListCtrl::GetNextItem(long item, int geom, int state) const
|
||||
if ( !IsVirtual() )
|
||||
id = (DataBrowserItemID)m_dbImpl->GetItemFromLine(line);
|
||||
|
||||
if ( (state & wxLIST_STATE_FOCUSED) && (m_current == line))
|
||||
return line;
|
||||
|
||||
if ( (state == wxLIST_STATE_DONTCARE ) )
|
||||
return line;
|
||||
|
||||
@@ -1679,6 +1683,9 @@ long wxListCtrl::GetNextItem(long item, int geom, int state) const
|
||||
if ( !IsVirtual() )
|
||||
id = (DataBrowserItemID)m_dbImpl->GetItemFromLine(line);
|
||||
|
||||
if ( (state & wxLIST_STATE_FOCUSED) && (m_current == line))
|
||||
return line;
|
||||
|
||||
if ( (state == wxLIST_STATE_DONTCARE ) )
|
||||
return line;
|
||||
|
||||
@@ -1790,6 +1797,7 @@ bool wxListCtrl::DeleteItem(long item)
|
||||
// Deletes all items
|
||||
bool wxListCtrl::DeleteAllItems()
|
||||
{
|
||||
m_current = -1;
|
||||
if (m_genericImpl)
|
||||
return m_genericImpl->DeleteAllItems();
|
||||
|
||||
|
Reference in New Issue
Block a user