4 ; Numeric writable icons
6 ; © 1994-1998 Straylight
9 ;----- Licensing note -------------------------------------------------------
11 ; This file is part of Straylight's Sapphire library.
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)
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.
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.
27 ;----- Overview -------------------------------------------------------------
45 [ :LNOT::DEF:numWrite__dfn
50 ; Control data: +0 == minimum value
58 ; Use: Control type for numeric writable icons.
64 ; Control data: +0 == minimum value
72 ; Use: Control type for numeric writable icons.
76 ; --- numWrite_set ---
78 ; On entry: R0 == dialogue box handle
79 ; R1 == icon number within dialogue
80 ; R2 == value to set in the icon
82 ; On exit: R2 == value actually set
84 ; Use: Writes the specified numeric value into the given writable
85 ; icon. The icon must be a dbx control with numWrite type
90 ; --- numWrite_read ---
92 ; On entry: R0 == dialogue box handle
95 ; On exit: CC if icon contains a valid integer, and
96 ; R2 == value shown in the icon
100 ; Use: Reads the numeric value within the icon specifed.
104 ; --- numWrite_bump ---
106 ; On entry: R0 == dialogue box handle
108 ; R2 == increment to apply to it
110 ; On exit: R2 == updated value in the icon
112 ; Use: Adjusts the value in a writable icon by a given increment.
116 ; --- Macro: NUMWRT ---
118 ; Arguments: icon == icon handle of control
119 ; min == minimum representable value
120 ; max == maximum representable value
122 ; Use: Inserts a definition of a numerical writable icon into
123 ; a dbx dialogue definition table.
126 $label NUMWRT $icon,$min,$max
127 $label CONTROL $icon,numWrite,,0
133 ;----- Constants ------------------------------------------------------------
135 numWrite_event EQU &80000004 ;R1 == icon number changed
136 ;R2 == subreason code
137 ;R3 == new value of icon
139 numWrite_change EQU 0 ;Subreason -- number changed
140 numWrite_move EQU 1 ;Subreason -- cursor moved
144 ;----- That's all, folks ----------------------------------------------------