Bad Seal Desktop 0.52                        |
(c) 2001 Kostas Michalopoulos aka Bad Sector |
---------------------------------------------+

 In these lines i will explain how you can add objects (usually icons) to
Bad Seal Desktop's userbox and how you can change your program's title in
`BadSeal' menu. But before say (or `write' if you like ;-)) anything else i
must inform you that if you use those `extended' functions, your program
will be not able to run in other SEAL Desktops (including older Bad Seal
versions). Until the time that these lines are written the only desktop
that is able to understand those functions is Bad Seal 0.5's Desktop. But
i hope that other SEAL developers (like Julien, Florian and of course
Michal) will support my functions.

Okay... let's go...

Adding an object to userbox is very simple. First of all you have to
include "desktop.h" to your program like this:

#include "allegro.h"
#include "seal.h"
#include "app.h"
#include "desktop.h"

...

and then you have to add your object to userbox by using the add_to_userbox
function like this:

add_to_userbox(object);

where "object" is a valid SEAL object. Actually this must be a view with
maximum height 16 or 18 (i suggest 16). Width can be whatever you like
(but don't overdo it ;-)).
Because desktop changes its objects's position after every use of the
add_to_userbox function, i suggest to define object's rectangle like:

t_rect = rect_assign(0, 0, width, 16); /* or , 18); */

Also because in most cases you have to define your own control, you don't
need to make it an external DLX: just add the code to your .c file.

Now if you want to remove your object just use the remove_from_userbox
function. Use it like this:

remove_from_userbox(object);

Important note: Bad Seal's Desktop places first object in userbox last. This
because usually the first object is usually a clock object (Bad Seal executes
dclock.exe when starts) and must not moved.

Another note: in ./SOURCES/SPACE in Bad Seal 0.5 distribution you will found
the source code of Space, a small utility for seeing the free space in hard
disk C:. This program is a good example on how to place and use an icon to
Bad Seal Desktop's userbox.


Now how to change program's title in `BadSeal' menu. This is very simple. As
you probably know SEAL and Bad Seal desktop just scans the PROGRAMS and
SETTINGS directory and it's sub-directories and makes a menu (Bad Seal 0.52's
Desktop also scans DOCS and HELP directories). As a side-effect, all program
names in that menu are actually their file names (f.e. PLAYER.EXE, IMAGER.EXE
etc etc). In Bad Seal 0.5's Desktop optionally you can make a file in any
of these folders (and if you want it's subfolders) named DESKTOP.INF that
will contain the program's filename and it's name as you want to be placed
in bad seal menu. This file is a simple text file that you can create with
the text editor and has this form:

filename1
Title 1
filename2
Title 2
...

(see ./PROGRAMS/DESKTOP.INF in Bad Seal 0.5 for an example).

Actually you can define a title for every filename, not only .EXEs.

In Bad Seal 0.52's desktop this has changed to become compatible with
Julien Etelain's DESKTOP 3.3 that supports icons and descriptions of every
file. In DESKTOP 3.3 and Bad Desktop 0.52 DESKTOP.INF's file format is:

[FILENAME1.EXT]
name="Title 1"
icon="path\to\a\bitmap.bmp"
des="Description for file 1"

[FILENAME2.EXT]
name="Title 2"
icon="path\to\another\bitmap.bmp"
des="Description for file 2"


Important note: DESKTOP 3.3 thinks that [filename.ext] is different than
[FILENAME.EXT] due to case sensitivity. This can cause errors when running
under pure DOS because there is no Long FileName support and all files are
in upper case. Bad Seal to avoid this problem converts all characters from
lower to upper case so in Bad Desktop's DESKTOP.INF you MUST define filenames
ALWAYS in upper case. For example if there is a file called myfile.txt and
you want to assign it a name and an icon you must write:

[MYFILE.TXT]
name="My text file"
icon="c:/mytexts.bmp"

and not

[myfile.txt]
name="My text file"
icon="c:/mytexts.bmp"

because Bad Desktop will just ignore it. 

                                                        Good Programming!


(c) 2001 Kostas Michalopoulos aka Bad Sector

