chiark / gitweb /
Initial revision
[ssr] / StraySrc / Libraries / Sapphire / sh / dbx / slider
1 ;
2 ; dbx.slider.sh
3 ;
4 ; Implementation of sliders as a dbx control
5 ;
6 ; © 1994-1998 Straylight
7 ;
8
9 ;----- Licensing note -------------------------------------------------------
10 ;
11 ; This file is part of Straylight's Sapphire library.
12 ;
13 ; Sapphire 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 ; Sapphire 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 Sapphire.  If not, write to the Free Software Foundation,
25 ; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
27 ;----- Overview -------------------------------------------------------------
28 ;
29 ; Controls provided:
30 ;
31 ;  slider
32 ;
33 ; Macros provided:
34 ;
35 ;   SLIDER
36
37                 GET     sapphire:dbx.dbx
38
39                 [       :LNOT::DEF:slider__dfn
40                 GBLL    slider__dfn
41
42 ; --- slider ---
43 ;
44 ; Control data: +0 == slider colour (if flags bit 9 clear)
45 ;               +1 == background colour
46 ;               +2 == separator colour
47 ;               +3 == reserved
48 ;               +4 == maximum slider value
49 ;               +8
50 ;
51 ; Workspace:    +0 == current slider value
52 ;               +4 == slider colour (if flags bit 9 set)
53 ;               +5 == reserved, must be 0
54 ;               +8
55 ;
56 ; Flags:        Bit 8 == slider is horizontal if clear, vertical is set
57 ;
58 ; Use:          Control type for a slider.
59
60                 IMPORT  slider
61
62 ;----- Macros and symbols ---------------------------------------------------
63
64                 MACRO
65 $label          SLIDER  $icon,$baseReg,$data,$flags,$slidC,$backC,$sepC,$max
66
67 $label          CONTROL $icon,slider,$baseReg,$flags,$data
68                 DCB     $slidC,$backC,$sepC,0
69                 DCD     $max
70                 ECTRL
71
72                 MEND
73
74 ; --- Direction flags ---
75
76 slFlag_vertical EQU     (1<<8)
77 slFlag_horizontal EQU   0
78 slFlag_colData  EQU     (1<<9)
79
80 ; --- Slider event codes ---
81
82 slider_event    EQU     &80000001               ;Something happened to slider
83                                                 ;R1 == subreason code
84                                                 ;R2 == icon handle
85                                                 ;R3 == new value of slider
86
87 slider_sliding  EQU     0
88 slider_slid     EQU     1
89
90                 ]
91
92 ;----- That's all, folks ----------------------------------------------------
93
94                 END