Bad Controls version 0.3                           |
(c) 2000, 2001 Kostas Michalopoulos aka Bad Sector |
---------------------------------------------------+

1. Installation
2. Using
3. Controls
 3.1. t_bad_checkbox
 3.2. t_bad_button
 3.3. t_bad_vtrackbar
4. Coming soon (i hope)

1. Installation
---------------

a. copy BADCTRLS.DLX to your SEAL/Bad Seal directory (f.e. C:\SEAL)
b. add <badctrls.dlx> just before <iodlg.dlx> in APP.SET
c. copy BADCTRLS.H to your SEAL/Bad Seal's ./INCLUDE directory (f.e. C:\SEAL\INCLUDE)

simple, isn't it?


2. Using
--------

to use Bad Controls just add #include "badctrls.h" to your SEAL application.
For Example:

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

/* your program code here */


You will found a demonstration program with this library called bcexampl.c. If
not, you will find it at www.badseal.org.

Important note: this control is designed for Bad Seal and *maybe* will not run
correctly with some other distributions. I haven't tested it yet with BlueSEAL
and SEAL/FreeDOS. I've tested it with SEAL 1D and SEAL 1E and only with colors
has a problem (background in controls was a little different).


3. Controls
-----------

in version 0.3 there are 3 controls:
  t_bad_checkbox
  t_bad_button and
  t_bad_vtrackbar

3.1. t_bad_checkbox
-------------------

t_bad_checkbox control is a check box for SEAL applications. Until the time that
these lines are written, there wasn't any similar control for SEAL. So let's
check how this control works.

(note: in badctrls.h you will find structure of t_bad_checkbox)

initialization:

t_rect r = rect_assign(give here your coords);
p_bad_checkbox my_checkbox = bad_checkbox_init(malloc(sizeof(t_bad_checkbox)), r, "check box's caption", MSG_msg, state);

where:

MSG_msg        is a valid SEAL message that occurs when user checks/unchecks 
              the checkbox.

state          is checkbox's state:

               BCB_UNCHECKED      unchecked
               BCB_CHECKED        checked
               BCB_GRAYED         grayed


Important note: in t_bad_checkbox structure is a field named "grayed". You MUST
NOT change this field because it's used internally by the event handler.

[new in 0.2: you can change checkbox's caption by using the 
change_caption(l_text c); function]


3.2. t_bad_button
-------------------
(new control in 0.2)

t_bad_button control is a replacement of the classic t_button control
of SEAL. This control can have more than one styles including Windows
95, Windows 3.1 and KDE styles.

(note: in badctrls.h you will find structure of t_bad_button)

initialization:

t_rect r = rect_assign(give here your coords);
p_bad_button my_button = bad_button_init(malloc(sizeof(t_bad_button)), r, "My Button", l_int style, MSG_msg);

where:

style          is button's style:

               BBS_SEAL        classic SEAL style
               BBS_BADSEAL     Bad Seal's style
               BBS_KDE         KDE-like style (not in Win95 look)
               BBS_WIN95       Windows 95 style
               BBS_WIN31       Windows 3.0 and 3.1x style
               BBS_MODERN      A more "modern" style :-)
               BBS_LIQUID      A MacOS-X button for small sizes (new in 0.3)

MSG_msg        is a valid SEAL message that occurs when user clicks on
              the button.


Important note: in t_bad_button structure is a field named "pressed". You MUST
NOT change this field because it's used internally by the event handler.

also there is an option-field named "switch-button". This makes button to act like
a checkbox but IS NOT TESTET YET so maybe there are bugs flying around.


3.3. t_bad_vtrackbar
-------------------
(new control in 0.3)


t_bad_vtrackbar is a vertical trackbar for applications like sound mixers,
volume controllers, etc. Can also act as a scroll bar but returns the value
after user releases the mouse button.

(note: in badctrls.h you will find structure of t_bad_vtrackbar)

initialization:

t_rect r = rect_assign(give here your coords);
p_bad_vtrackbar my_trackbar = bad_vtrackbar_init(malloc(sizeof(t_bad_vtrackbar)), r, MSG_msg);
my_trackbar->max = maximum_value;

where:

MSG_msg        is a valid SEAL message that occurs when user releases the
              left button on trackbar. A field in trackbar named pos contain
              the position of track (my_trackbar->pos in this example).

maximum_value  is the maximum value that the trackbar can return (minimum is
              0 - note that in t_bad_vtrackbar is a field named "min". This
              not used and is reserved for future use). By default the
              bad_trackbar_init functions set the "max" field (maximum value)
              to 100.


There is a function for changing track's position and redrawing trackbar:

my_trackbar->change_pos(my_trackbar, new_position);

where:

my_trackbar    see the example...

new_position   is the new position of trackbar.


By default bad_vtrackbar_init set track's position to 0.


4. Coming soon
--------------

Controls to add soon: 

t_bad_toolbar     a toolbar for SEAL applications
t_bad_radiobtn    a radio button control
t_bad_image       an image viewing control
t_bad_label       a changeable text control
t_bad_listbox     a more powerfull changeable list box

i'll see


(c) 2000, 2001 Kostas Michalopoulos aka Bad Sector

