Fixed focus event problems with control derived
from wxScrolledWindow. If wxTreeCtrl has no +/. button, toggle branch, otherwise send activate event upon double-click. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11432 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2731,14 +2731,17 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
|
|||||||
m_renameTimer->Stop();
|
m_renameTimer->Stop();
|
||||||
m_lastOnSame = FALSE;
|
m_lastOnSame = FALSE;
|
||||||
|
|
||||||
if (item->HasPlus())
|
if (item->HasPlus() && !HasButtons())
|
||||||
{
|
{
|
||||||
// for a "directory" node, toggle expansion
|
// If the control has no buttons,the only way
|
||||||
|
// to expand/collapse it is by double clicking
|
||||||
|
// an item. In this case we cannot send any
|
||||||
|
// activate event.
|
||||||
Toggle(item);
|
Toggle(item);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// for a "file" node, activate it
|
// If we have buttons, just send activate event.
|
||||||
wxTreeEvent nevent( wxEVT_COMMAND_TREE_ITEM_ACTIVATED,
|
wxTreeEvent nevent( wxEVT_COMMAND_TREE_ITEM_ACTIVATED,
|
||||||
GetId() );
|
GetId() );
|
||||||
nevent.m_item = (long) item;
|
nevent.m_item = (long) item;
|
||||||
|
@@ -298,6 +298,8 @@ bool wxScrolledWindow::Create(wxWindow *parent,
|
|||||||
|
|
||||||
if (m_parent)
|
if (m_parent)
|
||||||
m_parent->DoAddChild( this );
|
m_parent->DoAddChild( this );
|
||||||
|
|
||||||
|
m_focusWidget = m_wxwindow;
|
||||||
|
|
||||||
PostCreation();
|
PostCreation();
|
||||||
|
|
||||||
|
@@ -298,6 +298,8 @@ bool wxScrolledWindow::Create(wxWindow *parent,
|
|||||||
|
|
||||||
if (m_parent)
|
if (m_parent)
|
||||||
m_parent->DoAddChild( this );
|
m_parent->DoAddChild( this );
|
||||||
|
|
||||||
|
m_focusWidget = m_wxwindow;
|
||||||
|
|
||||||
PostCreation();
|
PostCreation();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user