Highlighted
Absent Member.
Absent Member.
326 views

[archive] tree view focus

[Migrated content. Thread originally posted on 18 October 2005]

Having programmatically found a tree item we want to scroll the tree up a few lines and place the focus on the found item. Using the following code:

01 ITEM-1 USAGE POINTER.
01 ITEM-2 USAGE POINTER.

SCR-OETREE-LINE-NO-Ef-Aft-Procedure.
1. PERFORM FIND-ENTERED-LINE.
2. MODIFY SCR-OETREE-TR VALUE ITEM-2.
PERFORM 4 TIMES
3. MODIFY SCR-OETREE-TR NEXT-ITEM = TVNI-NEXT
GIVING ITEM-1
4. MODIFY SCR-OETREE-TR VALUE ITEM-1
END-PERFORM.
5. MODIFY SCR-OETREE-TR VALUE ITEM-2.

The routine at line 1 returns the correct value for item-2 and the item shows as selected after line 2. However, line 3 does not return a value for item-1 even though there are many more items in the tree and since item-1 is 0 line 4 has no effect. Line 5 does return the focus to the correct item. Also we would like lines 2 and 5 to highlight the item as if it was selected with the mouse or arrow key. At present the selection shows gray background when done programmatically and bright blue when selected with mouse or arrow key.



Any suggestions?
0 Likes
2 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] tree view focus

It sounds to me that there is a focus issue. You are programmatically changing the selected item, however, the treeview do not have focus, hence the grey instead of the blue.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] tree view focus

Thank you Gisle! Right on the money as usual.

Vins Nash
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.