X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/695237bccd652c60deba347117ba5ab32067880c..45816ddded844f0bb76b8c44a0ccf429e1aa19f7:/src/generic/listctrl.cpp diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 1ba7eda09d..fa4ced72aa 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -1060,24 +1060,33 @@ void wxListTextCtrl::OnChar( wxKeyEvent &event ) { (*m_accept) = TRUE; (*m_res) = GetValue(); - m_owner->SetFocus(); + + if (!wxPendingDelete.Member(this)) + wxPendingDelete.Append(this); + + if ((*m_accept) && ((*m_res) != m_startValue)) + m_owner->OnRenameAccept(); + return; } if (event.m_keyCode == WXK_ESCAPE) { (*m_accept) = FALSE; (*m_res) = ""; - m_owner->SetFocus(); + + if (!wxPendingDelete.Member(this)) + wxPendingDelete.Append(this); + return; } + event.Skip(); } void wxListTextCtrl::OnKillFocus( wxFocusEvent &WXUNUSED(event) ) { - if (wxPendingDelete.Member(this)) return; - - wxPendingDelete.Append(this); + if (!wxPendingDelete.Member(this)) + wxPendingDelete.Append(this); if ((*m_accept) && ((*m_res) != m_startValue)) m_owner->OnRenameAccept(); @@ -1097,7 +1106,7 @@ BEGIN_EVENT_TABLE(wxListMainWindow,wxScrolledWindow) EVT_KEY_DOWN (wxListMainWindow::OnKeyDown) EVT_SET_FOCUS (wxListMainWindow::OnSetFocus) EVT_KILL_FOCUS (wxListMainWindow::OnKillFocus) - EVT_SCROLL (wxListMainWindow::OnScroll) + EVT_SCROLLWIN (wxListMainWindow::OnScroll) END_EVENT_TABLE() wxListMainWindow::wxListMainWindow() @@ -1166,7 +1175,7 @@ wxListMainWindow::wxListMainWindow( wxWindow *parent, wxWindowID id, m_renameTimer = new wxListRenameTimer( this ); m_renameAccept = FALSE; - SetBackgroundColour( *wxWHITE ); + SetBackgroundColour( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_LISTBOX ) ); } wxListMainWindow::~wxListMainWindow() @@ -2734,7 +2743,7 @@ bool wxListCtrl::Create(wxWindow *parent, m_headerWin = (wxListHeaderWindow *) NULL; } - SetBackgroundColour( *wxWHITE ); + SetBackgroundColour( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_LISTBOX ) ); return ret; }