X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6b06a7271f80f6823a6ebe5ca0960db5413b289a..ddac39da933484ea3d2034080df9af3cbcc266d8:/src/generic/listctrl.cpp diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 627f683f44..67562c04aa 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -2160,16 +2160,17 @@ bool wxListTextCtrlWrapper::AcceptChanges() { const wxString value = m_text->GetValue(); - if ( value == m_startValue ) - // nothing changed, always accept - return true; - + // notice that we should always call OnRenameAccept() to generate the "end + // label editing" event, even if the user hasn't really changed anything if ( !m_owner->OnRenameAccept(m_itemEdited, value) ) + { // vetoed by the user return false; + } - // accepted, do rename the item - m_owner->SetItemText(m_itemEdited, value); + // accepted, do rename the item (unless nothing changed) + if ( value != m_startValue ) + m_owner->SetItemText(m_itemEdited, value); return true; } @@ -4999,6 +5000,9 @@ bool wxGenericListCtrl::Create(wxWindow *parent, if ( !wxControl::Create( parent, id, pos, size, style, validator, name ) ) return false; + // this window itself shouldn't get the focus, only m_mainWin should + SetCanFocus(false); + // don't create the inner window with the border style &= ~wxBORDER_MASK;