Initial revision
[ssr] / StraySrc / Libraries / Sapphire / sh / dbx / numWrite
1 ;
2 ; dbx.numWrite.sh
3 ;
4 ; Numeric writable icons
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 ; Functions provided:
30 ;
31 ; numWrite_set
32 ; numWrite_read
33 ; numWrite_bump
34 ;
35 ; Controls provided:
36 ;
37 ; numWrite
38 ;
39 ; Macros provided:
40 ;
41 ; NUMWRT
42
43 GET sapphire:dbx.dbx
44
45 [ :LNOT::DEF:numWrite__dfn
46 GBLL numWrite__dfn
47
48 ; --- numWrite ---
49 ;
50 ; Control data: +0 == minimum value
51 ; +4 == maximum value
52 ; +8
53 ;
54 ; Workspace: +0
55 ;
56 ; Flags: --
57 ;
58 ; Use: Control type for numeric writable icons.
59
60 IMPORT numWrite
61
62 ; --- numWrite ---
63 ;
64 ; Control data: +0 == minimum value
65 ; +4 == maximum value
66 ; +8
67 ;
68 ; Workspace: +0
69 ;
70 ; Flags: --
71 ;
72 ; Use: Control type for numeric writable icons.
73
74 IMPORT numWrite
75
76 ; --- numWrite_set ---
77 ;
78 ; On entry: R0 == dialogue box handle
79 ; R1 == icon number within dialogue
80 ; R2 == value to set in the icon
81 ;
82 ; On exit: R2 == value actually set
83 ;
84 ; Use: Writes the specified numeric value into the given writable
85 ; icon. The icon must be a dbx control with numWrite type
86 ; for this to work.
87
88 IMPORT numWrite_set
89
90 ; --- numWrite_read ---
91 ;
92 ; On entry: R0 == dialogue box handle
93 ; R1 == icon handle
94 ;
95 ; On exit: CC if icon contains a valid integer, and
96 ; R2 == value shown in the icon
97 ; else CS and
98 ; R2 == 0
99 ;
100 ; Use: Reads the numeric value within the icon specifed.
101
102 IMPORT numWrite_read
103
104 ; --- numWrite_bump ---
105 ;
106 ; On entry: R0 == dialogue box handle
107 ; R1 == icon handle
108 ; R2 == increment to apply to it
109 ;
110 ; On exit: R2 == updated value in the icon
111 ;
112 ; Use: Adjusts the value in a writable icon by a given increment.
113
114 IMPORT numWrite_bump
115
116 ; --- Macro: NUMWRT ---
117 ;
118 ; Arguments: icon == icon handle of control
119 ; min == minimum representable value
120 ; max == maximum representable value
121 ;
122 ; Use: Inserts a definition of a numerical writable icon into
123 ; a dbx dialogue definition table.
124
125 MACRO
126 $label NUMWRT $icon,$min,$max
127 $label CONTROL $icon,numWrite,,0
128 DCD $min
129 DCD $max
130 ECTRL
131 MEND
132
133 ;----- Constants ------------------------------------------------------------
134
135 numWrite_event EQU &80000004 ;R1 == icon number changed
136 ;R2 == subreason code
137 ;R3 == new value of icon
138
139 numWrite_change EQU 0 ;Subreason -- number changed
140 numWrite_move EQU 1 ;Subreason -- cursor moved
141
142 ]
143
144 ;----- That's all, folks ----------------------------------------------------
145
146 END