Subroutines > Detailed Descriptions > XTREE

XTREE Update Notes

Note: The changes listed below are the ones that have NOT integrated into the main body of the documentation.

1203 – 02 February 2011

XTREE refinement: Adjust type-ahead logic introduced in 5.1.1197. The new rule is: On calling XTREE, if there is a pending event from clicking on the tree while it was inactive, then any unprocessed keyboard characters are stripped and ignored. In addition, if the XTF2_CLRDEFER flag is set and there is a virtual exitcode sequence pending, it is also stripped. Previously, the virtual exitcode sequence stripping was not dependent on the XTF2_CLRDEFER flag, which made it impossible to use XTREE as a kind of Eventwait handler for click events that had already happened (but which hadn't been detected by the application yet.)

1191 – 24 August 2010

XTREE refinement: when exiting from the tree is allowed with up arrow or down arrow, it now requires a minimum of 1/3 second since the last arrow key to allow the exit. This eliminates the problem of holding down the arrow key to scroll up/down and then finding yourself out of the tree and several fields away due to the up/down arrow exiting and then being interpreted by other controls as next/previous field.

1152.4.2 – 16 June 09

XTREE split/editable refinement: editable cell navigation now allows crossing over from the left pane to the right. Previously, navigation was only supported on the right, which meant that any editable cells in the left pane were only accessible by clicking on them in a way that didn't cause exit/re-entry for validation.

1147.0.2 – 01 May 09

XTREE refinement: Editable cells using cformat codes "#.", "#-", and "#-." (numeric with decimal, negative or both) were allowing non-numeric characters to be entered while editing. This loophole is now closed, although it is still possible to pre-load or display non-numeric data in such cells.

1134.9.2 - 20 Jan 09

XTREE enhancements: The following column attributes can now be set as defaults by assigning them to the zero column: Fold=, Dspmin=, Dspwid=

1134.3.4 - 11 Jan 09

XTREE enhancement: split and non-split trees now work better together. Previously, only one kind of tree could be operational active at one time, making it difficult to click between them.

1127.2.3 - 17 Oct 2008

Column configuration now saved even when tree is exited with Escape (since this is a common exit not necessarily considered as "cancel"). The only way to exit without saving is now Ctrl+C.

1119.2.1 - 09 July 2008

The determination of whether a "\" marks the beginning of hidden text in XTREE has been improved for array-mode trees. Previously, unless one of the columns specified the cformat code "\", all backslash characters were considered as the start of hidden text (from there to the end of the row). This was taking people by surprise, especially when the backslash occurred in an editable column (like in a filespec). The new rule is that a backslash will be treated as a literal character if ANY of the following is true:

• The cformat code "\" is present for any column (as before).

• The backslash occurs prior to the last physical column in the array data (without regard to the order in which the logical columns are defined).

• The last physical column is editable.

1108.1.4 - 16 Apr 2008

File mode no longer aborts if the file is not present, provided that the XTF_FCOLDEF flag is not set. It simply creates a tree with no data in it (but with the columns set up per the COLDEF parameter.)

974.3.1 - 05 Dec 06

In XTREE, it is now possible to scroll horizontally using the left and right arrow keys, provided that the XTF_LEFT and XTF_RIGHT flags are not set and that the tree is not in cell editing mode. The scroll increment has been arbitrarily set at 32 pixels (until such time that someone comes up with a really clever formula for scrolling just the right amount.)

974.3.3 - 05 Dec 06

Refine XTREE's handling of popup menus in the context of editing. Now, if you are in an editable cell (with validation) and you right-click on another editable, XTREE displays the context menu immediately and waits to see what user action will take place before deciding whether to exit. If the user aborts the context menu, then, if the previously edited cell needs validation, then it exits with EXITCODE -48. If it didn't need validation, then we just return to editing that cell. If the user selects an item on the popup menu, then we exit with that EXITCODE, but still set the xtr'xvalidate and xtr'xrow/xtr'xcol fields appropriately if validation of the previous cell is needed.

As an example of this, try the updated XTRA5 sample program (edit 131), which can be downloaded from http://www.microsabio.net/aftp/dsk0/908021. Open up the Debug message window and activate the XTREE trace. Hit Enter to all the questions except say Yes to the validation question. Then select a cell in the description column (going into editable cell mode.) Clear the contents, then right-click on another column (the read-only checkbox column for example). This will display the popup menu. When you dismiss the popup menu, either by selecting a choice on the menu or by some action that cancels the menu, you will then get the validation message, indicating that an empty cell is not acceptable. You'll be able to see in the debug messages the exitcode and other relevant values.

970.0.3 - 31 Oct 06

The XTREE backslash \ character now marks the start of hidden text within a column in array mode, just as it does in file mode. Note that to treat backslash as a normal character, you need to add the \ code to a column definition (any column will do). (WARNING: This may break existing XTREEs that contain backslashes in the array data since previously the \ column code was not necessary for arrays; talk to Herman if you don't like this, or just add \ to your column definitions.)

967.0.1 - 22 Sep 2006

It is now possible to use DIMX to allocate the ANSWER array (when required for trees that are editable, or allow multi-select, or allow drag/drop). Previously, you had to specify the MAP1 unformatted variable, i.e.:

MAP1 ANSWERX                ! ANSWERX passed to XTREE

   MAP2 ANSARY(100)

   MAP2 CB1,S,1             ! checkbox

   MAP2 EDIT1,S,10          ! editable cell

 

The problem with the above construct is that it is impossible to dynamically allocate. Now, you can do the following:

MAXCNT = 100                ! must match array size (i.e. # rows)

DIMX ANSARY(MAXCNT),S,11    ! element size = sum of editable fields

DIMX ARRAY(MAXCNT),S,200    ! array of rows (same MAXCNT as ANSARY)

...

xcall XTREE, srow, scol, ansary(1), array(1), maxcnt, coldef,...

 

Note that in the above case, XTREE has to "trust" you that the actual mapped size of the ANSARY() and ARRAY() arrays is equal to or greater than MAXCNT. Also note that you will have to parse the ANSARY() elements out into the individual fields that would normally make up ANSARY (i.e. as mapped in the first example above).

For ATE, note that this change requires updating the server side as well, because the XCALL argument checking is done by the server side before passing it to ATE.

967.0.2 - 22 Sep 2006

It is now possible to use the XTF_NOREDRAW flag along with opcode 4 (reselect) even when you are updating data in the editable cells prior to the reselect. Previously XTF_NOREDRAW disabled the updating of the editable cells from the ANSARY parameter on reentry. XTF_NOREDRAW might be useful in this circumstance to eliminate unwanted display adjustments taking place during the reentry process.

958.3.1 - 27 June 06

XTREE now allows you to hide a column by using the mouse to shrink it's width to 0. (Actually, you could always have done this, but now, if xtr'usecolorder=1, XTREE sets the corresponding entry in the xtr'colorder array to <position>+128, which effectively causes the column to remain hidden on subsequent calls to reselect from the tree.

This can be demonstrated easily in the XTRA3 sample program: use opcode 0 and set the modeless option to create/display the tree; then manually shrink one or more of the columns to become invisible. Then exit the tree and re-enter it with opcode 0 or 1 to verify that the column remains hidden. (Use the popup menu option to unhide them.)

958.1.4 - 27 June 06

XTREE now allows the program to keep track of temporarily hidden columns using the same means as it does to keep track of column order (i.e. via the xtr'colorder array). If xtr'colorder(x) >= 128, then real column x will be hidden.

The XTRA3 sample program has been updated (edit 130) to illustrate this. It also adds Hide and Unhide options to the popup menu to illustrate another way of accomplishing the same thing. (The beauty of the first method is that it requires no programming effort at all.)