Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When it comes to keyboard support, the concept of focus is essential. For a control to respond to keyboard input, it must be the control with keyboard focus. The SRP Tree Control is no different. Like all SRP OLE Controls, the SRP Tree Control will receive focus when the user tabs to it or clicks on it. If you need to programmatically set the focus, use the SRP Tree Control's Focus property, not the OpenInsight FOCUS property. Do this by using the OLE prefix:

...

In addition to the control having focus, there is also a single item that is the focus item. The focus item gives the user a sense of where they are. The focus item appears with a dotted rectangle surrounding it, unless the ShowFocusItem is 0. The FocusItem property can be used to get the item with focus or to programmatically move the focus to another item.

...

KeyNormal Action
+Expands the focus item
-Collapses the focus item
UpMoves to the item above
DownMoves to the item below
LeftIf expanded, just collapses the focus item. If collapsed, moves to focus item's parent.
RightIf expanded, moves to the focus item's first child. If collpsed, just expands the focus item.
PgUpMoves up one page.
PgDownMoves down one page.
HomeMoves to the top of the tree.
EndMoves to the bottom of the tree.
EnterFires a click event unless EnterBehavior is "None", in which case it moves focus to the next control.
TabMoves focus to the next control.
SpacebarToggles the selection in if hte SelectBehavior is set to "Toggle".

Note that when using the keys to navigate the tree, the selection moves to the new item. If the SelectBehavior property is set to "Multi", then the user can hold the SHIFT key while navigation to perform a span selection. If the SelectBehavior property is set to "Toggle", then only the focus moves when navigating, and the user must use the Spacebar to toggle the item's selection. In all cases, holding the CTRL key while navigating moves only the focus without disturbing the selection.

...

Note that keystroke finding is always enabled and will only locate items that are currently viewable. An item is viewable if it's parents are all expanded and it's ItemVisible and ItemEnabled properties are set to 1.

...

The SRP Tree Control provides you with the tools to implement modification, though it is not automated. It is not very often that users need to insert or delete items using the keyboard, but when the need arises, the OnModifyKey event can be captured. This event notifies you when the user has pressed the Insert or Delete keys. This gives you the opportunity to implement the appropriate logic, whether it's a simple removal of items or something must more complicated.