Initial revision
[ssr] / StraySrc / Glass / !Glass / h / colSelect
1 /*
2 * colSelect.c
3 *
4 * Handling of a colour button
5 *
6 * © 1994-1998 Straylight
7 */
8
9 /*----- Licensing note ----------------------------------------------------*
10 *
11 * This file is part of Straylight's Glass.
12 *
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)
16 * any later version.
17 *
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.
22 *
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.
26 */
27
28 /*----- Background information ----------------------------------------------
29
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:
33
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.
39
40 Specifications for a colour button
41
42 Size 36x36 OS units
43 Border Z3 type 3D, no WIMP border
44
45 If colour can be transparent, validation string must include an 'Strans'
46 instruction. The icon must have a background set.
47
48 ---------------------------------------------------------------------------*/
49
50 #ifndef __colSelect_h
51 #define __colSelect_h
52
53 /*----- Required header files ---------------------------------------------*/
54
55 #ifndef __dbox_h
56 #include "steel/dbox.h"
57 #endif
58
59 /*----- Type definitions --------------------------------------------------*/
60
61 typedef void (*colSelect_proc)(dbox d,dbox_field f,int colour,void *handle);
62
63 /*----- External routines -------------------------------------------------*/
64
65 /*
66 * void colSelect_setColourButton(dbox d,dbox_field f,int colour)
67 *
68 * Use
69 * Sets a colour button to show a colour
70 *
71 * Parameters
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
75 */
76
77 void colSelect_setColourButton(dbox d,dbox_field f,int colour);
78
79 /*
80 * void colSelect(dbox d,dbox_field f,wimp_bbits bbits,char *editing,
81 * BOOL allowTrans,colSelect_proc proc,void *handle)
82 *
83 * Use
84 * Handles mouse events on a colour button.
85 *
86 * Parameters
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
94 */
95
96 void colSelect(dbox d,dbox_field f,wimp_bbits bbits,char *editing,
97 BOOL allowTrans,colSelect_proc proc,void *handle);
98
99 #endif