I’m having some difficulty with a standard TreeView in regards to it’s processing of keystrokes and wondered how I might solve the following problem:
I have a tall rectangular component, using a horizontal divider bar to split it into top and bottom halves.
In the top half I have a treeview with a list of song names.
In the bottom half I have a ‘properties component’ which displays info about the selected song from the top half.
if the horizontal divider bar is ‘down’ far enough that the TreeView can display all the items, and has no scrollbar, then clicking in the TreeView correctly selects a song, and the up/down arrows on the keyboard will scroll from item to item as expected.
The problem occurs when the horizontal divider bar (and layout) is moved up such that the TreeView is too small to contain all the items and the scrollbars appear. At this point the scrollbars seem to be catching the up/down keys and the keyboard is controlling the scrollbar thumb position instead of selecting tree items.
Is there any way to tell the TreeView not to let the scrollbars have the keyboard focus? I looked around in the code but it’s a wee bit complicated and I was hoping this scenario has already been dealt with and am hoping I just don’t know which spell to invoke in order to make the desired magic happen…