Window options fall into three categories: options that affect the video output, options that affect non-modal processing, and options that affect mouse behavior. You will find a complete list of window options in Table 24.1. This chapter discusses the options that affect video output, although all options are included in Table 24.1 for completeness.
To set the window options, you use the set window options function, sw_opt():
|
||
|
|
|
|
|
|
|
|
|
For example, to turn OFF virtual cursor advance and clear-to-the-end-of-row options, you would call:
|
The window options are described in Table 24.1.
Table 24.1: Window Options
| Option | Action |
| AUTOCLEAR | When auto clear is ON, the window buffer will be cleared, using its fill attribute and fill character, every time it is removed from the screen. |
| AUTOFREE | If the autofree option is on, Vermont Views will free the window when it is removed from the screen. |
| Note: If the autofree option is ON, take care not to reference windows once they have been removed from the screen. | |
| AUTOUPDN | When the autoupdn option is ON, Vermont Views will take a window off the screen when the processing function for that window returns. |
| CLRENDROW | When the clear-to-the-end-of-row option is ON, the row on which string output ends is automatically cleared from the end of the output to the end of the row. The clearing is done using the window fill character and window attribute. The virtual cursor is placed immediately after the last character written, excluding the characters used for clearing. |
| For most applications, the default of ON is appropriate. A setting of OFF is useful, for example, when maintaining a status line. | |
| CSADVANCE | The default window setting is to advance the virtual cursor location when a string is written to the window. |
| Take care when disabling virtual cursor advance. When virtual cursor advance is OFF, successive calls to string output functions will start writing from the same location, overwriting previous output to the window. | |
| This can be useful for writing to the same place repetitively, such as maintaining a status line or an error message window. | |
| CSRPLACE | When physical cursor placement is turned ON, string output functions place the blinking physical cursor at the location of the window's virtual cursor. When OFF, the physical cursor does not move after string output. |
| MOU_DRAG | PCDOS only. When the mouse drag option is ON, the user is able to drag the window to a new location on the physical screen using the mouse. |
| MOU_MODAL | When the modal option is ON, the user must finish processing the current panel (window, data form, menu, choice list) before he or she can process another panel. When the modal option is turned off, the user is able to suspend processing on the current panel temporarily. |
| Note: Non-modal panels are processed differently from modal panels. If you have a working modal application and then turn this option OFF without modifying your code to account for the processing differences, your application will not work correctly. See Chapter 30, "Differences in Non-Modal Form Processing," for more information about processing non-modal panels | |
| MOU_MODQUIT | PCDOS only. When the modal quit option is ON, clicking the mouse outside the current window terminates processing on the window, just as if the user had pressed the Quit key. |
| MOU_RESIZE | PCDOS only. When the mouse resize option is ON, the user is able to resize the window using the mouse. |
| Note: Resizing a window with the mouse changes only the full dimensions of the window, that is, the space that the window occupies on the physical screen. The size of the underlying memory screen or memory file is not affected. | |
| TRACKING | When the window tracking option is ON (the default), output to the window's buffer automatically adjusts the buffer origin so that the output is always visible. Automatic tracking is a window option that controls whether a window scrolls to keep the virtual cursor in view. |
| If automatic tracking is turned OFF (or if you call a function to explicitly move the virtual cursor to another location), it is possible for the virtual cursor to move to a location in the buffer that is not currently displayed in the window. | |
| If this happens, the Vermont Views functions will not move the physical cursor from its current position. You should be careful when enabling the place physical cursor option (CSRPLACE) when tracking is turned OFF. | |
| WORDWRAP | When word wrap is ON, string output always breaks on a word boundary. |
| WNECHO | When the window echo option is ON (the default), output to the window's buffer is automatically echoed to the video screen. |
The options AUTOFREE, AUTOUPDN, MOU_MODAL, and MOU_MODQUIT are used in non-modal programming. For a more detailed discussion of these options, see Chapter 30, "Differences in Non-Modal Form Processing." MOU_DRAG and MOU_RESIZE are options available only to PCDOS users who are using a mouse. They are discussed in Chapter 43, "The Mouse (PCDOS Only)." The remaining options affect the video output functions and the location of the virtual and physical cursors. They are discussed in detail later in this chapter.