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:
Kevin Ollivier
2009-05-02 18:55:12 +00:00
parent 452a710f37
commit adc1049354
2 changed files with 10 additions and 1 deletions

View File

@@ -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();