Fix spurious label editing in generic wx{List,Tree,DataView}Ctrl.
Clicking on the control to give it focus must not start editing the label of an item in it, this is bad UI as you need to carefully select where do you click to avoid starting to edit the label and nobody else does it like this (probably because of the former reason). As a side note, it would be really great to abstract the item handling in a class that could be reused by all these controls instead of having to update 3 slightly different versions of the same code every time. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72634 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -3779,7 +3779,14 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
|
||||
// ==> LeftDown() || LeftDClick()
|
||||
if ( event.LeftDown() )
|
||||
{
|
||||
m_lastOnSame = item == m_current;
|
||||
// If we click on an already selected item but do it to return
|
||||
// the focus to the control, it shouldn't start editing the
|
||||
// item label because it's too easy to start editing
|
||||
// accidentally (and also because nobody else does it like
|
||||
// this). So only set this flag, used to decide whether we
|
||||
// should start editing the label later, if we already have
|
||||
// focus.
|
||||
m_lastOnSame = item == m_current && HasFocus();
|
||||
}
|
||||
|
||||
if ( flags & wxTREE_HITTEST_ONITEMBUTTON )
|
||||
|
Reference in New Issue
Block a user