;
; colourPot.sh
;
; dbx control for selecting Wimp colours
;
;  1995-1998 Straylight
;

;----- Licensing note -------------------------------------------------------
;
; This file is part of Straylight's Sapphire library.
;
; Sapphire 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.
;
; Sapphire 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 Sapphire.  If not, write to the Free Software Foundation,
; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

;----- Overview -------------------------------------------------------------
;
; Controls provided:
;
;   colourPot
;
; Macros provided:
;
;   COLPOT

		GET	sapphire:dbx.dbx

		[	:LNOT::DEF:colourPot__dfn
		GBLL	colourPot__dfn

; --- colourPot ---
;
; Control data:	+0 == null terminated title string, or empty for default
;		+n
;
; Workspace:	+0 == current colour selected
;		+1
;
; Flags:	bit 8 == allow transparent
;
; Use:		Provides a `colour button' which allows the user to choose
;		a Wimp colour.  Transparent is represented by 255.

		IMPORT	colourPot

;----- Macros and constants -------------------------------------------------

		MACRO
$label		COLPOT	$icon,$baseReg,$data,$flags,$title

$label		CONTROL	$icon,colourPot,$baseReg,$flags,$data
		DCB	"$title",0
		ALIGN
		ECTRL

		MEND

; --- Flags ---

cpFlag_trans	EQU	(1<<8)			;Allow transparent colour

; --- Event codes ---

colourPot_event	EQU	&80000006		;User has changed the colour
						;R1 == icon handle
						;R2 == new colour

		]

;----- That's all, folks ----------------------------------------------------

		END
