/* * colSelect.c * * Handling of a colour button * * © 1994-1998 Straylight */ /*----- Licensing note ----------------------------------------------------* * * This file is part of Straylight's Glass. * * Glass is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * Glass is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Glass. If not, write to the Free Software Foundation, * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*----- Background information ---------------------------------------------- A colour button is a small (36x36 OS unit) button, pressed into a dialogue, which allows the user to select a WIMP colour. Clicks on the button are handled as follows: SELECT Cycle through colours in ascending number order. If transparent is allowed, this comes between colours 15 and 0. Holding down the button auto-repeats. ADJUST Cycle through colours in reverse order to SELECT. MENU Display a colour selector dialogue. Specifications for a colour button Size 36x36 OS units Border Z3 type 3D, no WIMP border If colour can be transparent, validation string must include an 'Strans' instruction. The icon must have a background set. ---------------------------------------------------------------------------*/ #ifndef __colSelect_h #define __colSelect_h /*----- Required header files ---------------------------------------------*/ #ifndef __dbox_h #include "steel/dbox.h" #endif /*----- Type definitions --------------------------------------------------*/ typedef void (*colSelect_proc)(dbox d,dbox_field f,int colour,void *handle); /*----- External routines -------------------------------------------------*/ /* * void colSelect_setColourButton(dbox d,dbox_field f,int colour) * * Use * Sets a colour button to show a colour * * Parameters * dbox d == dbox containing button * dbox_field f == the icon which is the button * int colour == colour to set the button. 255 means transparent */ void colSelect_setColourButton(dbox d,dbox_field f,int colour); /* * void colSelect(dbox d,dbox_field f,wimp_bbits bbits,char *editing, * BOOL allowTrans,colSelect_proc proc,void *handle) * * Use * Handles mouse events on a colour button. * * Parameters * dbox d == the dialogue containing the colour button * dbox_field f == the icon which is the colour button * wimp_bbits bbits == button status that prompted this * char *editing == what we're editing (for dialogue) * BOOL allowTrans == whether we're allowed transparent colour * colSelect_proc proc == routine to take notice of any changes * void *handle == pointer to pass to the proc */ void colSelect(dbox d,dbox_field f,wimp_bbits bbits,char *editing, BOOL allowTrans,colSelect_proc proc,void *handle); #endif