AES 4.1 programming


So, you want to know how to make use of some of the cool AES 4.1 features then? well, there are quite a few, but here are some of the things that you can do...


Iconify

To add an iconify gadget to a window, simply or the value SMALLER (0x???) into the parts section of wind_create().

handle=wind_create(SMALLER | WM_NAME | WM_CLOSE | WM_MOVER, x,y,w,h);

Whenever the user clicks on the gadget, you will recieve either a WM_ICONIFY (0x???) or a WM_ICONIFYALL (0x???) message. Upon reciept of an iconify message you should use wind_set() to tell it to iconify it:

wind_set(handle,WF_ICONIFY,msg[4],msg[5],msg[6],msg[7]);

Note that when recieving a WF_ICONIFYALL message you should use the same wind_set() but close all other windows.

Now the window is iconified, you must continue to handle redraw and move messages for the window - but remembering to draw the correct object tree for your icon in the window. You could also interpret mouseclicks so that you can animate the icon in the same way that the desktop does.

When the user uniconifies the window, you will recieve a message WM_UNICONIFY, and should react in the obvious way of:

wind_set(handle,WF_UNICONIFY,msg[4],msg[5],msg[6],msg[7]);

Which will restore the window to the position given by msg[4-7].


Active Iconify

This is not a well documented feature, and is not included in the Atari Compendium, but was 'post-documented' by Atari. I got this information from Thomas Binder, who got it from Thomas Much, so thanks guys...

A window can be iconified by a program (eg. when the user selects a menu item) by closing the window using wind_close (or perhaps creating the window, but not actually opening it), and then calling wind_set and then re-opening the window:

wind_close(handle);
wind_set(handle, WF_ICONIFY, -1, -1, -1, -1);
wind_open(handle, WF_ICONIFY, -1, -1, -1, -1);

Again, the user program is responsible for all messages relating to the iconified window, and must service all redraws.

To restore the window upon a WM_UNICONIFY message is a little more tricky as the 'destination' co-ordinates are the -1,-1,-1,-1 that was passed to WF_ICONIFY. Therefore, you will need to store the position/size of the window before iconifying it.

Also note that the above code is un-defined for AES versions which do not support AES 4.1 type iconification, so the presence of iconify should be checked using appl_getinfo().

appl_getinfo(11,&useful, &dummy, &dummy, &dummy);
if ((useful & 0x180) == 0x180)
iconify_valid=TRUE;

Also, it should be pointed out that when I tested Geneva 005 as an AES under MiNT 1.12, this did not work. However, it does work under AES 4.1, and also N.AES. (dunno about Magic - anyone tried it?)

It has been claimed that the wind_close/wind_open calls are not needed. I have tried this, and it is NOT true - at least with the Atari AES 4.1. It may well be true for MagiC, and it will be true for Geneva 006, but it doesn't work with AES 4.1 if you omit these calls.


Toolbars

This is a great new feature of AES 4.1 which is very rarely used by software. I think this is a great shame as it is really easy to use. Take a look at my other page specifically about them...


Background Operation

It is stupidly simple to enable background operation of windows - ie. where mousclicks inside the window do not cause a WM_TOPPED message, but are interpreted as mouse-clicks - under AES 4.0 and above. To do this for a given window, simply call:

wind_set(handle,WF_BEVENT,1,0,0,0);

to set it - or change the 1 to a 0 to disable this feature.


appl_getinfo(MODE,&appinfo1,&appinfo2,&appinfo3,&appinfo4)

Well, as I mentioned it above... :)

This is a call that Atari added to enable you to check for the presence of certain AES features. The first parameter is the 'mode' parameter which is used to determine what you are asking about - eg 11 is for window gadgets, and the remaining pointers to ints are used to return information about the system.

This call is only present when the AES version is >= 4, or if appl_find("?AGI") succeeds. The appl_find call will only (?) succeed under MagiC, which returns an AES version 3.99 and so fail the first part of this test. I dont approve of this kludge, but I seem to be out-numbered on this...


Back to the programming pages...
Back to the Atari Pages...

Anthony Jacques : jacquesa@zetnet.co.uk