]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed focus event problems with control derived
authorRobert Roebling <robert@roebling.de>
Tue, 21 Aug 2001 11:12:42 +0000 (11:12 +0000)
committerRobert Roebling <robert@roebling.de>
Tue, 21 Aug 2001 11:12:42 +0000 (11:12 +0000)
    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

src/generic/treectlg.cpp
src/gtk/scrolwin.cpp
src/gtk1/scrolwin.cpp

index 4c72c6ac75d659dcb670cd27e74dc71575586145..7f880bb4d9914a34dfddbd34809b1a5706dde437 100644 (file)
@@ -2731,14 +2731,17 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
                 m_renameTimer->Stop();
                 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);
                 }
                 else
                 {
-                    // for a "file" node, activate it
+                    // If we have buttons, just send activate event.
                     wxTreeEvent nevent( wxEVT_COMMAND_TREE_ITEM_ACTIVATED,
                                         GetId() );
                     nevent.m_item = (long) item;
index 46cefd3e0fcfd4b45e366791b2684dbcec3c1a9f..2f5bd81523d99139d1cae5766bf0054a8a765808 100644 (file)
@@ -298,6 +298,8 @@ bool wxScrolledWindow::Create(wxWindow *parent,
 
     if (m_parent)
         m_parent->DoAddChild( this );
+        
+    m_focusWidget = m_wxwindow;
 
     PostCreation();
 
index 46cefd3e0fcfd4b45e366791b2684dbcec3c1a9f..2f5bd81523d99139d1cae5766bf0054a8a765808 100644 (file)
@@ -298,6 +298,8 @@ bool wxScrolledWindow::Create(wxWindow *parent,
 
     if (m_parent)
         m_parent->DoAddChild( this );
+        
+    m_focusWidget = m_wxwindow;
 
     PostCreation();