Backported [ 622089 ] wxTR_EDIT_LABELS vs wxTR_MULTIPLE style
Fix for wxTreeCtrl label editing in wxTR_MULTIPLE mode git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20011 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -204,6 +204,7 @@ wxMSW:
|
||||
- fix for explicit keyword detection (VC++)
|
||||
- fix for sending event from wxCheckListBox::Check()
|
||||
- wxCaret::SetSize correction for showing caret
|
||||
- fix for wxTreeCtrl label editing in wxTR_MULTIPLE mode
|
||||
|
||||
wxMotif:
|
||||
|
||||
|
@@ -2091,13 +2091,23 @@ long wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
||||
}
|
||||
else // normal click
|
||||
{
|
||||
// clear the selection and then let the default handler
|
||||
// do the job
|
||||
// avoid doing anything if we click on the only
|
||||
// currently selected item
|
||||
wxArrayTreeItemIds selections;
|
||||
size_t count = GetSelections(selections);
|
||||
if ( count == 0 ||
|
||||
count > 1 ||
|
||||
HITEM(selections[0]) != htItem )
|
||||
{
|
||||
// clear the previously selected items
|
||||
UnselectAll();
|
||||
|
||||
// prevent the click from starting in-place editing
|
||||
// when there was no selection in the control
|
||||
// which should only happen if we click on the
|
||||
// already selected item (and nothing else is
|
||||
// selected)
|
||||
TreeView_SelectItem(GetHwnd(), 0);
|
||||
}
|
||||
|
||||
// reset on any click without Shift
|
||||
m_htSelStart = 0;
|
||||
|
Reference in New Issue
Block a user