HomeAESWindow-dialogsExtended file-selectors

8.9 Window library

This library makes functions available to create, open and close windows, and much more. In all the following routines are available:

sys_set_winframe_manager Install a new window-frame manager
wind_calc Calculates window dimensions
wind_close Closes windows
wind_create Creates windows
wind_delete Deletes windows
wind_draw Redraws window components
wind_find Obtains window ID from a position specification
wind_get Obtains properties of a window
wind_new Deletes all windows
wind_open Opens window
wind_set Alters properties of a window
wind_update Blocks or releases screen operations
wind_xget Obtains properties of a window, extended version
wind_xset Alters properties of a window, extended version

Note: Under MagiC a single application should not use more than 16 windows, as otherwise the message buffer of the system may overflow and then it may not be possible to perform redraws any more.

See also:
Components of a window   Style guidelines   Window-dialogs   Overview of the wind_get/set subfunctions   wind_get and wind_set mode in Geneva

8.9.1 sys_set_winframe_manager

Name: ???
Opcode: 0 (sub-opcode 6)
Syntax: int16_t sys_set_winframe_manager( WINFRAME_HANDLER *old_wfh, WINFRAME_HANDLER *new_wfh, WINFRAME_SETTINGS **set )
Description:
Return value: unknown.
Availability: As of MagiC 6
Group: Window library
See also: Binding

8.9.1.1 Bindings for sys_set_winframe_manager

C: int16_t sys_set_winframe_manager( WINFRAME_HANDLER *old_wfh, WINFRAME_HANDLER *new_wfh, WINFRAME_SETTINGS **set );
Binding:
int16_t sys_set_winframe_manager( WINFRAME_HANDLER *old_wfh,
            WINFRAME_HANDLER *new_wfh,
            WINFRAME_SETTINGS **set )
{
   int_in[0]  = 6;      /* Subcode 6: Window-frame manager */
   addr_in[0] = old_wfh;
   addr_in[1] = new_wfh;

   crys_if(0);

   *set = addr_out[0];

   return ( int_out[0] );
}
GEM-Arrays:

Address Element Contents
control control[0] 0 # Function opcode
control+2 control[1] 1 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 2 # Entry in addr_in
control+8 control[4] 1 # Entry in addr_out
int_in int_in[0] 6
addr_in addr_in[0] old_wfh
addr_in+4 addr_in[1] new_wfh
int_out int_out[0] return value
addr_out addr_out[0] set

8.9.2 wind_calc

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

8.9.2.1 Bindings for wind_calc

C: 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 );
Binding:
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)
{
   int_in[0]  = wi_ctype;
   int_in[1]  = wi_ckind;
   int_in[2]  = wi_cinx;
   int_in[3]  = wi_ciny;
   int_in[4]  = wi_cinw;
   int_in[5]  = wi_cinh;

   crys_if (108);

   *coutx = int_out[1];
   *couty = int_out[2];
   *coutw = int_out[3];
   *couth = int_out[4];

   return ( int_out[0] );
}
GEM-Arrays:

Address Element Contents
control control[0] 108 # Function opcode
control+2 control[1] 6 # Entry in int_in
control+4 control[2] 5 # Entry in int_out
control+6 control[3] 0 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] wi_ctype
int_in+2 int_in[1] wi_ckind
int_in+4 int_in[2] wi_cinx
int_in+6 int_in[3] wi_ciny
int_in+8 int_in[4] wi_cinw
int_in+10 int_in[5] wi_cinh
int_out int_out[0] Return value
int_out+2 int_out[1] coutx
int_out+4 int_out[2] couty
int_out+6 int_out[3] coutw
int_out+8 int_out[4] couth

8.9.3 wind_close

Name: »»Close window« - Close a window
Opcode: 102
Syntax: int16_t wind_close ( int16_t wi_clhandle );
Description: The call wind_close removes the window with the ID wi_clhandle from the screen (closes it).

Note: The window will only be deleted irrevocably by a call of wind_delete.
Return value: An error has arisen only if the value 0 is returned.
Availability: All AES versions.
Group: Window library
See also: Binding   wind_open   wind_delete

8.9.3.1 Bindings for wind_close

C: int16_t wind_close ( int16_t wi_clhandle );
Binding:
int16_t wind_close (int16_t wi_clhandle)
{
   int_in[0]  = wi_clhandle;
   return ( crys_if(102) );
}
GEM-Arrays:

Address Element Contents
control control[0] 102 # Function opcode
control+2 control[1] 1 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 0 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] wi_clhandle
int_out int_out[0] Return value

8.9.4 wind_create

Name: »Window create« - Initializes a new window
Opcode: 100
Syntax: int16_t wind_create ( int16_t wi_crkind, int16_t wi_crwx, int16_t wi_crwy, int16_t wi_crww, int16_t wi_crwh );
Description: The call wind_create attempts to initialize a new window structure with the AES and at the same time determines its appearance and maximum size; it also allocates the memory required for it. Note that this call does not actually display the window on-screen - you need to follow it with a wind_open call for this.

wi_crwx, wi_crwy, wi_crww, wi_crwh set the maximum extent of the window.

wi_crkind describes the components as a bit-vector:

Element Value Meaning
NAME 0x0001 Title-bar
CLOSER 0x0002 Close-box
FULLER 0x0004 Fuller-box
MOVER 0x0008 Window may be moved by user
INFO 0x0010 Info-line
SIZER 0x0020 Sizer-box
UPARROW 0x0040 Up-arrow
DNARROW 0x0080 Down-arrow
VSLIDE 0x0100 Vertical slider
LFARROW 0x0200 Left arrow
RTARROW 0x0400 Right arrow
HSLIDE 0x0800 Horizontal slider
HOTCLOSEBOX 0x1000 Close-box with auto-repeat
MENUBAR 0x1000 Menu bar (XaAES)
BACKDROP 0x2000 Background-box
ICONIFIER 0x4000 Iconify-button
BORDER 0x8000 Border sizing


Notes: HOTCLOSEBOX is only available as of PC-GEM or MagiC Version 2.0 (in each case). Window borders that are not needed (e.g. bottom border) will be omitted as of AES Version 4.x or MagiC 3; this makes available a few more pixels of usable area.

MENUBAR is only available in XaAES. It reserves room for a menu bar widget in the window. The menu bar itself is attached to the window by wind_set.

Setting BORDER will make XaAES allow for window border sizing without the SIZER widget being used.

ICONIFIER is available only as of AES Version 4.1.

The presence of newer components such as the iconify button, for instance, is best inquired for by using appl_getinfo (opcode 11).
Return value: The function returns a non-negative handle if the AES still has a free window handle available. A return value smaller than 0 (i.e. negative) signals an error or no more free handles available.
Availability: All AES versions.
Group: Window library
See also: Binding   wind_delete

8.9.4.1 Bindings for wind_create

C: int16_t wind_create ( int16_t wi_crkind, int16_t wi_crwx, int16_t wi_crwy, int16_t wi_crww, int16_t wi_crwh );
Binding:
int16_t wind_create (int16_t wi_crkind, int16_t wi_crwx,
                     int16_t wi_crwy, int16_t wi_crww,
                     int16_t wi_crwh)
{
   int_in[0]  = wi_crkind;
   int_in[1]  = wi_crwx;
   int_in[2]  = wi_crwy;
   int_in[3]  = wi_crww;
   int_in[4]  = wi_crwh;

   return ( crys_if(100) );
}
GEM-Arrays:

Address Element Contents
control control[0] 100 # Function opcode
control+2 control[1] 5 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 0 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] wi_crkind
int_in+2 int_in[1] wi_crwx
int_in+4 int_in[2] wi_crwy
int_in+6 int_in[3] wi_crww
int_in+8 int_in[4] wi_crwh
int_out int_out[0] Return value

8.9.5 wind_delete

Name: »Delete window« - Delete a window
Opcode: 103
Syntax: int16_t wind_delete ( int16_t wi_dhandle );
Description: The call wind_delete destroys the window with the ID wi_dhandle and releases the relevant window handle again, as well as releasing any memory allocated to it.

Note: A window should be closed with wind_close before deleting it.
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   wind_close

8.9.5.1 Bindings for wind_delete

C: int16_t wind_delete ( int16_t wi_dhandle );
Binding:
int16_t wind_delete (int16_t wi_dhandle)
{
   int_in[0] = wi_dhandle;
   return ( crys_if(103) );
}
GEM-Arrays:

Address Element Contents
control control[0] 103 # Function opcode
control+2 control[1] 1 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 0 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] wi_dhandle
int_out int_out[0] Return value

8.9.6 wind_draw

Name: »Draw window« - Redraw the window components
Opcode: 99
Syntax: int16_t wind_draw ( int16_t wi_dhandle, int16_t wi_dstartob );
Description: The call wind_draw redraws the non-client area (window components) of a window with the ID wi_dhandle, taking the rectangle list into account.
Parameter Meaning
wi_dhandle ID (handle) of the window that is to be redrawn
wi_dstartob Index of the object where the drawing is to start


Note: This function is available only under N.AES and is of relatively little interest for "normal" applications. It is used specially by the internal screen-manager for the drawing of window objects.
Return value: An error has arisen only if the value 0 is returned.
Availability: The presence of this function can be checked for with appl_getinfo (opcode 65).
Group: Window library
See also: Binding

8.9.6.1 Bindings for wind_draw

C: int16_t wind_draw ( int16_t wi_dhandle, int16_t wi_dstartob );
Binding:
int16_t wind_draw ( int16_t wi_dhandle, int16_t wi_dstartob );
{
   int_in[0] = wi_dhandle;
   int_in[1] = wi_dstartob;
   return ( crys_if(99) );
}
GEM-Arrays:

Address Element Contents
control control[0] 99 # Function opcode
control+2 control[1] 2 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 0 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] wi_dhandle
int_in+2 int_in[1] wi_dstartob
int_out int_out[0] Return value

8.9.7 wind_find

Name: »Find window« - Find the ID of a window at the given coordinates.
Opcode: 106
Syntax: int16_t wind_find ( int16_t wi_fmx, int16_t wi_fmy );
Description: The call wind_find obtains the ID of the window that is found at a given position. The following apply:

Parameter Meaning
wi_fmx X-coordinate
wi_fmy Y-coordinate
Return value: The function returns the corresponding window ID. Here the value 0 represents the desktop, while -1 means that no window is present at the specified position.
Availability: All AES versions.
Group: Window library
See also: Binding   wind_get

8.9.7.1 Bindings for wind_find

C: int16_t wind_find ( int16_t wi_fmx, int16_t wi_fmy );
Binding:
int16_t wind_find (int16_t wi_fmx, int16_t wi_fmy)
{
   int_in[0]  = wi_fmx;
   int_in[1]  = wi_fmy;

   return ( crys_if(106) );
}
GEM-Arrays:

Address Element Contents
control control[0] 106 # Function opcode
control+2 control[1] 2 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 0 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] wi_fmx
int_in+2 int_in[1] wi_fmy
int_out int_out[0] Return value

8.9.8 wind_get

Name: »Get window« - Obtains various properties of a window.
Opcode: 104
Syntax: int16_t wind_get ( int16_t wi_ghandle, int16_t wi_gfield, int16_t *wi_gw1, int16_t *wi_gw2, int16_t *wi_gw3, int16_t *wi_gw3 );
Description: Depending on the parameters passed, the call wind_get returns information about various properties of the window with the ID wi_ghandle. The following apply for wi_gfield:

Summary of all subfunctions; numbers in brackets represent the wi_gfield mode:
WF_BEVENT (24) This mode inquires the state of the bit-vector that was set by wind_set (..., WF_BEVENT, ...), and writes it into the parameter wi_gw1.
Warning: The presence of this feature should be checked for with appl_getinfo (opcode 11).
WF_BITMAP (233) Get bitmap content of the window if MyAES "windows_backup" option is set to true, any windows of any application can be read.
MyAES 0.96 feature
WF_BOTTOM (25) This mode inquires the handle of the window that is currently at the bottom of the window list, and writes this into the parameter wi_gw1.

Warning: The presence of this feature should be checked for with appl_getinfo (opcode 11).
WF_CURRXYWH (05) This mode calculates the total size of the window, and writes its coordinates into the further parameters wi_gw1, wi_gw2, wi_gw3 and wi_gw4.
WF_DCOLOR (19) This mode returns the default colours of a newly created window, as follows:
wi_gw1 = Window component
wi_gw2 = Colour with window active
wi_gw3 = Colour with window inactive


Warning: The presence of this feature should be checked for with appl_getinfo (opcode 11).

Achtung: Das Vorhandensein dieses Features sollte per appl_getinfo (Opcode 11) ermittelt werden.

As of MagiC 4 and XaAES v 0.943 one can also inquire for each individual window component the state of the 3D-flags. The call for this is: wind_get (0, WF_DCOLOR, ...). The following apply:
wi_gw1 = Window component
wi_gw2 = Colour in active state
wi_gw3 = Colour in inactive state
wi_gw4 = 3D-flags


These 3D-flags are described as bit-vectors. The following apply:
Bit-0 = '3D in foreground' effect
Bit-1 = '3D in background' effect
Bit-2 = 'Selectable in foreground' effect
Bit-3 = 'Selectable in background' effect
Bit-8+n = Mask bit for bit 'n'


The presence of this feature can not be obtained with appl_getinfo at present.
WF_DDELAY (22362) This mode returns the delay values:
wi_gw1 = Start delay at a click on a scroll arrow
wi_gw2 = Continuing delay at a click on a scroll arrow
wi_gw3 = Continuing delay at a click on the 'Closer' widget
wi_gw4 = Continuing delay at a click on the 'Fuller' widget


All values are returned in milliseconds.

Warning: The presence of this feature should be checked for with appl_getinfo (opcode 22360).
WF_FIRSTXYWH (11) This mode calculates the coordinates of the first rectangle in the rectangle list, and writes them into the further parameters wi_gw1, wi_gw2, wi_gw3 and wi_gw4.
WF_FTOOLBAR (31) This mode obtains the first rectangle from the rectangle list of a toolbar. The following apply:
wi_gw1 = X-coordinate, and
wi_gw2 = Y-coordinate of top L corner,
wi_gw3 = Width, and
wi_gw4 = Height of the rectangle
WF_FULLXYWH (07) This mode calculates the maximum total size of the window, and writes this into the further parameters wi_gw1, wi_gw2, wi_gw3 and wi_gw4.
WF_HSLIDE (08) This mode calculates the position of the horizontal slider, and writes this into the further parameter wi_gw1 (0=far left to 1000=far right).
WF_HSLSIZE (15) This mode calculates the size of the horizontal slider relative to the total width of the window, and writes this into the further parameter wi_gw1 (-1=smallest size, 1=small to 1000=total width).
WF_ICONIFY (26) This mode returns the following values:
wi_gw1 = Window is iconified (1) or not (0)
wi_gw2 = Window width
wi_gw3 = Window height


Warning: The presence of this feature should be checked for with appl_getinfo (opcode 11).
WF_INFO (3) This mode obtains the current text of the window's info-line with the ID wi_ghandle and copies this into the buffer whose address was passed in intin[2] (high-WORD) and intin[3] (low-WORD).

If the window has no info-line then the return value of the function is 0; the passed buffer remains unchanged.

As an info-line can have at most 128 (N.AES) or 200 (XaAES) characters, the passed buffer should offer sufficient space to accomodate a string of this length.

This call is available only under N.AES and XaAES.
WF_INFOXYWH (104) This mode obtains the position of the INFO window component.

Available as of MagiC 6.10.
WF_KIND (1) This mode obtains the current components of the window, and writes them into the parameter wi_gw1.
WF_MENU (33) This mode returns the address of the OBJECT structure of the menu bar in the window. Here wi_gw1 contains the high-WORD, and wi_gw2 the low-WORD of the address, or NULL.
WF_MINXYWH (103) This mode inquires the minimum size of the window.

Available as of MagiC 6.
WF_NAME (2) This mode obtains the current window title of the window with the ID wi_ghandle and copies this into the buffer whose address was passed in intin[2] (high-WORD) and intin[3] (low-WORD).

If the window has no title, then the return value of the function is 0; the passed buffer remains unchanged.

As a window title can have at most 128 (N.AES) or 200 (XaAES) characters, the passed buffer should offer sufficient space to accomodate a string of this length.

This call is available only under MagiC (as of Version 6.0), N.AES and XaAES.
WF_NEWDESK (14) This mode returns the following values:
wi_gw1 = High-WORD of the desktop address
wi_gw2 = Low-WORD of the desktop address
wi_gw3 = Index of the first object


Note: The desktop address is to be understood as the address of the active desktop background tree. The output in wi_gw3 is available only under MagiC and as of AES Version 4.0.
Warning: The presence of this feature should be checked for with appl_getinfo (opcode 11). It is also present in KAOS 1.4.2 and as of MagiC 1.
WF_NEXTXYWH (12) This mode calculates the coordinates of the next rectangle in the rectangle list, and writes them into the further parameters wi_gw1, wi_gw2, wi_gw3 and wi_gw4.
WF_NTOOLBAR (32) This mode obtains the next rectangle from the rectangle list of a toolbar. The following apply:
wi_gw1 = X-coordinate, and
wi_gw2 = Y-coordinate of top L corner,
wi_gw3 = Width, and
wi_gw4 = Height of the rectangle
WF_OPTS (41) This mode returns the value that was set with wind_set ( WF_OPTS ).

The presence of this feature should be checked for using appl_getinfo (opcode 11).
WF_M_OWNER (101) This mode returns the following values:
wi_gw1 = Application ID of the owner


Present only as of KAOS 1.4.2 (where it was still called WF_OWNER) and in MagiC.
WF_OWNER (20) This mode returns the following values:
wi_gw1 = Application ID of the owner
wi_gw2 = Window is open (1) or closed (0)
wi_gw3 = ID of the window directly above
wi_gw4 = ID of the window directly below (in the window order list)


Warning: The presence of this feature should be checked for with appl_getinfo (opcode 11).
WF_PREVXYWH (06) This mode calculates the total size of the previous window, and writes them into the further paramters wi_gw1, wi_gw2, wi_gw3 and wi_gw4.
WF_SCREEN (17) This mode returns the address and length of the internal buffer in which the AES has stored the background of drop-down menus and alert boxes, and writes these into the further parameters wi_gw1 = high-WORD of the address, wi_gw2 = low-WORD of the address, wi_gw3 = high-WORD of the length and wi_gw4 = low-WORD of the length.

With TOS 1.02, 0 is returned for the length (though the buffer holds 8000 bytes).
WF_SHADE (22365) This mode returns the shading state of the window.
wi_gw1 = Current shading state:
1: Collapsed
0: Flipped open


Warning: The presence of this feature should be checked for with appl_getinfo (opcode 22360).
WF_TOOLBAR (30) lThis mode returns the address of the OBJECT structure of the toolbar. For this, wi_gw1 contains the high-WORD and wi_gw2 the low-WORD of the address.
WF_TOP (10) This mode returns the following values:
wi_gw1 = ID of the topped window
As of AES 3.3  
wi_gw2 = AESID of the owner
wi_gw3 = Handle from the window below
wi_gw4 = Special case for MagiC 2.0


If no window is open, wi_gw1 contains the value 0.


Warning: MagiC 2.0 must return a negative number (-2) for the top window handle if it belongs to the program of another application, else a string of old programs will not run. In MagiC 2.0 the actual handle is returned in wi_gw4. As of MagiC 3 this no longer occurs, i.e. the handle will be passed as usual in wi_gw1.

XaAESreturn the AES ID in wi_gw4 of the app that owns the window below.
WF_USER_POINTER (230) Get the user value of the window.
wi_gw1 and wi_gw2 are the 2 values already set by user with wind_set.
MyAES feature
WF_UNICONIFY (27) This mode obtains the original dimensions of an iconified window.
wi_gw1 = X-position, and
wi_gw2 = Y-position of top L corner,
wi_gw3 = Width and
wi_gw4 = Height of the window


Warning: The presence of this feature should be checked for with appl_getinfo (opcode 11).
WF_VSLIDE (09) This mode calculates the position of the vertical slider, and writes this into the further parameter wi_gw1 (0=very top to 1000=very bottom).
WF_VSLSIZE (16) This mode calculates the height of the vertical slider relative to the total window height, and writes this into the further parameters wi_gw1 (-1=smallest height, 1=small to 1000=whole height).
WF_WIDGETS (200) This mode obtains the current positions of the slider objects (W_UPARROW, W_DNARROW, etc.) of the window with the ID wi_ghandle. Written in the parameters wi_gw1 and wi_gw2 are the vertical components of the type rightwidgets, in the parameters wi_gw3and wi_gw4 the horizontal components of the type bottomwidgets. wi_gw1 is the top-most component, wi_gw2 the lowest component of the vertical slider. wi_gw3 is the left-most component and wi_gw4 the right-most component of the horizontal slider.

Warning: The presence of this feature should be checked for with appl_getinfo (opcode 11).
WF_M_WINDLIST (102) This mode returns in wi_gw1 (high-WORD) and wi_gw2 (low-WORD) a pointer to a NULL-terminated table of the opened windows (first element = top window), i.e. to a list of their handles as integer values. Negative handles belong to frozen applications. In no case may a write-access be made to the pointer!

Only present in KAOS as of 1.4.2 (WF_WINDLIST) and MagiC.
WF_WINX (22360) This mode returns information about an installed WINX version (as of WINX 2.1).
wi_gw1 = Version
Bit [15..12] Beta indicator
Bit [11.. 8] Major version number (currently 2)
Bit [ 7.. 4] Minor version number (actually 3)
Bit [ 3.. 0] Internal identifier
wi_gw2 = Creation date, GEMDOS format
wi_gw3 = Pointer (low-WORD) of the WINX externals, (or NULL)
wi_gw4 = Pointer (high-WORD) of the WINX externals, (or NULL)
WF_WINXCFG (22361) This mode returns the application-specific configuration switches of the currently running application.
wi_gw1 = Mask of the GLOBAL switches which are supported by the currently installed version of WINX
wi_gw2 = The current setting of the GLOBAL switches; applicable are only those switches which are set in the mask (bit 0 = switch 1)
wi_gw3 = Mask of the LOCAL switches, which are supported by the currently installed version of WINX
wi_gw4 = The current setting of the LOCAL switches; applicable are only those switches which are set in the mask (bit 0 = switch 1)


Normally applications should forgo the inquiry of this information.

Warning: The presence of this feature should be checked for with appl_getinfo (opcode 22360).
WF_WORKXYWH (04) This mode calculates the coordinates of the working area of the window, and writes these into the further parameters wi_gw1, wi_gw2, wi_gw3 and wi_gw4.
XA (0x5841) If the return value of this call is 'XA' (0x5841) then XaAES is installed. In wi_gw1 is the version (0x0964 for version V0.964). wi_ghandle must be zero.


Note: The parameters wi_gw1, wi_gw2, wi_gw3 and wi_gw4 here are pure output parameters.
Return value: An error has arisen only if the value 0 is returned.
Availability: All AES versions.
Group: Window library
See also: Binding   wind_set   Subfunctions overview

8.9.8.1 Bindings for wind_get

C: int16_t wind_get ( int16_t wi_ghandle, int16_t wi_gfield, int16_t *wi_gw1, int16_t *wi_gw2, int16_t *wi_gw3, int16_t *wi_gw3 );
Binding:
int16_t wind_get ( int16_t wi_ghandle, int16_t wi_gfield,
                   int16_t *wi_gw1, int16_t *wi_gw2,
                   int16_t *wi_gw3, int16_t *wi_gw3)
{
   int_in[0]  = wi_ghandle;
   int_in[1]  = wi_gfield;

   crys_if (104);

   *wi_gw1 = int_out[1];
   *wi_gw2 = int_out[2];
   *wi_gw3 = int_out[3];
   *wi_gw4 = int_out[4];

   return ( int_out[0] );
}
GEM-Arrays:

Address Element Contents
control control[0] 104 # Function opcode
control+2 control[1] 2 # Entry in int_in
control+4 control[2] 5 # Entry in int_out
control+6 control[3] 0 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] wi_ghandle
int_in+2 int_in[1] wi_gfield
int_out int_out[0] Return value
int_out+2 int_out[1] wi_gw1
int_out+4 int_out[2] wi_gw2
int_out+6 int_out[3] wi_gw3
int_out+8 int_out[4] wi_gw4

8.9.9 wind_new

Name: »New window« - Close all windows.
Opcode: 109
Syntax: void wind_new ( void );
Description: The call wind_new closes and deletes all windows, and resets the blocks set with wind_update as well as the mouse pointer 'hide' count.

Note about MagiC: Here the function is applied as a global and comprehensive clean-up function for an application, and also deletes its update requests, windows, menus etc. Other applications will never be impaired.
Return value: The function does not provide a return.
Availability: Since AES version 1.4
Group: Window library
See also: Binding   wind_create   wind_close   wind_update

8.9.9.1 Bindings for wind_new

C: void wind_new ( void );
Binding:
void wind_new (void)
{
   crys_if (109);
}
GEM-Arrays:

Address Element Contents
control control[0] 109 # Function opcode
control+2 control[1] 0 # Entry in int_in
control+4 control[2] 0 # Entry in int_out
control+6 control[3] 0 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out

8.9.10 wind_open

Name: »Open window« - Opens a window.
Opcode: 101
Syntax: int16_t wind_open ( int16_t wi_ohandle, int16_t wi_owx, int16_t wi_owy, int16_t wi_oww, int16_t wi_owh );
Description: The call wind_open displays a window on the screen. The following apply:

Parameter Meaning
wi_ohandle ID of the window to be opened
wi_owx X-coordinate, and
wi_owy Y-coordinate of top left corner,
wi_oww Width, and
wi_owh Height of the window


Note: The window must have been created beforehand with wind_create. The components title-bar, info-line and slider must have been set previously with a call of wind_set.

When specifying the coordinates -1,-1,-1,-1 for MagiC 3 onwards, the window will be placed at the next free position for iconifiable windows.
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   wind_close   wind_set

8.9.10.1 Bindings for wind_open

C: int16_t wind_open ( int16_t wi_ohandle, int16_t wi_owx, int16_t wi_owy, int16_t wi_oww, int16_t wi_owh );
Binding:
int16_t wind_open (int16_t wi_ohandle, int16_t wi_owx,
                   int16_t wi_owy, int16_t wi_oww,
                   int16_t wi_owh)
{
   int_in[0]  = wi_ohandle;
   int_in[1]  = wi_owx;
   int_in[2]  = wi_owy;
   int_in[3]  = wi_oww;
   int_in[4]  = wi_owh;

   return ( crys_if(101) );
}
GEM-Arrays:

Address Element Contents
control control[0] 101 # Function opcode
control+2 control[1] 5 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 0 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] wi_ohandle
int_in+2 int_in[1] wi_owx
int_in+4 int_in[2] wi_owy
int_in+6 int_in[3] wi_oww
int_in+8 int_in[4] wi_owh
int_out int_out[0] Return value

8.9.11 wind_set

Name: »Set window« - Alter various window attributes.
Opcode: 105
Syntax: int16_t wind_set ( int16_t wi_shandle, int16_t wi_sfield, int16_t wi_sw1, int16_t wi_sw2, int16_t wi_sw3, int16_t wi_sw4 );
Description: Depending on the passed parameters, the call wind_set alters various atributes of the window with the ID wi_shandle. The following apply for wi_sfield:

Overview of all subfunctions; numbers in brackets represent the wi_sfield mode:
WF_BEVENT (24) This mode permits the stopping of a WM_TOPPED message when clicking on a window (e.g. to allow continued functions in untopped windows). wi_sw1 is a bit-vector in which only bit 0 has any meaning at present. Other values than 1 are therefore not permitted. The call would then be: wind_set(wi_shandle, WF_BEVENT, 0x0001, 0, 0, 0).
Warning: The presence of this feature should be checked for with appl_getinfo (opcode 11).
WF_BOTTOM (25) This mode permits placing the (opened) window with the ID wi_shandle in the background, namely with wind_set(wi_shandle, WF_BOTTOM, 0, 0, 0, 0).
Warning: The presence of this feature should be checked for with appl_getinfo (opcode 11).
WF_BOTTOMALL (22368) This mode places all windows of the application wi_sw1 at the back.
wi_sw1 = ID of the application

If one passes a window ID unequal to DESKWINDOW in wi_shandle, then in addition the wi_shandle window will be placed right at the back (otherwise the order of the windows amongst each other will remain unchanged). wi_shandle must be open and belong to the application wi_sw1.
There is no guarantee that an application can apply WF_BOTTOMALL to the windows of another application (particularly in a multitasking environment). In that case a 0 is returned.
Warning: The presence of this feature should be checked for with appl_getinfo (opcode 22360).
WF_COLOR (18) This mode alters the colour of a window component. For this the index of the component is specified in wi_sw1:
Element (Value) Description
   
W_BOTTOMER (20) Backdrop button
W_BOX (0) Window's root object
W_CLOSER (2) Close-box
W_DATA (6) Parent object of the remaining components
W_DNARROW (11) Downward arrow
W_FULLER (4) Zoom-box
W_HBAR (14) Parent object of the vertical slider components
W_HELEV (18) Horizontal slider
W_HSLIDE (17) Background of the horizontal slider
W_INFO (5) Info-line
W_LFARROW (15) Leftward arrow
W_NAME (3) Move bar
W_RTARROW (16) Rightward arrow
W_SIZER (8) Size-box
W_SMALLER (19) Iconifier button
W_TITLE (1) Parent object of the close & zoom boxes, also the name
W_UPARROW (10) Upward arrow
W_VBAR (9) Parent object of the vertical slider components
W_VELEV (13) Vertical slider
W_VSLIDE (12) Background of the vertical slider
W_WORK (7) Working area

The colour for the object type of the window component is passed in parameter wi_sw2 if the window is topped, in wi_sw3 if it is inactive. A value of -1 retains the current colour setting.
Warning: The presence of this feature should be checked for with appl_getinfo (opcode 11). With TOS it only works as of AES Version 3.00.
WF_CURRXYWH (5) This mode sets the window size from wi_sw1, wi_sw2, wi_sw3 and wi_sw4.
XaAESis compatible with all other AES's, except from the following points:
  1. If x, y, w and h all have a value of -1 XaAES ignores the call, but fills in any return values when needed.
  2. x and y values of -1 are 'legal', i.e, one cannot use -1 to use any old x value. Of course, the x and y coordinates are checked to be inside the root window (not X when noleft = false).
  3. When h has a value of 0, the window is in fact shaded. This is a thing N.AES does with MiNTSetter, although I'm not sure this is correct. The application is sent a WM_SHADED message. On the next wind_set(handle, @{WF_CURRXYWH ignore},...) where the h coordinate is not equal to the window's shaded height, the window is unshaded. While the window is shaded via this method, [Shift]-clicks on the window title to shade a window are ignored.

XaAESfrom 2004-09-22 has an extended version.
WF_DCOLOR (19) This mode sets the default colours for the window components. The parameter wi_shandle is ignored, and for the remaning parameters the following applies:
wi_sw1 = Window component
wi_sw2 = Colour for active window
wi_sw3 = Colour for inactive window

Warning: The presence of this feature should be checked for with appl_getinfo (opcode 11). With TOS it only works as of AES Version 3.00; from Version 4.1 onwards it causes all the currently displayed windows that have not had their colour set explicitly with WF_COLOR to be changed.
When changing the component W_FULLER, both W_SMALLER and W_BOTTOMER will be changed automatically as well; this makes it necessary to change the 'Fuller' first, then the remaining components.
As of MagiC 4 it is possible to set 3D-flags for each individual window component. The following apply for this:
wi_sw1 = Window component
wi_sw2 = Colour in active state
wi_sw3 = Colour in inactive state
wi_sw4 = 3D-flags

The parameter wi_shandle must take the value 0 for this; the 3D-flags are described as a bit-vector for which the following apply:
Bit-0 = '3D in foreground' effect
Bit-1 = '3D in background' effect
Bit-2 = 'Selectable in foreground' effect
Bit-3 = 'Selectable in background' effect
Bit-8+n = Mask bit for bit 'n'

Thus only those bits for which the associated mask bit is set are altered. The presence of this feature can presently not be checked for with appl_getinfo.
WF_DDELAY (22362) This mode sets delay values:
wi_sw1 = Start delay for a click on a scroll arrow
wi_sw2 = Continuing delay for a click on a scroll arrow
wi_sw3 = Continuing delay for a click on the 'Closer' widget
wi_sw4 = Continuing delay for a click on the 'Fuller' widget

All values are set in milliseconds.
The delay values serve to retard actions if these are executed too quickly (for instance due to newer hardware).
Warning: The presence of this feature should be checked for with appl_getinfo (opcode 22360).
WF_FULLSCREEN (235) Switch fullscreen - normal window mode. The fullscreen mode is without any widget.
Hit the key ESC escape from fullscreen mode.
MyAES 0.96 feature
WF_FULLXYWH (7) If either wi_sw1, wi_sw2, wi_sw3 or wi_sw4 have a value of -1, that coordinate is not changed. If ALL coordinates have a value of -1, the window is actually moved to the current FULLXYWH coordinates, making the current window position the new PREVXYWH position.
XaAES since 2004-09-22, there is an extend version.
WF_HSLIDE (8) This mode sets the horizontal slider to the new position wi_sw1 (0=far left, to 1000=far right).
WF_HSLSIZE (15) This mode sets the size of the horizontal slider relative to the total width of the window to wi_sw1 (-1=smallest size, 1=small to 1000=total width).
WF_ICONIFY (26) This mode iconifies the window. The parameters wi_sw1 to wi_sw4 specify the position and the size of the window in its iconified state; these values are obtained from the AES at the arrival of a WM_ICONIFY message. Tip: To iconify an already created but not yet opened window, pass (-1,-1,-1,-1) as coordinates. The window can then be displayed on the screen with wind_open(handle,-1,-1,-1,-1). As of MagiC 4 and XaAES v0.943 this works also if the window is already open.
Warning: The presence of this feature should be checked for with appl_getinfo (opcode 11).
WF_IGNORE (13) This mode is used in some old AES versions. Its function is unknown.
WF_INFO (3) This mode writes the string to which wi_sw1 and wi_sw2 point to the Info-line. GEM only uses the pointer for this and does not create a copy. Under GEM the length is restricted to 80 characters; with N.AES there is a maxium of 128, with XaAES up to 200 are allowed.
WF_KIND (1) This mode sets wi_sw1 as a new window component; format as for wind_create.
WF_M_BACKDROP (100) With this mode a window wi_sw1 can be moved at one go to the bottom of the window stack without altering the order of the remaining windows. In KAOS 1.4.2 this parameter was still called WF_BACKDROP.
WF_MENU (33) This mode can attach a menu bar to a window. If the window was created without the MENUBAR attribute, the call is ignored. wi_sw1 and wi_sw2 must point to the address of the tree. You get MN_SELECTED message in the extended manner adopted from AES 4.1.
Only available in XaAES.
WF_NAME (2) This mode writes the string to which wi_sw1 and wi_sw2 point to the title-bar. GEM only uses the pointer for this and does not create a copy. Under GEM the length is restricted to 80 characters; with N.AES there is a maxium of 128, with XaAES up to 200 are allowed.
WF_NEWDESK (14) This mode sets the object tree to which wi_sw1 and wi_sw2 point as a new desktop, with wi_sw3 as the start object. By passing a NULL-pointer, the default background can be set again.
WF_OPTIONS (234) Change window behavior
wi_sw1 =
 1: request automatic close when application focus is lost and restore it when is back
wi_sw2 = remove/add option:
1: add option
0: remove option

MyAES feature
WF_OPTS (41) This mode sets some special options for XaAES.
wi_handle is a window handle, or -1. If 'handle' is a legal window handle, the options will only apply to that window. If 'handle' is -1, the settings will apply to all windows the application creates AFTER this call. wi_sw1 is 0 to clear the selected bits. or 1 to set the selected bits. wi_sw2 Currently available options for this are as follows:
WO0_WHEEL (0x0001) Setting this bit will enable extended mouse-wheel support, and go into WHL_AROWWHEEL mode causing XaAES to send extended WM_ARROWED messages to the application when the mouse-wheel turns. Read section "XaAES and wheel mouse handling" for details.
WO0_FULLREDRAW (0x0002) Setting this bit will make XaAES send WM_REDRAW messages to cover the whole work-area of the window when it is FULLED. Default behaviour is to only send WM_REDRAW messages for the areas that need it, blitting the already visible parts. This can also be configured via xaaes.cnf, see the app_options argument 'naesff'.
WO0_NOBLITW (0x0004) Setting this bit will make XaAES send WM_REDRAW messages to cover the whole work-area of the window when its WIDTH changes. This is handy for apps like HighWire, text processors etc. that need to reformat when window width changes. Default behaviour is to send WM_REDRAW messages for the areas that need it.
WO0_NOBLITH (0x0008) Setting this bit will make XaAES send WM_REDRAW messages to cover the whole work-area of the window when its HEIGHT changes. Default behaviour is to send WM_REDRAW messages for the areas that need it.
WO0_SENDREPOS (0x0010) Setting this bit will make XaAES send a WM_REPOSED(38) message when a window's X/WIDTH and/or Y/HEIGHT coordinate pair changes. Such changes happen when the user resizes the window using upper/left borders. Default behaviour is to first send a WM_MOVED followed by a WM_SIZED message under these conditions, because older apps don't evaluate the WIDTH/HEIGHT in WM_MOVED messages. So, dudes, set this bit and use WM_REPOSED!
WO0_WCOWORK (0x0020) Setting this bit will enable Window Coordinate Orientation WORK mode.

wi_sw3 and wi_sw4 are currently undefined and must be cleared.
The presence should be checked for using appl_getinfo (opcode 11).
WF_PREVXYWH (6) If eitherwi_sw1, wi_sw2, wi_sw3 or wi_sw4 have a value of -1, that coordinate is not changed. If ALL coordinates have a value of -1, the window is actually moved to the current PREVXYWH coordinates, making the current window position the new PREVXYWH position.
XaAESfrom 2004-09-22 has an extended version.
WF_SHADE (22365) This mode sets the shading state of the window.
wi_sw1 = Shade state to be activated:  1: Collapsed
 0: Flipped open
-1: Switch state

When shading (collapsing) a WM_SHADED message is sent, when unshading a WM_UNSHADED and a WM_REDRAW over the complete working area of the window. If one sets the state before opening the window, then it will be respected on opening. The closing of a window sets it automatically to unshaded (flipped open).
Warning: The presence of this feature should be checked for with appl_getinfo (opcode 22360).
WF_STACK (22366) This mode puts the window wi_shandle in the window stack below the window wi_sw1, without changing the screen position itself.
wi_sw1 = Open window/DESKWINDOW(0)/NOWINDOW (-1)

If window wi_shandle is closed, the desired position is stored and taken into account on opening the window with wind_open. wi_sw1 is only evaluated at the actual positioning. Should (wi_sw1 == DESKWINDOW), the window will be placed right at the back (corresponds to WF_BOTTOM). If (wi_sw1 == NOWINDOW) or wi_sw1 is not open, then the window wi_shandle will be placed right at the front (corresponds to WF_TOP).
Warning: The presence of this feature should be checked for with appl_getinfo (opcode 22360).
WF_TOOLBAR (30) This mode attaches a toolbar to a window, or alters or removes it. The following apply:
wi_sw1 = High-WORD, and
wi_sw2 = Low-WORD of the toolbar address

To remove a toolbar, the parameters wi_sw1 and wi_sw2 have to be set to NULL.
XaAESas of v0.942 can process toolbars. This has some more parameters:
wi_sw3 = Object index of the item where the drawing will start
wi_sw4 = The current editable object; where the cursor will be placed

Activating a toolbar object results in the event WM_TOOLBAR.
WF_TOP (10) This mode makes the window with the identifier wi_shandle be the new top window. As of MagiC 4 and XaAES v0.943, a call of wind_set (-1, WF_TOP, id, ...) can swap the menu and the desktop background to the application with the ID id; a value of -1 for id represents the current application.
WF_TOPALL (22367) This mode brings all windows of the application wi_sw1 to the front.
wi_sw1 = ID of the application

If one passes in wi_shandle a window ID other than DESKWINDOW (0), then wi_shandle will also be placed right at the front (else the order of the windows among each other will not be altered). wi_shandle must be open and belong to the application wi_sw1. There is no guarantee that an application can apply WF_TOPALL to the windows of another application (particularly in a multitasking environment). In that case a 0 is returned.
Warning: The presence of this feature should be checked for with appl_getinfo (opcode 22360).
WF_UNICONIFY (27) This mode uniconifies a specified window, returning it to its original size and position. It is only available as of AES Version 4.1.
Warning: The presence of this feature should be checked for with appl_getinfo (opcode 11).
WF_UNICONIFYXYWH (28) This mode uses the parameters wi_sw1 to wi_sw4 to pass the position and size of the window in its uniconified state to the next WF_UNICONIFY message targeting it. This opcode is particularly useful if a window that is already in an iconified state has been opened. It is only available as of AES Version 4.1.
WF_USER_POINTER (230) Link a user value to the windows.
wi_sw1 and wi_sw2 are the 2 value you can transmit it could be used as 32 bits pointer but any value can be provided.
MyAES feature
WF_VSLIDE (9) This mode sets the vertical slider to the new position wi_sw1 (0=very top to 1000=very bottom).
WF_VSLSIZE (16) This mode sets the height of the vertical slider relative to the total height to the value wi_sw1 (-1=smallest height, 1=small to 1000=total height).
WF_WCOLOR No information available at present.
WF_WHEEL (40) This mode sets the WA_WHEEL event for one window (wi_shandle= window ID) or for all applications (wi_shandle= 0). If wi_sw1 = 1, then the XaAES sends a special WM_ARROWED (WA_WHEEL) message. With wi_sw1= 1 one gets the normal message.
Available as of XaAES v0.960.
WF_WIDGETS (200) This mode sets the current positions of the slider objects (W_UPARROW, W_DNARROW, etc.) of the window with the ID wi_shandle. In the parameters wi_sw1 and wi_sw2 are passed the vertical components of the type rightwidgets, and in the parameters wi_sw3 and wi_sw4 the horizontal components of the type bottomwidgets. wi_sw1 is the top-most component wi_sw2 the lowest component of the vertical slider. wi_sw3 is the left-most component and wi_sw4 the right-most component of the horizontal slider.
WF_WIND_ATTACH (231) attach a window to another, using it if you close the mother window other windows linked will be closed. wi_sw1 the window to attach.
MyAES feature
WF_WINXCFG (22361) This mode sets the global and local switches of the called application, provided this is possible.
wi_sw1 = Mask of the global switch to be changed at this call (bit set means adopt switch)
wi_sw2 = New setting of the global switches (bit set means switch is on)
wi_sw3 = Mask of the local switch to be changed at this call (bit set means adopt switch)
wi_sw4 = New setting of the local switches (bit set means switch is on)

Which switches were actually altered can be found with a call of wind_get(WF_WINXCFG). Attention: This function should only be called by configuration programs that know what they are doing (e.g. WINX.CPX)!
Warning: The presence of this feature should be checked for with appl_getinfo (opcode 22360).


Note: The parameters wi_sw1, wi_sw2, wi_sw3 and wi_sw4 here are dependent on the function number passed in the parameter wi_sfield.

When specifying the window name, one should always leave a space before and after the character string for aesthetic reasons, since otherwise the pattern in the title-bar abuts directly to the first and last character of the name.

Warning: The opcodes listed here are no longer fully compatible with PC-GEM as development there proceeded in a different direction.
Return value: An error has arisen only if the value 0 is returned.
Availability: All AES versions.
Group: Window library
See also: Binding   wind_get   wind_create   OBJECT   Subfunctions overview

8.9.11.1 wind_set and PC-GEM

As of PC-GEM Version 2.0 the following apply:

WF_ATTRB (18): This sets the window attribute vector. Here: wi_sw1 = 0 (or 1): Window is the top window, or not; apart from this there is no further information available.

WF_SIZETOP (19): This makes the window an active one, without changing the order of the other windows. At the same time the position and size of the window can be reset:

wi_sw1 = X-position, and
wi_sw2 = Y-position of top left corner,
wi_sw3 = Width, and
wi_sw4 = Height of the window

8.9.11.2 Bindings for wind_set

C: int16_t wind_set ( int16_t wi_shandle, int16_t wi_sfield, int16_t wi_sw1, int16_t wi_sw2, int16_t wi_sw3, int16_t wi_sw4 );
Binding:
int16_t wind_set ( int16_t wi_shandle, int16_t wi_sfield,
                   int16_t wi_sw1, int16_t wi_sw2,
                   int16_t wi_sw3, int16_t wi_sw4 )
{
   int_in[0]  = wi_shandle;
   int_in[1]  = wi_sfield;
   int_in[2]  = wi_sw1;
   int_in[3]  = wi_sw2;
   int_in[4]  = wi_sw3;
   int_in[5]  = wi_sw4;

   return ( crys_if(105) );
}
GEM-Arrays:

Address Element Contents
control control[0] 105 # Function opcode
control+2 control[1] 6 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 0 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] wi_shandle
int_in+2 int_in[1] wi_sfield
int_in+4 int_in[2] wi_sw1
int_in+6 int_in[3] wi_sw2
int_in+8 int_in[4] wi_sw3
int_in+10 int_in[5] wi_sw4
int_out int_out[0] Return value

8.9.11.3 WF_TOPMOST, wind_set

A class of windows that will always 'float' ontop of classical windows. One key feature of windows in any WF_TOPMOST state is that they do not disturb current keyboard focus, and can be used to issue important messages, status raports, etc., without demanding user interaction.

wind_set (wi_shandle, WF_TOPMOST, wi_sw1,...)

WF_TOPMOST (232)

wi_sw1 =
0 = Remove topmost state on the corresponding window.
1 = Set topmost state on the corresponding window.
2 = Set topmost state and link window visibility to the owner's focus. That is, when owner is untopped the window disappears, when owner regains focus, the window automatically reappears.

Some common characteristics of windows with any WF_TOPMOST state set;

  1. Changing the WF_TOPMOST state can be done on open windows, but it is prefer not if possible.
  2. Windows which have TOPMOST state 1 or 2 never get keyboard focus.
  3. Windows which have TOPMOST state 1 or 2 never get WM_TOPPED or WM_UNTOPPED AES messages.

State 1:
Setting state 1 will make the corresponding window 'float' ontop of all other classical windows. State 1 windows will stay ontop until closed by the user or the application itself.

State 2:
Setting state 1 will make the corresponding window act like windows with state 1 set, with one important exception; The window is linked to the window owner's focus status. This means that when the application that owns the window looses focus, state 2 windows are automatically made unvisible by the AES. When the application regains focus, the window is automatically made visible again. This is done automatically, and no application handling is necessary.

8.9.12 wind_update

Name: »Update window« - Blocks or releases screen operations.
Opcode: 107
Syntax: int16_t wind_update ( int16_t wi_ubegend );
Description: The call wind_update signals the AES that a user application is currently redrawing the screen. Following this, the AES restricts its own graphical 'activities' such as the dropping down of menus or the moving of windows, for instance.
wi_ubegend Meaning
   
END_UPDATE (0) Screen redraw is compete and the flag set by BEG_UPDATE is reset
BEG_UPDATE (1) Screen redraw starts, rectangle lists are frozen, flag is set to prevent any other processes updating the screen
END_MCTRL (2) Application releases control of the mouse to the AES and resumes mouse click message reactions
BEG_MCTRL (3) The application wants to have sole control over mouse button messages


MagiC implements the 'check and set mode' of AES 4.00. The call then is wind_update (BEG_UPDATE|0x100) or and_update (BEG_MCTRL|0x100), i.e. a logical OR with a NO_BLOCK mask (0x100). Here the update control is only applied if no other application has control of the screen semaphore. If it has, the function returns at once with an error-value of 0.

Note: It is recommended that this function be used only for time-sensitive applications (e.g. terminal programs etc.) where long redraws by another applications could cause a timeout.

All wind_update modes nest, so to release the screen semaphore the same number of END_UPDATE calls must be received as BEG_UPDATEs were made, but it is preferable to design applications that avoid nesting these calls.

Both the BEG_xxx calls should be used before displaying a form or a popup to stop them from being overwritten, or mouse clicks to them being passed to other applications. Also, make sure you wait until after BEG_UPDATE has been called before turning off the mouse cursor when updating the screen.

The presence of this feature can be inquired for with appl_getinfo (opcode 11).
Return value: An error has arisen only if the value 0 is returned.
Availability: All AES versions.
Group: Window library
See also: Binding

8.9.12.1 Bindings for wind_update

C: int16_t wind_update ( int16_t wi_ubegend );
Binding:
int16_t wind_update (int16_t wi_ubegend)
{
   int_in[0] = wi_ubegend;
   return ( crys_if(107) );
}
GEM-Arrays:

Address Element Contents
control control[0] 107 # Function opcode
control+2 control[1] 1 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 0 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] wi_ubegend
int_out int_out[0] Return value

8.9.13 wind_xget

Name: »Get window« - Obtain properties of a window, extended version.
Opcode: 104
Syntax: int16_t wind_xget ( int16_t wi_ghandle, int16_t wi_gfield, int16_t *wi_gw1, int16_t *wi_gw2, int16_t *wi_gw3, int16_t *wi_gw3 int16_t *wo_gw2, int16_t *wo_gw3, int16_t *wo_gw3 );
Description: Depending on the parameters passed, the call wind_xget returns information about various properties of the window with the ID wi_ghandle. The following apply for wi_gfield:

Overview of all subfunctions; numbers in brackets represent the wi_gfield mode:
WF_CALCF2W (42)
This mode will take an arbitrary FULL area, and return the corresponding WORK area.

The presence should be checked for using appl_getinfo (opcode 11).
WF_CALCW2F (43)
This mode will take an arbitrary WORK area, and return the resulting FULL area of the window in question.

The presence should be checked for using appl_getinfo (opcode 11).
WF_FIRSTAREAXYWH (13)
wi_gw1, wi_gw2, wi_gw3 and wi_gw4 define a clipping area, and the AES may optimize the list of rectangles that is returned by WF_FIRSTAREAXYWH and WF_NEXTXYWH.

The presence should be checked for using appl_getinfo (opcode 11).
Return value: An error has arisen only if the value 0 is returned.
Availability: XaAES as of 2004-12-14
Group: Window library
See also: Binding   wind_get   wind_set   Subfunctions overview

8.9.13.1 Bindings for wind_xget

C: int16_t wind_xget ( int16_t wi_ghandle, int16_t wi_gfield, int16_t *wi_gw1, int16_t *wi_gw2, int16_t *wi_gw3, int16_t *wi_gw3, int16_t *wo_sw1, int16_t *wo_sw2, int16_t *wo_sw3, int16_t *wo_sw4 );
Binding:
int16_t wind_xget ( int16_t wi_ghandle, int16_t wi_gfield,
                    int16_t *wi_gw1, int16_t *wi_gw2,
                    int16_t *wi_gw3, int16_t *wi_gw3,
                    int16_t *wo_sw1, int16_t *wo_sw2,
                    int16_t *wo_sw3, int16_t *wo_sw4 );
{
   int_in[0]  = wi_ghandle;
   int_in[1]  = wi_gfield;
   int_in[2]  = *wi_sw1;
   int_in[3]  = *wi_sw2;
   int_in[4]  = *wi_sw3;
   int_in[5]  = *wi_sw4;

   crys_if (104);

   *wo_gw1 = int_out[1];
   *wo_gw2 = int_out[2];
   *wo_gw3 = int_out[3];
   *wo_gw4 = int_out[4];

   return ( int_out[0] );
}
GEM-Arrays:

Address Element Contents
control control[0] 104 # Function opcode
control+2 control[1] 6 # Entry in int_in
control+4 control[2] 5 # Entry in int_out
control+6 control[3] 0 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] wi_ghandle
int_in+2 int_in[1] wi_gfield
int_in+4 int_in[2] wi_sw1
int_in+6 int_in[3] wi_sw2
int_in+8 int_in[4] wi_sw3
int_in+10 int_in[5] wi_sw4
int_out int_out[0] Return value
int_out+2 int_out[1] wi_gw1
int_out+4 int_out[2] wi_gw2
int_out+6 int_out[3] wi_gw3
int_out+8 int_out[4] wi_gw4

8.9.14 wind_xset

Name: »Set window« - Alter individual properties of a window, extended version.
Opcode: 105
Syntax: int16_t wind_xset ( int16_t wi_shandle, int16_t wi_sfield, int16_t wi_sw1, int16_t wi_sw2, int16_t wi_sw3, int16_t wi_sw4, int16_t *wo_sw1, int16_t *wo_sw2, int16_t *wo_sw3, int16_t *wo_sw4 );
Description: Depending on the passed parameters, the call wind_xset alters various atributes of the window with the ID wi_shandle. The following apply for wi_sfield:

Overview of all subfunctions; numbers in brackets represent the wi_sfield mode:
WF_CURRXYWH (5)
This mode sets the window size from wi_sw1, wi_sw2, wi_sw3 and wi_sw4.
XaAESis compatible with all other AES's, except from the following points:
  1. If x, y, w and h all have a value of -1 XaAES ignores the call, but fills in any return values when needed.
  2. x and y values of -1 are 'legal', i.e, one cannot use -1 to use any old x value. Of course, the x and y coordinates are checked to be inside the root window (not X when noleft = false).
  3. When h has a value of 0, the window is in fact shaded. This is a thing N.AES does with MiNTSetter, although I'm not sure this is correct. The application is sent a WM_SHADED message. On the next wind_set(handle, WF_CURRXYWH,...) where the h coordinate is not equal to the window's shaded height, the window is unshaded. While the window is shaded via this method, [Shift]-clicks on the window title to shade a window are ignored.

XaAESas of 2004-09-22, there is also a shorter version.
WF_FULLXYWH (7)
If either wi_sw1, wi_sw2, wi_sw3 or wi_sw4 have a value of -1, that coordinate is not changed. If ALL coordinates have a value of -1, the window is actually moved to the current FULLXYWH coordinates, making the current window position the new PREVXYWH position.
  1. XaAES returns the resulting FULLXYWH, which the window will be moved to on the next use of the FULLED widget or...
  2. When all coordinates passed have a value of -1, XaAES returns the CURRXYWH of the new position the window was moved to, removing the need for a wind_get(handle, WF_CURRXYWH,...) call.

XaAESas of 2004-09-22, there is also a shorter version.
WF_PREVXYWH (6)
If eitherwi_sw1, wi_sw2, wi_sw3 or wi_sw4 have a value of -1, that coordinate is not changed. If ALL coordinates have a value of -1, the window is actually moved to the current PREVXYWH coordinates, making the current window position the new PREVXYWH position.
  1. XaAES returns the resulting PREVXYWH, which the window will be moved to on the next use of the FULLED widget or...
  2. When all coordinates passed have a value of -1, XaAES returns the CURRXYWH of the new position the window was moved to, removing the need for a wind_get(handle, WF_CURRXYWH,...) call.

XaAES as of 2004-09-22, there is an shorterversion.


Note: The parameters wi_sw1, wi_sw2, wi_sw3 and wi_sw4 here are dependent on the function number passed in the parameter wi_sfield.
Return value: An error has arisen only if the value 0 is returned.
Availability: XaAES since 2004-09-22
Group: Window library
See also: Binding   wind_get   wind_create   OBJECT   Subfunctions overview

8.9.14.1 Bindings for wind_xset

C: int16_t wind_xset ( int16_t wi_shandle, int16_t wi_sfield, int16_t wi_sw1, int16_t wi_sw2, int16_t wi_sw3, int16_t wi_sw4, int16_t *wo_sw1, int16_t *wo_sw2, int16_t *wo_sw3, int16_t *wo_sw4 );
Binding:
int16_t wind_xset ( int16_t wi_shandle, int16_t wi_sfield,
                    int16_t wi_sw1, int16_t wi_sw2,
                    int16_t wi_sw3, int16_t wi_sw4,
                    int16_t *wo_sw1, int16_t *wo_sw2,
                    int16_t *wo_sw3, int16_t *wo_sw4 );
{
   int_in[0]  = wi_shandle;
   int_in[1]  = wi_sfield;
   int_in[2]  = wi_sw1;
   int_in[3]  = wi_sw2;
   int_in[4]  = wi_sw3;
   int_in[5]  = wi_sw4;

   crys_if(105);

   *wo_sw1 = int_out[1];
   *wo_sw1 = int_out[2];
   *wo_sw1 = int_out[3];
   *wo_sw1 = int_out[4];

   return ( int_out[0] );
}
GEM-Arrays:

Address Element Contents
control control[0] 105 # Function opcode
control+2 control[1] 6 # Entry in int_in
control+4 control[2] 5 # Entry in int_out
control+6 control[3] 0 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] wi_shandle
int_in+2 int_in[1] wi_sfield
int_in+4 int_in[2] wi_sw1
int_in+6 int_in[3] wi_sw2
int_in+8 int_in[4] wi_sw3
int_in+10 int_in[5] wi_sw4
int_out int_out[0] Return value
int_out+2 int_out[1] wo_sw1
int_out+4 int_out[2] wo_sw2
int_out+6 int_out[3] wo_sw3
int_out+8 int_out[4] wo_sw4

8.9.15 The components of a window

The following illustration shows the window of a GEM text editor, and describes the most important components of this window.

Note that the clickable 'buttons' use characters from the system font, and may look different if a substitute system font is in use.

When the Closer of an application window is clicked on, the window will close and its contents will be discarded; if it allows user input (text editors, graphics programs, spreadsheets ...), any changes made to the contents since the last 'Save' operation are lost. Most well- behaved applications warn the user with an alert about this and give a final opportunity to save the changed contents.

When the Closer of a desktop window is clicked on in TOS, it will display the next-higher directory level, or, if already showing the root directory, close the window; some alternative desktops such as MAGXDESK, Jinnee and Thing offer the option to either behave in the same way, or can be set for the Closer to shut the window immediately from any directory level - they use a 'parent' widget at the top of the window to move to the next-higher level.

The Title-bar shows the full path to the current directory (in a desktop window) or to the current file (in an application's window). It may also show other details, such as the current cursor position etc. (if the window does not have an info-line).

The Mover allows the whole window to be moved by clicking and holding down the left mouse button while dragging the outline of the window to a new position.

The Backdrop button is only present in MagiC and similar system extensions. If several windows are open, clicking on it places the window at the bottom of the 'stack', permitting rapid cycling through the windows.

The Iconifier button is only present as of AES Version 4.1 and later MagiC versions. When clicked on, the window is shrunk to a large icon at the bottom left of the screen, carrying a suitable identity label. If several windows are iconified, their icons will be ranged next to each other. A double-click on the icon will restore the window to its former position and size.

Clicking on the Fuller enlarges the window to fill the screen. A second click restores the former size.

The Info-line provides various items of information about the window's contents. In applications it is optional and must be provided by the running program. This also applies to the menu-line (may be scrollable if too long to fit the window) and the toolbar.

When one of the four arrows is clicked on, it scrolls the contents in the appropriate direction by one line or column if the contents exceed the current width and/or height of the window. This action repeats if the mouse button is held down.

The width of the sliders indicate what portion of the total contents is being displayed on the screen in comparison with the shaded area in the two elevators representing the off-screen portions. Holding down the left mouse button and dragging the slider allows the window's contents to be scrolled quickly in the relevant direction.

Clicking in the elevator area scrolls the contents by one screen height or width; this too repeats if the button is held down.

Clicking on the Sizer and holding down the left mouse button allows dragging the window to a new size. During this the outline of the window appears dotted as an aid to placement. The top left corner remains in position.

See also: Window library

8.9.16 Overview of the wind_get/set subfunctions

An 'x' shows in which wind_xxx function the subfunction is present. In most cases clicking on the 'x' will bring up further details.

Subfunction Dec Hex get xget set xset
WF_KIND 1 0x0001 x   x  
WF_NAME 2 0x0002 x   x  
WF_INFO 3 0x0003 x   x  
WF_WORKXYWH 4 0x0004 x      
WF_CURRXYWH 5 0x0005 x   x x
WF_PREVXYWH 6 0x0006 x   x x
WF_FULLXYWH 7 0x0007 x   x x
WF_HSLIDE 8 0x0008 x   x  
WF_VSLIDE 9 0x0009 x   x  
WF_TOP 10 0x000A x   x  
WF_FIRSTXYWH 11 0x000B x      
WF_NEXTXYWH 12 0x000C x      
WF_IGNORE 13 0x000D     x  
WF_FIRSTAREAXYWH 13 0x000D   x    
WF_NEWDESK 14 0x000E x   x  
WF_HSLSIZE 15 0x000F x   x  
WF_VSLSIZE 16 0x0010 x   x  
WF_SCREEN 17 0x0011 x      
WF_COLOR 18 0x0012     x  
WF_ATTRB 18 0x0012     x  
WF_DCOLOR 19 0x0013 x   x  
WF_SIZETOP 19 0x0013     x  
WF_OWNER 20 0x0014 x      
WF_TOPAP (only X/GEM) 20 0x0014        
WF_BEVENT 24 0x0018 x   x  
WF_BOTTOM 25 0x0019 x   x  
WF_ICONIFY 26 0x001A x   x  
WF_UNICONIFY 27 0x001B x   x  
WF_UNICONIFYXYWH 28 0x001C     x  
WF_TOOLBAR 30 0x001E x   x  
WF_FTOOLBAR 31 0x001F x      
WF_NTOOLBAR 32 0x0020 x      
WF_MENU 33 0x0021 x   x  
WF_WHEEL 40 0x0028 x   x  
WF_OPTS 41 0x0029 x   x  
WF_CALCF2W 42 0x002A   x    
WF_CALCW2F 43 0x002B   x    
WF_CALCF2U 44 0x002C        
WF_CALCU2F 45 0x002D        
WF_MAXWORKXYWH 46 0x002E        
WF_M_BACKDROP 100 0x0064 x      
WF_M_OWNER 101 0x0065 x      
WF_M_WINDLIST 102 0x0066 x      
WF_MINXYWH 103 0x0067 x      
WF_INFOXYWH 104 0x0068 x      
WF_WIDGETS 200 0x00C8 x   x  
WF_USER_POINTER 230 0x00E6 x   x  
WF_WIND_ATTACH 231 0x00E7     x  
WF_TOPMOST 232 0x00E8     x  
WF_BITMAP 233 0x00E9 x      
WF_OPTIONS 234 0x00EA     x  
WF_FULLSCREEN 235 0x00EB     x  
WF_OBFLAG 1001 0x03E9 x   x  
WF_OBTYPE 1002 0x03EA x      
WF_OBSPEC 1003 0x03EB x   x  
X_WF_MENU 4352 0x1100 x   x  
X_WF_DIALOG 4608 0x1200 x   x  
X_WF_DIALWID 4864 0x1300 x   x  
X_WF_DIALHT 5120 0x1400 x   x  
X_WF_DFLTDESK 5376 0x1500 x   x  
X_WF_MINMAX 5632 0x1600 x   x  
X_WF_HSPLIT 5888 0x1700 x   x  
X_WF_VSPLIT 6144 0x1800 x   x  
X_WF_SPLMIN 6400 0x1900 x   x  
X_WF_HSLIDE2 6656 0x1A00 x   x  
X_WF_VSLIDE2 6912 0x1B00 x   x  
X_WF_HSLSIZE2 7168 0x1C00 x   x  
X_WF_VSLSIZE2 7424 0x1D00 x   x  
X_WF_DIALFLGS 7680 0x1E00 x   x  
X_WF_OBJHAND 7936 0x1F00 x   x  
X_WF_DIALEDIT 8192 0x2000 x   x  
X_WF_DCOLSTAT 8448 0x2100 x   x  
WF_WINX 22360 0x5758 x      
WF_WINXCFG 22361 0x5759 x   x  
WF_DDELAY 22362 0x575A x   x  
WF_SHADE 22365 0x575D x   x  
WF_STACK 22366 0x575E     x  
WF_TOPALL 22367 0x575F     x  
WF_BOTTOMALL 22368 0x5760     x  
XA 22593 0x5841 x      

8.9.17 wind_get and wind_set mode in Geneva

In all cases, the wind_get function can be used to retrieve the following information for a particular window. wind_set can be used to set the values.

X_WF_MENU (0x1100)


Setting this attribute causes a menu bar to appear below the window's name and information bars. The wi_sw1 parameter should have the high-WORD of the address of the object tree containing the menu. wi_sw2 contains the low-WORD of the address. If a NULL pointer is passed, the menu bar will be blank.

Example:

      int handle;
      OBJECT *menu;

      handle = wind_create( MOVER|X_MENU, 20, 20, 200, 200 );
      if( handle>0 ) {
         wind_set( handle, X_WF_MENU, menu );
         wind_open( handle, 20, 20, 200, 200 );
      }
X_WF_DIALOG (0x1200)


This option allows a program to create dialog boxes within windows. It is generally used in conjunction with the X_MU_DIALOG event type.

The wi_sw1 parameter should have the high-WORD of the address of the object tree containing the dialog. wi_sw2 contains the low- WORD of the address. If a NULL address is passed, there will be no dialog associated with the window, and it will receive events normally.

If the window does not have horizontal or vertical sliders, then the size of the root object of the dialog will automatically be sized to fit the entire working area of the window. If the window has sliders, then the dialog will automatically scroll and update as the user operates them. No action is necessary on the part of the program.

If the window is open when this call occurs, the entire dialog is always redrawn and the sliders, if present, are updated. All slider updates can be turned off by clearing the X_WTFL_SLIDERS attribute for the window, by way of the x_wind_tree function.

Refer to the section describing shel_write for information on how to cause a windowed dialog to scroll by sending a message to Geneva.

Example:

      int handle;
      OBJECT dial = { -1, -1, -1, G_BOX, 0, 0, 0x021131L, 0, 0, 1000, 1000 };
                              /* a large, filled rectangle */


      handle = wind_create( MOVER|SIZER|CLOSER|UPARROW|DNARROW|\
        VSLIDE|LFARROW|RTARROW|HSLIDE, 20, 20, 200, 200 );

      if( handle>0 ) {
        wind_set( handle, X_WF_DIALOG, d
        wind_set( handle, X_WF_DIALHT, 10 );  /* vert. scroll jump */
        wind_set( handle, X_WF_DIALWID, 10 ); /* horiz. scroll jump */
        wind_open( handle, 20, 20, 200, 200 );
      }
X_WF_DIALWID (0x1300)


This option is used in conjunction with the X_WF_DIALOG option. It controls the interval at which scrolling by the user occurs. For instance, a value of 10 will cause the left and right scroll arrows to scroll the dialog within the window by 10 pixels at a time. The default value is 1.

Since, by default, Geneva will use a blit operation to move most of a windowed dialog's contents when scrolling, unpredictable redraw errors can occur when redrawing the unblitted area of a dialog if the dialog uses a patterned fill and X_WF_DIALWID is not a multiple of 16 pixels.

X_WF_DIALHT (0x1400)


This option is used in conjunction with the X_WF_DIALOG option. It controls the interval at which scrolling by the user occurs. For instance, a value of 10 will cause the up and down scroll arrows to scroll the dialog within the window by 10 pixels at a time. The default value is 1.

Since, by default, Geneva will use a blit operation to move most of a windowed dialog's contents when scrolling, unpredictable redraw errors can occur when redrawing the unblitted area of a dialog if the dialog uses a patterned fill and X_WF_DIALWID is not a multiple of 16 pixels.

X_WF_DFLTDESK (0x1500)


This option allows a program to redefine the default desktop, so that it will be something other than the normal grey pattern. The wi_sw1 parameter should have the high-WORD of the address of the object tree containing the new object tree. wi_sw2 cont address pattern) desktop will become the new default. The wi_sw3 parameter must contain the total number of objects in the object tree which contains the new desktop.

If the application which has changed the default desktop terminates, the default grey pattern is reinstated automatically.

X_WF_MINMAX (0x1600)


This option allows a program to change the minimum and maximum sizes to which the user can resize a particular window.

By default, Geneva calculates a minimum window size that is large enough to contain all of the window widgets without overlapping. The maximum size always defaults to the working area of the entire desktop.

The wi_sw1 and wi_sw2 parameters are the minimum window width and height, respectively, and wi_sw3 and wi_sw4 are the maximum width and height of the window. Passing a value of -1 in any of these parameters in a call to wind_set will cause no change to occur in that one value.

X_WF_HSPLIT (0x1700)


This option reflects the location of the horizontal split bar of a window.

The wi_sw1 parameter is the new location of the bar, in pixels. If the value is zero, the bar will be all the way to the left edge; if it is -1 (which is the default) it will be all the way to the right.

Return value from wind_get:

wi_gw1 = Split bar position
wi_gw2 = Size, in pixels, of the upper window region
wi_gw3 = Size of the lower window region

Note: The value returned by wind_get may not be equal to the value supplied to wind_set if the user has either changed the size of the window, or if the value was too large or not large enough to exceed the minimum bar position. See the function x_wind_create and the X_WF_SPLMIN option, below, for more information.

X_WF_VSPLIT (0x1800)


This option reflects the location of the vertical split bar of a window.

The wi_sw1 parameter is the new location of the bar, in pixels. If the value is zero, the bar will be at the very top; if it is -1 (which is the default) it will be at the very bottom.

Return value from wind_get:

wi_gw1 = Split bar position
wi_gw2 = Size, in pixels, of the left window region
wi_gw3 = Size of the right window region

Note that the value returned to wind_get may not be equal to the value supplied by wind_set if the user has either changed the size of the window, or if the value was too large or not large enough to exceed the minimum bar position. See the function x_wind_create and the X_WF_SPLMIN option, below, for more information.

X_WF_SPLMIN (0x1900)


This option controls the minimum sizes of the areas defined by the horizontal and vertical split bars.

wi_sw1 = Minimum width of region to left of horizontal split
wi_sw2 = Minimum width of region to right of horizontal split
wi_sw3 = Minimum height of region above vertical split
wi_sw4 = Minimum height of region below vertical split

When the user drags a split bar, these values are checked. He will not be able to drag the bar if the window is too small to fit two regions having these sizes. When a wind_set call is made to set the position of one of the split bars, they will be 'snapped' to one edge or the other if the position is less than 1/2 of the minimum distance away from the edge. Furthermore, when the window is made smaller, the positions of the split bars are automatically changed so as to satisfy these minimum values. For this reason, a program should never assume that they have not changed.

Passing a value of -1 in any of these parameters in a call to wind_set will cause no change to occur in that one value.

X_WF_HSLIDE2 (0x1A00)


This option gets or sets the position of the second horizontal slider (which appears to the right of a horizontal split bar) in a manner identical to WF_HSLIDE.

X_WF_VSLIDE2 (0x1B00)


This option gets or sets the position of the second vertical slider (which appears below a vertical split bar) in a manner identical to WF_VSLIDE.

X_WF_HSLSIZE2 (0x1C00)


This option gets or sets the size of the second horizontal slider (which appears to the right of a horizontal split bar) in a manner identical to WF_HSLSIZE.

X_WF_VSLSIZE2 (0x1D00)


This option gets or sets the size of the second vertical slider (which appears below a vertical split bar) in a manner identical to WF_VSLSIZE.

X_WF_DIALFLGS (0x1E00)


This option gets/sets flags related to the way dialogs within windows are processed. Currently, only the following three bits are used. All other bits are reserved for future use:

X_WD_ACTIVE (bit 0)


When this bit is off, no mouse or keyboard events will be processed. This is a good way to temporarily lock a windowed dialog while presenting the user with a sub-dialog that asks for other input (like the 'Find' option in the Task Manager's 'Flags' dialog.) This attribute defaults to On.

X_WD_BLITSCRL (bit 1)


If this flag is set, which it is by default, a windowed dialog will be scrolled in real time by way of a blit operation. Care should be taken when displaying object trees which use fill patterns, because if the X_WF_DIALWID or X_WF_DIALHT are not an even increment of 16, the fill pattern may not match up correctly when the user scrolls the window. If this flag is off, the entire dialog will be redrawn every time its position changes. In this case, the scroll increment does not matter.

X_WD_KEYS (bit 2) (since Update 004)


When set, any keypresses that would otherwise be processed as part of the dialog are instead passed through to the application.

An example is when NeoDesk is run with the desktop in a window. Normally, things like [Shift]-[C] would be treated like a keypress in a dialog without any editable field and ignored. When this bit is set, the keypress will instead go to the application.

X_WF_OBJHAND (0x1F00) (since Update 003)


When an application wants to intercept some or all of the button events that would otherwise be interpreted by Geneva to mean that a window widget has been clicked on, this wind_set mode can be used to provide Geneva with the address of a routine which instructs Geneva to either ignore the event, or to process it as normal. This allows the programmer to redefine the operation of window widgets, and to define his own actions for new widgets which have been added with the x_wind_tree function.

The routine is passed the handle of the window containing the object and the index of the object within the window's object tree. If the user routine returns a 0, then Geneva will generate an X_WM_OBJECT message and send it to the application. If the routine returns a 1, then Geneva will process the action as a normal event and act accordingly.

IMPORTANT: The application's object handler routine must not use any AES functions.

The following example declares an object handler which allows the action of the vertical scroll bar to be redefined:

       /* change this to "int cdecl objhand..." for Pure C */
int objhand( int handle, int obj )
{  /* handle parameter is not used */
  if( obj==WGVSMLSL ) return 0;   /* this is the vertical slider */
  return 1;                       /* otherwise, process as normal */
}

main()
{
 int handle, message[8];

  handle = wind_create( NAME|MOVER|VSLIDE|UPARROW|DNARROW,
      50, 50, 150, 150 );

  if( handle > 0 )
  {
    wind_set( handle, X_WF_OBJHAND, &objhand );
    wind_open( handle, 50, 50, 150, 150 );
  }

  ...

  evnt_mesag( message );

  switch( message[0] )
  {

    case X_WM_OBJECT:
      if( message[3]==handle && message[4]==WGVSMLSL )
         /* do something new with the slider */
  }
}

If wind_set( X_WF_OBJHAND ) is passed a NULL pointer instead of a pointer to a function, object handling is discontinued for that window.

Note that in order for Geneva to determine that the mouse has been clicked on an object in a window's tree structure, it must be of type EXIT or TOUCHEXIT. Geneva's default window widgets already have these attributes set correctly.

wind_get can also be used to get a pointer to the current object handler routine. A NULL pointer means that there is no object handler defined.

X_WF_DIALEDIT (0x2000) (since Update 003)


When a windowed dialog has been defined with wind_set mode X_WF_DIALOG, these two options can be used to get or set the index of the object which currently has the edit cursor. This can be helpful when an application changes the contents of a text field while the dialog is still displayed, or when it needs to hide the object that currently has the edit cursor.

wind_get( X_WF_DIALEDIT ) will return the index of the object which currently has the edit cursor in the wi_gw1 parameter, and the position of the edit cursor within the object's text in the wi_gw2 parameter.

wind_set( X_WF_DIALEDIT ) changes the object (wi_sw1) and the edit index (wi_sw2). If the object is 0, then the edit cursor will simply be turned off; otherwise it will be moved to the new object. If the index is 0, the cursor will be positioned before the leftmost character in the field; if it is a number > 0, it will be further to the right. If the index is -1, then the cursor will be automatically moved to the rightmost position.

X_WF_DCOLSTAT (0x2100) (since Update 004)


This mode gets or sets a window widget's default colours and ob_state value. Unlike WF_DCOLOR, this option gives full control over all of Geneva's extended window widgets.

For wind_set, the wi_sw1 parameter contains the index of the window widget to change, taken from the list of WGCLOSE through WGSIZE, as outlined in xwind.h. wi_sw2 contains the colour for the widget when the window is on top, wi_sw3 is for an untopped window. wi_sw4 contains the ob_state WORD of the object. If any of these values is set to -1, then no change occurs.

For wind_get, the wi_sw1 parameter must be a pointer to a WORD containing the index of the widget being inquired about, the same way WF_COLOR and WFDCOLOR work.

Example: Turn the 3D attribute on for the mover bar

      int top, untop, state, gadget;

      gadget = WGMOVE;
      wind_get( 0, X_WF_DCOLSTAT, &gadget, &top, &untop, &state );
      state |= X_MAGIC|X_DRAW3D;
      wind_set( 0, X_WF_DCOLSTAT, gadget, -1, -1, state );

HomeAESWindow-dialogsExtended file-selectors