4 * Handling of a colour button
6 * © 1994-1998 Straylight
9 /*----- Licensing note ----------------------------------------------------*
11 * This file is part of Straylight's Glass.
13 * Glass is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2, or (at your option)
18 * Glass is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with Glass. If not, write to the Free Software Foundation,
25 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 /*----- Background information ----------------------------------------------
30 A colour button is a small (36x36 OS unit) button, pressed into a
31 dialogue, which allows the user to select a WIMP colour. Clicks on the
32 button are handled as follows:
34 SELECT Cycle through colours in ascending number order. If
35 transparent is allowed, this comes between colours 15 and 0.
36 Holding down the button auto-repeats.
37 ADJUST Cycle through colours in reverse order to SELECT.
38 MENU Display a colour selector dialogue.
40 Specifications for a colour button
43 Border Z3 type 3D, no WIMP border
45 If colour can be transparent, validation string must include an 'Strans'
46 instruction. The icon must have a background set.
48 ---------------------------------------------------------------------------*/
53 /*----- Required header files ---------------------------------------------*/
56 #include "steel/dbox.h"
59 /*----- Type definitions --------------------------------------------------*/
61 typedef void (*colSelect_proc)(dbox d,dbox_field f,int colour,void *handle);
63 /*----- External routines -------------------------------------------------*/
66 * void colSelect_setColourButton(dbox d,dbox_field f,int colour)
69 * Sets a colour button to show a colour
72 * dbox d == dbox containing button
73 * dbox_field f == the icon which is the button
74 * int colour == colour to set the button. 255 means transparent
77 void colSelect_setColourButton(dbox d,dbox_field f,int colour);
80 * void colSelect(dbox d,dbox_field f,wimp_bbits bbits,char *editing,
81 * BOOL allowTrans,colSelect_proc proc,void *handle)
84 * Handles mouse events on a colour button.
87 * dbox d == the dialogue containing the colour button
88 * dbox_field f == the icon which is the colour button
89 * wimp_bbits bbits == button status that prompted this
90 * char *editing == what we're editing (for dialogue)
91 * BOOL allowTrans == whether we're allowed transparent colour
92 * colSelect_proc proc == routine to take notice of any changes
93 * void *handle == pointer to pass to the proc
96 void colSelect(dbox d,dbox_field f,wimp_bbits bbits,char *editing,
97 BOOL allowTrans,colSelect_proc proc,void *handle);