Showing changes from revision #2 to #3:
Added | Removed | Changed
Windows consist of two discrete separate areas:
Contains the title bar, scroll bar indicators, close icon etc. | |
Contains all the |
The System system-area area does not normally get updated via by the application, except except, for perhaps, perhaps the Title Bar.
The work work-area area is where the application will display information to the user; you can think of it as a document where the words are and written. pictures may be displayed.
The following table shows all the important co-ordinate co-ordinate-systems aspects for dealing with a work work-area. area.
Specify the minimum and maximum x and y co-ordinates of the entire |
|
Specify the width and height of the |
|
Specify the co-ordinate offsets of the horizontal and vertical scroll bars. This determines which part of the |
|
screen position co-ordinates | Specify where the window should be displayed on the screen using x and y co-ordinates |
Note: All co-ordinates are provided in OS graphics units.
The following snippet of code specifies the size of the work work-area. area. Itdoes not , however, specify the size of the work work-area area that is to be shown.
In this example it would produce a work work-area area 2000 units high and 1000 units wide. The origin of x and y co-ordinates are from the top left, hence the height is a negative number.
work_area_x_min = 0 work_area_y_min = –2000 work_area_x_max = 1000 work_area_y_max = 0
The following snippet of code specifies the size of the work work-area areaand the size of the work work-area area to be shown.
In this example it would produce a work work-area area 2000 units high and 1000 units wide, but displaying only a 200 high by 100 wide part of it.
work_area_x_min = 0 work_area_y_min = –2000 work_area_x_max = 1000 work_area_y_max = 0 visible_area_x_min = 0 visible_area_y_min = 0 visible_area_x_max = 100 visible_area_y_max = 200
The following snippet of code specifies the size of the work work-area, area, the size of the work work-area area to be shownand which part of the work work-area are is to be shown.
In this example it would produce a work work-area area 2000 units high and 1000 units wide, but displaying only a 200 high by 100 wide from the x and y offsets of 20 and 100 respectively.
work_area_x_min = 0 work_area_y_min = –2000 work_area_x_max = 1000 work_area_y_max = 0 visible_area_x_min = 0 visible_area_y_min = 0 visible_area_x_max = 100 visible_area_y_max = 200 scroll_offset_x = 20 scroll_offset_y = –100
The following snippet of code specifies the size of the work work-area, area, the size of the work work-area area to be shown, which part of the work work-area are is to be shownand where on the screen this work work-area area should be displayed.
In this example it would produce a work work-area area 2000 units high and 1000 units wide, display only 200 high by 100 wide from the x and y offsets of 20 and 100 respectively and display it on the screen at (300, 600).Please note: that the screen co-ordinates originate from the bottom left of the screen, as opposed to the top left for windows.
work_area_x_min = 0 work_area_y_min = –2000 work_area_x_max = 1000 work_area_y_max = 0 visible_area_x_min = 0 visible_area_y_min = 0 visible_area_x_max = 100 visible_area_y_max = 200 scroll_offset_x = 20 scroll_offset_y = –100 screen_x = 300 screen_y = 600
Although at first glance, the calculations may seem daunting, they do get easier the more you use them. A rule of thumb is that work work-area area co-ordinate origins are the top left of a window, where as the screen co-ordinates are from the bottom left of the screen.
A number of way of retrieving windows co-ordinates exist.
Note: The co-ordinates above are only a small subset of larger set of data required to create a window as per SWIs such as Wimp_CreateWindow.
Windows are able to overlap other windows, and in order to keep track of the order of overlapping windows, the wimp also maintains ‘depth’. This is called the window stack. The window at at the top of the stack is deemed to be the forefront window on the screen.
A window can change its window stack position by user intervention such as clicking on the Title Bar or the Back icon within the system area of a window.
A window can determine its own window stack value by specifying which window that it must appear behind. Another option is simply stating whether it should be ‘top’ or ‘bottom’ in the stack.
Many attributes of a window is are defined by setting a series of flags in the window block; can it be moved, does it has a Title Bar, does it ignore mouse clicks etc. etc? There are many other settings that can be changed in addition to this these to provide a comprehensive set of window configurations.
In addition to the window definition, any initial icons belonging to a window are also defined.
For a complete view of a window window’s Flags and all associated data, it see is available withinWimp_CreateWindow.