_windowtype Structures

Structures of type _windowtype contain sizes, locations, and color codes for the three windows produced by presentation graphics: the chart window, the data window, and the legend. Windows are located on the screen relative to the screen's logical origin. By changing the logical origin, you can display charts that are partly or completely off the screen.

The PGCHART.H file defines _windowtype as the following:

typedef struct

{

short x1; /* Left edge of window in

pixels */

short y1; /* Top edge of window in

pixels */

short x2; /* Right edge of window in

pixels */

short y2; /* Bottom edge of window in

pixels */

short border; /* TRUE for border, FALSE

otherwise */

short background; /* Internal palette color for

window background */

short borderstyle; /* Style bytes for window

border */

short bordercolor; /* Internal palette color for

window border */

} _windowtype;

The following list describes _windowtype member variables:

background

An integer between 1 and _PG_PALETTELEN that specifies the window's background color. The default value for background is 1.

border

A Boolean variable that determines whether a border frame is drawn around a window.

bordercolor

An integer between 1 and _PG_PALETTELEN that specifies the color of the window's border frame. The default value is 1.

borderstyle

An integer between 1 and _PG_PALETTELEN that specifies the line style of the window's border frame. The default value is 1.

x1, y1, x2, y2

Window coordinates in pixels. The ordered pair (x1, y1) specifies the coordinate of the upper-left corner of the window. The ordered pair ( x2, y2 ) specifies the coordinate of the lower-right corner.

The reference point for the coordinates depends on the type of window. The chart window is located relative to the logical origin, usually the upper-left corner of the screen. The data and legend windows are located relative to the upper-left corner of the chart window. This allows you to change the position of the chart window without having to redefine coordinates for the other two windows.