How to Restore User Resized List Box Column Widths

Top  Previous  Next

The resize feature on listboxes is most useful if the user specified sizing is remembered and reapplied to the list box. The following procedure uses embedded GETINI, PUTINI, and PROPERTY assignment syntax statements to save and restore the user specified formatting changes. The formatting is stored in an application specific .INI file.

1.

In the Application Tree dialog, DOUBLE-CLICK on your browse procedure.

The Procedure Properties dialog appears.

2.

Press the Embeds button.

The Embedded Source dialog appears.

3.

In the Embedded Source dialog, DOUBLE-CLICK on the "WindowManager Method Executable Code -- Ask -- ( ) " embed point.

The Select Embed Type dialog appears.

4.

DOUBLE-CLICK on SOURCE.

The Text Editor appears, ready to accept your embedded source statements.

5.

Type the following statement, then Exit! the Text Editor and save your changes.

?Browse:1{PROP:FORMAT}=GETINI('Preferences','?Browse:1Format',?Browse:1{PROP:FORMAT},'MyApp.INI')

where ?Browse:1 is the field equate label for your list box, and MyApp is the name of your .APP file. "Preferences" is the section in the .INI file where the information is stored. "?Browse:1Format" is the entry in the .INI file where the information is stored, and "?Browse:1{PROP:FORMAT}" supplies the current format string as the default in case there is no formatting information in the .INI file.

5.6.

Set the Priority to "First". This embeds the code before the PARENT.Ask() method.

5.7.

Highlight the "WindowManager Method Executable Code -- Ask -- ( ) " embed point again and press Insert.

The Select Embed Type dialog appears.

5.8.

DOUBLE-CLICK on SOURCE.

The Text Editor appears, ready to accept your embedded source statements.

5.9.

Type the following statement, then Exit! the Text Editor and save your changes.

PUTINI('Preferences','?Browse:1Format',?Browse:1{PROP:FORMAT},'MyApp.INI')

where ?Browse:1 is the field equate label for your list box, and MyApp is the name of your .APP file.

5.9.10.

Set the Priority to "Last". This embeds the code after the PARENT.Ask() method.