Opened 4 years ago

Last modified 2 years ago

#17676 infoneeded_new defect

wxTreeCtrl focus not set properly on editing item label

Reported by: kinaou Owned by:
Priority: normal Milestone:
Component: wxMSW Version: 3.0.2
Keywords: wxTreeCtrl EditLabel Cc:
Blocked By: Blocking:
Patch: yes

Description

On MSW, run the treectrl sample, click once on the Root item then select Item > Rename item....
=> Nothing happens

In wxTreeCtrl::MSWOnNotify(), the event TVN_BEGINLABELEDIT is well received, but m_focusLost being true, the event wxEVT_TREE_BEGIN_LABEL_EDIT is not processed.

The attached patch corrects that.

Attachments (1)

wxTreeCtrl_FocusEditLabel.patch download (588 bytes) - added by kinaou 4 years ago.

Download all attachments as: .zip

Change History (3)

Changed 4 years ago by kinaou

comment:1 Changed 2 years ago by catalin

FWIW this doesn't happen with post-3.1.1 sources. When doing the steps in the description an edit box with text "Editing root item" shows up (which will be the new name of the root item if not modified, in spite of the event.Veto() call in MyTreeCtrl::OnEndLabelEdit, but that is probably a different issue).

comment:2 Changed 2 years ago by vadz

  • Status changed from new to infoneeded_new

Thanks for testing this, not sure how did I manage to completely not notice (or even more completely forget) about this one. I can confirm that the bug doesn't happen for me under Windows 7 but it's worrisome that I don't see any changes that could have fixed it. So maybe it can still be seen under a different OS version (where did you see it, Kinaou?)?

OTOH TVN_BEGINLABELEDIT handler doesn't seem to use m_focusLost anywhere and it's only used in WM_LBUTTONDOWN handler to avoid starting item editing on mouse click -- but not on explicit EditLabel() call is here.

So I just don't see at all what's going on here, it would be great if Kinaou could check if he still sees it. TIA!

Note: See TracTickets for help on using tickets.