Change context menu handling of SvTreeListBox
Status quo
When using the Right-Mouse-Button to rise up the context menu, the context always applies to the last selected entry/entries. Thus when the selection is not actual visible, it is not clear to which entry/entries the menu belongs to. In addition, the menu may be opened far away from the selection which it refers to.
When rising up the context menu by keyboard (shift-F10), the menu is placed at the actual mouse position and not at the position where the selected entry is/entries are located.
How it will be
Handling right mouse button click
Click over any entry.
Previously selected entry/entries will be deselected. The entry under the mouse position is selected and used as context.
Click in empty arrea
For single selectable SvTreeListBoxes: no context menu
For multi selectable SvTreeListBoxes: Actual selection is cleared and a menu with empty context is used.
Handling context menu request by keyboard
No entry selected
One entry selected, entry visible
Position of menu in the middle of the entry.
One entry selected, entry is invisible
Entry will be made visible, position of menu again is the middle of the entry.
More than one entry is selected, no entry is visible
The first selected entry is made visible and the position of menu again is the middle of the entry.
More than one entry is selected, one or more entries are visible
The position of menu is the middle of the first visible selected entry.
Focused entry is not selected
The focused entry is ignored.
Empty context is used. Position of context menu will be the upper left corner of the list box.