Open robmcmullen opened 12 years ago
[Trac time 20080619 001245Z] Might be fixed with later releases of wxPython...
[Trac time 20080207 052210Z] There's definitely a problem in the C++ source. The page up/page down key gets sent to the FindItem method, which pingpongs around for thousands of times before somehow stopping. It then falls through that case statement and eventually lets the scrolled window handle it. I added the following code in wxTreeListMainWindow::OnChar
to short-circuit this:
// <PAGEUP>, <PAGEDOWN> handled by the scrolled window
case WXK_PAGEDOWN:
case WXK_PAGEUP:
event.Skip();
break;
but note that the correct way to do this would be to figure out what item is highlighted, move up or down a full page, and highlight the new item.
[Trac time 20080207 052605Z] Since the wxTreeListMainWindow is a subclass of scrolled window, there may be a way to do what I want. I stuck some debugging printing in the following version of OnChar:
// <PAGEUP>, <PAGEDOWN> handled by the scrolled window
case WXK_PAGEDOWN:
case WXK_PAGEUP: {
int start_x = 0;
int start_y = 0;
GetViewStart (&start_x, &start_y);
int client_h = 0;
int client_w = 0;
GetClientSize (&client_w, &client_h);
printf("view: (%d,%d) client: (%d,%d)\
", start_x, start_y, client_w, client_h);
event.Skip();
} break;
but what I'm still missing is a way to figure out what index number the currently selected item is. If I could do that, I think I could get it working.
[Trac time 20080206 063011Z] Hitting the page down key when no tree list item is selected results in a freeze. Eventually it comes out of it, but there must be an O(n!^2) search happening somewhere. Looks like it is a problem in the C++; it seems like it can be worked around by selecting on a node before hitting page down.
A gdb traceback shows:
and looking at the code in wxPython-src-2.8.7.1/src/common/dynarray.cpp shows a confusing set of macros that seem to be used instead of a template. Hard to see which Insert method is actually being called...
Looks like it might be going through the default loop in wxPython-src-2.8.7.1/contrib/gizmos/wxCode/src/treelistctrl.cpp at line 3661?