Margins are the area inside the border and outside the work area. They can have their own fill character and attribute. By default, the margin character is a space and the attribute is set to the window's attribute. You can change the size of the margins and their display attribute and character.
Designer: Window margins can be specified in the Designer. You can also change them in your code by calling the functions described below.
For windows defined with the window definition functions (wn_def(), wn_vdef(), wn_nbdef(), and wn_mfdef()) the left, right, top, and bottom margins have default values of zero. Therefore, the working area of the window is the area immediately within the window border.
You can change the margins with the set window margins function, sw_mg():
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Specify NOCHANGE for any parameter that you do not want to change. For example, to change the margin attribute and character without changing the size of the margins, use code similar to this:
|
The following call changes the attribute and character for the margins and sets the window to have left and right margins of one space each and top and bottom margins of two spaces each with the call:
|
Note: If a window is larger than its memory screen, then the area between the interior work area and the border is treated as a virtual margin. The margin character and attribute are used to display virtual margins as well as margins set in code.
Caution: Changing the size of the margins changes the size of the window's interior work area. This will affect where the text in the work area is displayed on the screen. If you do not update the window on the screen, you may see strange results when writing to or uncovering that window. If the window is set on the screen, you must do the following:
Changing the size of the interior work area causes additional problems for basic windows, since the size of the memory screen no longer matches the interior work area dimensions. For virtual windows, the change in size is not a problem, since Vermont Views assumes that the work area and the memory screen buffer are not the same size. For a complete description of possible problems and solutions when changing the size of a basic window's work area, see the section "Resizing a Memory Screen," later in this chapter.