Created On:  19 October 2011

Problem:

How do you change the text item of a tree view control?

Resolution:

In version 9.0.1 there is an enhancement that enables the user to change the text of a tree-view item. This feature is controlled by a new runtime configuration variable TV_EDITLABELS. When this variable is set to "1" (on, true, yes) you can change the value of the tree-view item by clicking it with the mouse (just like with Windows Explorer). When the variable is set to "0" (off, false, no) text changes are not allowed. The default value of TV_EDITLABELS is "0".

To keep track of the changes, two additional messages are generated from the tree-view to the COBOL program:

MSG_TV_BEGINEDITLABEL and MSG_TV_ENDEDITLABEL.

MSG_TV_BEGINEDITLABEL is sent to the COBOL program when the user begins the edit. EVENT-DATA-1 is always 0, and EVENT-DATA-2 contains the handle of the item being modified. The program can prevent the modification by setting EVENT-ACTION to EVEN-ACTION-FAIL.

MSG_TV_ENDEDITLABEL is sent when the user has successfully finished editing. EVENT-DATA-1 is always 0 and EVENT-DATA-2 contains the handle of the modified item.

These messages are further documented in ACUCOBOL-GT User Interface Programming, section 6.3. INSTRUCTIONS for use: To enable text changing with tree-views, set the runtime configuration variable TV_EDITLABELS to "1" (on, true, yes). When the variable is set to "0" (off, false, no) no text changes may occur. The default value of TV_EDITLABELS is "0".
N/A