Make list consistent with tree in terms of Vetoed changes closing the inline edit and right-clicking on an item selecting it [patch 1110252]

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31646 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Kevin Hock 2005-01-29 23:52:55 +00:00
parent 07763c990e
commit eaefbb887c

View File

@ -2075,12 +2075,11 @@ void wxListTextCtrl::OnChar( wxKeyEvent &event )
switch ( event.m_keyCode ) switch ( event.m_keyCode )
{ {
case WXK_RETURN: case WXK_RETURN:
if ( AcceptChanges() ) // Notify the owner about the changes
{ AcceptChanges();
// Close the text control, changes were accepted
Finish(); // Even if vetoed, close the control (consistent with MSW)
} Finish();
// else do nothing, do not accept and do not close
break; break;
@ -2988,6 +2987,15 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
} }
else if (event.RightDown()) else if (event.RightDown())
{ {
// If the item is already selected, do not update the selection.
// Multi-selections should not be cleared if a selected item is clicked.
if (!IsHighlighted(current))
{
HighlightAll(false);
ChangeCurrent(current);
ReverseHighlight(m_current);
}
SendNotify( current, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, SendNotify( current, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK,
event.GetPosition() ); event.GetPosition() );
} }