XTROP_RESELECT

The XTROP_RESELECT operation is used to re-enter (i.e. put the focus on) an existing (modeless) tree. It is similar to the create, replace, and append operations except without the overhead of recreating/reconfiguring the control or reloading the data. The Array or File parameter is ignored. For editable trees, the Answer array is processed though, allowing you to make changes to the context or attributes of the corresponding cells. For example, after the user makes changes to one cell, causing the tree to exit, the application may make additional changes to related cells prior to putting the editing focus on the next cell.

For non-editable trees, the initial selection(s) is/are typically determined by the Answer parameter. For editable trees, the XTR.TARGETROW, XTR.TARGETCOL, XTR.XNAVOD and XTR.XNAVMASK parameters in the XTRCTL structure typically determine the position of re-entry. The primary exception to the typical case is when the last event for the tree in question was a click that generated an exitcode when the tree was inactive/unfocused, the location of the click will take precedence over the answer or XTR.XXX parameters. The scenario is as follows. Imagine that some control has the focus, say, an input field. The user then clicks on an XTREE that was inactive. This generates an exitcode (based on the XTR.KBDSTR field of the clicked-on tree), causing the input field to exit. The user's expectation would be that the tree would become active, with the row or cell clicked on being selected. The application can tell from the exitcode which control (or which tree) was clicked, but it can't tell which row or cell was clicked, so it can't set up the answer or XTR.XXX parameters to start with that row or cell selected. However, the tree itself has local memory and can remember the the fact and location of the prior click event; it uses that information to override the selection coordinates passed by the application. In cases where you don't want that feature, you can set the XTR2_CLRDEFER bit in the XTREE Flags2 parameter.

The XTRA4 and PCKMNU programs in EXLIB:[908,21] illustrate this.