3 summary:: A view displaying a modifiable numerical value.
8 A view that displays a numerical value and allows to modify it by typing the value in, and incrementing or decrementing it using the keyboard, or mouse.
10 Using the keyboard, the value will change on each arrow key press by the amount defined by link::#-step::.
12 Mouse scrolling is performed by pressing a mouse button inside the view and dragging the mouse vertically. The value will change according to the mouse cursor movement, in steps defined by link::#-scroll_step::.
14 By default, holding down the Shift, Ctrl, or Alt key while incrementing or decrementing the value will multiply the steps by 100, 10, or 0.1 respectively, though you can customize this by setting link::#-shift_scale::, link::#-ctrl_scale::, or link::#-alt_scale::. Scrolling can be enabled or disabled by modifying the link::#-scroll:: variable.
34 Numerical value between 0 and 1.
40 Sets link::#-value:: to the argument and triggeres link::#-action::.
43 Increments the value by link::#-step:: multiplied by 'factor'.
49 Decrements the value by link::#-step:: multiplied by 'factor'.
55 Text to be displayed instead of the numerical value. Setting link::#-value:: after this will display the value again.
61 If link::#-setBoth:: is true, setting this variable also sets link::#-string:: to the argument interpreted link::Classes/Object#-asString#as String::.
64 Any object, typically one which makes sense to display as a string, such as a Float.
67 A variable stating whether setting link::#-object:: will also set link::#-string::.
75 SUBSECTION:: Restrictions on data
78 The lowest numerical value allowed. Trying to set a lower value will clip it to this.
84 The highest numerical value allowed. Trying to set a higher value will clip it to this.
90 The minimum amount of decimal places displayed. If the value can be completely described with less decimal places, zeros will be appended until reaching this.
96 The maximum amount of decimal places displayed. The value will always be rounded to this amount of decimals.
102 Sets both link::#-minDecimals:: and link::#-maxDecimals:: to the argument.
110 SUBSECTION:: Appearance
113 The alignment of the displayed value.
116 One of the following symbols: \centered, \left, or \right.
119 The color used to display the value before it is ever changed by user interaction.
125 The color used to display the value after is has been typed in.
131 The color used to display the value while it is being typed in.
139 SUBSECTION:: Interaction
142 The amount by which the value will changed when link::#-increment:: or link::#-decrement:: is called, or when related keys are pressed.
148 The amount by which the value will changed when scrolled using the mouse.
154 The factor by which link::#-step:: or link::#-scroll_step:: is multiplied when incrementing or decrementing the value using keyboard or mouse while the Shift key is pressed.
160 The factor by which link::#-step:: or link::#-scroll_step:: is multiplied when incrementing or decrementing the value using keyboard or mouse while the Ctrl key is pressed.
166 The factor by which link::#-step:: or link::#-scroll_step:: is multiplied when incrementing or decrementing the value using keyboard or mouse while the Alt key is pressed.
176 The action object evaluated whenever the user changes the value by interacting with the view.
178 METHOD:: defaultKeyDownAction
180 Any key representing a character that can make part of a floating point number representation will initiated the editing of the value. Pressing Return (or Enter) will finish the editing and store the value typed in as a Float.
182 Aside from that, this method implements the default effects of key presses as follows:
185 ## strong::Key:: || strong::Effect::
186 ## up arrow || increment
187 ## down arrow || decrement
188 ## right arrow || increment
189 ## left arrow || decrement
194 SUBSECTION:: Drag and drop
196 METHOD:: defaultGetDrag
200 METHOD:: defaultCanReceiveDrag
202 True if the current drag data is a number.
204 METHOD:: defaultReceiveDrag
205 Sets link::#-valueAction:: to the current drag data.