]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/contrib/gizmos/treelistctrl.cpp
Always set background colour prior to any HTML rendering (this fixes assert in GTK2...
[wxWidgets.git] / wxPython / contrib / gizmos / treelistctrl.cpp
index a559d95415657e2d70460a08f6d4f2fd629a0981..8ea7363b013cecf1c488f6bb03dea80ad4ba03cd 100644 (file)
@@ -1646,11 +1646,16 @@ wxTreeListItem *wxTreeListItem::HitTest(const wxPoint& point,
                                         const wxTreeListMainWindow *theCtrl,
                                         int &flags, int& column, int level)
 {
-    column = -1;
+    column = theCtrl->GetMainColumn(); //-1;
     wxTreeListItem* res = HitTest(point, theCtrl, flags, level);
 
-    if(!res) return res;
-    if(flags & wxTREE_HITTEST_ONITEMINDENT) {
+    if(!res) {
+        column = -1;
+        return res;
+    }
+    if (point.x >= theCtrl->m_owner->GetHeaderWindow()->GetWidth())
+        column = -1;
+    else if(flags & wxTREE_HITTEST_ONITEMINDENT) {
         int x = 0;
         for(size_t i = 0; i < theCtrl->GetMainColumn(); ++i) {
             int w = theCtrl->m_owner->GetHeaderWindow()->GetColumnWidth(i);
@@ -3540,7 +3545,7 @@ void wxTreeListMainWindow::OnChar( wxKeyEvent &event )
     // right : open if parent and go next (or expand on Win32)
     // home  : go to root
     // end   : go to last item without opening parents
-    switch (event.KeyCode())
+    switch (event.GetKeyCode())
     {
 #ifndef __WXMSW__ // mimic the standard win32 tree ctrl
         case '+':
@@ -3754,6 +3759,7 @@ wxTreeItemId wxTreeListMainWindow::HitTest(const wxPoint& point, int& flags,
     int w, h;
     GetSize(&w, &h);
     flags=0;
+    column = -1;
     if (point.x<0) flags |= wxTREE_HITTEST_TOLEFT;
     if (point.x>w) flags |= wxTREE_HITTEST_TORIGHT;
     if (point.y<0) flags |= wxTREE_HITTEST_ABOVE;