;
; dbx.slider.sh
;
; Implementation of sliders as a dbx control
;
;  1994-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:
;
;  slider
;
; Macros provided:
;
;   SLIDER

		GET	sapphire:dbx.dbx

		[	:LNOT::DEF:slider__dfn
		GBLL	slider__dfn

; --- slider ---
;
; Control data:	+0 == slider colour (if flags bit 9 clear)
;		+1 == background colour
;		+2 == separator colour
;		+3 == reserved
;		+4 == maximum slider value
;		+8
;
; Workspace:	+0 == current slider value
;		+4 == slider colour (if flags bit 9 set)
;		+5 == reserved, must be 0
;		+8
;
; Flags:	Bit 8 == slider is horizontal if clear, vertical is set
;
; Use:		Control type for a slider.

		IMPORT	slider

;----- Macros and symbols ---------------------------------------------------

		MACRO
$label		SLIDER	$icon,$baseReg,$data,$flags,$slidC,$backC,$sepC,$max

$label		CONTROL	$icon,slider,$baseReg,$flags,$data
		DCB	$slidC,$backC,$sepC,0
		DCD	$max
		ECTRL

		MEND

; --- Direction flags ---

slFlag_vertical	EQU	(1<<8)
slFlag_horizontal EQU	0
slFlag_colData	EQU	(1<<9)

; --- Slider event codes ---

slider_event	EQU	&80000001		;Something happened to slider
						;R1 == subreason code
						;R2 == icon handle
						;R3 == new value of slider

slider_sliding	EQU	0
slider_slid	EQU	1

		]

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

		END
