•  Back 
  •  Window library 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help page 
  •  Show info about hypertext 
  •  View a new file 
Topic       : TOS - The Operating System
Author      : 
Version     : tos.hyp (December 19, 2008)
Subject     : Programmieren/Atari
Nodes       : 3010
Index Size  : 93790
HCP-Version : 5
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Title
@help       : 
@options    : +g -i -s +x +zz -t4
@width      : 70
View Ref-File8.9.1  wind_calc                                                   TOS

 Name:         »Window calculation« - Calculates the limits or the 
               total space requirement of a window

 Opcode:       108

 Syntax:       int16_t wind_calc ( int16_t wi_ctype, int16_t wi_ckind, 
               int16_t wi_cinx, int16_t wi_ciny, int16_t wi_cinw, 
               int16_t wi_cinh, int16_t *coutx, int16_t *couty, 
               int16_t *coutw, int16_t *couth );

 Description:  The call wind_calc calculates the size of the border 
               area from the coordinates of the working area of a 
               specific window, or vice versa. The following apply:

                Parameter  Meaning

                wi_ctype   0 = WC_BORDER calculates the coordinates of 
                           the border area from the coordinates of the 
                           working area in the parameters wi_cinx, 
                           wi_ciny, wi_cinw and wi_cinh.
                           1 = WC_WORK calculates the coordinates of 
                           the working area from the coordinates of 
                           the border area in the parameters wi_cinx, 
                           wi_ciny, wi_cinw and wi_cinh.
                wi_ckind   An integer parameter that contains all 
                           components of the window, with a format as
                wi_cinx    X-coordinate, and
                wi_ciny    Y-coordinate of top left corner,
                wi_cinw    Width, and
                wi_cinh    Height of the window (already known)
                coutx      X-coordinate,
                couty      Y-coordinate,
                coutw      Width, and
                couth      Height of the calculated components

               Note: One should never assume that the components of a 
               window have a given size or position, but always use 
               this function. Even then, the calculated height will be 
               incorrect if the window has a toolbar attached to it; 
               this can be corrected by adjusting the value by the 
               height of the toolbar (see also below).

               WINX extension: Premise: appl_getinfo (opcode 22360) If 
               one sets bit 15 in wi_ctype (e.g. by addition of the 
               constant WC_WIN (=$8000)) and in wi_ckind passes the ID 
               of a window instead of the window components, it is 
               possible to obtain more exact dimensions for the 
               window, as the function can take into account the 
               current properties of the window (e.g. a toolbar). 
               Additionally the function performs an auto-correction 
               of the structure area, which is also performed by 
               functions such as wind_open, wind_set( WF_CURRXYWH) 
               when necessary and if supported by the AES.

 Return value: An error has arisen only if the value 0 is returned.

 Availability: All AES versions.

 Group:        Window library

 See Also:     Binding   wind_create   Problems with toolbars