Switch constants from int to hex
[toolkit.git] / index.html
blob45db2aea3dcd4b55f3643c1acbaaea9cd5b8deba
1 <html>
2 <head>
3 <title>toolkit Showcase And Documentation</title>
4 <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
6 <!-- MAIN STUFF -->
7 <script src="toolkit/javascript/class.js"></script>
8 <script src="toolkit/javascript/constants.js"></script>
9 <script src="toolkit/javascript/toolkit.js"></script>
10 <script src="toolkit/javascript/mootools-core-1.4.5.js"></script>
11 <script src="javascript/showcase.js"></script>
12 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/toolkit.css"/>
13 <!--<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Open+Sans:400,700,300,400italic,300italic,700italic"/>-->
15 <!-- IMPLEMENTS -->
16 <script src="toolkit/implements/base.js"></script>
17 <script src="toolkit/implements/audiomath.js"></script>
18 <script src="toolkit/implements/ranged.js"></script>
19 <script src="toolkit/implements/ranges.js"></script>
20 <script src="toolkit/implements/gradient.js"></script>
21 <script src="toolkit/implements/warning.js"></script>
22 <script src="toolkit/implements/anchor.js"></script>
23 <script src="toolkit/implements/globalcursor.js"></script>
24 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/globalcursor.css">
25 <script src="toolkit/implements/tooltip.js"></script>
26 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/tooltip.css">
28 <!-- WIDGET -->
29 <script src="toolkit/widgets/widget.js"></script>
31 <!-- MODULES -->
32 <script src="toolkit/modules/range.js"></script>
33 <script src="toolkit/modules/filter.js"></script>
34 <script src="toolkit/modules/dragvalue.js"></script>
35 <script src="toolkit/modules/scrollvalue.js"></script>
36 <script src="toolkit/modules/scale.js"></script>
37 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/scale.css">
38 <script src="toolkit/modules/graph.js"></script>
39 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/graph.css">
40 <script src="toolkit/modules/grid.js"></script>
41 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/grid.css">
42 <script src="toolkit/modules/responsehandle.js"></script>
43 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/responsehandle.css">
44 <script src="toolkit/modules/eqband.js"></script>
45 <script src="toolkit/modules/circular.js"></script>
46 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/circular.css">
48 <!-- WIDGETS -->
49 <script src="toolkit/widgets/meterbase.js"></script>
50 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/meterbase.css">
51 <script src="toolkit/widgets/chart.js"></script>
52 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/chart.css">
53 <script src="toolkit/widgets/gauge.js"></script>
54 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/gauge.css">
55 <script src="toolkit/widgets/button.js"></script>
56 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/button.css">
57 <script src="toolkit/widgets/valuebutton.js"></script>
58 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/valuebutton.css">
59 <script src="toolkit/widgets/toggle.js"></script>
60 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/toggle.css">
61 <script src="toolkit/widgets/state.js"></script>
62 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/state.css">
63 <script src="toolkit/widgets/levelmeter.js"></script>
64 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/levelmeter.css">
65 <script src="toolkit/widgets/frequencyresponse.js"></script>
66 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/frequencyresponse.css">
67 <script src="toolkit/widgets/dynamics.js"></script>
68 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/dynamics.css">
69 <script src="toolkit/widgets/responsehandler.js"></script>
70 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/responsehandler.css">
71 <script src="toolkit/widgets/equalizer.js"></script>
72 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/clock.css">
73 <script src="toolkit/widgets/clock.js"></script>
74 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/window.css">
75 <script src="toolkit/widgets/window.js"></script>
76 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/knob.css">
77 <script src="toolkit/widgets/knob.js"></script>
78 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/value.css">
79 <script src="toolkit/widgets/value.js"></script>
80 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/fader.css">
81 <script src="toolkit/widgets/fader.js"></script>
82 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/select.css">
83 <script src="toolkit/widgets/select.js"></script>
84 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/label.css">
85 <script src="toolkit/widgets/label.js"></script>
86 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/keyboard.css">
87 <script src="toolkit/widgets/keyboard.js"></script>
88 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/container.css">
89 <script src="toolkit/widgets/container.js"></script>
90 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/buttonarray.css">
91 <script src="toolkit/widgets/buttonarray.js"></script>
92 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/pager.css">
93 <script src="toolkit/widgets/pager.js"></script>
94 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/valueknob.css">
95 <script src="toolkit/widgets/valueknob.js"></script>
96 <link rel="stylesheet" type="text/css" href="toolkit/templates/default/css/table.css">
97 <script src="toolkit/widgets/table.js"></script>
98 <link rel="stylesheet" type="text/css" href="css/screen.css"/>
99 <link rel="stylesheet" type="text/css" href="css/showcase.css"/>
101 <script type="text/javascript">
102 //window.addEventListener("load", function () {
103 //document.body.innerHTML=""
104 //t = new Table({container:document.body});
105 //t.add_cell({x:2,y:2,width:3,height:3});
106 //t.add_cell({x:5,y:5,width:1,height:1});
108 //});
109 if (!TK.browser().name == "Firefox") {
110 //window.addEventListener('load', TK.seat_all_svg);
111 //window.addEventListener('scroll', TK.seat_all_svg);
112 //window.addEventListener('resize', TK.seat_all_svg);
114 </script>
116 <style type="text/css">
118 </style>
120 </head>
121 <body>
122 <div class="header">
123 <ul class="navigation" id="navigation">
125 </ul>
126 </div>
129 <ul id="wrapper">
130 <!--
132 <li id="Example" class="widget">
133 <!-- ########################################################### -->
134 <!-- EXAMPLE WIDGET -->
135 <!-- ########################################################### -->
137 <!--<p class="description">
138 <strong>Example</strong> provides stuff.
139 </p>
140 <p class="description">
141 Use example to play with the example in a terminal:
142 <a href="javascript:example.set('state', true)">example.set("state", true)</a>
143 <small>(toggles the state of the widget)</small>
144 </p>
146 <div class="showcase">
147 <div id="sc_example">
149 </div>
150 </div>
152 <div class="buttons"></div>
154 <table class="options collapse" title="⚙ Options">
155 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
156 <tr>
157 <td>example <i class="static">⚓</i></td>
158 <td>description.</td>
159 <td>default</td>
160 </tr>
161 </table>
163 <table class="methods collapse" title="⚒ Methods">
164 <tr><th>Method</th><th>Description</th></tr>
165 <tr>
166 <td>method(options)</td>
167 <td>description.</td>
168 </tr>
169 </table>
171 <table class="domelements collapse" title="⛁ DOM-Elements">
172 <tr><th>Element (class)</th><th>Description</th></tr>
173 <tr>
174 <td>example.element ("div.toolkit-example") <i class="delegated">⇄</i> <i class="classified">❇</i> <i class="stylized">✎</i></td>
175 <td>description.</td>
176 </tr>
177 </table>
179 <table class="modules collapse" title="⚛ Modules">
180 <tr><th>Module</th><th>Description</th></tr>
181 <tr>
182 <td>example.module</td>
183 <td>description.</td>
184 </tr>
185 </table>
187 <table class="events collapse" title="⚑ Events">
188 <tr><th>Event</th><th>Description</th></tr>
189 <tr>
190 <td>event</td>
191 <td>description.</td>
192 </tr>
193 </table>
194 </li>
197 <li>
198 <!-- ########################################################### -->
199 <!-- MAIN -->
200 <!-- ########################################################### -->
202 <img style="float: right; margin-left: 20px;" src="images/toolkit.png"/>
204 <strong>toolkit</strong> is a graphical toolkit written in JavaScript
205 for building audio related user interfaces running in modern browsers.
206 <strong>toolkit</strong> is supposed to work in Chrome/Chromium, Safari, Firefox > 4 and Internet Explorer >= 9.
207 </p>
209 <strong>toolkit </strong> offers some widgets of all day use like
210 <a href="#window">Window</a> or <a href="#button">Button</a> but concentrates
211 especially on things like <a href="#frequencyresponse">FrequencyResponse</a>,
212 <a href="#knob">Knob</a> or <a href="#gauge">Gauge</a>.
213 </p>
215 This page shows and describes the different widgets of the toolkit See some widgets in action,
216 test things in a terminal (Chrome: CTL+SHIFT+J, FF: Firebug + F12) or just get some information about
217 the different options of the API.
218 </p>
219 <ul>
220 <li><strong>Please note #1:</strong> Options marked with an anchor sign <i class="static"></i> are only available on build time and remain
221 static after the widget was created.
222 </li>
223 <li>
224 <strong>Please note #2:</strong> Options marked with an exchange arrow sign <i class="delegated"></i> point out a DOM element
225 which was delegated to the main widget instance (see <a href="#widget">Widget</a>.delegate() for more details).
226 </li>
227 <li>
228 <strong>Please note #3:</strong> Options marked with a sparkle sign <i class="classified"></i> point out a DOM element
229 which was classified to the main widget instance (see <a href="#widget">Widget</a>.classified() for more details).
230 </li>
231 <li>
232 <strong>Please note #4:</strong> Options marked with a pencil sign <i class="stylized"></i> point out a DOM element
233 which was stylized (see <a href="#widget">Widget</a>.stylize() for more details).
234 </li>
235 <li>
236 <strong>Please note #5:</strong> This toolkit is in the origination process so it may contain some bugs.
237 It is developed mainly using Chrome so there may be undetected flaws in other browsers.
238 If you find any of them please send a mail to <a href="mail:schmidt@boomshop.net">schmidt@boomshop.net</a>.
239 Thank you very much.
240 </li>
241 </ul>
242 <hr>
243 </li>
252 <li class="box class"><a name="widgets"></a><h1>Widgets</h1>
253 <p><strong>Widgets</strong> are fully functional elements to build user interfaces. They typically rely on other elements
254 like <a href="#modules">Modules</a> and <a href="#modules">Implements</a> and are somehow based on
255 <a href="#widget">Widget</a> itself or other widgets.
256 </li>
265 <li id="Button" class="widget">
266 <!-- ########################################################### -->
267 <!-- BUTTON WIDGET -->
268 <!-- ########################################################### -->
270 <p class="description">
271 <strong>Button</strong> is a simple, clickable widget to trigger funcions. They fire a couple
272 of click-related events and consist of a label and an icon. Buttons are used
273 as a base to build different other widgets from. Button extends <a href="#widget">Widget</a>.
274 </p>
275 <p class="description">
276 Use button to play with the example in a terminal:
277 <a href="javascript:button.set('state', true)">button.set("state", true)</a>
278 <small>(toggles the state of the widget)</small>
279 </p>
281 <style type="text/css">
283 </style>
285 <div class="showcase">
286 <div id="sc_button" style="text-align: center;">
288 </div>
289 </div>
291 <div class="buttons"></div>
293 <table class="options collapse" title="⚙ Options">
294 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
295 <tr>
296 <td>label</td>
297 <td>A text or HTML snipped used as a label for the button. Set to false to hide the label element.</td>
298 <td>false</td>
299 </tr>
300 <tr>
301 <td>icon</td>
302 <td>A URL to an icon to show on the button. Set to false to hide the image element.</td>
303 <td>false</td>
304 </tr>
305 <tr>
306 <td>state</td>
307 <td>Buttons can represent a state (like a toggle button) which is indicated by the class ".toolkit-active"</td>
308 <td>false</td>
309 </tr>
310 <tr>
311 <td>state_color</td>
312 <td>If the state is true, set a custom background color for the label.</td>
313 <td>false</td>
314 </tr>
315 </table>
317 <table class="domelements collapse" title="⛁ DOM-Elements">
318 <tr><th>Element (class)</th><th>Description</th></tr>
319 <tr>
320 <td>button.element ("div.toolkit-state") <i class="delegated"></i> <i class="classified"></i> <i class="stylized"></i></td>
321 <td>The base element of the widget. It draws the background color and acts as a container fo the other elements.</td>
322 </tr>
323 <tr>
324 <td>button._label ("div.toolkit-label")</td>
325 <td>The text label of the button</td>
326 </tr>
327 <tr>
328 <td>button._icon ("img.toolkit-icon")</td>
329 <td>An icon to display</td>
330 </tr>
331 </table>
332 </li>
334 <li id="ButtonArray" class="widget">
335 <!-- ########################################################### -->
336 <!-- BUTTON ARRAY WIDGET -->
337 <!-- ########################################################### -->
339 <p class="description">
340 <strong>ButtonArray</strong> is a horizontal or vertical
341 aligned array of buttons. It automatically clips overhanging
342 buttons and adds arrow buttons if the space is too small.
343 ButtonArray extends <a href="#Container" title="Container">Container</a>.
344 </p>
345 <p class="description">
346 Use ba_horiz1, ba_horiz2, ba_vert1 and ba_vert2 to play with the examples in a terminal:
347 <a href="javascript:ba_vert2.set('show', 10)">ba_vert2.set("show", 10)</a>
348 <small>(scrolls to button #10)</small>
349 </p>
351 <style type="text/css">
352 #sc_buttonarray .toolkit-vertical {
353 /*width: 20%;*/
354 height: 400px;
355 margin-right: 20px;
356 float: left;
358 #sc_buttonarray .toolkit-horizontal {
359 width: 75%;
360 float: right;
361 margin-bottom: 20px;
363 </style>
365 <div class="showcase">
366 <div id="sc_buttonarray">
368 </div>
369 </div>
371 <div class="buttons"></div>
373 <table class="options collapse" title="⚙ Options">
374 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
375 <tr>
376 <td>buttons</td>
377 <td>An array of button option objects or label strings. It is used for the initial button list
378 but can be set later to replace the whole button list with a new one.If get is
379 called, the converted list of button instances is returned.</td>
380 <td>[]</td>
381 </tr>
382 <tr>
383 <td>direction</td>
384 <td>One out of _TOOLKIT_VERTICAL or _TOOLKIT_HORIZONTAL.</td>
385 <td>_TOOLKIT_HORIZONTAL</td>
386 </tr>
387 <tr>
388 <td>auto_arrows</td>
389 <td>Set to false if you don't want to display automatically generated arrow buttons.</td>
390 <td>true</td>
391 </tr>
392 <tr>
393 <td>show</td>
394 <td>A button or a id to show.</td>
395 <td>0</td>
396 </tr>
397 </table>
399 <table class="methods collapse" title="⚒ Methods">
400 <tr><th>Method</th><th>Description</th></tr>
401 <tr>
402 <td>add_button(button, pos)</td>
403 <td>Adds a new button. "button" is an object
404 with options for the button (see <a href="#Button" title="Button widget">Button</a>
405 for more information) or a string for the label, pos is an integer for the position of the button.
406 If pos is omitted, it is added to the end of the list.</td>
407 </tr>
408 <tr>
409 <td>add_buttons([button, ...])</td>
410 <td>Adds an array of buttons to the end of the list. "button" is an object
411 with options for the button (see <a href="#Button" title="Button widget">Button</a>
412 for more information) or strings for the button label</td>
413 </tr>
414 <tr>
415 <td>remove_button(button)</td>
416 <td>Removes a button from the widget. "button" is either a button instance
417 or an integer.
418 </td>
419 </tr>
420 </table>
422 <table class="domelements collapse" title="⛁ DOM-Elements">
423 <tr><th>Element (class)</th><th>Description</th></tr>
424 <tr>
425 <td>buttonarray._clip ("div.toolkit-clip")</td>
426 <td>A clipping area containing the list of buttons.</td>
427 </tr>
428 <tr>
429 <td>buttonarray._container ("div.toolkit-container")</td>
430 <td>A DIV element containing all the buttons.</td>
431 </tr>
432 </table>
434 <table class="modules collapse" title="⚛ Modules">
435 <tr><th>Module</th><th>Description</th></tr>
436 <tr>
437 <td>buttonarray.prev</td>
438 <td>The previous arrow button instance.</td>
439 </tr>
440 <tr>
441 <td>buttonarray.next</td>
442 <td>The next arrow button instance.</td>
443 </tr>
444 </table>
446 <table class="events collapse" title="⚑ Events">
447 <tr><th>Event</th><th>Description</th></tr>
448 <tr>
449 <td>added</td>
450 <td>This event is fired when a button was added. Hands over the button instance.</td>
451 </tr>
452 <tr>
453 <td>removed</td>
454 <td>This event is fired when a button is about being removed. Hands over the button instance to destroy.</td>
455 </tr>
456 <tr>
457 <td>changed</td>
458 <td>This event is fired when the active button changed. Hands over the button instance and the id.</td>
459 </tr>
460 </table>
461 </li>
463 <li id="Chart" class="widget">
464 <!-- ########################################################### -->
465 <!-- CHART WIDGET -->
466 <!-- ########################################################### -->
468 <p class="description">
469 <strong>Chart</strong> is an SVG image containing one or more <a href="#graph">Graphs</a>.
470 There are functions to add and remove graphs. Chart extends <a href="#widget">Widget</a>,
471 implements <a href="#ranges">Ranges</a>
472 and contains a <a href="grid">Grid</a> and two <a href="#range">Ranges</a>.
473 </p><p>
474 Use cgraph1, cgraph2 and chart to play with the objects
475 in a terminal: <a href="javascript:cgraph2.set('color', '#fff')">cgraph2.set("color", "#fff")</a>.
476 </p>
478 <style type="text/css">
479 #sc_chart {
482 </style>
484 <div class="showcase" style="">
485 <div id="sc_chart">
487 </div>
488 </div>
490 <div class="buttons"></div>
492 <table class="options collapse" title="⚙ Options">
493 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
494 <tr>
495 <td>range_x <i class="static"></i></td>
496 <td>
497 An object with options for a <a href="#range">Range</a> for the x axis
498 or a function returning a <a href="#range">Range</a> instance.</td>
499 <td>{}</td>
500 </tr>
501 <tr>
502 <td>range_y <i class="static"></i></td>
503 <td>An object with options for a <a href="#range">Range</a> for the y axis
504 or a function returning a <a href="#range">Range</a> instance.</td>
505 <td>{}</td>
506 </tr>
507 <tr>
508 <td>grid_x</td>
509 <td>An array containing objects with the following members for the x axis: <br />{pos:x[, color: "colorstring"[, class: "classname"[, label:"labeltext"]]]}</td>
510 <td>[]</td>
511 </tr>
512 <tr>
513 <td>grid_y</td>
514 <td>An array containing objects with the following members for the y axis: <br />{pos:x[, color: "colorstring"[, class: "classname"[, label:"labeltext"]]]}</td>
515 <td>[]</td>
516 </tr>
517 <tr>
518 <td>width</td>
519 <td>The width of the chart. Set basis of Chart.x for initial width to prevent
520 redundant redrawing. Meant as a wrapper for Chart.x.set("basis", 300)</td>
521 <td>0</td>
522 </tr>
523 <tr>
524 <td>height</td>
525 <td>The height of the chart. Set basis of Chart.y for initial height to prevent
526 redundant redrawing. Meant as a wrapper for Chart.y.set("basis", 300)</td>
527 <td>0</td>
528 </tr>
529 <tr>
530 <td>key</td>
531 <td>Draw a description for the graphs. Graphs need to have key
532 set, too. Set a position out of these:
533 <ul>
534 <li>_TOOLKIT_TOP_LEFT</li>
535 <li>_TOOLKIT_TOP_RIGHT</li>
536 <li>_TOOLKIT_BOTTOM_LEFT</li>
537 <li>_TOOLKIT_BOTTOM_RIGHT</li>
538 </ul>
539 Use false to disable the key.</td>
540 <td>false</td>
541 </tr>
542 <tr>
543 <td>key_size</td>
544 <td>Width of the little rectangles displaying the style of a graph
545 in the key</td>
546 <td>20</td>
547 </tr>
548 <tr>
549 <td>title</td>
550 <td>Draw a title inside the chart</td>
551 <td>""</td>
552 </tr>
553 <tr>
554 <td>title_position</td>
555 <td>Set the position of the title. Possible values are:
556 <ul>
557 <li>_TOOLKIT_TOP_LEFT</li>
558 <li>_TOOLKIT_TOP</li>
559 <li>_TOOLKIT_LEFT</li>
560 <li>_TOOLKIT_CENTER</li>
561 <li>_TOOLKIT_RIGHT</li>
562 <li>_TOOLKIT_BOTTOM_LEFT</li>
563 <li>_TOOLKIT_BOTTOM</li>
564 <li>_TOOLKIT_BOTTOM_RIGHT</li>
565 </ul>
566 </td>
567 <td>_TOOLKIT_TOP_RIGHT</td>
568 </tr>
569 </table>
571 <table class="methods collapse" title="⚒ Methods">
572 <tr><th>Method</th><th>Description</th></tr>
573 <tr>
574 <td>add_graph([options])</td>
575 <td>Create a Graph inside the Chart. Options is an object containing
576 options for the <a href="#graph">Graph</a> element. If options.x or
577 options.y is omitted, they are replaced with the internal range objects
578 to provide an overall coodinates system.
579 <br/><br/>
580 It returns the new Graph instance.
581 </td>
582 </tr>
583 <tr>
584 <td>remove_graph(graph)</td>
585 <td>Remove a certain Graph from the chart.</td>
586 </tr>
587 <tr>
588 <td>empty()</td>
589 <td>Removes all graphs from the chart.</td>
590 </tr>
591 </table>
593 <table class="modules collapse" title="⚛ Modules">
594 <tr><th>Module</th><th>Description</th></tr>
595 <tr>
596 <td>chart.grid</td>
597 <td>The instance of the <a href="#grid">Grid</a> module.</td>
598 </tr>
599 <tr>
600 <td>chart.range_x</td>
601 <td>The instance of the <a href="#range">Range</a> module for the x axis.</td>
602 </tr>
603 <tr>
604 <td>chart.range_y</td>
605 <td>The instance of the <a href="#range">Range</a> module for the y axis.</td>
606 </tr>
607 <tr>
608 <td>chart.graphs</td>
609 <td>Array containing all <a href="#graph">Graph</a> instances.</td>
610 </tr>
611 </table>
612 <table class="domelements collapse" title="⛁ DOM-Elements">
613 <tr><th>Element (class)</th><th>Description</th></tr>
614 <tr>
615 <td>chart.element ("svg.toolkit-chart") <i class="delegated"></i> <i class="classified"></i> <i class="stylized"></i></td>
616 <td>The SVG image.</td>
617 </tr>
618 <tr>
619 <td>chart._graphs ("g.toolkit-graphs")</td>
620 <td>The SVG group element containing all Graphs.</td>
621 </tr>
622 <tr>
623 <td>chart._key ("g.toolkit-key")</td>
624 <td>The SVG group element containing all key elements.</td>
625 </tr>
626 <tr>
627 <td>chart._key_txt ("text")</td>
628 <td>The SVG text element containing all key labels.</td>
629 </tr>
630 <tr>
631 <td>chart._key_background ("rect.toolkit-background")</td>
632 <td>The SVG rect element drawing a background for the key.</td>
633 </tr>
634 </table>
636 <table class="events collapse" title="⚑ Events">
637 <tr><th>Event</th><th>Description</th></tr>
638 <tr>
639 <td>graphadded</td>
640 <td>Is fired when a Graph was added.</td>
641 </tr>
642 <tr>
643 <td>graphremoved</td>
644 <td>Is fired when a Graph was removed.</td>
645 </tr>
646 <tr>
647 <td>resized</td>
648 <td>Is fired when the SVG was resized.</td>
649 </tr>
650 <tr>
651 <td>emptied</td>
652 <td>Is fired when Chart was emptied.</td>
653 </tr>
654 </table>
656 </li>
658 <li id="Clock" class="widget">
659 <!-- ########################################################### -->
660 <!-- CLOCK WIDGET -->
661 <!-- ########################################################### -->
663 <p class="description">
664 <strong>Clock</strong> shows a customized clock with <a href="#circular">Circulars</a>
665 displaying hours, minutes and seconds. It contains three free formatable labels.
666 </p>
667 <p class="description">
668 Use clock to play with the example in a terminal:
669 <a href="javascript:clock.set('offset', 3600000)">clock.set('offset', 3600000)</a>
670 <small>Sets the time of the clock to the actual one</small>
671 </p>
673 <style type="text/css">
674 #sc_clock {
677 </style>
679 <div class="showcase" style="text-align: center">
680 <div id="sc_clock" class="">
682 </div>
683 </div>
685 <div class="buttons"></div>
687 <table class="options collapse" title="⚙ Options">
688 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
689 <tr>
690 <td>size</td>
691 <td>The size of the clock.</td>
692 <td>200</td>
693 </tr>
694 <tr>
695 <td>margin</td>
696 <td>The margin between the edges and the most outer circular.</td>
697 <td>0</td>
698 </tr>
699 <tr>
700 <td>time</td>
701 <td>A date object to show.</td>
702 <td>new Date()</td>
703 </tr>
704 <tr>
705 <td>show_seconds</td>
706 <td>Show the circular displaying the seconds.</td>
707 <td>ture</td>
708 </tr>
709 <tr>
710 <td>show_minutes</td>
711 <td>Show the circular displaying minutes.</td>
712 <td>true</td>
713 </tr>
714 <tr>
715 <td>show_hours</td>
716 <td>Show the circular displaying hours.</td>
717 <td>true</td>
718 </tr>
719 <tr>
720 <td>timeout</td>
721 <td>The frequency for updating the clock in milliseconds.
722 If set to 0 clock expects the application to set a date/time.</td>
723 <td>0</td>
724 </tr>
725 <tr>
726 <td>timeadd</td>
727 <td>If timeout is set make the redraw appearing shortly after
728 the real clock changed. E.g. set timeout to 1000 and timeadd to 10
729 to have a clock showing seconds 10 ms after the real clock switched
730 to reduce the impact on the CPU (to avoid having the clock calculating things
731 every 10 ms).</td>
732 <td>0</td>
733 </tr>
734 <tr>
735 <td>offset</td>
736 <td>A offset in milliseconds used when "timeout" options is set.
737 This forces clock to run "independently" on the system clock
738 with an offset value. Use this to reduce traffic while having
739 a steady running clock on a client.
740 </td>
741 <td>0</td>
742 </tr>
743 <tr>
744 <td>fps</td>
745 <td>Frames per second. Is used to calculate SMTP-Frames for display.</td>
746 <td>25</td>
747 </tr>
748 <tr>
749 <td>months</td>
750 <td>An array containing months names.</td>
751 <td>["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]</td>
752 </tr>
753 <tr>
754 <td>days</td>
755 <td>An array containing days names.</td>
756 <td>["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]</td>
757 </tr>
758 <tr>
759 <td>label</td>
760 <td>A callback function for displaying the main label receiving the date object, year, month, day of the week, day,
761 hour, minute, second, millisecond, frame, months array and days array.
762 It is expected to return a formatted string.</td>
763 <td>function (_date, year, month, date, day, hour, minute, second, millisecond, frame, months, days) {
764 return hour + ":" + minute + ":" + second;}</td>
765 </tr>
766 <tr>
767 <td>label_upper</td>
768 <td>A callback function for displaying the upper label receiving the date object, year, month, day of the week, day,
769 hour, minute, second, millisecond, frame, months array and days array.
770 It is expected to return a formatted string.</td>
771 <td>function (_date, year, month, date, day, hour, minute, second, millisecond, frame, months, days) {
772 return days[day];}</td>
773 </tr>
774 <tr>
775 <td>label_lower</td>
776 <td>A callback function for displaying the lower label receiving the date object, year, month, day of the week, day,
777 hour, minute, second, millisecond, frame, months array and days array.
778 It is expected to return a formatted string.</td>
779 <td>function (_date, year, month, date, day, hour, minute, second, millisecond, frame, months, days) {
780 return (date &lt; 10 ? "0" + date : date) + ". " + months[month] + " " + year;}</td>
781 </tr>
782 <tr>
783 <td>label_scale</td>
784 <td>Multiplicator for the font size of upper and lower labels
785 calculated from the font size of the main label.</td>
786 <td>0.33</td>
787 </tr>
788 </table>
790 <table class="modules collapse" title="⚛ Modules">
791 <tr><th>Module</th><th>Description</th></tr>
792 <tr>
793 <td>clock.circulars</td>
794 <td>Obect containing all <a href="#circular">Circulars</a>, namely seconds, minutes and hours.</td>
795 </tr>
796 </table>
798 <table class="domelements collapse" title="⛁ DOM-Elements">
799 <tr><th>Element (class)</th><th>Description</th></tr>
800 <tr>
801 <td>clock.element ("svg.toolkit-clock")</td>
802 <td>An SVG image containing the <a href="#circular">Circulars</a>
803 and all labels.</td>
804 </tr>
805 <tr>
806 <td>clock._label ("text.toolkit-label")</td>
807 <td>An SVG text element displaying the main label.</td>
808 </tr>
809 <tr>
810 <td>clock._label_upper ("text.toolkit-label-upper")</td>
811 <td>An SVG text element displaying the upper label.</td>
812 </tr>
813 <tr>
814 <td>clock._label_lower ("text.toolkit-label-lower")</td>
815 <td>An SVG text element displaying the lower label.</td>
816 </tr>
817 </table>
819 <table class="events collapse" title="⚑ Events">
820 <tr><th>Event</th><th>Description</th></tr>
821 <tr>
822 <td>timedrawn</td>
823 <td>Is fired after the time was drawn. Hands over the widget instance and the time object from its options.</td>
824 </tr>
825 </table>
827 </li>
830 <li id="Container" class="widget">
831 <!-- ########################################################### -->
832 <!-- CONTAINER WIDGET -->
833 <!-- ########################################################### -->
835 <p class="description">
836 <strong>Container</strong> is a simple DIV elementbased on
837 <a href="#widget">Widget</a>.
838 </p>
839 <div class="buttons"></div>
840 <table class="options collapse" title="⚙ Options">
841 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
842 <tr>
843 <td>content</td>
844 <td>A string parsed as HTML or a ready-to-use DOM node</td>
845 <td>""</td>
846 </tr>
847 </table>
848 <table class="domelements collapse" title="⛁ DOM-Elements">
849 <tr><th>Element (class)</th><th>Description</th></tr>
850 <tr>
851 <td>container.element ("div.toolkit-container") <i class="delegated"></i> <i class="classified"></i> <i class="stylized"></i></td>
852 <td>The main element is a simple DIV.</td>
853 </tr>
854 </table>
855 </li>
857 <li id="Dynamics" class="widget">
858 <!-- ########################################################### -->
859 <!-- DYNAMICS WIDGET -->
860 <!-- ########################################################### -->
862 <p class="description">
863 <strong>Dynamics</strong> are based on <a href="#graph">Graphs</a> and
864 display the characteristics of dynamic processors. They are square
865 widgets drawing a <a href="#grid">Grid</a> automatically based on the range.
866 Graphs based on fixed values like threshold and ratio are available
867 for compressors, gates, expanders and limiters.
868 </p><p>
869 Use comp, expand and dyna to play with the examples in a terminal.
870 <a href="javascript:expand.set('threshold', 0)">expand.set('threshold', 0)</a>
871 </p>
873 <style type="text/css">
874 #sc_dynamics {
877 </style>
879 <div class="showcase" style="">
880 <div id="sc_dynamics">
882 </div>
883 </div>
885 <div class="buttons"></div>
887 <table class="options collapse" title="⚙ Options">
888 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
889 <tr>
890 <td>db_grid</td>
891 <td>Draw a grid line every [n] dBs</td>
892 <td>12</td>
893 </tr>
894 <tr>
895 <td>min</td>
896 <td>The lowest value</td>
897 <td>0</td>
898 </tr>
899 <tr>
900 <td>max</td>
901 <td>Maximum value</td>
902 <td>0</td>
903 </tr>
904 <tr>
905 <td>size</td>
906 <td>The size of the widget in pixels</td>
907 <td>400</td>
908 </tr>
909 <tr>
910 <td>scale</td>
911 <td>The scale on the y (dB) axis:
912 <ul>
913 <li>_TOOLKIT_LINEAR</li>
914 <li>_TOOLKIT_DECIBEL / _TOOLKIT_LOG2</li>
915 <li>_TOOLKIT_FREQUENCY / _TOOLKIT_LOG10</li>
916 <li>function (value, options, coef) {}</li>
917 </ul>
918 If a function instead of a constant
919 is handed over, it receives the
920 actual options object as the second
921 argument and is supposed to return a
922 coefficient between 0 and 1. If the
923 third argument "coef" is true, it is
924 supposed to return a value depending
925 on a coefficient handed over as the
926 first argument.
927 </td>
928 <td>_TOOLKIT_FLAT</td>
929 </tr>
930 <tr>
931 <td>type</td>
932 <td>type of dynamics display. can be
933 <ul>
934 <li>_TOOLKIT_COMPRESSOR</li>
935 <li>_TOOLKIT_LIMITER</li>
936 <li>_TOOLKIT_GATE</li>
937 <li>_TOOLKIT_EXPANDER</li>
938 <li>false</li>
939 </ul>
940 If set to false, draw your curves manually.
941 Other constants activate some of the following
942 options:
943 </td>
944 <td>false</td>
945 </tr>
946 <tr>
947 <td>threshold</td>
948 <td>Threshold for all types</td>
949 <td>0</td>
950 </tr>
951 <tr>
952 <td>ratio</td>
953 <td>The ratio of all types except _TOOLKIT_GATE</td>
954 <td>1</td>
955 </tr>
956 <tr>
957 <td>makeup</td>
958 <td>Makeup value for all types.</td>
959 <td>0</td>
960 </tr>
961 <tr>
962 <td>range</td>
963 <td>Reduction of a _TOOLKIT_EXPANDER.</td>
964 <td>0</td>
965 </tr>
966 <tr>
967 <td>grid_labels</td>
968 <td>A callback function formatting the string for the grid labels.</td>
969 <td>function (val) { return val + (!val ? "dB":""); }</td>
970 </tr>
971 </table>
973 <table class="domelements collapse" title="⛁ DOM-Elements">
974 <tr><th>Element (class)</th><th>Description</th></tr>
975 <tr>
976 <td>dynamics._steady ("path.toolkit-steady")</td>
977 <td>A SVG path created via add_graph() showing
978 a ratio of 1:1.</td>
979 </tr>
980 </table>
982 </li>
984 <li id="Equalizer" class="widget">
985 <!-- ########################################################### -->
986 <!-- EQUALIZER WIDGET -->
987 <!-- ########################################################### -->
989 <p class="description">
990 <strong>Equalizer</strong> is a <a href="#responsehandler">ResponseHandler</a>
991 adding some <a href="#eqband">EqBands</a> instead of simple
992 <a href="#responsehandle">ResponseHandles</a>.
993 </p>
994 <p class="description">
995 Use eq to play with the example in a terminal:
996 <a href="javascript:fr.set('db_grid', 6)">eq.set("db_grid", 6)</a>
997 <small>Sets the dB grid to 6dB</small>
998 </p>
1000 <style type="text/css">
1001 #sc_equalizer {
1004 </style>
1006 <div class="showcase" style="">
1007 <div id="sc_equalizer">
1009 </div>
1010 </div>
1012 <div class="buttons"></div>
1014 <table class="options collapse" title="⚙ Options">
1015 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
1016 <tr>
1017 <td>bands</td>
1018 <td>A list of <a href="#eqband">equalizer bands</a> to create on initialization.</td>
1019 <td>[]</td>
1020 </tr>
1021 </table>
1023 <table class="methods collapse" title="⚒ Methods">
1024 <tr><th>Method</th><th>Description</th></tr>
1025 <tr>
1026 <td>add_band([options])</td>
1027 <td>Create a EqBand inside the Equalizer. Options is an object containing
1028 options for the <a href="#eqband">EqBand</a> element.
1029 <br/><br/>
1030 It returns the new EqBand instance.
1031 </td>
1032 </tr>
1033 <tr>
1034 <td>add_bands(bands)</td>
1035 <td>Create a bunch of EqBand inside the Equalizer. The argumnt
1036 is a list of object containing
1037 options for the <a href="#eqband">EqBand</a> elements.
1038 <br/><br/>
1039 It returns the new EqBand instance.
1040 </td>
1041 </tr>
1042 <tr>
1043 <td>remove_band(handle)</td>
1044 <td>Remove a EqBand from the Equalizer.</td>
1045 </tr>
1046 <tr>
1047 <td>remove_bands()</td>
1048 <td>Removes all EqBands from the Equalizer.</td>
1049 </tr>
1050 </table>
1052 <table class="modules collapse" title="⚛ Modules">
1053 <tr><th>Module</th><th>Description</th></tr>
1054 <tr>
1055 <td>equalizer.bands</td>
1056 <td>Array containing all <a href="#eqbands">EqBands</a></td>
1057 </tr>
1058 </table>
1060 <table class="domelements collapse" title="⛁ DOM-Elements">
1061 <tr><th>Element (class)</th><th>Description</th></tr>
1062 <tr>
1063 <td>equalizer._bands ("g.toolkit-eqbands")</td>
1064 <td>The SVG group element containing all EqBands.</td>
1065 </tr>
1066 </table>
1068 <table class="events collapse" title="⚑ Events">
1069 <tr><th>Event</th><th>Description</th></tr>
1070 <tr>
1071 <td>bandadded</td>
1072 <td>Is fired after a band was added. Hands over the new band and the widget instance.</td>
1073 </tr>
1074 <tr>
1075 <td>bandremoved</td>
1076 <td>Is fired after a band was removed. Hands over the widget instance.</td>
1077 </tr>
1078 <tr>
1079 <td>emptied</td>
1080 <td>Is fired after all bands were removed. Hands over the widget instance.</td>
1081 </tr>
1082 </table>
1083 </li>
1085 <li id="Fader" class="widget">
1086 <!-- ########################################################### -->
1087 <!-- FADER WIDGET -->
1088 <!-- ########################################################### -->
1090 <p class="description">
1091 <strong>Fader</strong> provides stuff.
1092 </p>
1093 <p class="description">
1094 Use example to play with the example in a terminal:
1095 <a href="javascript:example.set('state', true)">example.set("state", true)</a>
1096 <small>(toggles the state of the widget)</small>
1097 </p>
1098 <style type="text/css">
1099 #sc_fader .toolkit-fader {
1100 height: 400px;
1101 margin-right: 8px;
1103 </style>
1104 <div class="showcase">
1105 <div id="sc_fader">
1107 </div>
1108 </div>
1110 <div class="buttons"></div>
1112 <table class="options collapse" title="⚙ Options">
1113 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
1114 <tr>
1115 <td>example <i class="static"></i></td>
1116 <td>description.</td>
1117 <td>default</td>
1118 </tr>
1119 </table>
1121 <table class="methods collapse" title="⚒ Methods">
1122 <tr><th>Method</th><th>Description</th></tr>
1123 <tr>
1124 <td>method(options)</td>
1125 <td>description.</td>
1126 </tr>
1127 </table>
1129 <table class="domelements collapse" title="⛁ DOM-Elements">
1130 <tr><th>Element (class)</th><th>Description</th></tr>
1131 <tr>
1132 <td>example.element ("div.toolkit-example") <i class="delegated"></i> <i class="classified"></i> <i class="stylized"></i></td>
1133 <td>description.</td>
1134 </tr>
1135 </table>
1137 <table class="modules collapse" title="⚛ Modules">
1138 <tr><th>Module</th><th>Description</th></tr>
1139 <tr>
1140 <td>example.module</td>
1141 <td>description.</td>
1142 </tr>
1143 </table>
1145 <table class="events collapse" title="⚑ Events">
1146 <tr><th>Event</th><th>Description</th></tr>
1147 <tr>
1148 <td>event</td>
1149 <td>description.</td>
1150 </tr>
1151 </table>
1152 </li>
1154 <li id="FrequencyResponse" class="widget">
1155 <!-- ########################################################### -->
1156 <!-- FREQUENCY RESPONSE WIDGET -->
1157 <!-- ########################################################### -->
1159 <p class="description">
1160 <strong>FrequencyResponse</strong> is a <a href="#chart">Chart</a> drawing frequencies
1161 on the x axis and dB values on the y axis. This widget
1162 automatically draws a <a href="#grid">Grid</a> depending on the ranges.
1163 </p>
1164 <p class="description">
1165 Use fr and frgraph to play with the example in a terminal:
1166 <a href="javascript:fr.set('db_grid', 6)">fr.set("db_grid", 6)</a>
1167 <small>Sets the dB grid to 6dB</small>
1168 </p>
1170 <style type="text/css">
1171 #sc_frequencyresponse {
1174 </style>
1176 <div class="showcase" style="">
1177 <div id="sc_frequencyresponse">
1179 </div>
1180 </div>
1182 <div class="buttons"></div>
1184 <table class="options collapse" title="⚙ Options">
1185 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
1186 <tr>
1187 <td>db_grid</td>
1188 <td>Draw a grid line every [n] dBs</td>
1189 <td>12</td>
1190 </tr>
1191 <tr>
1192 <td>scale</td>
1193 <td>The scale on the y (dB) axis:
1194 <ul>
1195 <li>_TOOLKIT_LINEAR</li>
1196 <li>_TOOLKIT_DECIBEL / _TOOLKIT_LOG2</li>
1197 <li>_TOOLKIT_FREQUENCY / _TOOLKIT_LOG10</li>
1198 <li>function (value, options, coef) {}</li>
1199 </ul>
1200 If a function instead of a constant
1201 is handed over, it receives the
1202 actual options object as the second
1203 argument and is supposed to return a
1204 coefficient between 0 and 1. If the
1205 third argument "coef" is true, it is
1206 supposed to return a value depending
1207 on a coefficient handed over as the
1208 first argument.
1209 </td>
1210 <td>_TOOLKIT_FLAT</td>
1211 </tr>
1212 </table>
1213 </li>
1215 <li id="Gauge" class="widget">
1216 <!-- ########################################################### -->
1217 <!-- GAUGE WIDGET -->
1218 <!-- ########################################################### -->
1220 <p class="description">
1221 <strong>Gauge</strong> simply puts a single <a href="#circular">Circular</a> into a SVG image.
1222 </p>
1223 <p class="description">
1224 Use gauge[0-5] to play with the example in a terminal:
1225 <a href="javascript:gauge[0].set('value', Math.random()*10)">gauge[0].set('value', Math.random()*10)</a>
1226 <small>Sets the value of the first gauge to random</small>
1227 </p>
1229 <style type="text/css">
1230 #sc_gauge .toolkit-gauge {
1231 margin-right: 6px;
1232 margin-left: 6px;
1235 #gauge0 .toolkit-base {
1236 opacity: 1;
1237 stroke-width: 12px;
1238 stroke: rgba(0, 42, 66, 0.1);
1239 fill: rgb(0, 42, 66);
1241 #gauge0 .toolkit-hand {
1242 fill: white;
1244 #gauge0 .toolkit-dot {
1245 fill: rgba(255,255,255,0.33);
1248 #gauge1 .toolkit-label {
1249 font-size: 9px;
1252 #gauge3 {
1253 background: url(images/gauge.svg) no-repeat 50% 0%;
1254 background-size: contain;
1255 fill: white;
1257 #gauge3 .toolkit-dot {
1258 fill: white;
1260 #gauge3 .toolkit-title {
1261 opacity: 0.9;
1262 fill: white;
1265 #gauge4 {
1266 background: url(images/vumeter.png) no-repeat 50% 0%;
1267 background-size: 100% 100%;
1268 fill: white;
1270 #gauge4 .toolkit-base {
1271 opacity: 1;
1273 #gauge4 .toolkit-hand {
1274 opacity: 1;
1276 #gauge4 .toolkit-marker {
1277 fill: rgba(255,255,255,0.4);
1279 #gauge4 .toolkit-title {
1280 opacity: 0.9;
1281 fill: white;
1284 #gauge5 {
1285 background: url(images/vumeter_light.png) no-repeat 50% 0%;
1286 background-size: 100% 100%;
1287 fill: rgba(0,0,0,0.8);
1289 #gauge5 .toolkit-base {
1290 opacity: 1;
1291 fill: rgba(0,0,0,0.8);
1293 #gauge5 .toolkit-hand {
1294 opacity: 1;
1296 #gauge5 .toolkit-title {
1297 opacity: 0.9;
1299 </style>
1301 <div class="showcase" style="">
1302 <div id="sc_gauge" class="">
1304 </div>
1305 </div>
1307 <div class="buttons"></div>
1309 <table class="options collapse" title="⚙ Options">
1310 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
1311 <tr>
1312 <td>width</td>
1313 <td>The width of the SVG</td>
1314 <td>120</td>
1315 </tr>
1316 <tr>
1317 <td>height</td>
1318 <td>The height of the SVG</td>
1319 <td>120</td>
1320 </tr>
1321 <tr>
1322 <td>size</td>
1323 <td>The diameter of the gauge</td>
1324 <td>120</td>
1325 </tr>
1326 <tr>
1327 <td>title</td>
1328 <td>Title fo the gauge. Object with optional members:
1329 <ul>
1330 <li><strong>pos</strong>: position in angles</li>
1331 <li><strong>margin</strong>: margin of the imaginary circle from size</li>
1332 <li><strong>align</strong>: alignment, _TOOLKIT_INNER or _TOOLKIT OUTER</li>
1333 <li><strong>title</strong>: the title as a string</li>
1334 </ul>
1335 Or a single string to set the title to.
1336 </td>
1337 <td>{pos: 90, margin: 20, align: _TOOLKIT_INNER, title:""}</td>
1338 </tr>
1339 </table>
1341 <table class="domelements collapse" title="⛁ DOM-Elements">
1342 <tr><th>Element (class)</th><th>Description</th></tr>
1343 <tr>
1344 <td>gauge._svg ("svg.toolkit-gauge") <i class="delegated"></i> <i class="classified"></i> <i class="stylized"></i></td>
1345 <td>An SVG image containing the <a href="#circular">Circular</a>.</td>
1346 </tr>
1347 <tr>
1348 <td>gauge._title ("text.toolkit-title")</td>
1349 <td>An SVG text element displaying the title.</td>
1350 </tr>
1351 </table>
1353 <table class="events collapse" title="⚑ Events">
1354 <tr><th>Event</th><th>Description</th></tr>
1355 <tr>
1356 <td>titledrawn</td>
1357 <td>Is fired after the title was drawn.</td>
1358 </tr>
1359 </table>
1361 </li>
1363 <li id="Keyboard" class="widget">
1364 <!-- ########################################################### -->
1365 <!-- KEYBOARD WIDGET -->
1366 <!-- ########################################################### -->
1368 <p class="description">
1369 <strong>Keyboard</strong> provides stuff.
1370 </p>
1371 <p class="description">
1372 Use example to play with the example in a terminal:
1373 <a href="javascript:keyboard.set('state', true)">keyboard.set("state", true)</a>
1374 <small>(toggles the state of the widget)</small>
1375 </p>
1377 <div class="showcase">
1378 <div id="sc_keyboard">
1380 </div>
1381 </div>
1383 <div class="buttons"></div>
1385 <table class="options collapse" title="⚙ Options">
1386 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
1387 <tr>
1388 <td>example <i class="static"></i></td>
1389 <td>description.</td>
1390 <td>default</td>
1391 </tr>
1392 </table>
1394 <table class="methods collapse" title="⚒ Methods">
1395 <tr><th>Method</th><th>Description</th></tr>
1396 <tr>
1397 <td>method(options)</td>
1398 <td>description.</td>
1399 </tr>
1400 </table>
1402 <table class="domelements collapse" title="⛁ DOM-Elements">
1403 <tr><th>Element (class)</th><th>Description</th></tr>
1404 <tr>
1405 <td>example.element ("div.toolkit-example") <i class="delegated"></i> <i class="classified"></i> <i class="stylized"></i></td>
1406 <td>description.</td>
1407 </tr>
1408 </table>
1410 <table class="modules collapse" title="⚛ Modules">
1411 <tr><th>Module</th><th>Description</th></tr>
1412 <tr>
1413 <td>example.module</td>
1414 <td>description.</td>
1415 </tr>
1416 </table>
1418 <table class="events collapse" title="⚑ Events">
1419 <tr><th>Event</th><th>Description</th></tr>
1420 <tr>
1421 <td>event</td>
1422 <td>description.</td>
1423 </tr>
1424 </table>
1425 </li>
1428 <li id="Knob" class="widget">
1429 <!-- ########################################################### -->
1430 <!-- KNOB WIDGET -->
1431 <!-- ########################################################### -->
1433 <p class="description">
1434 <strong>Knob</strong> is a <a href="#circular">Circular</a> injected
1435 into a SVG and extended by <a href="#scrollvalue">ScrollValue</a>
1436 and <a href="#dragvalue">DragValue</a> to set its value.
1437 </p>
1438 <p class="description">
1439 Events and classes of DragValue and ScrollValue are delegated to knob._svg.
1440 </p>
1441 <p class="description">
1442 Use knob, kno21 and knob2 to play with the examples in a terminal:
1443 <a href="javascript:knob.set('value', 200)">knob.set("value", 12)</a>
1444 <small>(sets the value of the knob to 12)</small>
1445 </p>
1446 <style type="text/css">
1447 #sc_knob .toolkit-knob {
1448 margin: 10px;
1450 #sc_knob .toolkit-knob.knob2 .toolkit-value {
1451 fill: rgba(0, 47, 66, 1);
1453 #sc_knob .toolkit-knob.knob2 .toolkit-warn .toolkit-value {
1454 fill: #c00;
1456 #sc_knob .toolkit-knob.knob2 .toolkit-dot {
1457 fill: white;
1459 #sc_knob .toolkit-knob.knob2 .toolkit-base {
1460 fill: rgba(0, 47, 66, 0.5);
1463 #sc_knob .toolkit-knob.knob2 {
1464 width: 120px;
1465 heigh: 120px;
1467 #sc_knob .toolkit-knob.knob {
1468 width: 50px;
1469 height: 50px;
1471 #sc_knob .toolkit-knob.knob1 {
1472 width: 80px;
1473 height: 80px;
1475 </style>
1476 <div class="showcase">
1477 <div id="sc_knob" style="text-align: center">
1479 </div>
1480 </div>
1482 <div class="buttons"></div>
1484 <table class="options collapse" title="⚙ Options">
1485 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
1486 <tr>
1487 <td>size</td>
1488 <td>Size of the SVG viewBox, no need to change if you want to use percentual values.</td>
1489 <td>100</td>
1490 </tr>
1491 <tr class="inherit">
1492 <td>step</td>
1493 <td>The settings for the step options of <a href="#ranged">Ranged</a>.</td>
1494 <td>1</td>
1495 </tr>
1496 <tr class="inherit">
1497 <td>hand</td>
1498 <td>The settings for the shift_up options of <a href="#ranged">Ranged</a>.</td>
1499 <td>4</td>
1500 </tr>
1501 <tr class="inherit">
1502 <td>shift_down</td>
1503 <td>The settings for the shift_down options of <a href="#ranged">Ranged</a>.</td>
1504 <td>0.25</td>
1505 </tr>
1506 <tr class="inherit">
1507 <td>hand</td>
1508 <td>The settings for the hand of <a href="#circular">Circular</a>.</td>
1509 <td>{width: 2, length: 6, margin: 22}</td>
1510 </tr>
1511 <tr class="inherit">
1512 <td>dot</td>
1513 <td>The settings for the dots of <a href="#circular">Circular</a>.</td>
1514 <td>{margin: 13, length: 5, width: 2}</td>
1515 </tr>
1516 <tr class="inherit">
1517 <td>marker</td>
1518 <td>The settings for the markers of <a href="#circular">Circular</a>.</td>
1519 <td>{margin: 13, thickness: 5}</td>
1520 </tr>
1521 <tr class="inherit">
1522 <td>label</td>
1523 <td>The settings for the labels of <a href="#circular">Circular</a>.</td>
1524 <td>{margin: 10, align: _TOOLKIT_OUTER}</td>
1525 </tr>
1526 <tr>
1527 <td>direction</td>
1528 <td>The direction for <a href="#dragvalue">DragValue</a>.</td>
1529 <td>_TOOLKIT_VERTICAL</td>
1530 </tr>
1531 <tr>
1532 <td>rotation</td>
1533 <td>Used when drag_direction = _TOOLKIT_POLAR. Defines the angle of
1534 the middle of the positive value changes. 0 means straight upward.
1535 E.g. a value of 45 does positive value changes in upper and
1536 right directions. An angle of 225 reverses the value set.</td>
1537 <td>45</td>
1538 </tr>
1539 <tr>
1540 <td>blind_angle</td>
1541 <td>Used when drag_direction = _TOOLKIT_POLAR. Amount of degrees
1542 to separate positive from negative value changes.</td>
1543 <td>20</td>
1544 </tr>
1545 <tr>
1546 <td>reset</td>
1547 <td>Double clicking the widget resets the value to this one. If undefined,
1548 the initial value is used.</td>
1549 <td><em>undefined</em></td>
1550 </tr>
1551 </table>
1553 <table class="domelements collapse" title="⛁ DOM-Elements">
1554 <tr><th>Element (class)</th><th>Description</th></tr>
1555 <tr>
1556 <td>knob._svg ("svg.toolkit-knob") <i class="delegated"></i> <i class="classified"></i> <i class="stylized"></i></td>
1557 <td>The SVG element containing the <a href="#circular">Circular</a>.</td>
1558 </tr>
1559 </table>
1561 <table class="modules collapse" title="⚛ Modules">
1562 <tr><th>Module</th><th>Description</th></tr>
1563 <tr>
1564 <td>knob.drag</td>
1565 <td>The <a href="#dragvalue">DragValue</a> instance.</td>
1566 </tr>
1567 <tr>
1568 <td>knob.scroll</td>
1569 <td>The <a href="#scrollvalue">ScrollValue</a> instance.</td>
1570 </tr>
1571 </table>
1573 </li>
1575 <li id="Label" class="widget">
1576 <!-- ########################################################### -->
1577 <!-- LABEL WIDGET -->
1578 <!-- ########################################################### -->
1580 <p class="description">
1581 <strong>Label</strong> provides a simple area to display HTML or text.
1582 </p>
1583 <p class="description">
1584 Use label to play with the Label in a terminal:
1585 <a href="javascript:label.set('label', 'Hello World!')">label.set("label", "Hello World!")</a>
1586 <small>(toggles the content of the label)</small>
1587 </p>
1589 <div class="showcase">
1590 <div id="sc_label">
1592 </div>
1593 </div>
1595 <div class="buttons"></div>
1597 <table class="options collapse" title="⚙ Options">
1598 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
1599 <tr>
1600 <td>label</td>
1601 <td>The HTML or text to display.</td>
1602 <td>""</td>
1603 </tr>
1604 </table>
1606 <table class="domelements collapse" title="⛁ DOM-Elements">
1607 <tr><th>Element (class)</th><th>Description</th></tr>
1608 <tr>
1609 <td>label.element ("div.toolkit-label") <i class="delegated"></i> <i class="classified"></i> <i class="stylized"></i></td>
1610 <td>The div container of the label.</td>
1611 </tr>
1612 </table>
1613 </li>
1615 <li id="LevelMeter" class="widget">
1616 <!-- ########################################################### -->
1617 <!-- LEVEL METER WIDGET -->
1618 <!-- ########################################################### -->
1620 <p class="description">
1621 <strong>LevelMeter</strong> is a fully functional display of numerical values. It is an enhanced
1622 <a href="#meterbase">MeterBase</a> containing a <a href="#state">clip LED</a>,
1623 a peak pin with value label and hold markers. LevelMeters
1624 have some automatically triggered functionality like falling and resetting all kinds
1625 of values after a time. All additional elements can be set automatically as soon as
1626 the value rises above them.
1627 </p>
1628 <p class="description">
1629 Use meters.[title] to play with the examples in a terminal:
1630 <a href="javascript:meters.mvr.set('value', 12)">meters.mvr.set("value", 12)</a>
1631 <small>(sets the value of the vertical meter on the left to 12)</small>
1632 </p>
1634 <style type="text/css">
1635 #sc_levelmeter .toolkit-meter-base.toolkit-vertical {
1636 height: 354px;
1638 </style>
1640 <div class="showcase" style="margin-left: 80px">
1641 <div id="sc_levelmeter">
1643 </div>
1644 <div id="sc_levelmeter_buttons" style="clear: both; text-align: right;margin-top: 30px;width: 700px;display: none;">
1645 <button class="button" onClick="run()">Run Demo</button>
1646 <button class="button" onClick="running=false">Stop Demo</button>
1647 <button class="button" onClick="reset()">Reset Peak</button>
1648 <button class="button" onClick="hold()">Toggle Hold</button>
1649 <p style="text-align:right; width: 700px;"><small>Please don't expect too much performance with this poorly hacked demo on this overloaded page..</small></p>
1650 </div>
1652 </div>
1654 <div class="buttons"></div>
1656 <table class="options collapse" title="⚙ Options">
1657 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
1658 <tr>
1659 <td>clip</td>
1660 <td>Set the state of the clipping LED</td>
1661 <td>false</td>
1662 </tr>
1663 <tr>
1664 <td>falling</td>
1665 <td>If falling is active set a step size (value) the meter falls per frame.</td>
1666 <td>0</td>
1667 </tr>
1668 <tr>
1669 <td>falling_fps</td>
1670 <td>Frames per second for the falling loop</td>
1671 <td>24</td>
1672 </tr>
1673 <tr>
1674 <td>falling_init</td>
1675 <td>Frames the first falling action takes to start (avoid flickering on steady signals while using external and internal falling)</td>
1676 <td>2</td>
1677 </tr>
1678 <tr>
1679 <td>peak</td>
1680 <td>The value for the peak pin, false = set to value.</td>
1681 <td>false</td>
1682 </tr>
1683 <tr>
1684 <td>top</td>
1685 <td>The value for the top hold, false = set to value.</td>
1686 <td>false</td>
1687 </tr>
1688 <tr>
1689 <td>bottom</td>
1690 <td>The value for the bottom hold, false = set to value.</td>
1691 <td>false</td>
1692 </tr>
1693 <tr>
1694 <td>hold_size</td>
1695 <td>Amount of segments for the hold indicators (top and bottom)</td>
1696 <td>1</td>
1697 </tr>
1698 <tr>
1699 <td>show_peak</td>
1700 <td>Show or hide the peak marker (bool).</td>
1701 <td>false</td>
1702 </tr>
1703 <tr>
1704 <td>show_clip</td>
1705 <td>Show or hide the clipping state widget (bool).</td>
1706 <td>false</td>
1707 </tr>
1708 <tr>
1709 <td>show_hold</td>
1710 <td>Show or hide the hold indicators of top and bottom (bool).</td>
1711 <td>false</td>
1712 </tr>
1713 <tr>
1714 <td>clipping</td>
1715 <td>If auto clipping is active, set the value where clipping appears.</td>
1716 <td>0</td>
1717 </tr>
1718 <tr>
1719 <td>auto_clip</td>
1720 <td>Activate auto clipping. Set this value to:
1721 <ul>
1722 <li>-1: value is never reset automatically</li>
1723 <li>n: Milliseconds after the value is reset automatically</li>
1724 <li>false: disable auto clipping</li>
1725 </ul>
1726 </td>
1727 <td>false</td>
1728 </tr>
1729 <tr>
1730 <td>auto_peak</td>
1731 <td>Activate auto peak setting. Set this value to:
1732 <ul>
1733 <li>-1: value is never reset automatically</li>
1734 <li>n: Milliseconds after the value is reset automatically</li>
1735 <li>false: disable auto peak</li>
1736 </ul>
1737 </td>
1738 <td>false</td>
1739 </tr>
1740 <tr>
1741 <td>peak_label</td>
1742 <td>Activate automatically setting the label. Set this value to:
1743 <ul>
1744 <li>-1: value is never reset automatically</li>
1745 <li>n: Milliseconds after the value is reset automatically</li>
1746 <li>false: disable automatically setting the label</li>
1747 </ul>
1748 </td>
1749 <td>false</td>
1750 </tr>
1751 <tr>
1752 <td>auto_hold</td>
1753 <td>Activate auto hold (top and bottom). This is an indicator inside the bar.
1754 Set this value to:
1755 <ul>
1756 <li>-1: value is never reset automatically</li>
1757 <li>n: Milliseconds after the value is reset automatically</li>
1758 <li>false: disable auto hold</li>
1759 </ul>
1760 </td>
1761 <td>false</td>
1762 </tr>
1763 <tr>
1764 <td>format_peak</td>
1765 <td>A function to format the peak label before it is drawn. Receives the actual value
1766 and is supposed to return a string.</td>
1767 <td>function (value) { return value.toFixed(2); }</td>
1768 </tr>
1769 <tr>
1770 <td>clip_options</td>
1771 <td>Add more options for the <a href="#state">clipping LED</a>.</td>
1772 <td>{}</td>
1773 </tr>
1774 </table>
1776 <table class="methods collapse" title="⚒ Methods">
1777 <tr><th>Method</th><th>Description</th></tr>
1778 <tr>
1779 <td>reset_peak()</td>
1780 <td>Resets the peak value to the actual value.</td>
1781 </tr>
1782 <tr>
1783 <td>reset_label()</td>
1784 <td>Resets the label value to the actual value.</td>
1785 </tr>
1786 <tr>
1787 <td>reset_clip()</td>
1788 <td>Resets the clip value to false.</td>
1789 </tr>
1790 <tr>
1791 <td>reset_top()</td>
1792 <td>Resets the top hold value to the actual value.</td>
1793 </tr>
1794 <tr>
1795 <td>reset_bottom()</td>
1796 <td>Resets the bottom hold value to the actual value.</td>
1797 </tr>
1798 <tr>
1799 <td>reset_all()</td>
1800 <td>Resets all auto values to their initial state.</td>
1801 </tr>
1802 <tr>
1803 <td>draw_peak()</td>
1804 <td>Draw the peak hold element according to options.peak.</td>
1805 </tr>
1806 </table>
1808 <table class="modules collapse" title="⚛ Modules">
1809 <tr><th>Module</th><th>Description</th></tr>
1810 <tr>
1811 <td>levelmeter.state</td>
1812 <td>The instance of a state widget for clipping.</td>
1813 </tr>
1814 </table>
1816 <table class="domelements collapse" title="⛁ DOM-Elements">
1817 <tr><th>Element (class)</th><th>Description</th></tr>
1818 <tr>
1819 <td>levelmeter._clip ("div.toolkit-clip")</td>
1820 <td>The base element of the state widget for clipping.</td>
1821 </tr>
1822 <tr>
1823 <td>levelmeter._peak ("div.toolkit-peak")</td>
1824 <td>A small pin at the side of the bar pointing on a value.</td>
1825 </tr>
1826 <tr>
1827 <td>levelmeter._peak_label ("span.toolkit-peak-label")</td>
1828 <td>The label inside the peak element.</td>
1829 </tr>
1830 <tr>
1831 <td>levelmeter._mask3 ("div.toolkit-mask.toolkit-mask3")</td>
1832 <td>The mask for top values.</td>
1833 </tr>
1834 <tr>
1835 <td>levelmeter._mask4 ("div.toolkit-mask.toolkit-mask4")</td>
1836 <td>The mask for bottom values.</td>
1837 </tr>
1838 </table>
1840 <table class="events collapse" title="⚑ Events">
1841 <tr><th>Event</th><th>Description</th></tr>
1842 <tr>
1843 <td>peakchanged</td>
1844 <td>Is fired after the peak pin was changed.</td>
1845 </tr>
1846 <tr>
1847 <td>topchanged</td>
1848 <td>Is fired after the peak pin was changed.</td>
1849 </tr>
1850 <tr>
1851 <td>bottomchanged</td>
1852 <td>Is fired after the peak pin was changed.</td>
1853 </tr>
1854 <tr>
1855 <td>clipping</td>
1856 <td>Is fired when the clip LED is triggered.</td>
1857 </tr>
1858 <tr>
1859 <td>drawmeter</td>
1860 <td>Is fired when the meter was drawn.</td>
1861 </tr>
1862 <tr>
1863 <td>drawpeak</td>
1864 <td>Is fired when the peak value was drawn.</td>
1865 </tr>
1866 <tr>
1867 <td>resetpeak</td>
1868 <td>Is fired when the peak was reset.</td>
1869 </tr>
1870 <tr>
1871 <td>resetlabel</td>
1872 <td>Is fired when the label was reset.</td>
1873 </tr>
1874 <tr>
1875 <td>resetclip</td>
1876 <td>Is fired when the clip was reset.</td>
1877 </tr>
1878 <tr>
1879 <td>resettop</td>
1880 <td>Is fired when the top hold value was reset.</td>
1881 </tr>
1882 <tr>
1883 <td>resetbottom</td>
1884 <td>Is fired when the bottom hold value was reset.</td>
1885 </tr>
1886 </table>
1888 </li>
1890 <li id="MeterBase" class="widget">
1891 <!-- ########################################################### -->
1892 <!-- METER BASE WIDGET -->
1893 <!-- ########################################################### -->
1895 <p class="description">
1896 A <strong>MeterBase</strong> draws a horizontal or vertical bar with a colored background
1897 and some design and masking elements. It implements a <a href="#scale">Scale</a>
1898 to draw some labels and markers. MeterBases are used to build different metering
1899 elements from, e.g. LevelMeters, CorrelationMeters and the like. MeterBase
1900 extends <a href="#widget">Widget</a> and implements <a href="#ranged">Ranged</a>
1901 and <a href="#gradient">Gradient</a>.
1902 </p>
1903 <p class="description">
1904 Use mbvr, mbvl, mbhb and mbht to play with the examples in a terminal:
1905 <a href="javascript:mbvl.set('value', Math.random()*120 - 96)">mbvl.set("value", Math.random()*120 - 96)</a>
1906 <small>(sets a random value on the vertical meter)</small>
1907 </p>
1909 <style type="text/css">
1910 #sc_meterbase {
1911 margin-left: 80px;
1913 #sc_meterbase .toolkit-meter-base.toolkit-vertical.toolkit-right {
1915 #sc_meterbase .toolkit-meter-base.toolkit-vertical {
1916 height: 200px;
1917 margin-bottom: 30px;
1919 #sc_meterbase .toolkit-meter-base.toolkit-horizontal {
1920 width: 500px;
1922 #sc_meterbase .toolkit-meter-base.toolkit-vertical .toolkit-bar {
1923 width: 100px;
1925 #sc_meterbase .toolkit-meter-base.toolkit-horizontal .toolkit-bar {
1926 height: 50px;
1928 </style>
1930 <div class="showcase" style="">
1931 <div id="sc_meterbase">
1933 </div>
1934 </div>
1936 <div class="buttons"></div>
1938 <table class="options collapse" title="⚙ Options">
1939 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
1940 <tr>
1941 <td>layout <i class="static"></i></td>
1942 <td>Layout of the widget.
1943 <ul>
1944 <li>_TOOLKIT_LEFT: vertical, bar on the left</li>
1945 <li>_TOOLKIT_RIGHT: vertical, bar on the right</li>
1946 <li>_TOOLKIT_TOP: horizontal, bar on top</li>
1947 <li>_TOOLKIT_BOTTOM: horizontal, bar on bottom</li>
1948 </ul>
1949 </td>
1950 <td>_TOOLKIT_LEFT</td>
1951 </tr>
1952 <tr>
1953 <td>value</td>
1954 <td>The value to show in the bar</td>
1955 <td>0</td>
1956 </tr>
1957 <tr>
1958 <td>label</td>
1959 <td>The value to show as the label. If set to false, the label is initially set to value.</td>
1960 <td>false</td>
1961 </tr>
1962 <tr>
1963 <td>title</td>
1964 <td>The title of the meter.</td>
1965 <td>""</td>
1966 </tr>
1967 <tr>
1968 <td>show_title</td>
1969 <td>Show or hide the title (bool)</td>
1970 <td>false</td>
1971 </tr>
1972 <tr>
1973 <td>show_label</td>
1974 <td>Show or hide the label (bool)</td>
1975 <td>false</td>
1976 </tr>
1977 <tr>
1978 <td>show_scale</td>
1979 <td>Show or hide the scale (bool)</td>
1980 <td>true</td>
1981 </tr>
1982 <tr>
1983 <td>show_marker</td>
1984 <td>Show or hide the marker in the bar (bool) - needs show_scale to be true.</td>
1985 <td>true</td>
1986 </tr>
1987 <tr>
1988 <td>format_label</td>
1989 <td>A function to format the label before it is drawn. Receives the actual value
1990 and is supposed to return a string.</td>
1991 <td>function (val) { return val.toFixed(2); }</td>
1992 </tr>
1993 <tr>
1994 <td>division</td>
1995 <td>Minimum step size (as value) between labels or dots for the scale widget.</td>
1996 <td>1</td>
1997 </tr>
1998 <tr>
1999 <td>levels</td>
2000 <td>Array consisting of the multipliers labels and dots for the scale widget can be drawn.
2001 E.g. a division of 5 and levels of [1, 2, 5] would draw labels at 5, 10 or 25, 50, 75 ...
2002 (but not 30 or 80) depending on the available space. Dots are drawn one level lower between the
2003 labels (if there's enough space). The highest level can be drawn at real number multiplicators,
2004 too, lower levels are only possible at the exact division.
2005 </td>
2006 <td>[1, 5, 10]</td>
2007 </tr>
2008 <tr>
2009 <td>scale_base</td>
2010 <td>The base value where drawing of labels and dots for the scale widget starts. Every drawing position
2011 is compared to the base position. E.g. a base of 12 and a division of 10 would draw
2012 labels at -10, 2, 12, 24, ... false sets the base to the min value.</td>
2013 <td>false</td>
2014 </tr>
2015 <tr>
2016 <td>show_labels</td>
2017 <td>Show or hide the labels inside the scale (bool)</td>
2018 <td>true</td>
2019 </tr>
2020 <tr>
2021 <td>format_labels</td>
2022 <td>A function to format the labels for the scale widget before they are drawn. Receives the actual value
2023 and is supposed to return a string.</td>
2024 <td>function (val) { return val.toFixed(2); }</td>
2025 </tr>
2026 <tr>
2027 <td>gap_dots</td>
2028 <td>Minimum gap (in pixels) between dots for the scale widget.</td>
2029 <td>4</td>
2030 </tr>
2031 <tr>
2032 <td>gap_labels</td>
2033 <td>Minimum gap (in pixels) between labels for the scale widget.</td>
2034 <td>40</td>
2035 </tr>
2036 <tr>
2037 <td>show_min</td>
2038 <td>Draw a label for minimum value</td>
2039 <td>true</td>
2040 </tr>
2041 <tr>
2042 <td>show_max</td>
2043 <td>Draw a label for maximum value</td>
2044 <td>true</td>
2045 </tr>
2046 <tr>
2047 <td>show_base</td>
2048 <td>Draw a label for base value</td>
2049 <td>true</td>
2050 </tr>
2051 </table>
2053 <table class="methods collapse" title="⚒ Methods">
2054 <tr><th>Method</th><th>Description</th></tr>
2055 <tr>
2056 <td>draw_meter()</td>
2057 <td>Draw the meter bar according to options.value.</td>
2058 </tr>
2059 </table>
2061 <table class="modules collapse" title="⚛ Modules">
2062 <tr><th>Module</th><th>Description</th></tr>
2063 <tr>
2064 <td>meterbase.scale</td>
2065 <td>The <a href="#scale">Scale</a> instance</td>
2066 </tr>
2067 </table>
2068 <table class="domelements collapse" title="⛁ DOM-Elements">
2069 <tr><th>Element (class)</th><th>Description</th></tr>
2070 <tr>
2071 <td>meterbase.element ("div.toolkit-meter-base") <i class="classified"></i> <i class="stylized"></i></td>
2072 <td>The base element of the widget. It contains the bar, the scale, the title and the label.</td>
2073 </tr>
2074 <tr>
2075 <td>meterbase._title ("div.toolkit-title")</td>
2076 <td>The title div</td>
2077 </tr>
2078 <tr>
2079 <td>meterbase._label ("div.toolkit-label")</td>
2080 <td>The label div</td>
2081 </tr>
2082 <tr>
2083 <td>meterbase._scale ("div.toolkit-meter-scale")</td>
2084 <td>The scale container div</td>
2085 </tr>
2086 <tr>
2087 <td>meterbase._bar ("div.toolkit-bar") <i class="delegated"></i></td>
2088 <td>The bar container div.</td>
2089 </tr>
2090 <tr>
2091 <td>meterbase._base ("div.toolkit-base")</td>
2092 <td>The base of the bar drawing the background color/gradient</td>
2093 </tr>
2094 <tr>
2095 <td>meterbase._over ("div.toolkit-over")</td>
2096 <td>The overlay for designing purposes (e.g. fake-LED's)</td>
2097 </tr>
2098 <tr>
2099 <td>meterbase._mask1 ("div.toolkit-mask.toolkit-mask1")</td>
2100 <td>The mask for values above base</td>
2101 </tr>
2102 <tr>
2103 <td>meterbase._mask2 ("div.toolkit-mask.toolkit-mask2")</td>
2104 <td>The mask for values below base</td>
2105 </tr>
2106 </table>
2108 <table class="events collapse" title="⚑ Events">
2109 <tr><th>Event</th><th>Description</th></tr>
2110 <tr>
2111 <td>valuechanged</td>
2112 <td>The value has changed. Hands over the new value and widget instance.</td>
2113 </tr>
2114 <tr>
2115 <td>labelchanged</td>
2116 <td>The label has changed. Hands over the new label and the widget instance.</td>
2117 </tr>
2118 <tr>
2119 <td>scalechanged</td>
2120 <td>The scale has changed. Hands over the key, the new label and the widget instance.</td>
2121 </tr>
2122 <tr>
2123 <td>basechanged</td>
2124 <td>The label has changed. Hands over the new base and the widget instance.</td>
2125 </tr>
2126 <tr>
2127 <td>titlechanged</td>
2128 <td>The title has changed. Hands over the new title and the widget instance.</td>
2129 </tr>
2130 <tr>
2131 <td>backgroundchanged</td>
2132 <td>Is fired when any background was set on an element. Hands over
2133 the element, the background string and the firing widget</td>
2134 </tr>
2135 </table>
2137 </li>
2140 <li id="Pager" class="widget">
2141 <!-- ########################################################### -->
2142 <!-- PAGER WIDGET -->
2143 <!-- ########################################################### -->
2145 <p class="description">
2146 <strong>Pager</strong> provides stuff.
2147 </p>
2148 <p class="description">
2149 Use example to play with the example in a terminal:
2150 <a href="javascript:pager.set('show', 5)">pager.set("show", 5)</a>
2151 <small>(scrolls to page #5)</small>
2152 </p>
2154 <style type="text/css">
2155 #sc_pager .toolkit-pager {
2156 width: 100%;
2157 height: 200px;
2158 margin-bottom: 30px;
2160 </style>
2162 <div class="showcase">
2163 <div id="sc_pager">
2165 </div>
2166 </div>
2168 <div class="buttons"></div>
2170 <table class="options collapse" title="⚙ Options">
2171 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
2172 <tr>
2173 <td>example <i class="static"></i></td>
2174 <td>description.</td>
2175 <td>default</td>
2176 </tr>
2177 </table>
2179 <table class="methods collapse" title="⚒ Methods">
2180 <tr><th>Method</th><th>Description</th></tr>
2181 <tr>
2182 <td>method(options)</td>
2183 <td>description.</td>
2184 </tr>
2185 </table>
2187 <table class="domelements collapse" title="⛁ DOM-Elements">
2188 <tr><th>Element (class)</th><th>Description</th></tr>
2189 <tr>
2190 <td>example.element ("div.toolkit-example") <i class="delegated"></i> <i class="classified"></i> <i class="stylized"></i></td>
2191 <td>description.</td>
2192 </tr>
2193 </table>
2195 <table class="modules collapse" title="⚛ Modules">
2196 <tr><th>Module</th><th>Description</th></tr>
2197 <tr>
2198 <td>example.module</td>
2199 <td>description.</td>
2200 </tr>
2201 </table>
2203 <table class="events collapse" title="⚑ Events">
2204 <tr><th>Event</th><th>Description</th></tr>
2205 <tr>
2206 <td>event</td>
2207 <td>description.</td>
2208 </tr>
2209 </table>
2210 </li>
2213 <li id="ResponseHandler" class="widget">
2214 <!-- ########################################################### -->
2215 <!-- RESPONSE HANDLER WIDGET -->
2216 <!-- ########################################################### -->
2218 <p class="description">
2219 <strong>ResponseHandler</strong> is a <a href="#frequencyresponse">FrequencyResponse</a>
2220 adding some <a href="#responsehandle">ResponseHandles</a>. It is meant as a universal
2221 user interface for equalizers and the like.
2222 </p>
2223 <p class="description">
2224 Use handles[n] to play with the example handles in a terminal:
2225 <a href="javascript:handles[14].set('active', !handles[14].get('active'))">handles[14].set('active', !handles[14].get('active'))</a>
2226 <small>(toggles the active state of the bottom-blocked handle)</small>
2227 </p>
2228 <style type="text/css">
2229 #sc_responsehandler {
2232 </style>
2234 <div class="showcase" style="">
2235 <div id="sc_responsehandler">
2237 </div>
2238 </div>
2239 <div id="log"></div>
2240 <div class="buttons"></div>
2242 <table class="options collapse" title="⚙ Options">
2243 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
2244 <tr>
2245 <td>importance_handle</td>
2246 <td>A multiplier for the label hit test. Defines the "weight" of handles to flee.<br/>
2247 Technicaly: The overlapping square pixels are multiplied with this factor to determine
2248 the smallest overlapping region.</td>
2249 <td>1</td>
2250 </tr>
2251 <tr>
2252 <td>importance_label</td>
2253 <td>A multiplier for the label hit test. Defines the "weight" of labels to flee.<br/>
2254 Technicaly: The overlapping square pixels are multiplied with this factor to determine
2255 the smallest overlapping region.</td>
2256 <td>4</td>
2257 </tr>
2258 <tr>
2259 <td>importance_border</td>
2260 <td>A multiplier for the label hit test. Defines the "weight" of the images boundaries to flee.<br/>
2261 Technicaly: The overlapping square pixels are multiplied with this factor to determine
2262 the smallest overlapping region.</td>
2263 <td>50</td>
2264 </tr>
2265 <tr>
2266 <td>depth</td>
2267 <td>If positioning is percentual we better should know about the real height</td>
2268 <td>0</td>
2269 </tr>
2270 <td>range_z <i class="static"></i></td>
2271 <td>
2272 An object with options for a <a href="#range">Range</a> for the z axis
2273 or a function returning a <a href="#range">Range</a> instance.</td>
2274 <td>{ scale: _TOOLKIT_LINEAR }</td>
2275 </tr>
2276 <tr>
2277 <td>handles</td>
2278 <td>A list of <a href="#responsehandle">ResponseHandles</a> to create on initialization.</td>
2279 <td>[]</td>
2280 </tr>
2281 </table>
2283 <table class="methods collapse" title="⚒ Methods">
2284 <tr><th>Method</th><th>Description</th></tr>
2285 <tr>
2286 <td>add_handle([options])</td>
2287 <td>Create a ResponseHandle inside the ResponseHandler. Options is an object containing
2288 options for the <a href="#responsehandle">ResponseHandle</a> element.
2289 <br/><br/>
2290 It returns the new ResponseHandle instance.
2291 </td>
2292 </tr>
2293 <tr>
2294 <td>add_handles(handles)</td>
2295 <td>Create a bunch of ResponseHandle inside the ResponseHandler. The argument
2296 is a list of objects containing
2297 options for the <a href="#responsehandle">ResponseHandle</a> element.
2298 </td>
2299 </tr>
2300 <tr>
2301 <td>remove_handle(handle)</td>
2302 <td>Remove a ResponseHandle from the ResponseHandler.</td>
2303 </tr>
2304 <tr>
2305 <td>remove_handles()</td>
2306 <td>Removes all ResponseHandles from the ResponseHandler.</td>
2307 </tr>
2308 </table>
2310 <table class="modules collapse" title="⚛ Modules">
2311 <tr><th>Module</th><th>Description</th></tr>
2312 <tr>
2313 <td>responsehandler.range_z</td>
2314 <td>The instance of the <a href="#range">Range</a> module for the z axis.</td>
2315 </tr>
2316 <tr>
2317 <td>responsehandler.handles</td>
2318 <td>Array containing all <a href="#responsehandle">ResponseHandles</a></td>
2319 </tr>
2320 </table>
2322 <table class="domelements collapse" title="⛁ DOM-Elements">
2323 <tr><th>Element (class)</th><th>Description</th></tr>
2324 <tr>
2325 <td>responsehandler._handles ("g.toolkit-response-handles")</td>
2326 <td>The SVG group element containing all ResponseHandles.</td>
2327 </tr>
2328 </table>
2330 <table class="events collapse" title="⚑ Events">
2331 <tr><th>Event</th><th>Description</th></tr>
2332 <tr>
2333 <td>handleadded</td>
2334 <td>Is fired when a ResponseHandle was added. Hands over the new handle and the widget instance.</td>
2335 </tr>
2336 <tr>
2337 <td>handleremoved</td>
2338 <td>Is fired when a ResponseHandle was removed. Hands over the widget instance.</td>
2339 </tr>
2340 <tr>
2341 <td>emptied</td>
2342 <td>Is fired after all ResponseHandles were removed. Hands over the widget instance.</td>
2343 </tr>
2344 </table>
2346 </li>
2348 <li id="Select" class="widget">
2349 <!-- ########################################################### -->
2350 <!-- SELECT WIDGET -->
2351 <!-- ########################################################### -->
2353 <p class="description">
2354 <strong>Select</strong> provides stuff.
2355 </p>
2356 <p class="description">
2357 Use example to play with the example in a terminal:
2358 <a href="javascript:example.set('state', true)">example.set("state", true)</a>
2359 <small>(toggles the state of the widget)</small>
2360 </p>
2362 <div class="showcase">
2363 <div id="sc_select">
2365 </div>
2366 </div>
2368 <div class="buttons"></div>
2370 <table class="options collapse" title="⚙ Options">
2371 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
2372 <tr>
2373 <td>example <i class="static"></i></td>
2374 <td>description.</td>
2375 <td>default</td>
2376 </tr>
2377 </table>
2379 <table class="methods collapse" title="⚒ Methods">
2380 <tr><th>Method</th><th>Description</th></tr>
2381 <tr>
2382 <td>method(options)</td>
2383 <td>description.</td>
2384 </tr>
2385 </table>
2387 <table class="domelements collapse" title="⛁ DOM-Elements">
2388 <tr><th>Element (class)</th><th>Description</th></tr>
2389 <tr>
2390 <td>example.element ("div.toolkit-example") <i class="delegated"></i> <i class="classified"></i> <i class="stylized"></i></td>
2391 <td>description.</td>
2392 </tr>
2393 </table>
2395 <table class="modules collapse" title="⚛ Modules">
2396 <tr><th>Module</th><th>Description</th></tr>
2397 <tr>
2398 <td>example.module</td>
2399 <td>description.</td>
2400 </tr>
2401 </table>
2403 <table class="events collapse" title="⚑ Events">
2404 <tr><th>Event</th><th>Description</th></tr>
2405 <tr>
2406 <td>event</td>
2407 <td>description.</td>
2408 </tr>
2409 </table>
2410 </li>
2412 <li id="State" class="widget">
2413 <!-- ########################################################### -->
2414 <!-- STATE WIDGET -->
2415 <!-- ########################################################### -->
2417 <p class="description">
2418 The <strong>State</strong> widget is a multi-functional adaption of a traditional LED. It is able to show
2419 different colors as well as on/off states. The "brightness" can be set seamlessly. Classes
2420 can be used to display different styles. State extends <a href="#widget">Widget</a>.
2421 </p>
2422 <p class="description">
2423 Use s1 ... s8 to play with the examples in a terminal:
2424 <a href="javascript:s8.set('state', !s8.get('state'))">s8.set("state", !s8.get("state"))</a>
2425 <small>(sets the state of the "on air" state to inactive)</small>
2426 </p>
2428 <style type="text/css">
2429 .toolkit-state {
2430 float: left;
2432 div.toolkit-state.on_air {
2433 width: 250px;
2434 height: 70px;
2436 div.toolkit-state.on_air .toolkit-over {
2437 background: url(images/on_air.png) no-repeat 50% 51%;
2439 </style>
2441 <div class="showcase">
2442 <div id="sc_state">
2444 </div>
2445 </div>
2447 <div class="buttons"></div>
2449 <table class="options collapse" title="⚙ Options">
2450 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
2451 <tr>
2452 <td>state</td>
2453 <td>The state of the element. Can be true or false or a float between 0 and 1 for seamless "brightness".</td>
2454 <td>0</td>
2455 </tr>
2456 <tr>
2457 <td>color</td>
2458 <td>The color of the element as a valid CSS string (e.g. "red", "#00f", "rgb(0, 0, 255)")</td>
2459 <td>"red"</td>
2460 </tr>
2461 <tr>
2462 <td>opacity</td>
2463 <td>The opacity of the mask when state = false or 0</td>
2464 <td>0.8</td>
2465 </tr>
2466 </table>
2468 <table class="domelements collapse" title="⛁ DOM-Elements">
2469 <tr><th>Element (class)</th><th>Description</th></tr>
2470 <tr>
2471 <td>state.element ("div.toolkit-state") <i class="delegated"></i> <i class="classified"></i> <i class="stylized"></i></td>
2472 <td>The base element of the widget. It draws the background color and acts as a container fo the other elements.</td>
2473 </tr>
2474 <tr>
2475 <td>state._over ("div.toolkit-over")</td>
2476 <td>An element for designing purposes. It is drawn over the background of the base element and is used
2477 to show a semi-transparent PNG for faking some differences in the distribution of light.</td>
2478 </tr>
2479 <tr>
2480 <td>state._mask ("div.toolkit-mask")</td>
2481 <td>The mask is used to darken, lighten or flatten the background colour depending on the CSS of it.
2482 Its opacity reacts directly on the state variable.</td>
2483 </tr>
2484 </table>
2486 <table class="events collapse" title="⚑ Events">
2487 <tr><th>Event</th><th>Description</th></tr>
2488 <tr>
2489 <td>statechanged</td>
2490 <td>Is fired when the state was changed.</td>
2491 </tr>
2492 <tr>
2493 <td>colorchanged</td>
2494 <td>Is fired after the color changed.</td>
2495 </tr>
2496 </table>
2497 </li>
2499 <li id="Toggle" class="widget">
2500 <!-- ########################################################### -->
2501 <!-- TOGGLE WIDGET -->
2502 <!-- ########################################################### -->
2504 <p class="description">
2505 <strong>Toggle</strong> is an enhanced button that toggles between two states. It additionally
2506 consist of an "active" icon and an "active" label. The 2nd example below has press
2507 toggle enabled, so click and hold toggles for the duration of the mousedown.
2508 Toggle extends <a href="#button" title="Button">Button</a>.
2509 </p>
2510 <p class="description">
2511 Use toggle to play with the 1st example in a terminal:
2512 <a href="javascript:toggle.toggle()">toggle.toggle()</a>
2513 and press to play with the 2nd example in a terminal:
2514 <a href="javascript:press.toggle()">press.toggle()</a>
2515 <small>(toggles the state of the widget)</small>
2516 </p>
2517 <style type="text/css">
2518 #sc_toggle .toolkit-button {
2519 margin-right: 10px;
2521 </style>
2523 <div class="showcase">
2524 <div id="sc_toggle" style="text-align: center;">
2526 </div>
2527 </div>
2529 <div class="buttons"></div>
2531 <table class="options collapse" title="⚙ Options">
2532 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
2533 <tr>
2534 <td>label_active</td>
2535 <td>A text or HTML snipped used as a label for the active toggle state. Set to false to use the default label.</td>
2536 <td>false</td>
2537 </tr>
2538 <tr>
2539 <td>icon_active</td>
2540 <td>A URL to an icon to show on the active toggle. Set to false to use the default label.</td>
2541 <td>false</td>
2542 </tr>
2543 <tr>
2544 <td>press</td>
2545 <td>To enable press toggle set a time in milliseconds after a press is interpreted as a toggle. Releasing the button
2546 after a press toggle resets to the original state.</td>
2547 <td>0</td>
2548 </tr>
2549 <tr>
2550 <td>toggle</td>
2551 <td>Enable or disable toggling, disable for external toggle only or if pure push-to-talk is needed.</td>
2552 <td>true</td>
2553 </tr>
2554 </table>
2556 <table class="methods collapse" title="⚒ Methods">
2557 <tr><th>Method</th><th>Description</th></tr>
2558 <tr>
2559 <td>toggle()</td>
2560 <td>Toggle the button.</td>
2561 </tr>
2562 <tr>
2563 <td>cancel_press()</td>
2564 <td>Cancels an eventually active press toggle.</td>
2565 </tr>
2566 </table>
2568 <table class="events collapse" title="⚑ Events">
2569 <tr><th>Event</th><th>Description</th></tr>
2570 <tr>
2571 <td>toggled</td>
2572 <td>Is fired when the state of the toggle changed.
2573 Hands over the new state and the widget instance.</td>
2574 </tr>
2575 </table>
2577 </li>
2579 <li id="Value" class="widget" >
2580 <!-- ########################################################### -->
2581 <!-- VALUE WIDGET -->
2582 <!-- ########################################################### -->
2584 <p class="description">
2585 <strong>Value</strong> is a formatted text field displaying numbers and text
2586 and providing a input text entry for editing the value. Value is based on
2587 <a href="#widget">Widget</a> and used e.g. in <a href="#valuebutton">ValueButton</a>.
2588 </p>
2589 <p class="description">
2590 Use value to play with the example in a terminal:
2591 <a href="javascript:value.set('value', 1000)">value.set("value", 1000)</a>
2592 <small>(sets the value to 1000)</small>
2593 </p>
2594 <style type="text/css">
2596 </style>
2598 <div class="showcase">
2599 <div id="sc_value" style="text-align: center;">
2601 </div>
2602 </div>
2604 <div class="buttons"></div>
2606 <table class="options collapse" title="⚙ Options">
2607 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
2608 <tr>
2609 <td>value</td>
2610 <td>The value to show</td>
2611 <td>0</td>
2612 </tr>
2613 <tr>
2614 <td>format</td>
2615 <td>A callback function formating the value to a string for display.</td>
2616 <td>function (val) { return val.toFixed(2); }</td>
2617 </tr>
2618 <tr>
2619 <td>size</td>
2620 <td>The size attribute of the input node</td>
2621 <td>5</td>
2622 </tr>
2623 <tr>
2624 <td>set</td>
2625 <td>A callback function getting a manually entered value and
2626 returning a processed value or false to disable editing.</td>
2627 <td>false</td>
2628 </tr>
2629 </table>
2631 <table class="elements collapse" title="⚛ Elements">
2632 <tr><th>Element (class)</th><th>Description</th></tr>
2633 <tr>
2634 <td>value.element ("form.toolkit-value") <i class="delegated"></i> <i class="classified"></i> <i class="stylized"></i></td>
2635 <td>The base element of the widget.</td>
2636 </tr>
2637 <tr>
2638 <td>value._input ("input.toolkit-input")</td>
2639 <td>The input field for editing purpses.</td>
2640 </tr>
2641 </table>
2643 <table class="events collapse" title="⚑ Events">
2644 <tr><th>Event</th><th>Description</th></tr>
2645 <tr>
2646 <td>valueclicked</td>
2647 <td>Is fired when the input field was clicked and editing starts.
2648 Hands over the actual value and the widget instance.</td>
2649 </tr>
2650 <tr>
2651 <td>valuetyping</td>
2652 <td>Is fired when the input field receives key presses.
2653 Hands over the event, the actual value and the widget instance.</td>
2654 </tr>
2655 <tr>
2656 <td>valueescaped</td>
2657 <td>Is fired when the input field was left via "esc" key.
2658 Hands over the actual value and the widget instance.</td>
2659 </tr>
2660 <tr>
2661 <td>valueset</td>
2662 <td>Is fired when the input was entered.
2663 Hands over the actual value and the widget instance.</td>
2664 </tr>
2665 <tr>
2666 <td>valuedone</td>
2667 <td>Is fired when editing the input field has ended.
2668 Hands over the actual value and the widget instance.</td>
2669 </tr>
2670 </table>
2672 </li>
2674 <li id="ValueButton" class="widget">
2675 <!-- ########################################################### -->
2676 <!-- VALUE BUTTON WIDGET -->
2677 <!-- ########################################################### -->
2679 <p class="description">
2680 <strong>ValueButton</strong> is an enhanced button that represents a numerical value
2681 with all options to change it via drag, scroll or keyboard input. ValueButton displays
2682 a little bar element for providing direct optical comparison between different values.
2683 ValueButton extends <a href="#button">Button</a> and implements <a href="#warning">Warning</a> and <a href="#ranged">Ranged</a>.
2684 </p>
2686 Layout is handled a little sloppy by now, you have to style your valuebuttons via CSS
2687 on your own by now because there are no presets atm.
2688 </p>
2689 <p class="description">
2690 Events and classes of DragValue and ScrollValue are delegated to valuebutton.element.
2691 </p>
2692 <p class="description">
2693 Use the titles of the buttons to play with the examples in a terminal:
2694 <a href="javascript:release.set('value', 500)">release.set('value', 500)</a>
2695 <small>(sets the value of the release button to 500ms)</small>
2696 </p>
2697 <style type="text/css">
2698 #sc_vbutton .toolkit-valuebutton {
2699 width: 220px;
2701 </style>
2703 <div class="showcase">
2704 <div id="sc_vbutton" style="text-align: center;">
2706 </div>
2707 </div>
2709 <div class="buttons"></div>
2711 <table class="options collapse" title="⚙ Options">
2712 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
2713 <tr class="inherit">
2714 <td>snap</td>
2715 <td>The snap options of <a href="#ranged">Ranged</a>.</td>
2716 <td>0.01</td>
2717 </tr>
2718 <tr>
2719 <td>value_format</td>
2720 <td>A callback receiving the value and returning a string to display.</td>
2721 <td>function (val) { return val.toFixed(2); }</td>
2722 </tr>
2723 <tr>
2724 <td>bar_direction</td>
2725 <td>How the bar is drawn, _TOOLKIT_VERTICAL or _TOOLKIT_HORIZONTAL.</td>
2726 <td>_TOOLKIT_HORIZONTAL</td>
2727 </tr>
2728 <tr>
2729 <td>drag_direction</td>
2730 <td>How <a href="#dragvalue">DragValue</a> behaves, _TOOLKIT_VERTICAL, _TOOLKIT_HORIZONTAL or _TOOLKIT_POLAR.</td>
2731 <td>_TOOLKIT_VERTICAL</td>
2732 </tr>
2733 <tr>
2734 <td>rotation</td>
2735 <td>Used when drag_direction = _TOOLKIT_POLAR. Defines the angle of
2736 the middle of the positive value changes. 0 means straight upward.
2737 E.g. a value of 45 does positive value changes in upper and
2738 right directions. An angle of 225 reverses the value set.</td>
2739 <td>45</td>
2740 </tr>
2741 <tr>
2742 <td>blind_angle</td>
2743 <td>Used when drag_direction = _TOOLKIT_POLAR. Amount of degrees
2744 to separate positive from negative value changes.</td>
2745 <td>20</td>
2746 </tr>
2747 <tr>
2748 <td>reset</td>
2749 <td>Double clicking the widget resets the value to this one. If undefined,
2750 the initial value is used.</td>
2751 <td><i>undefined</i></td>
2752 </tr>
2753 </table>
2755 <table class="elements collapse" title="⚛ Elements">
2756 <tr><th>Element (class)</th><th>Description</th></tr>
2757 <tr>
2758 <td>valuebutton.value</td>
2759 <td>The instance of the <a href="#value">Value</a> Widget.</td>
2760 </tr>
2761 <tr>
2762 <td>valuebutton.drag</td>
2763 <td>The instance of the <a href="#dragvalue">DragValue</a> Module.</td>
2764 </tr>
2765 <tr>
2766 <td>valuebutton.scroll</td>
2767 <td>The instance of the <a href="#scrollvalue">ScrollValue</a> Module.</td>
2768 </tr>
2769 </table>
2771 <table class="domelements collapse" title="⛁ DOM-Elements">
2772 <tr><th>Element (class)</th><th>Description</th></tr>
2773 <tr>
2774 <td>valuebutton._bar ("div.toolkit-bar")</td>
2775 <td>The bar indicating the value.</td>
2776 </tr>
2777 <tr>
2778 <td>valuebutton._base ("div.toolkit-base")</td>
2779 <td>The container holding the bar.</td>
2780 </tr>
2781 <tr>
2782 <td>valuebutton._over ("div.toolkit-over")</td>
2783 <td>A div used as a overlay for designing purposes.</td>
2784 </tr>
2785 <tr>
2786 <td>valuebutton._value</td>
2787 <td>The text container of the <a href="#value">Value</a> widget.</td>
2788 </tr>
2789 <tr>
2790 <td>valuebutton._input</td>
2791 <td>The input element of the <a href="#value">Value</a> widget.</td>
2792 </tr>
2793 </table>
2795 <table class="events collapse" title="⚑ Events">
2796 <tr><th>Event</th><th>Description</th></tr>
2797 <tr>
2798 <td>valuechanged</td>
2799 <td>Is fired when the value was changed via scroll, drag or keyboard entry.</td>
2800 </tr>
2801 <tr>
2802 <td>doubleclick</td>
2803 <td>Is fired when the was double clicked. Hands over the reset value and the widget instance.</td>
2804 </tr>
2805 </table>
2807 </li>
2809 <li id="ValueKnob" class="widget">
2810 <!-- ########################################################### -->
2811 <!-- VALUE KNOB WIDGET -->
2812 <!-- ########################################################### -->
2814 <p class="description">
2815 <strong>ValueKnob</strong> provides stuff.
2816 </p>
2817 <p class="description">
2818 Use valueknob to play with the example in a terminal:
2819 <a href="javascript:valueknob.set('value', 0)">valueknob.set("value", 0)</a>
2820 <small>(sets the value to 0)</small>
2821 </p>
2823 <div class="showcase">
2824 <div id="sc_valueknob">
2826 </div>
2827 </div>
2829 <div class="buttons"></div>
2831 <table class="options collapse" title="⚙ Options">
2832 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
2833 <tr>
2834 <td>example <i class="static"></i></td>
2835 <td>description.</td>
2836 <td>default</td>
2837 </tr>
2838 </table>
2840 <table class="methods collapse" title="⚒ Methods">
2841 <tr><th>Method</th><th>Description</th></tr>
2842 <tr>
2843 <td>method(options)</td>
2844 <td>description.</td>
2845 </tr>
2846 </table>
2848 <table class="domelements collapse" title="⛁ DOM-Elements">
2849 <tr><th>Element (class)</th><th>Description</th></tr>
2850 <tr>
2851 <td>example.element ("div.toolkit-example") <i class="delegated"></i> <i class="classified"></i> <i class="stylized"></i></td>
2852 <td>description.</td>
2853 </tr>
2854 </table>
2856 <table class="modules collapse" title="⚛ Modules">
2857 <tr><th>Module</th><th>Description</th></tr>
2858 <tr>
2859 <td>example.module</td>
2860 <td>description.</td>
2861 </tr>
2862 </table>
2864 <table class="events collapse" title="⚑ Events">
2865 <tr><th>Event</th><th>Description</th></tr>
2866 <tr>
2867 <td>event</td>
2868 <td>description.</td>
2869 </tr>
2870 </table>
2871 </li>
2875 <li id="Widget" class="widget" rel="audiomath">
2876 <!-- ########################################################### -->
2877 <!-- WIDGET WIDGET -->
2878 <!-- ########################################################### -->
2880 <p class="description">
2881 <strong>Widget</strong> is the base class for all widgets drawing DOM elements. It
2882 provides basic functionality like delegating events, setting options and
2883 firing some events. Widget implements <a href="#audiomath">AudioMath</a>,
2884 <a target="_blank" href="http://mootools.net/docs/core/Class/Class.Extras#Options">Options</a> and
2885 <a target="_blank" href="http://mootools.net/docs/core/Class/Class.Extras#Events">Events</a>.
2886 </p>
2888 <div class="buttons"></div>
2890 <table class="options collapse" title="⚙ Options">
2891 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
2892 <tr>
2893 <td>container</td>
2894 <td>A DOM element as container to inject the element into</td>
2895 <td>undefined</td>
2896 </tr>
2897 <tr>
2898 <td>id</td>
2899 <td>The id of the element. It is generated as random string if omitted.</td>
2900 <td>undefined</td>
2901 </tr>
2902 <tr>
2903 <td>class <i class="static"></i></td>
2904 <td>A CSS class to add to the main element.</td>
2905 <td>undefined</td>
2906 </tr>
2907 <tr>
2908 <td>styles</td>
2909 <td>An object containing CSS style declarations. Can only be used
2910 if any of the widgets elements was stylized via widget.stylize(element).
2911 </td>
2912 <td>undefined</td>
2913 </tr>
2914 <tr>
2915 <td>disabled</td>
2916 <td>Widgets can be set inactive. Inactive widgets set the class
2917 ".toolkit-disabled" on an eventually stylized element. Widgets
2918 may use this parameter e.g. to restrict events.
2919 </td>
2920 <td>true</td>
2921 </tr>
2922 </table>
2924 <table class="methods collapse" title="⚒ Methods">
2925 <tr><th>Method</th><th>Description</th></tr>
2926 <tr>
2927 <td>initialize(options)</td>
2928 <td>Main actions every widget needs to take like setting a id
2929 or the initial options. Argument is the options
2930 object handed over to initialize. Returns the widget. An
2931 Extending widget should call the corresponding parent constructor.
2932 <em>before</em> it has taken its own actions.</td>
2933 </tr>
2934 <tr>
2935 <td>initialized()</td>
2936 <td>Is supposed to be called by extending widgets <em>after</em>
2937 they have initialized themselves. Fires the "initialized" event.
2938 Returns the widget.</td>
2939 </tr>
2940 <tr>
2941 <td>set(key, value, hold)</td>
2942 <td>Set an option. Key is the options name, value the new value
2943 and hold prevents some options to take the default action (like e.g. redraw()).
2944 Returns the widgets instance. An Extending widget should call the corresponding parent constructor
2945 <em>after</em> it has taken its own actions.</td>
2946 </tr>
2947 <tr>
2948 <td>get(key)</td>
2949 <td>Get the value of an option. An Extending widget should call the corresponding parent constructor
2950 <em>after</em> it has taken its own actions.</td>
2951 </tr>
2952 <tr>
2953 <td>redraw()</td>
2954 <td>Redraw the widget. Fires the "redraw" event and is supposed
2955 to get enhanced by widgets extending this base class.The widget
2956 should call the corresponding parent constructor <em>after</em> it has built all elements.</td>
2957 </tr>
2958 <tr>
2959 <td>destroy()</td>
2960 <td>Destroy the widget. Fires the "destroy" event and is supposed
2961 to get enhanced by widgets extending this base class. The widget
2962 should call the corresponding parent constructor <em>after</em> it has destroyed the elements.</td>
2963 </tr>
2964 <tr>
2965 <td>widgetize(element, delegate, classify)</td>
2966 <td>Create a widget from a DOM element. Basically it means to add the id
2967 from options and set a basic CSS class. If delegate is true, all events
2968 are delegated to the widgets instance. If classify is true, all CSS functionality
2969 will be bound to the widget instance. Returns the element.</td>
2970 </tr>
2971 <tr>
2972 <td>delegate(element)</td>
2973 <td>Takes a DOM element and delegates its main events to the widget class.
2974 Returns the element. The events hand over the event object itself, the widget
2975 instance and the element the events were delegated from.</td>
2976 </tr>
2977 <tr>
2978 <td>classify(element)</td>
2979 <td>Takes a DOM element and delegates its CSS functionality to the widget class.
2980 Returns the element.</td>
2981 </tr>
2982 <tr>
2983 <td>stylize(element)</td>
2984 <td>Marks a DOM element as receiver for the options.styles property.
2985 Returns the element.</td>
2986 </tr>
2987 <tr>
2988 <td>addClass(class) <i class="delegated"></i></td>
2989 <td>If a delegation was executed, addClass adds a CSS class to the delegated
2990 element.</td>
2991 </tr>
2992 <tr>
2993 <td>removeClass(class) <i class="delegated"></i></td>
2994 <td>If a delegation was executed, addClass removes a CSS class from the delegated
2995 element.</td>
2996 </tr>
2997 <tr>
2998 <td>add_event(event, function) <i class="delegated"></i></td>
2999 <td>Adds an event listener with a callback function to the Widget. "event" can be an array of descriptors or a string.</td>
3000 </tr>
3001 <tr>
3002 <td>remove_event(event, function) <i class="delegated"></i></td>
3003 <td>Removes an event listener with a callback function from the Widget.</td>
3004 </tr>
3005 <tr>
3006 <td>fire_event(event, arguments, delay) <i class="delegated"></i></td>
3007 <td>Fires an event on the Widget.Arguments is a variable or an array with arguments
3008 passed to the callback and delay dealys the execution in milliseconds.</td>
3009 </tr>
3010 </table>
3012 <table class="events collapse" title="⚑ Events">
3013 <tr><th>Event</th><th>Description</th></tr>
3014 <tr>
3015 <td>initialize</td>
3016 <td>Is fired when an instance gets created.
3017 Hands over the widget instance.</td>
3018 </tr>
3019 <tr>
3020 <td>initialized</td>
3021 <td>Is fired when an instance was created.
3022 Hands over the widget instance.</td>
3023 </tr>
3024 <tr>
3025 <td>redraw</td>
3026 <td>Is fired when the widget wants to redraw.
3027 Hands over the widget instance.</td>
3028 </tr>
3029 <tr>
3030 <td>destroy</td>
3031 <td>Is fired when the widget is destroyed.
3032 Hands over the widget instance.</td>
3033 </tr>
3034 <tr>
3035 <td>set</td>
3036 <td>Is fired when the options are changed.
3037 Hands over the key, the new value, the hold parameter and the widget instance.</td>
3038 </tr>
3039 <tr>
3040 <td>set_[value]</td>
3041 <td>Is fired when a certain value was set, e.g. "set_width" or "set_id".<br />
3042 Hands over the new value, the hold parameter and the widget instance.</td>
3043 </tr>
3044 <tr>
3045 <td>get</td>
3046 <td>Is fired if an option was requested.
3047 Hands over the key, the value and the widget instance.</td>
3048 </tr>
3049 <tr>
3050 <td>widgetized</td>
3051 <td>Is fired when an element was widgetized..
3052 Hands over the element and the widget instance.</td>
3053 </tr>
3054 <tr>
3055 <td>delegated</td>
3056 <td>Is fired when an element delegated all its events to the widgets instance.
3057 Hands over the element and the widget instance.</td>
3058 </tr>
3059 <tr>
3060 <td>classified</td>
3061 <td>Is fired when an element handed all CSS class functionality over to the widgets instance.
3062 Hands over the element and the widget instance.</td>
3063 </tr>
3064 <tr>
3065 <td>stylized</td>
3066 <td>Is fired when an element was marked as a receiver for options.styles.
3067 Hands over the element and the widget instance.</td>
3068 </tr>
3069 <tr>
3070 <td>mouseenter <i class="delegated"></i></td>
3071 <td>Is fired when the mouse enters the delegating element.
3072 Hands over event, widget instance and the DOM element receiving the event.</td>
3073 </tr>
3074 <tr>
3075 <td>mouseleave <i class="delegated"></i></td>
3076 <td>Is fired when the mouse leaves the delegating element.
3077 Hands over event, widget instance and the DOM element receiving the event.</td>
3078 </tr>
3079 <tr>
3080 <td>click <i class="delegated"></i></td>
3081 <td>Is fired when a mouse button is clicked.
3082 Hands over event, widget instance and the DOM element receiving the event.</td>
3083 </tr>
3084 <tr>
3085 <td>mousedown <i class="delegated"></i></td>
3086 <td>Is fired when a mouse button is pressed.
3087 Hands over event, widget instance and the DOM element receiving the event.</td>
3088 </tr>
3089 <tr>
3090 <td>mouseup <i class="delegated"></i></td>
3091 <td>Is fired when a mouse button is released.
3092 Hands over event, widget instance and the DOM element receiving the event.</td>
3093 </tr>
3094 <tr>
3095 <td>mousemove <i class="delegated"></i></td>
3096 <td>Is fired when the mouse is moved inside the element.
3097 Hands over event, widget instance and the DOM element receiving the event.</td>
3098 </tr>
3099 <tr>
3100 <td>startdrag <i class="delegated"></i></td>
3101 <td>Is fired when dragging starts.
3102 Hands over event, widget instance and the DOM element receiving the event.</td>
3103 </tr>
3104 <tr>
3105 <td>stopdrag <i class="delegated"></i></td>
3106 <td>Is fired when dragging stops.
3107 Hands over event, widget instance and the DOM element receiving the event.</td>
3108 </tr>
3109 <tr>
3110 <td>touchstart <i class="delegated"></i></td>
3111 <td>Is fired when a finger is put on a touchscreen.
3112 Hands over event, widget instance and the DOM element receiving the event.</td>
3113 </tr>
3114 <tr>
3115 <td>touchend <i class="delegated"></i></td>
3116 <td>Is fired when a finger is lifted froma touchscreen.
3117 Hands over event, widget instance and the DOM element receiving the event.</td>
3118 </tr>
3119 <tr>
3120 <td>touchmove <i class="delegated"></i></td>
3121 <td>Is fired when a finger moves on a touchscreen.
3122 Hands over event, widget instance and the DOM element receiving the event.</td>
3123 </tr>
3124 <tr>
3125 <td>dblclick <i class="delegated"></i></td>
3126 <td>Is fired when the mouse button was clicked twice.
3127 Hands over event, widget instance and the DOM element receiving the event.</td>
3128 </tr>
3129 <tr>
3130 <td>keydown <i class="delegated"></i></td>
3131 <td>Is fired when a key is pressed.
3132 Hands over event, widget instance and the DOM element receiving the event.</td>
3133 </tr>
3134 <tr>
3135 <td>keypress <i class="delegated"></i></td>
3136 <td>Is fired when a key was pressed.
3137 Hands over event, widget instance and the DOM element receiving the event.</td>
3138 </tr>
3139 <tr>
3140 <td>keyup <i class="delegated"></i></td>
3141 <td>Is fired when a key is released.
3142 Hands over event, widget instance and the DOM element receiving the event.</td>
3143 </tr>
3144 <tr>
3145 <td>scoll <i class="delegated"></i></td>
3146 <td>Is fired when the element receives a scroll event.
3147 Hands over event, widget instance and the DOM element receiving the event.</td>
3148 </tr>
3149 <tr>
3150 <td>focus <i class="delegated"></i></td>
3151 <td>Is fired when the element gets focus.
3152 Hands over event, widget instance and the DOM element receiving the event.</td>
3153 </tr>
3154 <tr>
3155 <td>blur <i class="delegated"></i></td>
3156 <td>Is fired when the focus is taken from the element.
3157 Hands over event, widget instance and the DOM element receiving the event.</td>
3158 </tr>
3159 </table>
3161 </li>
3163 <li id="Window" class="widget">
3164 <!-- ########################################################### -->
3165 <!-- WINDOW WIDGET -->
3166 <!-- ########################################################### -->
3168 <p class="description">
3169 <strong>Window</strong> provides a inline Element with window-like functionality.
3170 </p>
3171 <p class="description">
3172 Use window to play with the example in a terminal:
3173 <a href="javascript:win.set('maximize', {x: true, y: true})">win.set("maximize", {x: true, y: true})</a>
3174 <small>(toggles the vertical maximized state of the window)</small>
3175 </p>
3177 <div class="showcase">
3178 <div id="sc_window" style="text-align: center">
3180 </div>
3181 </div>
3183 <div class="buttons"></div>
3185 <table class="options collapse" title="⚙ Options">
3186 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
3187 <tr>
3188 <td>width</td>
3189 <td>The width of the window in pixels.</td>
3190 <td>500</td>
3191 </tr>
3192 <tr>
3193 <td>height</td>
3194 <td>The height of the window in pixels.</td>
3195 <td>200</td>
3196 </tr>
3197 <tr>
3198 <td>active</td>
3199 <td>Set the widget inactive. Simply sets .toolkit-active class.</td>
3200 <td>true</td>
3201 </tr>
3202 <tr>
3203 <td>x</td>
3204 <td>The horizontal position of the window depending on the anchor.</td>
3205 <td>0</td>
3206 </tr>
3207 <tr>
3208 <td>y</td>
3209 <td>The vertical position of the window depending on the anchor.</td>
3210 <td>0</td>
3211 </tr>
3212 <tr>
3213 <td>anchor</td>
3214 <td>The coordinates for the position calculations. Can be one out of
3215 <ul>
3216 <li>_TOOLKIT_TOP_LEFT</li>
3217 <li>_TOOLKIT_TOP</li>
3218 <li>_TOOLKIT_TOP_RIGHT</li>
3219 <li>_TOOLKIT_LEFT</li>
3220 <li>_TOOLKIT_CENTER</li>
3221 <li>_TOOLKIT_RIGHT</li>
3222 <li>_TOOLKIT_BOTTOM_LEFT</li>
3223 <li>_TOOLKIT_BOTTOM</li>
3224 <li>_TOOLKIT_BOTTOM_RIGHT</li>
3225 </ul>
3226 </td>
3227 <td>_TOOLKIT_TOP_LEFT</td>
3228 </tr>
3229 <tr>
3230 <td>title</td>
3231 <td>The window title.</td>
3232 <td>""</td>
3233 </tr>
3234 <tr>
3235 <td>status</td>
3236 <td>The content of the status bar (if any).</td>
3237 <td>""</td>
3238 </tr>
3239 <tr>
3240 <td>icon</td>
3241 <td>URL to a window icon.</td>
3242 <td>""</td>
3243 </tr>
3244 <tr>
3245 <td>content</td>
3246 <td>The content of the window. Can be a string or a mootoolized object</td>
3247 <td>""</td>
3248 </tr>
3249 <tr>
3250 <td>fixed</td>
3251 <td>Whether the window sticks to the viewport (true) rather than the document (false).</td>
3252 <td>true</td>
3253 </tr>
3254 <tr>
3255 <td>modal</td>
3256 <td>Whether the window is modal (blocking) or not. <b>Not implemented by now!</b>.</td>
3257 <td>false</td>
3258 </tr>
3259 <tr>
3260 <td>dock</td>
3261 <td>Dock the window to a border or corner. Can be one out of:
3262 <ul>
3263 <li>_TOOLKIT_TOP_LEFT</li>
3264 <li>_TOOLKIT_TOP</li>
3265 <li>_TOOLKIT_TOP_RIGHT</li>
3266 <li>_TOOLKIT_LEFT</li>
3267 <li>_TOOLKIT_CENTER</li>
3268 <li>_TOOLKIT_RIGHT</li>
3269 <li>_TOOLKIT_BOTTOM_LEFT</li>
3270 <li>_TOOLKIT_BOTTOM</li>
3271 <li>_TOOLKIT_BOTTOM_RIGHT</li>
3272 </ul>
3273 Or use false to disable.
3274 <b>Not implemented by now!</b>
3275 </td>
3276 <td>false</td>
3277 </tr>
3278 <tr>
3279 <td>maximize</td>
3280 <td>false for no maximizing at all or object with x and y
3281 as boolean members for indicating maximization in a certain direction.</td>
3282 <td>false</td>
3283 </tr>
3284 <tr>
3285 <td>minimize</td>
3286 <td>Whether the window is minimized or not. Is meant to be used via
3287 a window manager application which keeps track of minimized windows.
3288 Minimized windows will be disposed from the DOM and can be redrawn
3289 by setting this to false again.</td>
3290 <td>false</td>
3291 </tr>
3292 <tr>
3293 <td>shrink</td>
3294 <td>Rolls the window up into its title bar.</td>
3295 <td>false</td>
3296 </tr>
3297 <tr>
3298 <td>open</td>
3299 <td>Initial position of the window. Can be one out of:
3300 <ul>
3301 <li>_TOOLKIT_TOP_LEFT</li>
3302 <li>_TOOLKIT_TOP</li>
3303 <li>_TOOLKIT_TOP_RIGHT</li>
3304 <li>_TOOLKIT_LEFT</li>
3305 <li>_TOOLKIT_CENTER</li>
3306 <li>_TOOLKIT_RIGHT</li>
3307 <li>_TOOLKIT_BOTTOM_LEFT</li>
3308 <li>_TOOLKIT_BOTTOM</li>
3309 <li>_TOOLKIT_BOTTOM_RIGHT</li>
3310 </ul>
3311 </td>
3312 <td>_TOOLKIT_CENTER</td>
3313 </tr>
3314 <tr>
3315 <td>z_index</td>
3316 <td>The z position of piling windows. Is meant to be used
3317 by a window manager application.</td>
3318 <td>10000</td>
3319 </tr>
3320 <tr>
3321 <td>min_width</td>
3322 <td>Minimum possible width.</td>
3323 <td>300</td>
3324 </tr>
3325 <tr>
3326 <td>max_width</td>
3327 <td>Maximum possible width, -1 ~ infinite.</td>
3328 <td>-1</td>
3329 </tr>
3330 <tr>
3331 <td>min_height</td>
3332 <td>Minimum possible height.</td>
3333 <td>100</td>
3334 </tr>
3335 <tr>
3336 <td>max_height</td>
3337 <td>Maximum possible width, -1 ~ infinite.</td>
3338 <td>-1</td>
3339 </tr>
3340 <tr>
3341 <td>draggable</td>
3342 <td>Set whether the window is draggable on the title bar.</td>
3343 <td>true</td>
3344 </tr>
3345 <tr>
3346 <td>resizable</td>
3347 <td>Set whether the window has a resize element.</td>
3348 <td>true</td>
3349 </tr>
3350 <tr>
3351 <td>resizing</td>
3352 <td>Update content policy while resizing. Posible values are:
3353 <ul>
3354 <li>_TOOLKIT_CONTINUOUS</li>
3355 <li>_TOOLKIT_COMPLETE</li>
3356 </ul>
3357 </td>
3358 <td>_TOOLIIT_CONTINUOUS</td>
3359 </tr>
3360 <tr>
3361 <td>header_action</td>
3362 <td>Action to take when title bar receives a double click.
3363 Possible values are:
3364 <ul>
3365 <li>_TOOLKIT_CLOSE</li>
3366 <li>_TOOLKIT_SHRINK</li>
3367 <li>_TOOLKIT_MINIMIZE</li>
3368 <li>_TOOLKIT_MAXIMIZE</li>
3369 <li>_TOOLKIT_MAXIMIZE_VERT</li>
3370 <li>_TOOLKIT_MAXIMIZE_HORIZ</li>
3371 </ul>
3372 Set to false to disable.
3373 </td>
3374 <td>_TOOLKIT_MAXIMIZE</td>
3375 </tr>
3376 <tr>
3377 <td>header_left</td>
3378 <td>Single value or array of:
3379 <ul>
3380 <li>_TOOLKIT_TITLE</li>
3381 <li>_TOOLKIT_ICON</li>
3382 <li>_TOOLKIT_CLOSE</li>
3383 <li>_TOOLKIT_MINIMIZE</li>
3384 <li>_TOOLKIT_SHRINK</li>
3385 <li>_TOOLKIT_MAXIMIZE</li>
3386 <li>_TOOLKIT_MAXIMIZE_VERT</li>
3387 <li>_TOOLKIT_MAXIMIZE_HORIZ</li>
3388 <li>_TOOLKIT_STATUS</li>
3389 </ul>
3390 </td>
3391 <td>[_TOOLKIT_ICON]</td>
3392 </tr>
3393 <tr>
3394 <td>header_center</td>
3395 <td>Single value or array of:
3396 <ul>
3397 <li>_TOOLKIT_TITLE</li>
3398 <li>_TOOLKIT_ICON</li>
3399 <li>_TOOLKIT_CLOSE</li>
3400 <li>_TOOLKIT_MINIMIZE</li>
3401 <li>_TOOLKIT_SHRINK</li>
3402 <li>_TOOLKIT_MAXIMIZE</li>
3403 <li>_TOOLKIT_MAXIMIZE_VERT</li>
3404 <li>_TOOLKIT_MAXIMIZE_HORIZ</li>
3405 <li>_TOOLKIT_STATUS</li>
3406 </ul></td>
3407 <td>[_TOOLKIT_TITLE]</td>
3408 </tr>
3409 <tr>
3410 <td>header_right</td>
3411 <td>Single value or array of:
3412 <ul>
3413 <li>_TOOLKIT_TITLE</li>
3414 <li>_TOOLKIT_ICON</li>
3415 <li>_TOOLKIT_CLOSE</li>
3416 <li>_TOOLKIT_MINIMIZE</li>
3417 <li>_TOOLKIT_SHRINK</li>
3418 <li>_TOOLKIT_MAXIMIZE</li>
3419 <li>_TOOLKIT_MAXIMIZE_VERT</li>
3420 <li>_TOOLKIT_MAXIMIZE_HORIZ</li>
3421 <li>_TOOLKIT_STATUS</li>
3422 </ul></td>
3423 <td>[_TOOLKIT_MAXIMIZE, _TOOLKIT_CLOSE]</td>
3424 </tr>
3425 <tr>
3426 <td>footer_left</td>
3427 <td>Single value or array of:
3428 <ul>
3429 <li>_TOOLKIT_TITLE</li>
3430 <li>_TOOLKIT_ICON</li>
3431 <li>_TOOLKIT_CLOSE</li>
3432 <li>_TOOLKIT_MINIMIZE</li>
3433 <li>_TOOLKIT_SHRINK</li>
3434 <li>_TOOLKIT_MAXIMIZE</li>
3435 <li>_TOOLKIT_MAXIMIZE_VERT</li>
3436 <li>_TOOLKIT_MAXIMIZE_HORIZ</li>
3437 <li>_TOOLKIT_STATUS</li>
3438 </ul></td>
3439 <td>[]</td>
3440 </tr>
3441 <tr>
3442 <td>footer_center</td>
3443 <td>Single value or array of:
3444 <ul>
3445 <li>_TOOLKIT_TITLE</li>
3446 <li>_TOOLKIT_ICON</li>
3447 <li>_TOOLKIT_CLOSE</li>
3448 <li>_TOOLKIT_MINIMIZE</li>
3449 <li>_TOOLKIT_SHRINK</li>
3450 <li>_TOOLKIT_MAXIMIZE</li>
3451 <li>_TOOLKIT_MAXIMIZE_VERT</li>
3452 <li>_TOOLKIT_MAXIMIZE_HORIZ</li>
3453 <li>_TOOLKIT_STATUS</li>
3454 </ul></td>
3455 <td>[]</td>
3456 </tr>
3457 <tr>
3458 <td>footer_right</td>
3459 <td>Single value or array of:
3460 <ul>
3461 <li>_TOOLKIT_TITLE</li>
3462 <li>_TOOLKIT_ICON</li>
3463 <li>_TOOLKIT_CLOSE</li>
3464 <li>_TOOLKIT_MINIMIZE</li>
3465 <li>_TOOLKIT_SHRINK</li>
3466 <li>_TOOLKIT_MAXIMIZE</li>
3467 <li>_TOOLKIT_MAXIMIZE_VERT</li>
3468 <li>_TOOLKIT_MAXIMIZE_HORIZ</li>
3469 <li>_TOOLKIT_STATUS</li>
3470 </ul></td>
3471 <td>[]</td>
3472 </tr>
3473 <tr>
3474 <td>auto_active</td>
3475 <td>Toggles the active state if mouse enters/leaves the window.</td>
3476 <td>false</td>
3477 </tr>
3478 <tr>
3479 <td>auto_close</td>
3480 <td>Set whether close button destroys the window or not.</td>
3481 <td>true</td>
3482 </tr>
3483 <tr>
3484 <td>auto_maximize</td>
3485 <td>Set whether maximize button toggles the window or not.</td>
3486 <td>true</td>
3487 </tr>
3488 <tr>
3489 <td>auto_minimize</td>
3490 <td>Set whether minimize button toggles the window or not.</td>
3491 <td>true</td>
3492 </tr>
3493 <tr>
3494 <td>auto_shrink</td>
3495 <td>Set whether shrink button toggles the window or not.</td>
3496 <td>true</td>
3497 </tr>
3498 <tr>
3499 <td>hide_status</td>
3500 <td>If set to !0 status message hides after n milliseconds.</td>
3501 <td>0</td>
3502 </tr>
3503 </table>
3505 <table class="methods collapse" title="⚒ Methods">
3506 <tr><th>Method</th><th>Description</th></tr>
3507 <tr>
3508 <td>toggle_maximize()</td>
3509 <td>Toggles the maximize state. If only one direction
3510 is maximized, the other one gets maximized, too.</td>
3511 </tr>
3512 <tr>
3513 <td>toggle_maximize_vertical()</td>
3514 <td>Toggles the vertical maximize state.</td>
3515 </tr>
3516 <tr>
3517 <td>toggle_maximize_horizontal()</td>
3518 <td>Toggles the horizontal maximize state.</td>
3519 </tr>
3520 <tr>
3521 <td>toggle_minimize()</td>
3522 <td>Toggles the minimize state.</td>
3523 </tr>
3524 <tr>
3525 <td>toggle_shrink()</td>
3526 <td>Toggles the shrinked state.</td>
3527 </tr>
3528 </table>
3530 <table class="domelements collapse" title="⛁ DOM-Elements">
3531 <tr><th>Element (class)</th><th>Description</th></tr>
3532 <tr>
3533 <td>Window.element ("div.toolkit-window") <i class="delegated"></i> <i class="classified"></i> <i class="stylized"></i></td>
3534 <td>description.</td>
3535 </tr>
3536 <tr>
3537 <td>Window._header ("div.toolkit-header")</td>
3538 <td>The header container of the window. Receives
3539 the double click for header_action.</td>
3540 </tr>
3541 <tr>
3542 <td>Window._footer ("div.toolkit-footer")</td>
3543 <td>The footer container of the window.</td>
3544 </tr>
3545 <tr>
3546 <td>Window._content ("div.toolkit-content")</td>
3547 <td>The content container of the window.</td>
3548 </tr>
3549 <tr>
3550 <td>Window._header_left ("div.toolkit-header-left")</td>
3551 <td>The left area of the header.</td>
3552 </tr>
3553 <tr>
3554 <td>Window._header_center ("div.toolkit-header-center")</td>
3555 <td>The middle area of the header.</td>
3556 </tr>
3557 <tr>
3558 <td>Window._header_right ("div.toolkit-header-right")</td>
3559 <td>The right area of the header.</td>
3560 </tr>
3561 <tr>
3562 <td>Window._footer_left ("div.toolkit-footer-left")</td>
3563 <td>The left area of the footer.</td>
3564 </tr>
3565 <tr>
3566 <td>Window._footer_center ("div.toolkit-footer-center")</td>
3567 <td>The middle area of the footer.</td>
3568 </tr>
3569 <tr>
3570 <td>Window._footer_right ("div.toolkit-footer-right")</td>
3571 <td>The right area of the footer.</td>
3572 </tr>
3573 <tr>
3574 <td>Window._title ("div.toolkit-title")</td>
3575 <td>The title of the window.</td>
3576 </tr>
3577 <tr>
3578 <td>Window._status ("div.toolkit-status")</td>
3579 <td>The status of the window.</td>
3580 </tr>
3581 <tr>
3582 <td>Window._icon ("img.toolkit-icon")</td>
3583 <td>The icon of the window.</td>
3584 </tr>
3585 <tr>
3586 <td>Window._resize ("div.toolkit-resize")</td>
3587 <td>The resize element of the window.</td>
3588 </tr>
3589 </table>
3591 <table class="modules collapse" title="⚛ Modules">
3592 <tr><th>Module</th><th>Description</th></tr>
3593 <tr>
3594 <td>Window.close</td>
3595 <td>The close button.</td>
3596 </tr>
3597 <tr>
3598 <td>Window.maximize</td>
3599 <td>The maximize button.</td>
3600 </tr>
3601 <tr>
3602 <td>Window.maximize_vert</td>
3603 <td>The vertical maximize button.</td>
3604 </tr>
3605 <tr>
3606 <td>Window.maximize_horiz</td>
3607 <td>The horizontal maximize button.</td>
3608 </tr>
3609 <tr>
3610 <td>Window.minimize</td>
3611 <td>The minimize button.</td>
3612 </tr>
3613 <tr>
3614 <td>Window.shrink</td>
3615 <td>The shrink button.</td>
3616 </tr>
3617 <tr>
3618 <td>Window.drag</td>
3619 <td>The drag object for the header.</td>
3620 </tr>
3621 <tr>
3622 <td>Window.resize</td>
3623 <td>The drag object for the resizer.</td>
3624 </tr>
3625 </table>
3627 <table class="events collapse" title="⚑ Events">
3628 <tr><th>Event</th><th>Description</th></tr>
3629 <tr>
3630 <td>maximizetoggled</td>
3631 <td>Is fired when maximize is toggled via its functions.
3632 Hands over the window instance and the maximize object with x and y as members.</td>
3633 </tr>
3634 <tr>
3635 <td>minimizetoggled</td>
3636 <td>Is fired when minimize is toggled via its function.
3637 Hands over the window instance and the minimize state.</td>
3638 </tr>
3639 <tr>
3640 <td>shrink</td>
3641 <td>Is fired when shrink state is toggled via its function.
3642 Hands over the window instance and the shrink state.</td>
3643 </tr>
3644 <tr>
3645 <td>dimensionschanged</td>
3646 <td>Is fired when the dimensions of the window changed via API.
3647 Hands over the window instance and a dimensions object.</td>
3648 </tr>
3649 <tr>
3650 <td>positionchanged</td>
3651 <td>Is fired when the position of the window changed via API.
3652 Hands over the window instance and a dimensions object.</td>
3653 </tr>
3654 <tr>
3655 <td>contentresized</td>
3656 <td>Is fired when the content of the window was resized.
3657 Hands over the window instance.</td>
3658 </tr>
3659 <tr>
3660 <td>headerchanged</td>
3661 <td>Is fired when the header was rebuilt.
3662 Hands over the window instance.</td>
3663 </tr>
3664 <tr>
3665 <td>footerchanged</td>
3666 <td>Is fired when the footer was rebuilt.
3667 Hands over the window instance.</td>
3668 </tr>
3669 <tr>
3670 <td>startdrag</td>
3671 <td>Is fired when dragging starts.
3672 Hands over the window instance and the event.</td>
3673 </tr>
3674 <tr>
3675 <td>stopdrag</td>
3676 <td>Is fired when dragging ends.
3677 Hands over the window instance and the event.</td>
3678 </tr>
3679 <tr>
3680 <td>dragging</td>
3681 <td>Is fired when the window is dragged.
3682 Hands over the window instance and the event.</td>
3683 </tr>
3684 <tr>
3685 <td>startresize</td>
3686 <td>Is fired when resizing starts.
3687 Hands over the window instance and the event.</td>
3688 </tr>
3689 <tr>
3690 <td>stopresize</td>
3691 <td>Is fired when resizing ends.
3692 Hands over the window instance and the event.</td>
3693 </tr>
3694 <tr>
3695 <td>resizing</td>
3696 <td>Is fired when the window gets resized.
3697 Hands over the window instance and the event.</td>
3698 </tr>
3699 <tr>
3700 <td>closeclicked</td>
3701 <td>Is fired when the close button is clicked.</td>
3702 </tr>
3703 <tr>
3704 <td>maximizeclicked</td>
3705 <td>Is fired when the maximize button is clicked.
3706 Hands over the window instance and the maximize object.</td>
3707 </tr>
3708 <tr>
3709 <td>maximizeverticalclicked</td>
3710 <td>Is fired when the maximize vertical button is clicked.
3711 Hands over the window instance and the maximize vertical state.</td>
3712 </tr>
3713 <tr>
3714 <td>maximizehorizontalclicked</td>
3715 <td>Is fired when the maximize horizontal button is clicked.
3716 Hands over the window instance and the maximize horizontal state.</td>
3717 </tr>
3718 <tr>
3719 <td>minimizeclicked</td>
3720 <td>Is fired when the minimize button is clicked.
3721 Hands over the window instance and the minimize state.</td>
3722 </tr>
3723 <tr>
3724 <td>shrinkclicked</td>
3725 <td>Is fired when the shrink button is clicked.
3726 Hands over the window instance and the shrink state.</td>
3727 </tr>
3728 <tr>
3729 <td>headeraction</td>
3730 <td>Is fired when a header double click occured.
3731 Hands over the window instance and the header action constant.</td>
3732 </tr>
3733 </table>
3734 </li>
3747 <li class="box class"><a name="modules"></a><h1>Modules</h1>
3748 <p><strong>Modules</strong> are elements that extend functionality or
3749 usability of widgets. They may create additional DOM or SVG elements but normally aren't
3750 capable of existing on their own. For example a <a href="#responsehandle">ResponseHandle</a> needs
3751 a <a href="#chart">Chart</a> or any other SVG-based parent to be drawn in and used with.
3752 </li>
3766 <li id="Circular" class="module">
3767 <!-- ########################################################### -->
3768 <!-- CIRCULAR MODULE -->
3769 <!-- ########################################################### -->
3771 <p class="description">
3772 <strong>Circular</strong> is a SVG group element containing two paths for displaying
3773 numerical values in a circular manner. Circular is able to draw labels,
3774 dots and markers and can show a hand. Circular e.g. is implemented by
3775 the clock to draw the hours, minutes and seconds. Circular extends
3776 <a href="#widget">Widget</a> and implements <a href="#range">Range</a>
3777 and <a href="#warning">Warning</a>.
3778 <a href="#gauge">Gauge</a> demonstrates single Circulars inside SVG images.
3779 </p>
3781 <div class="buttons"></div>
3783 <table class="options collapse" title="⚙ Options">
3784 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
3785 <tr>
3786 <td>value</td>
3787 <td>The value to show</td>
3788 <td>0</td>
3789 </tr>
3790 <tr>
3791 <td>size</td>
3792 <td>The outer diameter of the overall circular</td>
3793 <td>200</td>
3794 </tr>
3795 <tr>
3796 <td>thickness</td>
3797 <td>The thickness of the base and the value ring.</td>
3798 <td>3</td>
3799 </tr>
3800 <tr>
3801 <td>margin</td>
3802 <td>The margin of value and base ring.</td>
3803 <td>0</td>
3804 </tr>
3805 <tr>
3806 <td>hand</td>
3807 <td>An object with the hands dimensions:
3808 <ul>
3809 <li><stong>width</strong>: The width of the hand</li>
3810 <li><stong>length</strong>: The length of the hand</li>
3811 <li><stong>margin</strong>: The margin of the hand</li>
3812 </ul>
3813 </td>
3814 <td>{width: 3, length: 60, margin: 22}</td>
3815 </tr>
3816 <tr>
3817 <td>start</td>
3818 <td>The starting point in degrees (0=right, 90=bottom, 180=left, 270=top)</td>
3819 <td>135</td>
3820 </tr>
3821 <tr>
3822 <td>basis</td>
3823 <td>The maximum angle difference when value = max</td>
3824 <td>270</td>
3825 </tr>
3826 <tr>
3827 <td>base</td>
3828 <td>If base value is set, value ring starts at this point and shows values
3829 above and beneath base value. Set to false to disable based drawing.
3830 </td>
3831 <td>false</td>
3832 </tr>
3833 <tr>
3834 <td>show_base</td>
3835 <td>Draw the base ring.</td>
3836 <td>true</td>
3837 </tr>
3838 <tr>
3839 <td>show_value</td>
3840 <td>Draw the value ring.</td>
3841 <td>true</td>
3842 </tr>
3843 <tr>
3844 <td>show_hand</td>
3845 <td>Draw the hand.</td>
3846 <td>true</td>
3847 </tr>
3848 <tr>
3849 <td>x</td>
3850 <td>Move the whole circular in x direction.</td>
3851 <td>0</td>
3852 </tr>
3853 <tr>
3854 <td>y</td>
3855 <td>Move the whole circular in y direction.</td>
3856 <td>0</td>
3857 </tr>
3858 <tr>
3859 <td>marker</td>
3860 <td>Default settings for markers. Object with the following members:
3861 <ul>
3862 <li><strong>margin</strong>: default margin of markers (distance from outer size)</li>
3863 <li><strong>thickness</strong>: default thickness of markers</li>
3864 </ul>
3865 </td>
3866 <td>{thickness: 20, margin: 0}</td>
3867 </tr>
3868 <tr>
3869 <td>markers</td>
3870 <td>Array containing objects describing a marker. Members are:
3871 <ul>
3872 <li><strong>from (optional)</strong>: value from where to draw the marker. If omitted, min is used.</li>
3873 <li><strong>to (optional)</strong>: value setting the end of the marker. If omitted, max is used.</li>
3874 <li><strong>color (optional)</strong>: color string for the fill of the marker</li>
3875 <li><strong>class (optional)</strong>: the class of the marker</li>
3876 <li><strong>margin (optional)</strong>: margin if you want another one as the default (distance from outer size)</li>
3877 <li><strong>thickness (optional)</strong>: thickness if you want another one as the default</li>
3878 </ul>
3879 </td>
3880 <td>[]</td>
3881 </tr>
3882 <tr>
3883 <td>dot</td>
3884 <td>Default settings for dots. Object with the following optional members:
3885 <ul>
3886 <li><strong>margin</strong>: default margin of dots (distance from outer size)</li>
3887 <li><strong>width</strong>: default width of dots</li>
3888 <li><strong>length</strong>: default length of dots</li>
3889 </ul>
3890 </td>
3891 <td>{width: 3, length: 3, margin: 22}</td>
3892 </tr>
3893 <tr>
3894 <td>dots</td>
3895 <td>Array containing objects describing a dot. Members are:
3896 <ul>
3897 <li><strong>pos</strong>: value where to draw the dot</li>
3898 <li><strong>color (optional)</strong>: color string for the fill of the dot</li>
3899 <li><strong>class (optional)</strong>: the class of the dot</li>
3900 <li><strong>margin (optional)</strong>: margin if you want another one as the default (distance from outer size)</li>
3901 <li><strong>width (optional)</strong>: width if you want another one as the default</li>
3902 <li><strong>length (optional)</strong>: length if you want another one as the default</li>
3903 </ul>
3904 </td>
3905 <td>[]</td>
3906 </tr>
3907 <tr>
3908 <td>label</td>
3909 <td>Settings for labels. Object with the following optional members:
3910 <ul>
3911 <li><strong>margin</strong>: default margin of dots (distance from outer size)</li>
3912 <li><strong>align</strong>: _TOOLKIT_INNER or _TOOLKIT_OUTER describe where to put the anchor of labels. INNER means labels inside a virtual circle at margin, OUTER vice versa.</li>
3913 <li><strong>format</strong>: function receiving the value and returning a string. Used if a label in the list has no label member set.</li>
3914 </ul>
3915 </td>
3916 <td>{margin: 27, align: _TOOLKIT_INNER, format: function (val) { return val; }}</td>
3917 </tr>
3918 <tr>
3919 <td>labels</td>
3920 <td>Array containing objects describing a label. Members are:
3921 <ul>
3922 <li><strong>pos</strong>: value where to draw the label</li>
3923 <li><strong>label (optional)</strong>: text for the label. If omitted, the value from pos is sent through label.format</li>
3924 <li><strong>color (optional)</strong>: color string for the fill of the dot</li>
3925 <li><strong>class (optional)</strong>: the class of the dot</li>
3926 <li><strong>margin (optional)</strong>: margin if you want another one as the default (distance from outer size)</li>
3927 </ul>
3928 </td>
3929 <td>[]</td>
3930 </tr>
3931 </table>
3933 <table class="modules collapse" title="⚛ Modules">
3934 <tr><th>Module</th><th>Description</th></tr>
3935 <tr>
3936 <td>circular.element ("g.toolkit-circular") <i class="delegated"></i> <i class="classified"></i> <i class="stylized"></i></td>
3937 <td>An SVG group element containing the other elements.</td>
3938 </tr>
3939 <tr>
3940 <td>circular._base ("path.toolkit-base")</td>
3941 <td>An SVG path element drawing the base ring.</td>
3942 </tr>
3943 <tr>
3944 <td>circular._value ("path.toolkit-value")</td>
3945 <td>An SVG path element drawing the value.</td>
3946 </tr>
3947 <tr>
3948 <td>circular._hand ("rect.toolkit-hand")</td>
3949 <td>An SVG rect element showing a hand.</td>
3950 </tr>
3951 <tr>
3952 <td>circular._markers ("g.toolkit-markers")</td>
3953 <td>An SVG group element containing the marker path elements.</td>
3954 </tr>
3955 <tr>
3956 <td>circular._dots ("g.toolkit-dots")</td>
3957 <td>An SVG group element containing the dot rect elements.</td>
3958 </tr>
3959 <tr>
3960 <td>circular._labels ("g.toolkit-labels")</td>
3961 <td>An SVG group element containing the label text elements.</td>
3962 </tr>
3963 </table>
3966 <table class="events collapse" title="⚑ Events">
3967 <tr><th>Event</th><th>Description</th></tr>
3968 <tr>
3969 <td>labelsdrawn</td>
3970 <td>Labels where redrawn. Hands over the widget instance.</td>
3971 </tr>
3972 <tr>
3973 <td>dotsdrawn</td>
3974 <td>Dots where redrawn. Hands over the widget instance.</td>
3975 </tr>
3976 <tr>
3977 <td>markersdrawn</td>
3978 <td>Markers where redrawn. Hands over the widget instance.</td>
3979 </tr>
3980 <tr>
3981 <td>handdrawn</td>
3982 <td>Hand was redrawn. Hands over the widget instance.</td>
3983 </tr>
3984 </table>
3985 </li>
3987 <li id="DragValue" class="module">
3988 <!-- ########################################################### -->
3989 <!-- DRAG VALUE MODULE -->
3990 <!-- ########################################################### -->
3992 <p class="description">
3993 <strong>DragValue</strong> enables dragging an element and setting a value
3994 according to the distance. DragValue is used e.g. in <a href="#knob">Knob</a> for
3995 setting its value. DragValue extends <a href="#widget">Widget</a> and implements
3996 <a href="#globalcursor">GlobalCursor</a>.
3997 </p>
3999 <div class="buttons"></div>
4001 <table class="options collapse" title="⚙ Options">
4002 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
4003 <tr>
4004 <td>element</td>
4005 <td>The element receiving the drag event.</td>
4006 <td>false</td>
4007 </tr>
4008 <tr>
4009 <td>range</td>
4010 <td>A callback function returning the range instance for calculating the drag parameters.</td>
4011 <td>function () { return {}; }</td>
4012 </tr>
4013 <tr>
4014 <td>events</td>
4015 <td>Function returning the element firing the drag event. Set to false to use the main element.</td>
4016 <td>false</td>
4017 </tr>
4018 <tr>
4019 <td>classes</td>
4020 <td>The element receiving CSS-classes. Set to false to use the main element.</td>
4021 <td>false</td>
4022 </tr>
4023 <tr>
4024 <td>get</td>
4025 <td>A callback function returning the actual value.</td>
4026 <td>false</td>
4027 </tr>
4028 <tr>
4029 <td>set</td>
4030 <td>A callback function for setting the value.</td>
4031 <td>false</td>
4032 </tr>
4033 <tr>
4034 <td>direction</td>
4035 <td>The drag direction, either _TOOLKIT_HORIZONTAL, _TOOLKIT_VERTICAL or _TOOLKIT_POLAR.</td>
4036 <td>_TOOLKIT_VERTICAL</td>
4037 </tr>
4038 <tr>
4039 <td>rotation</td>
4040 <td>Used when direction = _TOOLKIT_POLAR. Defines the angle of
4041 the middle of the positive value changes. 0 means straight upward.
4042 E.g. a value of 45 does positive value changes in upper and
4043 right directions. An angle of 225 reverses the value set.</td>
4044 <td>45</td>
4045 </tr>
4046 <tr>
4047 <td>blind_angle</td>
4048 <td>Used when direction = _TOOLKIT_POLAR. Amount of degrees
4049 to separate positive from negative value changes.</td>
4050 <td>20</td>
4051 </tr>
4052 <tr>
4053 <td>active</td>
4054 <td>Deactivate the dragging.</td>
4055 <td>true</td>
4056 </tr>
4057 <tr>
4058 <td>cursor</td>
4059 <td>Activate the global cursor.</td>
4060 <td>false</td>
4061 </tr>
4062 </table>
4064 <table class="events collapse" title="⚑ Events">
4065 <tr><th>Event</th><th>Description</th></tr>
4066 <tr>
4067 <td>startdrag</td>
4068 <td>This event is fired when dragging starts. It gets fired by the
4069 DragValue instance (handing over the DragValue instance and the mousedown event)
4070 and by the element set via "events" option (handing over
4071 the mousedown event, the actual value, the element receiving the drag,
4072 the DragValue instance and the range instance).</td>
4073 </tr>
4074 <tr>
4075 <td>dragging</td>
4076 <td>This event is fired when dragging occurs. It gets fired by the
4077 DragValue instance (handing over the DragValue instance and the mousedown event)
4078 and by the element set via "events" option (handing over
4079 the mousedown event, the actual value, the element receiving the drag,
4080 the DragValue instance and the range instance).</td>
4081 </tr>
4082 <tr>
4083 <td>stopdrag</td>
4084 <td>This event is fired when dragging ends. It gets fired by the
4085 DragValue instance (handing over the DragValue instance and the mousedown event)
4086 and by the element set via "events" option (handing over
4087 the mousedown event, the actual value, the element receiving the drag,
4088 the DragValue instance and the range instance).</td>
4089 </tr>
4090 </table>
4091 </li>
4093 <li id="EqBand" class="module">
4094 <!-- ########################################################### -->
4095 <!-- EQ BAND MODULE -->
4096 <!-- ########################################################### -->
4098 <p class="description">
4099 <strong>Filter</strong> An EqBand extends a <a href="#responsehandle">ResponseHandle</a>
4100 and holds a dependent <a href="#filter">Filter</a> It is used
4101 as a fully functional representation of a single equalizer band. EqBand
4102 needs a <a href="#chart">Chart</a> or other derivates to be drawn in.
4103 </p>
4105 <div class="buttons"></div>
4107 <table class="options collapse" title="⚙ Options">
4108 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
4109 <tr>
4110 <td>type</td>
4111 <td>The type of the filter:
4112 <ul>
4113 <li>_TOOLKIT_PARAMETRIC: Parametric bell</li>
4114 <li>_TOOLKIT_NOTCH: Notch filter</li>
4115 <li>_TOOLKIT_LOWSHELF: Low shelf</li>
4116 <li>_TOOLKIT_HIGHSHELF: High shelf</li>
4117 <li>_TOOLKIT_LOWPASS_1: Low pass 1st order</li>
4118 <li>_TOOLKIT_LOWPASS_2: Low pass 2st order</li>
4119 <li>_TOOLKIT_LOWPASS_3: Low pass 3st order</li>
4120 <li>_TOOLKIT_LOWPASS_4: Low pass 4st order</li>
4121 <li>_TOOLKIT_HIGHPASS_1: High pass 1st order</li>
4122 <li>_TOOLKIT_HIGHPASS_2: High pass 2st order</li>
4123 <li>_TOOLKIT_HIGHPASS_3: High pass 3st order</li>
4124 <li>_TOOLKIT_HIGHPASS_4: High pass 4st order</li>
4125 </ul>
4126 </td>
4127 <td>_TOOLKIT_PARAMETRIC</td>
4128 </tr>
4129 <tr>
4130 <td>freq</td>
4131 <td>The frequency of the filter</td>
4132 <td>0</td>
4133 </tr>
4134 <tr>
4135 <td>gain</td>
4136 <td>The gain of the filter</td>
4137 <td>0</td>
4138 </tr>
4139 <tr>
4140 <td>q</td>
4141 <td>The Q of the filter</td>
4142 <td>0</td>
4143 </tr>
4144 </table>
4146 <table class="methods collapse" title="⚒ Methods">
4147 <tr><th>Method</th><th>Description</th></tr>
4148 <tr>
4149 <td>freq2gain(freq)</td>
4150 <td>Returns a gain according to the given frequency.</td>
4151 </tr>
4152 <tr>
4153 <td>set(key, value, hold)</td>
4154 <td>Set an option. Key is the options name, value the new value
4155 and hold prevents some options to take the default action (like e.g. redraw()).
4156 Returns the widgets instance.</td>
4157 </tr>
4158 <tr>
4159 <td>get(key)</td>
4160 <td>Get the value of an option.</td>
4161 </tr>
4162 </table>
4164 <table class="modules collapse" title="⚛ Modules">
4165 <tr><th>Module</th><th>Description</th></tr>
4166 <tr>
4167 <td>eqband.filter</td>
4168 <td>A <a href="#filter">Filter</a> for the bands.</td>
4169 </tr>
4170 </table>
4171 </li>
4173 <li id="Filter" class="module">
4174 <!-- ########################################################### -->
4175 <!-- FILTER MODULE -->
4176 <!-- ########################################################### -->
4178 <p class="description">
4179 <strong>Filter</strong> provides functions for calculating
4180 filter curves for different filter types. Filter implements
4181 <a href="#audiomath">AudioMath</a>,
4182 <a target="_blank" href="http://mootools.net/docs/core/Class/Class.Extras#Options">Options</a> and
4183 <a target="_blank" href="http://mootools.net/docs/core/Class/Class.Extras#Events">Events</a>.
4185 </p>
4187 <div class="buttons"></div>
4189 <table class="options collapse" title="⚙ Options">
4190 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
4191 <tr>
4192 <td>type</td>
4193 <td>The type of the filter:
4194 <ul>
4195 <li>_TOOLKIT_PARAMETRIC: Parametric bell</li>
4196 <li>_TOOLKIT_NOTCH: Notch filter</li>
4197 <li>_TOOLKIT_LOWSHELF: Low shelf</li>
4198 <li>_TOOLKIT_HIGHSHELF: High shelf</li>
4199 <li>_TOOLKIT_LOWPASS_1: Low pass 1st order</li>
4200 <li>_TOOLKIT_LOWPASS_2: Low pass 2st order</li>
4201 <li>_TOOLKIT_LOWPASS_3: Low pass 3st order</li>
4202 <li>_TOOLKIT_LOWPASS_4: Low pass 4st order</li>
4203 <li>_TOOLKIT_HIGHPASS_1: High pass 1st order</li>
4204 <li>_TOOLKIT_HIGHPASS_2: High pass 2st order</li>
4205 <li>_TOOLKIT_HIGHPASS_3: High pass 3st order</li>
4206 <li>_TOOLKIT_HIGHPASS_4: High pass 4st order</li>
4207 </ul>
4208 </td>
4209 <td>_TOOLKIT_PARAMETRIC</td>
4210 </tr>
4211 <tr>
4212 <td>freq</td>
4213 <td>The frequency of the filter</td>
4214 <td>0</td>
4215 </tr>
4216 <tr>
4217 <td>gain</td>
4218 <td>The gain of the filter</td>
4219 <td>0</td>
4220 </tr>
4221 <tr>
4222 <td>q</td>
4223 <td>The Q of the filter</td>
4224 <td>0</td>
4225 </tr>
4226 </table>
4228 <table class="methods collapse" title="⚒ Methods">
4229 <tr><th>Method</th><th>Description</th></tr>
4230 <tr>
4231 <td>freq2gain(freq)</td>
4232 <td>Returns a gain according to the given frequency and the type of the filter.</td>
4233 </tr>
4234 <tr>
4235 <td>set(key, value, hold)</td>
4236 <td>Set an option. Key is the options name, value the new value
4237 and hold prevents some options to take the default action (like e.g. redraw()).
4238 Returns the widgets instance.</td>
4239 </tr>
4240 <tr>
4241 <td>get(key)</td>
4242 <td>Get the value of an option.</td>
4243 </tr>
4244 <tr>
4245 <td>reset()</td>
4246 <td>Resets all filter pre-calculations.</td>
4247 </tr>
4248 <tr>
4249 <td>peak(freq)</td>
4250 <td>Calculate a parametric bell filter. Returns the gain according to the frequency.</td>
4251 </tr>
4252 <tr>
4253 <td>notch(freq)</td>
4254 <td>Calculate a notch filter. Returns the gain according to the frequency.</td>
4255 </tr>
4256 <tr>
4257 <td>low_shelf(freq)</td>
4258 <td>Calculate a low shelf filter. Returns the gain according to the frequency.</td>
4259 </tr>
4260 <tr>
4261 <td>high_shelf(freq)</td>
4262 <td>Calculate a high shelf filter. Returns the gain according to the frequency.</td>
4263 </tr>
4264 <tr>
4265 <td>lpf_order1(freq)</td>
4266 <td>Calculate a low pass 1st order. Returns the gain according to the frequency.</td>
4267 </tr>
4268 <tr>
4269 <td>lpf_order2(freq)</td>
4270 <td>Calculate a low pass 2nd order. Returns the gain according to the frequency.</td>
4271 </tr>
4272 <tr>
4273 <td>lpf_order3(freq)</td>
4274 <td>Calculate a low pass 3rd order. Returns the gain according to the frequency.</td>
4275 </tr>
4276 <tr>
4277 <td>lpf_order4(freq)</td>
4278 <td>Calculate a low pass 4th order. Returns the gain according to the frequency.</td>
4279 </tr>
4280 <tr>
4281 <td>hpf_order1(freq)</td>
4282 <td>Calculate a high pass 1st order. Returns the gain according to the frequency.</td>
4283 </tr>
4284 <tr>
4285 <td>hpf_order2(freq)</td>
4286 <td>Calculate a high pass 2nd order. Returns the gain according to the frequency.</td>
4287 </tr>
4288 <tr>
4289 <td>hpf_order3(freq)</td>
4290 <td>Calculate a high pass 3rd order. Returns the gain according to the frequency.</td>
4291 </tr>
4292 <tr>
4293 <td>hpf_order4(freq)</td>
4294 <td>Calculate a high pass 4th order. Returns the gain according to the frequency.</td>
4295 </tr>
4296 </table>
4298 <table class="events collapse" title="⚑ Events">
4299 <tr><th>Event</th><th>Description</th></tr>
4300 <tr>
4301 <td>initialized</td>
4302 <td>The initializing process of the widget is complete. hands
4303 over the widget instance.</td>
4304 </tr>
4305 <tr>
4306 <td>set</td>
4307 <td>Is fired when any option was set. Hands over
4308 the key, the new value, the hold parameter and the firing widget.</td>
4309 </tr>
4310 <tr>
4311 <td>set_[value]</td>
4312 <td>Is fired when a certain value was set, e.g. "set_width" or "set_id".<br />
4313 Hands over the new value, the hold parameter and the widget instance.</td>
4314 </tr>
4315 <tr>
4316 <td>get</td>
4317 <td>Is fired when an option is requested. Hands over
4318 the key, the value and the firing widget.</td>
4319 </tr>
4320 <tr>
4321 <td>reset</td>
4322 <td>Is fired when all filter pre-calculations are erased.</td>
4323 </tr>
4324 </table>
4325 </li>
4328 <li id="Graph" class="module">
4329 <!-- ########################################################### -->
4330 <!-- GRAPH MODULE -->
4331 <!-- ########################################################### -->
4333 <p class="description">
4334 A <strong>Graph</strong> is a single SVG path element. It provides some functions to easily draw
4335 paths inside Charts and other derivates. Graph extends <a href="#widget">Widget</a> and implements
4336 <a href="#ranges">Ranges</a>.
4337 </p>
4339 <div class="buttons"></div>
4341 <table class="options collapse" title="⚙ Options">
4342 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
4343 <tr>
4344 <td>dots</td>
4345 <td>An array containing objects with x and y members: {x:0.1, y:0.5} or a ready-to-use string</td>
4346 <td>[]</td>
4347 </tr>
4348 <tr>
4349 <td>type</td>
4350 <td>The curving mode of the path:
4351 <ul>
4352 <li>L = normal (needs x,y)</li>
4353 <li>T = smooth quadratic Bézier (needs x, y)</li>
4354 <li>Q = quadratic Bézier (needs: x1, y1, x, y)</li>
4355 <li>C = CurveTo (needs: x1, y1, x2, y2, x, y)</li>
4356 <li>S = SmoothCurve (needs: x1, y1, x, y)</li>
4357 <li>H[n] = smooth horizontal flat; It is like S with y1 = y and x1 between
4358 x and last x with a factor (smoothing) of [n]. [n] should be a int or float
4359 between 1 and 5. No [n] factor means 3.</li>
4360 </ul>
4361 </td>
4362 <td>L</td>
4363 </tr>
4364 <tr>
4365 <td>mode</td>
4366 <td>The drawing mode of the path:
4367 <ul>
4368 <li>_TOOLKIT_LINE: simple line</li>
4369 <li>_TOOLKIT_BOTTOM: filled below the line</li>
4370 <li>_TOOLKIT_TOP: filled above the line</li>
4371 <li>_TOOLKIT_CENTER: filled from center of the widget</li>
4372 <li>_TOOLKIT:VARIABLE: filled from a percentual position on the canvas, provide base option</li>
4373 </ul>
4374 </td>
4375 <td>_TOOLKIT_LINE</td>
4376 </tr>
4377 <tr>
4378 <td>base</td>
4379 <td>If the drawing mode is _TOOLKIT_VARIABLE provide a value to draw the fill from</td>
4380 <td>0</td>
4381 </tr>
4382 <tr>
4383 <td>color</td>
4384 <td>A color for the curve</td>
4385 <td>""</td>
4386 </tr>
4387 <td>range_x <i class="static"></i></td>
4388 <td>
4389 An object with options for a <a href="#range">Range</a> for the x axis
4390 or a function returning a <a href="#range">Range</a> instance.</td>
4391 <td>{}</td>
4392 </tr>
4393 <tr>
4394 <td>range_y <i class="static"></i></td>
4395 <td>An object with options for a <a href="#range">Range</a> for the y axis
4396 or a function returning a <a href="#range">Range</a> instance.</td>
4397 <td>{}</td>
4398 </tr>
4399 <tr>
4400 <td>width</td>
4401 <td>The width of the graph. Set basis of Graph.x for initial width to prevent
4402 redundant redrawing. Meant as a wrapper for Graph.x.set("basis", 300)</td>
4403 <td>0</td>
4404 </tr>
4405 <tr>
4406 <td>height</td>
4407 <td>The height of the graph. Set basis of Graph.y for initial height to prevent
4408 redundant redrawing. Meant as a wrapper for Graph.y.set("basis", 300)</td>
4409 <td>0</td>
4410 </tr>
4411 <tr>
4412 <td>key</td>
4413 <td>If the graph has a key enabled, draw a short description
4414 for this graph. Expects a string or false to disable.</td>
4415 <td>false</td>
4416 </table>
4418 <table class="elements collapse" title="⚛ Elements">
4419 <tr><th>Element (class)</th><th>Description</th></tr>
4420 <tr>
4421 <td>graph.element ("path.toolkit-graph") <i class="delegated"></i> <i class="classified"></i> <i class="stylized"></i></td>
4422 <td>The SVG path.</td>
4423 </tr>
4424 </table>
4426 <table class="events collapse" title="⚑ Events">
4427 <tr><th>Event</th><th>Description</th></tr>
4428 <tr>
4429 <td>graphchanged</td>
4430 <td>Is fired when the graph was changed.</td>
4431 </tr>
4432 <tr>
4433 <td>resized</td>
4434 <td>Is fired when width or height of the graph was changed.</td>
4435 </tr>
4436 </table>
4437 </li>
4439 <li id="Grid" class="module">
4440 <!-- ########################################################### -->
4441 <!-- GRID MODULE -->
4442 <!-- ########################################################### -->
4444 <p class="description">
4445 A <strong>Grid</strong> creates a couple of lines and labels in a SVG image on the x and y axis.
4446 It is used in e.g. <a href="#graph">Graphs</a> and
4447 <a href="frequencyresponse">FrequencyResponses</a> to draw markers and values.
4448 Graphs need a parent SVG image do draw into. The base element of a Grid is a
4449 SVG group containing all the labels and lines. Grids extend
4450 <a href="#widget">Widget</a> and implements <a href="#ranges">Ranges</a>.
4451 </p>
4453 <div class="buttons"></div>
4455 <table class="options collapse" title="⚙ Options">
4456 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
4457 <tr>
4458 <td>grid_x</td>
4459 <td>An array containing objects with the following members for the x axis: <br />{pos:x[, color: "colorstring"[, class: "classname"[, label:"labeltext"]]]}</td>
4460 <td>[]</td>
4461 </tr>
4462 <tr>
4463 <td>grid_y</td>
4464 <td>An array containing objects with the following members for the y axis: <br />{pos:x[, color: "colorstring"[, class: "classname"[, label:"labeltext"]]]}</td>
4465 <td>[]</td>
4466 </tr>
4467 <tr>
4468 <td>range_x <i class="static"></i></td>
4469 <td>An object with options for a <a href="#range">Range</a> for the x axis
4470 or a function returning a <a href="#range">Range</a> instance.</td>
4471 <td>{}</td>
4472 </tr>
4473 <tr>
4474 <td>range_y <i class="static"></i></td>
4475 <td>An object with options for a <a href="#range">Range</a> for the y axis
4476 or a function returning a <a href="#range">Range</a> instance.</td>
4477 <td>{}</td>
4478 </tr>
4479 </table>
4481 <table class="modules collapse" title="⚛ Modules">
4482 <tr><th>Module</th><th>Description</th></tr>
4483 <tr>
4484 <td>grid.range_x</td>
4485 <td>A <a href="#range">Range</a> for the x axis.</td>
4486 </tr>
4487 <tr>
4488 <td>grid.range_y</td>
4489 <td>A <a href="#range">Range</a> for the y axis.</td>
4490 </tr>
4491 </table>
4492 <table class="domelements collapse" title="⛁ DOM-Elements">
4493 <tr><th>Element (class)</th><th>Description</th></tr>
4494 <tr>
4495 <td>grid.element ("g.toolkit-grid") <i class="delegated"></i> <i class="classified"></i></td>
4496 <td>The SVG group containing all other elements.</td>
4497 </tr>
4498 <tr>
4499 <td>[paths] ("g.toolkit-grid-line")</td>
4500 <td>SVG paths drawing the grid.</td>
4501 </tr>
4502 <tr>
4503 <td>[text] ("g.toolkit-grid-label")</td>
4504 <td>SVG text elements containing the grid labels.</td>
4505 </tr>
4506 </table>
4508 <table class="events collapse" title="⚑ Events">
4509 <tr><th>Event</th><th>Description</th></tr>
4510 <tr>
4511 <td>gridchanged</td>
4512 <td>Is fired when the grid was changed.</td>
4513 </tr>
4514 <tr>
4515 <td>resized</td>
4516 <td>Is fired when the grid was resized.</td>
4517 </tr>
4518 </table>
4520 </li>
4523 <li id="Range" class="module">
4524 <!-- ########################################################### -->
4525 <!-- RANGE MODULE -->
4526 <!-- ########################################################### -->
4528 <p class="description">
4529 <strong>Range</strong> provides functions for calculating linear scales from different values.
4530 Range is useful to build coordinate systems, calculating pixel positions
4531 for different scale types and the like. Ranged is used e.g. in Scale,
4532 MeterBase and Graph to draw elements on a certain position according to
4533 a value on an arbitrary scale. Range implements <a href="#ranged">Ranged</a>,
4534 <a target="_blank" href="http://mootools.net/docs/core/Class/Class.Extras#Options">Options</a> and
4535 <a target="_blank" href="http://mootools.net/docs/core/Class/Class.Extras#Events">Events</a>.
4536 </p>
4538 <div class="buttons"></div>
4540 <table class="methods collapse" title="⚒ Methods">
4541 <tr><th>Method</th><th>Description</th></tr>
4542 <tr>
4543 <td>initialize(options)</td>
4544 <td>Is called automatically on instantiation. Argument is on object
4545 containing options to set initially.</td>
4546 </tr>
4547 <tr>
4548 <td>set(key, value, hold)</td>
4549 <td>Set an option. Key is the options name, value the new value
4550 and hold prevents some options to take the default action (like e.g. redraw()).
4551 Returns the widgets instance.</td>
4552 </tr>
4553 <tr>
4554 <td>get(key)</td>
4555 <td>Get the value of an option.</td>
4556 </tr>
4557 </table>
4559 <table class="events collapse" title="⚑ Events">
4560 <tr><th>Event</th><th>Description</th></tr>
4561 <tr>
4562 <td>initialized</td>
4563 <td>The initializing process of the widget is complete. hands
4564 over the widget instance.</td>
4565 </tr>
4566 <tr>
4567 <td>set</td>
4568 <td>Is fired when any option was set. Hands over
4569 the key, the new value, the hold parameter and the firing widget.</td>
4570 </tr>
4571 <tr>
4572 <td>set_[value]</td>
4573 <td>Is fired when a certain value was set, e.g. "set_width" or "set_id".<br />
4574 Hands over the new value, the hold parameter and the widget instance.</td>
4575 </tr>
4576 <tr>
4577 <td>get</td>
4578 <td>Is fired when an option is requested. Hands over
4579 the key, the value and the firing widget.</td>
4580 </tr>
4581 </table>
4582 </li>
4585 <li id="ResponseHandle" class="module">
4586 <!-- ########################################################### -->
4587 <!-- RESPONSE HANDLE MODULE -->
4588 <!-- ########################################################### -->
4590 <p class="description">
4591 <strong>ResponseHandle</strong> is a controller inside a <a href="#responsehandler">ResponseHandler</a>,
4592 but can manually be used in <a href="#freqeuncyresponse">FrequencyResponse</a> or <a href="#graph">Graph</a>, too.
4593 ResponseHandles have various faces and functions to provide different controls for every
4594 application an alterable Graph may be used in:
4595 <ul>
4596 <li><strong>Circular handles:</strong> used for e.g. parametric EQ's, normally draggable
4597 in x and y direction. Able to show z axis via its size.</li>
4598 <li><strong>Lines:</strong> Vertical lines ca be used to e.g. modify a shelving filter
4599 while horizontal lines restricted in width may be used as handles for a graphical EQ
4600 with fixed bands. They are able to show the z axis via their size.</li>
4601 <li><strong>Blocks:</strong> Blocks roughly act like lines but draw themself as rectangles
4602 filling the space to their boundary. They can't show any z axis except as value in the label.</li>
4603 </ul>
4604 ResponseHandle is based on <a href="#widget">Widget</a> and implements <a href="#ranges">Ranges</a>, <a href="#warning">Warning</a> and <a href="#globalcursor">GlobalCursor</a>.
4605 </p>
4607 <div class="buttons"></div>
4609 <table class="options collapse" title="⚙ Options">
4610 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
4611 <tr>
4612 <td>range_x <i class="static"></i></td>
4613 <td>
4614 An object with options for a <a href="#range">Range</a> for the x axis
4615 or a function returning a <a href="#range">Range</a> instance.</td>
4616 <td>{}</td>
4617 </tr>
4618 <tr>
4619 <td>range_y <i class="static"></i></td>
4620 <td>An object with options for a <a href="#range">Range</a> for the y axis
4621 or a function returning a <a href="#range">Range</a> instance.</td>
4622 <td>{}</td>
4623 </tr>
4624 <tr>
4625 <td>range_z <i class="static"></i></td>
4626 <td>
4627 An object with options for a <a href="#range">Range</a> for the z axis
4628 or a function returning a <a href="#range">Range</a> instance.</td>
4629 <td>{}</td>
4630 </tr>
4631 <tr>
4632 <td>mode <i class="static"></i></td>
4633 <td>Mode of the ResponseHandle.
4634 <ul>
4635 <li>_TOOLKIT_CIRCULAR: a circular handle</li>
4636 <li>_TOOLKIT_LINE_VERTICAL: vertical bar</li>
4637 <li>_TOOLKIT_LINE_HORIZONAL: horizontal bar</li>
4638 <li>_TOOLKIT_BLOCK_LEFT: rectangle bound to the left edge</li>
4639 <li>_TOOLKIT_BLOCK_RIGHT: rectangle bound to the right edge</li>
4640 <li>_TOOLKIT_BLOCK_TOP: rectangle bound to the top edge</li>
4641 <li>_TOOLKIT_BLOCK_BOTTOM: rectangle bound to the bottom edge</li>
4642 </ul>
4643 </td>
4644 <td>_TOOLKIT_CIRCULAR</td>
4645 </tr>
4646 <tr>
4647 <td>intersect</td>
4648 <td>callback function for checking intersections: function (x1, y1, x2, y2, id) {}<br />
4649 Returns a value describing the amount of intersection with other handle elements.
4650 Intersections are weighted depending on the intersecting object. E.g. SVG edges normally have
4651 a very high impact while intersecting in comparison with overlapping handle objects
4652 that have a low impact on intersection.
4653 </td>
4654 <td>function(){ return {intersect:0, count:0} }</td>
4655 </tr>
4656 <tr>
4657 <td>preferences</td>
4658 <td>Perferred position of the label. This options is an array containing positions
4659 with a descending priority - the first child will be the most preferred position.<br/>
4660 Possible positions depend on the chosen handle mode:
4661 <ul>
4662 <li><strong>_TOOLKIT_CIRCULAR</strong>: _TOOLKIT_TOP, _TOOLKIT_BOTTOM, _TOOLKIT_LEFT, _TOOLKIT_RIGHT</li>
4663 <li><strong>_TOOLKIT_LINE_VERTICAL</strong>: _TOOLKIT_TOP_LEFT, _TOOLKIT_TOP_RIGHT, _TOOLKIT_LEFT, _TOOLKIT_RIGHT, _TOOLKIT_BOTTOM_LEFT, _TOOLKIT_BOTTOM_RIGHT</li>
4664 <li><strong>_TOOLKIT_LINE_HORIZONTAL</strong>: _TOOLKIT_TOP_LEFT, _TOOLKIT_TOP, _TOOLKIT_TOP_RIGHT, _TOOLKIT_BOTTOM_LEFT, _TOOLKIT_BOTTOM, _TOOLKIT_BOTTOM_RIGHT</li>
4665 <li><strong>_TOOLKIT_BLOCK_[LEFT/RIGHT/TOP/BOTTOM]</strong>: _TOOLKIT_TOP_LEFT, _TOOLKIT_TOP, _TOOLKIT_TOP_RIGHT, _TOOLKIT_LEFT, _TOOLKIT_CENTER, _TOOLKIT_RIGHT, _TOOLKIT_BOTTOM_LEFT, _TOOLKIT_BOTTOM, _TOOLKIT_BOTTOM_RIGHT</li>
4666 </ul>
4667 </td>
4668 <td>[_TOOLKIT_LEFT, _TOOLKIT_TOP, _TOOLKIT_RIGHT, _TOOLKIT_BOTTOM]</td>
4669 </tr>
4670 <tr>
4671 <td>label</td>
4672 <td>A callback function layouting the label. "\n" creates line breaks.
4673 </td>
4674 <td>function (title, x, y, z) { return [ title, "\n", x, " Hz\n", y.toFixed(2), " dB\nQ: ", z.toFixed(2) ].join(""); }</td>
4675 </tr>
4676 <tr>
4677 <td>x</td>
4678 <td>A value for the x position</td>
4679 <td>0</td>
4680 </tr>
4681 <tr>
4682 <td>y</td>
4683 <td>A value for the y position</td>
4684 <td>0</td>
4685 </tr>
4686 <tr>
4687 <td>z</td>
4688 <td>A value for the z axis</td>
4689 <td>0</td>
4690 </tr>
4691 <tr>
4692 <td>x_min</td>
4693 <td>Restrict x axis, minimum value, false to disable lower restriction</td>
4694 <td>false</td>
4695 </tr>
4696 <tr>
4697 <td>x_max</td>
4698 <td>Restrict x axis, maximum value, false to disable upper restriction</td>
4699 <td>false</td>
4700 </tr>
4701 <tr>
4702 <td>y_min</td>
4703 <td>Restrict y axis, minimum value, false to disable lower restriction</td>
4704 <td>false</td>
4705 </tr>
4706 <tr>
4707 <td>y_max</td>
4708 <td>Restrict y axis, maximum value, false to disable upper restriction</td>
4709 <td>false</td>
4710 </tr>
4711 <tr>
4712 <td>z_min</td>
4713 <td>Restrict z axis, minimum value, false to disable lower restriction</td>
4714 <td>false</td>
4715 </tr>
4716 <tr>
4717 <td>z_max</td>
4718 <td>Restrict z axis, maximum value, false to disable upper restriction</td>
4719 <td>false</td>
4720 </tr>
4721 <tr>
4722 <td>min_size</td>
4723 <td>Minimum size for drawing a handle.</td>
4724 <td>24</td>
4725 </tr>
4726 <tr>
4727 <td>margin</td>
4728 <td>Space between labels and handle/image borders</td>
4729 <td>3</td>
4730 </tr>
4731 <tr>
4732 <td>z_handle</td>
4733 <td>Draw a tiny handle for manipulating the z axis. z_handle has the following
4734 values:
4735 <ul>
4736 <li>_TOOLKIT_TOP_LEFT</li>
4737 <li>_TOOLKIT_TOP</li>
4738 <li>_TOOLKIT_TOP_RIGHT</li>
4739 <li>_TOOLKIT_LEFT</li>
4740 <li>_TOOLKIT_RIGHT</li>
4741 <li>_TOOLKIT_BOTTOM_LEFT</li>
4742 <li>_TOOLKIT_BOTTOM</li>
4743 <li>_TOOLKIT_BOTTOM_RIGHT</li>
4744 </ul>
4745 </td>
4746 <td>false</td>
4747 </tr>
4748 <tr>
4749 <td>z_handle_size</td>
4750 <td>Size in pixels for the z handle</td>
4751 <td>6</td>
4752 </tr>
4753 <tr>
4754 <td>z_handle_centered</td>
4755 <td>If the z handle is centered (top, rifght, bottom, left) set it to this size;
4756 Values &gt; 1 are interpreted as pixels, values &lt; 1 declare a percentual value of the main handles width/height
4757 </td>
4758 <td>true</td>
4759 </tr>
4760 <tr>
4761 <td>min_drag</td>
4762 <td>Distance in pixels before dragging starts</td>
4763 <td>0</td>
4764 </tr>
4765 <tr>
4766 <td>show_axis</td>
4767 <td>Show a second (_TOOLKIT_LINE_* or _TOOLKIT_BLOCK_*) or both axis (_TOOLKIT_CIRCULAR) while dragging</td>
4768 <td>false</td>
4769 </tr>
4770 </table>
4772 <table class="modules collapse" title="⚛ Modules">
4773 <tr><th>Module</th><th>Description</th></tr>
4774 <tr>
4775 <td>responsehandle.range_x</td>
4776 <td>The instance of the <a href="#range">Range</a> module for the x axis.</td>
4777 </tr>
4778 <tr>
4779 <td>responsehandle.range_y</td>
4780 <td>The instance of the <a href="#range">Range</a> module for the y axis.</td>
4781 </tr>
4782 <tr>
4783 <td>responsehandle.range_z</td>
4784 <td>The instance of the <a href="#range">Range</a> module for the y axis.</td>
4785 </tr>
4786 </table>
4788 <table class="domelements collapse" title="⛁ DOM-Elements">
4789 <tr><th>Element (class)</th><th>Description</th></tr>
4790 <tr>
4791 <td>responsehandle.element ("g.toolkit-response-handle") <i class="delegated"></i> <i class="classified"></i> <i class="stylized"></i></td>
4792 <td>The SVG group element containing all other elements. It may have additional
4793 classes added depending on the state of the handle:
4794 <ul>
4795 <li>.toolkit-active - if the handle is about to change an axis</li>
4796 <li>.toolkit-inactive - when the option "active" is set to false</li>
4797 <li>.toolkit-warn - when a maximum of the z axis is reached</li>
4798 </ul>
4799 It may have additional
4800 classes added depending on the mode of the handle:
4801 <ul>
4802 <li>.toolkit-circular</li>
4803 <li>.toolkit-line.toolkit-line-vertical</li>
4804 <li>.toolkit-line.toolkit-line-horizontal</li>
4805 <li>.toolkit-block.toolkit-block-top</li>
4806 <li>.toolkit-block.toolkit-block-right</li>
4807 <li>.toolkit-block.toolkit-block-bottom</li>
4808 <li>.toolkit-block.toolkit-block-left</li>
4809 </ul>
4810 </td>
4811 </tr>
4812 <tr>
4813 <td>responsehandle._label ("text.toolkit-label")</td>
4814 <td>The SVG text element containing different tspans for each line.</td>
4815 </tr>
4816 <tr>
4817 <td>responsehandle._handle ("[circle/rect].toolkit-handle")</td>
4818 <td>The main SVG handle element.</td>
4819 </tr>
4820 <tr>
4821 <td>responsehandle._line1 ("path.toolkit-line.toolkit-line-1")</td>
4822 <td>One of two lines for design/pointing purposes</td>
4823 </tr>
4824 <tr>
4825 <td>responsehandle._line2 ("path.toolkit-line.toolkit-line-2")</td>
4826 <td>One of two lines for design/pointing purposes</td>
4827 </tr>
4828 </table>
4830 <table class="events collapse" title="⚑ Events">
4831 <tr><th>Event</th><th>Description</th></tr>
4832 <tr>
4833 <td>handlegrabbed</td>
4834 <td>Is fired when a ResponseHandle was clicked.
4835 Hands over an object containing the values and coordinates and
4836 the ResponseHandle instance.</td>
4837 </tr>
4838 <tr>
4839 <td>handlereleased</td>
4840 <td>Is fired when a ResponseHandle was released.
4841 Hands over an object containing the values and coordinates and
4842 the ResponseHandle instance.</td>
4843 </tr>
4844 <tr>
4845 <td>handledragging</td>
4846 <td>Is fired when a ResponseHandle is dragged.
4847 Hands over an object containing the values and coordinates and
4848 the ResponseHandle instance.</td>
4849 </tr>
4850 <tr>
4851 <td>zchangestarted</td>
4852 <td>Is fired when a ResponseHandles z axis starts to change.
4853 Hands over the z value and the ResponseHandle instance.</td>
4854 </tr>
4855 <tr>
4856 <td>zchanged</td>
4857 <td>Is fired when a ResponseHandles z axis was changed.
4858 Hands over the new z value and the ResponseHandle instance.</td>
4859 </tr>
4860 <tr>
4861 <td>zchangeended</td>
4862 <td>Is fired when a ResponseHandles z axis change has ended.
4863 Hands over the new z value and the ResponseHandle instance.</td>
4864 </tr>
4865 </table>
4867 </li>
4869 <li id="Scale" class="module">
4870 <!-- ########################################################### -->
4871 <!-- SCALE MODULE -->
4872 <!-- ########################################################### -->
4874 <p class="description">
4875 <strong>Scale</strong> can be used to draw dots and labels as markers next to a meter,
4876 a fader or a frequency response graph. Depending on some parameters
4877 it tries to decide on its own where to draw labels and dots depending
4878 on the available space and the scale. Scales can be drawn vertically
4879 and horizontally. Scale implements <a href="#ranges">Ranges</a> and extends <a href="#widget">Widget</a>.
4880 </p>
4881 <p class="description">
4882 Use scales.left, scales.right, scales.top and scales.bottom to play with the examples in a terminal:
4883 <a href="javascript:scales.left.set('gap_labels', 20)">scales.left.set("gap_labels", 20)</a>
4884 <small>(doubles the amount of drawn labels in the vertical scale on the left)</small>
4885 </p>
4887 <style type="text/css">
4888 #sc_scale_h_t {
4889 margin-left: 90px;
4891 #sc_scale_h_t .toolkit-scale {
4894 #sc_scale_h_b {
4895 margin-left: 90px;
4896 margin-top: 185px;
4898 #sc_scale_h_b .toolkit-scale {
4901 #sc_scale_v_l {
4902 height: 200px;
4903 float: left;
4905 #sc_scale_v_l .toolkit-scale {
4908 #sc_scale_v_r {
4909 height: 200px;
4910 float: right;
4912 #sc_scale_v_r .toolkit-scale {
4915 #sc_scale {
4917 </style>
4919 <div class="showcase" style="">
4920 <div id="sc_scale">
4922 </div>
4923 </div>
4925 <div class="buttons"></div>
4927 <table class="options collapse" title="⚙ Options">
4928 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
4929 <tr>
4930 <td>layout <i class="static"></i></td>
4931 <td>Layout of the widget.
4932 <ul>
4933 <li>_TOOLKIT_LEFT: vertical, bar on the left</li>
4934 <li>_TOOLKIT_RIGHT: vertical, bar on the right</li>
4935 <li>_TOOLKIT_TOP: horizontal, bar on top</li>
4936 <li>_TOOLKIT_BOTTOM: horizontal, bar on bottom</li>
4937 </ul>
4938 </td>
4939 <td>_TOOLKIT_LEFT</td>
4940 </tr>
4941 <tr>
4942 <td>division</td>
4943 <td>Minimum step size (as value) between labels or dots.</td>
4944 <td>1</td>
4945 </tr>
4946 <tr>
4947 <td>levels</td>
4948 <td>Array consisting of the multipliers labels and dots can be drawn.
4949 E.g. a division of 5 and levels of [1, 2, 5] would draw labels at 5, 10 or 25, 50, 75 ...
4950 (but not 30 or 80) depending on the available space. Dots are drawn one level lower between the
4951 labels (if there's enough space). The highest level can be drawn at real number multiplicators,
4952 too, lower levels are only possible at the exact division.
4953 </td>
4954 <td>[1]</td>
4955 </tr>
4956 <tr>
4957 <td>base</td>
4958 <td>The base value where drawing of labels and dots starts. Every drawing position
4959 is compared to the base position. E.g. a base of 12 and a division of 10 would draw
4960 labels at -10, 2, 12, 24, ... false sets the base to the min value.</td>
4961 <td>false</td>
4962 </tr>
4963 <tr>
4964 <td>labels</td>
4965 <td>A function to format the labels before they are drawn. Receives the actual value
4966 and is supposed to return a string.</td>
4967 <td>function (val) { return val.toFixed(2); }</td>
4968 </tr>
4969 <tr>
4970 <td>gap_dots</td>
4971 <td>Minimum gap (in pixels) between dots.</td>
4972 <td>4</td>
4973 </tr>
4974 <tr>
4975 <td>gap_labels</td>
4976 <td>Minimum gap (in pixels) between labels.</td>
4977 <td>40</td>
4978 </tr>
4979 <tr>
4980 <td>show_labels</td>
4981 <td>Draw labels</td>
4982 <td>true</td>
4983 </tr>
4984 <tr>
4985 <td>show_min</td>
4986 <td>Draw a label for minimum value</td>
4987 <td>true</td>
4988 </tr>
4989 <tr>
4990 <td>show_max</td>
4991 <td>Draw a label for maximum value</td>
4992 <td>true</td>
4993 </tr>
4994 <tr>
4995 <td>show_base</td>
4996 <td>Draw a label for base value</td>
4997 <td>true</td>
4998 </tr>
4999 </table>
5001 <table class="methods collapse" title="⚒ Methods">
5002 <tr><th>Method</th><th>Description</th></tr>
5003 <tr>
5004 <td>draw_dot(value, class)</td>
5005 <td>Draw a dot at a certain value. Add a CSS class if needed.</td>
5006 </tr>
5007 <tr>
5008 <td>draw_label(value, class)</td>
5009 <td>Draw a label at a certain value. Add a CSS class if needed.</td>
5010 </tr>
5011 </table>
5013 <table class="domelements collapse" title="⛁ DOM-Elements">
5014 <tr><th>Element (class)</th><th>Description</th></tr>
5015 <tr>
5016 <td>scale.element ("div.toolkit-scale") <i class="delegated"></i> <i class="classified"></i> <i class="stylized"></i></td>
5017 <td>The base element of the widget. It contains the dots and labels.</td>
5018 </tr>
5019 <tr>
5020 <td>[dots] ("div.toolkit-dot")</td>
5021 <td>Dots are absolutely positioned divs. They can have different additional
5022 CSS classes depending on their position. These classes are:
5023 <ul>
5024 <li>".toolkit-marker" - The dot belongs to a label</li>
5025 <li>".toolkit-min" - the dot is drawn on the min value</li>
5026 <li>".toolkit-max" - the dot is drawn on the max value</li>
5027 <li>".toolkit-base" - the dot is drawn on the base value</li>
5028 </ul>
5029 </td>
5030 </tr>
5031 <tr>
5032 <td>[labels] ("span.toolkit-label")</td>
5033 <td>Labels are absolute positioned spans containing text. They can have the same
5034 additional classes as dots (except ".toolkit-marker").</td>
5035 </tr>
5036 </table>
5038 <table class="events collapse" title="⚑ Events">
5039 <tr><th>Event</th><th>Description</th></tr>
5040 <tr>
5041 <td>scalechanged</td>
5042 <td>The scale has changed. Hands over the key, the new label and the widget instance.</td>
5043 </tr>
5044 </table>
5046 </li>
5048 <li id="ScrollValue" class="module">
5049 <!-- ########################################################### -->
5050 <!-- SCROLL VALUE MODULE -->
5051 <!-- ########################################################### -->
5053 <p class="description">
5054 <strong>ScrollValue</strong> enables the mouse wheel on an element for setting a value.
5055 ScrollValue is used e.g. in <a href="#knob">Knob</a> for
5056 setting its value. ScrollValue extends <a href="#widget">Widget</a> and implements
5057 <a href="#globalcursor">GlobalCursor</a>.
5058 </p>
5060 <div class="buttons"></div>
5062 <table class="options collapse" title="⚙ Options">
5063 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
5064 <tr>
5065 <td>element</td>
5066 <td>The element receiving the scroll event.</td>
5067 <td>false</td>
5068 </tr>
5069 <tr>
5070 <td>range</td>
5071 <td>A callback function returning the range instance for calculating the drag parameters.</td>
5072 <td>function () { return {}; }</td>
5073 </tr>
5074 <tr>
5075 <td>events</td>
5076 <td>A function returning the element firing the scroll event. Set to false to use the main element.</td>
5077 <td>false</td>
5078 </tr>
5079 <tr>
5080 <td>classes</td>
5081 <td>The element receiving CSS-classes. Set to false to use the main element.</td>
5082 <td>false</td>
5083 </tr>
5084 <tr>
5085 <td>get</td>
5086 <td>A callback function returning the actual value.</td>
5087 <td>false</td>
5088 </tr>
5089 <tr>
5090 <td>set</td>
5091 <td>A callback function for setting the value.</td>
5092 <td>false</td>
5093 </tr>
5094 <tr>
5095 <td>active</td>
5096 <td>Deactivate the scrolling.</td>
5097 <td>true</td>
5098 </tr>
5099 </table>
5101 <table class="events collapse" title="⚑ Events">
5102 <tr><th>Event</th><th>Description</th></tr>
5103 <tr>
5104 <td>scrollstarted</td>
5105 <td>This event is fired when scrolling starts. It gets fired by mousewheel
5106 ScrollValue instance (handing over the ScrollValue instance and the mousedown event)
5107 and by the element set via "events" option (handing over
5108 the mousewheel event, the actual value, the element receiving the drag,
5109 the ScrollValue instance and the range instance).</td>
5110 </tr>
5111 <tr>
5112 <td>scrolling</td>
5113 <td>This event is fired when scrolling occurs. It gets fired by the
5114 ScrollValue instance (handing over the ScrollValue instance and the mousewheel event)
5115 and by the element set via "events" option (handing over
5116 the mousewheel event, the actual value, the element receiving the drag,
5117 the ScrollValue instance and the range instance).</td>
5118 </tr>
5119 <tr>
5120 <td>scrollended</td>
5121 <td>This event is fired when scrolling ends. It gets fired by the
5122 ScrollValue instance (handing over the ScrollValue instance and the mousewheel event)
5123 and by the element set via "events" option (handing over
5124 the mousewheel event, the actual value, the element receiving the drag,
5125 the ScrollValue instance and the range instance).</td>
5126 </tr>
5127 </table>
5128 </li>
5142 <li class="box class"><a name="implements"></a><h1>Implements</h1>
5143 <p><strong>Implements</strong> enhance the functionality of
5144 <a href="#widgets">Widgets</a> or <a href="#modules">Modules</a>. Implementing
5145 them gives a widget or module some more functions to do <a href="#audiomath">calculations</a> or
5146 create special effects like a <a href="#gradient">gradient</a>.
5147 </li>
5160 <li id="Anchor" class="implement">
5161 <!-- ########################################################### -->
5162 <!-- ANCHOR IMPLEMENT -->
5163 <!-- ########################################################### -->
5165 <p class="description">
5166 <strong>Anchor</strong> adds a single function to an object to calculate
5167 a real position according to x, y, width and height of an element and a
5168 given gravity like _TOOLKIT_BOTTOM_RIGHT.
5169 Anchor is used e.g. in <a href="#window">Window</a> or <a href="#keyboard">Keyboard</a>.
5170 </p>
5172 <div class="buttons"></div>
5174 <table class="methods collapse" title="⚒ Methods">
5175 <tr><th>Method</th><th>Description</th></tr>
5176 <tr>
5177 <td>translate_anchor(anchor, x, y, width, height)</td>
5178 <td>Translates an anchor to a real position.
5179 anchor can be one out of:
5180 <ul>
5181 <li>_TOOLKIT_TOP_LEFT</li>
5182 <li>_TOOLKIT_TOP</li>
5183 <li>_TOOLKIT_TOP_RIGHT</li>
5184 <li>_TOOLKIT_LEFT</li>
5185 <li>_TOOLKIT_CENTER</li>
5186 <li>_TOOLKIT_RIGHT</li>
5187 <li>_TOOLKIT_BOTTOM_LEFT</li>
5188 <li>_TOOLKIT_BOTTOM</li>
5189 <li>_TOOLKIT_BOTTOM_RIGHT</li>
5190 </ul>
5191 x, y, width and height are the coordinates of the
5192 widget for which the position is calculated.<br/><br/>
5193 Returns: {x: n, y: n}
5194 </td>
5195 </tr>
5196 </table>
5197 </li>
5199 <li id="AudioMath" class="implement">
5200 <!-- ########################################################### -->
5201 <!-- AUDIO MATH IMPLEMENT -->
5202 <!-- ########################################################### -->
5204 <p class="description">
5205 <strong>AudioMath</strong> provides a couple of functions for turning linear values into
5206 logarithmic ones and vice versa. If you need an easy convertion between
5207 dB or Hz and a linear scale implement this class.
5208 </p>
5210 <div class="buttons"></div>
5212 <table class="methods collapse" title="⚒ Methods">
5213 <tr><th>Method</th><th>Description</th></tr>
5214 <tr><td>db2coef(value, min, max)</td><td>
5215 <ul><li>value: dB as float (1 = 0dB)</li>
5216 <li>min: minimum dB already sent through log2</li>
5217 <li>max: maximum dB already sent through log2</li></ul></td></tr>
5218 <tr><td>coef2db(coef, min, max)</td><td>
5219 <ul><li>coef: coefficient</li>
5220 <li>min: minimum dB already sent through log2</li>
5221 <li>max: maximum dB already sent through log2</li></ul></td></tr>
5222 <tr><td>db2scale(value, min, max, scale)</td><td>
5223 <ul><li>value: dB as float (1 = 0dB)</li>
5224 <li>min: minimum dB already sent through log2</li>
5225 <li>max: maximum dB already sent through log2</li>
5226 <li>scale: the size of the scale</li></ul></td></tr>
5227 <tr><td>scale2db(value, min, max, scale)</td><td>
5228 <ul><li>value: position in the scale</li>
5229 <li>min: minimum dB already sent through log2</li>
5230 <li>max: maximum dB already sent through log2</li>
5231 <li>scale: the size of the scale</li></ul></td></tr>
5232 <tr><td>freq2coef(value, min, max)</td><td>
5233 <ul><li>value: frequency as float</li>
5234 <li>min: minimum freq already sent through log10</li>
5235 <li>max: maximum freq already sent through log10</li></ul></td></tr>
5236 <tr><td>coef2freq(coef, min, max)</td><td>
5237 <ul><li>coef: coefficient</li>
5238 <li>min: minimum freq already sent through log10</li>
5239 <li>max: maximum freq already sent through log10</li></ul></td></tr>
5240 <tr><td>freq2scale(value, min, max, scale)</td><td>
5241 <ul><li>value: freq as float</li>
5242 <li>min: minimum freq already sent through log10</li>
5243 <li>max: maximum freq already sent through log10</li>
5244 <li>scale: the size of the scale</li></ul></td></tr>
5245 <tr><td>scale2freq(value, min, max, scale)</td><td>
5246 <ul><li>value: position in the scale</li>
5247 <li>min: minimum freq already sent through log10</li>
5248 <li>max: maximum freq already sent through log10</li>
5249 <li>scale: the size of the scale</li></ul></td></tr>
5250 </table>
5251 </li>
5253 <li id="GlobalCursor" class="implement">
5254 <!-- ########################################################### -->
5255 <!-- GLOBAL CURSOR IMPLEMENT -->
5256 <!-- ########################################################### -->
5258 <p class="description">
5259 <strong>GlobalCursor</strong> adds global cursor classes to enshure the
5260 exclusive use of one of the standard cursors (http://www.echoecho.com/csscursors.htm) in
5261 the whole application. Global Cursor implements
5262 <a target="_blank" href="http://mootools.net/docs/core/Class/Class.Extras#Events">Events</a>.
5263 GlobalCursor is used e.g. in <a href="#responsehandle">ResponseHandle</a> or <a href="#dragvalue">DragValue</a>.
5264 </p>
5266 <div class="buttons"></div>
5268 <table class="methods collapse" title="⚒ Methods">
5269 <tr><th>Method</th><th>Description</th></tr>
5270 <tr>
5271 <td>global_cursor(cursor)</td>
5272 <td>Sets the global cursor. Can be one out of:<br/><br/>
5273 auto | crosshair | default | pointer | move | e-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize | text | wait | help | progress | not-allowed | no-drop | vertical-text | all-scroll | col-resize | row-resize
5274 </td>
5275 </tr>
5276 <tr>
5277 <td>remove_cursor(cursor)</td>
5278 <td>Removes the global cursor. Can be one out of:<br/><br/>
5279 auto | crosshair | default | pointer | move | e-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize | text | wait | help | progress | not-allowed | no-drop | vertical-text | all-scroll | col-resize | row-resize
5280 </td>
5281 </tr>
5282 </table>
5284 <table class="events collapse" title="⚑ Events">
5285 <tr><th>Event</th><th>Description</th></tr>
5286 <tr>
5287 <td>globalcursor</td>
5288 <td>Is fired when a global cursor was set. Hands over the cursor.</td>
5289 </tr>
5290 <tr>
5291 <td>cursorremoved</td>
5292 <td>Is fired when a global cursor was removed. Hands over the cursor.</td>
5293 </tr>
5294 </table>
5296 </li>
5298 <li id="Gradient" class="implement">
5299 <!-- ########################################################### -->
5300 <!-- GRADIENT IMPLEMENT -->
5301 <!-- ########################################################### -->
5303 <p class="description">
5304 <strong>Gradient</strong> Gradient provides a function to set the background of a DOM element to a
5305 CSS gradient according on the users browser and version. Gradient
5306 implements <a href="#ranged">Ranged</a>.
5307 </p>
5309 <div class="buttons"></div>
5311 <table class="options collapse" title="⚙ Options">
5312 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
5313 <tr>
5314 <td>gradient</td>
5315 <td>Gradient for the background.
5316 Keys are ints or floats as string
5317 corresponding to the chosen scale.
5318 Values are valid CSS color strings
5319 like #ff8000 or rgb(0,56,103)</td>
5320 <td>false</td>
5321 </tr>
5322 <tr>
5323 <td>background</td>
5324 <td>Background if no gradient is set.</td>
5325 <td>"#000000"</td>
5326 </tr>
5327 </table>
5329 <table class="methods collapse" title="⚒ Methods">
5330 <tr><th>Method</th><th>Description</th></tr>
5331 <tr>
5332 <td>draw_gradient(element, grad, fallback)</td>
5333 <td>This function generates a string from a given gradient object to set
5334 as a CSS background for a DOM element. If element is given, the function
5335 automatically sets the background. If grad is omitted, the
5336 gradient is taken from options. Fallback is used if no gradient
5337 can be created. If fallback is omitted, options.background is used.
5338 if no range is set Gradient assumes that the implementing instance
5339 has Range functionality.</td>
5340 </tr>
5341 </table>
5343 <table class="events collapse" title="⚑ Events">
5344 <tr><th>Event</th><th>Description</th></tr>
5345 <tr>
5346 <td>backgroundchanged</td>
5347 <td>Is fired when any background was set on an element. Hands over
5348 the element, the background string and the firing widget</td>
5349 </tr>
5350 </table>
5352 </li>
5354 <li id="Ranged" class="implement" rel="audiomath">
5355 <!-- ########################################################### -->
5356 <!-- RANGED IMPLEMENT -->
5357 <!-- ########################################################### -->
5359 <p class="description">
5360 <strong>Ranged</strong> provides functions for calculating linear scales from different values.
5361 Ranged is useful to build coordinate systems, calculating pixel positions
5362 for different scale types and the like. Ranged is used e.g. in Scale,
5363 MeterBase and Graph to draw elements on a certain position according to
5364 a value on an arbitrary scale. Ranged implements <a href="#audiomath">AudioMath</a>.
5365 </p>
5367 <div class="buttons"></div>
5369 <table class="options collapse" title="⚙ Options">
5370 <tr><th>Option</th><th>Description</th><th>Default</th></tr>
5371 <tr><td>scale</td>
5372 <td>What kind of value are we having?
5373 <ul>
5374 <li>_TOOLKIT_LINEAR</li>
5375 <li>_TOOLKIT_DECIBEL / _TOOLKIT_LOG2</li>
5376 <li>_TOOLKIT_FREQUENCY / _TOOLKIT_LOG10</li>
5377 <li>function (value, options, coef) {}</li>
5378 </ul>
5379 If a function instead of a constant
5380 is handed over, it receives the
5381 actual options object as the second
5382 argument and is supposed to return a
5383 coefficient between 0 and 1. If the
5384 third argument "coef" is true, it is
5385 supposed to return a value depending
5386 on a coefficient handed over as the
5387 first argument.</td>
5388 <td>_TOOLKIT_LINEAR</td></tr>
5389 <tr><td>reverse</td>
5390 <td>true if the range is reversed</td>
5391 <td>false</td></tr>
5392 <tr><td>basis</td>
5393 <td>Dimensions of the range, set to
5394 width/height in pixels, if you need
5395 it for drawing purposes, to 100 if
5396 you need percentual values or to 1
5397 if you just need a linear
5398 coefficient for a e.g. logarithmic
5399 scale.</td>
5400 <td>0</td></tr>
5401 <tr><td>min</td>
5402 <td>Minimum value of the range</td>
5403 <td>0</td></tr>
5404 <tr><td>max</td>
5405 <td>Maximum value of the range</td>
5406 <td>0</td></tr>
5407 <tr><td>step</td>
5408 <td>Step size, needed for e.g. user
5409 interaction</td>
5410 <td>0</td></tr>
5411 <tr><td>shift_up</td>
5412 <td>Multiplier for e.g. SHIFT pressed
5413 while stepping</td>
5414 <td>4</td></tr>
5415 <tr><td>shift_down</td>
5416 <td>Multiplier for e.g. SHIFT + CONTROL
5417 pressed while stepping</td>
5418 <td>0.25</td></tr>
5419 <tr><td>snap</td>
5420 <td>Snap the value to a virtual grid
5421 with this distance
5422 Using snap option with float values
5423 causes the range to reduce its
5424 minimum and maximum values depending
5425 on the amount of decimal digits
5426 because of the implementation of
5427 math in JavaScript.
5428 Using a step size of e.g. 1.125
5429 reduces the maximum usable value
5430 from 9,007,199,254,740,992 to
5431 9,007,199,254,740.992 (note the
5432 decimal point)</td>
5433 <td>0</td></tr>
5434 <tr><td>round</td>
5435 <td>If snap is set decide how to jump
5436 between snaps. Setting this to true
5437 slips to the next snap if the value
5438 is more than on its half way to it.
5439 Otherwise the value has to reach the
5440 next snap until it is hold there
5441 again.</td>
5442 <td>false</td></tr>
5443 <tr><td>log_factor</td>
5444 <td>The factor is used to stretch the
5445 used range of the logarithmic curve</td>
5446 <td>false</td></tr>
5447 </table>
5449 <table class="methods collapse" title="⚒ Methods">
5450 <tr><th>Method</th><th>Description</th></tr>
5451 <tr><td>val2real(n, nosnap)</td>
5452 <td>Calculates "real world" values (positions, coefficients, ...)
5453 depending on options.basis</td></tr>
5454 <tr><td>real2val(n, nosnap)</td>
5455 <td>Returns a point on the scale for the "real world" value (positions,
5456 coefficients, ...) based on options.basis</td></tr>
5457 <tr><td>val2px(n, nosnap)</td>
5458 <td>Just a wrapper for having understandable code and backward
5459 compatibility</td></tr>
5460 <tr><td>px2val(n, nosnap)</td>
5461 <td>Just a wrapper for having understandable code and backward
5462 compatibility</td></tr>
5463 <tr><td>val2coef(n, nosnap)</td><td>Calculates a coefficient for the value</td></tr>
5464 <tr><td>coef2val(n, nosnap)</td><td>Calculates a value from a coefficient</td></tr>
5465 <tr><td>val2perc(n, nosnap)</td><td>Calculates percents on the scale from a value</td></tr>
5466 <tr><td>perc2val(n, nosnap)</td><td>Calculates a value from percents of the scale</td></tr>
5467 <tr><td>val2based(value, basis, nosnap)</td>
5468 <td>Takes a value and returns the corresponding point on the scale
5469 according to basis</td></tr>
5470 <tr><td>based2val(coef, basis, nosnap)</td>
5471 <td>Takes a point on the scale according to basis and returns the
5472 corresponding value</td></tr>
5473 <tr><td>snap_value(value)</td>
5474 <td>If snapping is enabled, snaps the value to the grid.
5475 Returns the snapped value.</td></tr>
5476 </table>
5478 </li>
5480 <li id="Ranges" class="implement">
5481 <!-- ########################################################### -->
5482 <!-- RANGES IMPLEMENT -->
5483 <!-- ########################################################### -->
5485 <p class="description">
5486 <strong>Ranges</strong> provides a function for adding different ranges to a widget for
5487 building coordinate systems and the like. Ranges implements
5488 <a target="_blank" href="http://mootools.net/docs/core/Class/Class.Extras#Events">Events</a>
5489 and uses <a href="#range">Range</a>.
5490 </p>
5492 <div class="buttons"></div>
5494 <table class="methods collapse" title="⚒ Methods">
5495 <tr><th>Method</th><th>Description</th></tr>
5496 <tr><td>add_range(from, name)</t><td>Add a range. From is a function returning a Range instance or an
5497 object containing options for a new Range. If name is set, the range
5498 is added to the main instance and a set function is created.<br />
5499 this.set([name], {basis: 250, min: 0}); results in:<br />
5500 this[name].set("basis", 250);<br />
5501 this[name].set("min", 0);<br />
5502 If name is set and this.options[name] exists, is an object and from
5503 is an object, too, both are merged before a range is created.
5504 Returns the range.</td></tr>
5505 </table>
5507 <table class="events collapse" title="⚑ Events">
5508 <tr><th>Event</th><th>Description</th></tr>
5509 <tr>
5510 <td>rangeadded</td>
5511 <td>Is fired when a new <a href="#range">Range</a> was created. Hands over
5512 the new Range and the widget instance.</td>
5513 </tr>
5514 </table>
5516 </li>
5518 <li id="Tooltip" class="implement">
5519 <!-- ########################################################### -->
5520 <!-- TOOLTIP IMPLEMENT -->
5521 <!-- ########################################################### -->
5523 <p class="description">
5524 <strong>Tooltip</strong> adds a tooltip list to a widget. Tooltip
5525 lists follow the mouse pointer throughout the document and auto-show
5526 and auto-hide automatically according to the amount of single tooltips.
5527 </p>
5529 <div class="buttons"></div>
5531 <table class="methods collapse" title="⚒ Methods">
5532 <tr><th>Method</th><th>Description</th></tr>
5533 <tr>
5534 <td>tooltip(content, tooltip)</td>
5535 <td>Shows, updates and removes a tooltip.
5536 <ul>
5537 <li>If tooltip is undefined, a new tooltip is generated.</li>
5538 <li>If content is false, the tooltip is removed.</li>
5539 <li>If content and tooltip is set, the tooltip is updated.</li>
5540 </ul>
5541 Returns the tooltip.
5542 <br/><br/>
5543 Content can be a string interpreted as HTML or a DOM element.
5544 </td>
5545 </tr>
5546 </table>
5548 <table class="domelements collapse" title="⛁ DOM-Elements">
5549 <tr><th>Element (class)</th><th>Description</th></tr>
5550 <tr>
5551 <td>widget._tooltip ("div.toolkit-tooltip")</td>
5552 <td>The UL element containing all single tooltips.</td>
5553 </tr>
5554 </table>
5556 <table class="events collapse" title="⚑ Events">
5557 <tr><th>Event</th><th>Description</th></tr>
5558 <tr>
5559 <td>tooltipremoved</td>
5560 <td>Is fired when a single tooltip was removed,
5561 hands over the tooltip and the firing widget.</td>
5562 </tr>
5563 <tr>
5564 <td>tooltipadded</td>
5565 <td>Is fired when a single tooltip was removed,
5566 hands over the empty tooltip, the content and the firing widget.</td>
5567 </tr>
5568 <tr>
5569 <td>tooltipset</td>
5570 <td>Is fired when a single tooltip was set,
5571 hands over the tooltip and the firing widget.</td>
5572 </tr>
5573 <tr>
5574 <td>tooltipshow</td>
5575 <td>Is fired when the tooltips where shown,
5576 hands over the firing widget.</td>
5577 </tr>
5578 <tr>
5579 <td>tooltiphide</td>
5580 <td>Is fired when the tooltips where hidden,
5581 hands over the firing widget.</td>
5582 </tr>
5583 </table>
5584 </li>
5586 <li id="Warning" class="implement">
5587 <!-- ########################################################### -->
5588 <!-- WARNING IMPLEMENT -->
5589 <!-- ########################################################### -->
5591 <p class="description">
5592 <strong>Warning</strong> sets a timed class "toolkit-warn" on an element. It is
5593 used e.g. in <a href="#responsehandle">ResponseHandle</a> or <a href="dragvalue">DragValue</a> when the value exceeds the
5594 range. Warning implements
5595 <a target="_blank" href="http://mootools.net/docs/core/Class/Class.Extras#Events">Events</a>.
5596 </p>
5598 <div class="buttons"></div>
5600 <table class="methods collapse" title="⚒ Methods">
5601 <tr><th>Method</th><th>Description</th></tr>
5602 <tr><td>warning(element, timeout)</td>
5603 <td>Sets the class "toolkit-warn" on the given element enad keeps it for the
5604 amount of milliseconds in timeout. Timeout defaults to 250.
5605 </td></tr>
5606 </table>
5608 <table class="events collapse" title="⚑ Events">
5609 <tr><th>Event</th><th>Description</th></tr>
5610 <tr>
5611 <td>warning</td>
5612 <td>Is fired when a warning is requested.
5613 Hands over the widget instance.</td>
5614 </tr>
5615 </table>
5617 </li>
5619 </ul>
5620 </body>
5621 </html>