root/trunk/luigi/doc/gui.html

Revision 36, 27.8 kB (checked in by baxissimo, 2 years ago)

First cut at docs using Candydoc.

Line 
1 <html><head>
2 <meta http-equiv="content-type" content="text/html; charset=utf-8">
3 <meta content="text/javascript" http-equiv="content-script-type">
4 <title>luigi.gui</title>
5 <link rel="stylesheet" type="text/css" href="candydoc/style.css">
6 <!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="candydoc/ie56hack.css"><![endif]-->
7 <script language="JavaScript" src="candydoc/util.js" type="text/javascript"></script>
8 <script language="JavaScript" src="candydoc/tree.js" type="text/javascript"></script>
9 <script language="JavaScript" src="candydoc/explorer.js" type="text/javascript"></script>
10 </head><body>
11 <div id="tabarea"></div><div id="explorerclient"></div>
12 <div id="content"><script>explorer.initialize("luigi.gui");</script>
13     <table class="content">
14         <tr><td id="docbody"><h1>luigi.gui</h1><!-- Generated by Ddoc from gui.d -->
15 Luigi is an OpenGL based GUI library.
16 <br><br>
17 The goal is to provide a simple but flexible way to add a simple
18    GUI to an OpenGL program.
19 <br><br>
20
21    Luigi supports themes and input adaptors.  Themes give you a way
22    to customize the look of GUI.  Input adaptors do the work of
23    taking events from the OS or from a windowing toolkit like GLD, and
24    turning them into something Luigi can use.
25 <br><br>
26
27
28 <script>explorer.outline.incSymbolLevel();</script>
29 <dl>
30 <script>explorer.outline.writeEnabled = true;</script>
31 <dt><span class="decl">class
32 <span class="currsymbol">Luigi</span>
33 <script>explorer.outline.addDecl('Luigi');</script>
34
35 ;
36 </span></dt>
37 <script>explorer.outline.writeEnabled = false;</script>
38
39
40 <dd>The singleton master object.
41  Holds GUI globals including the theme, the input adapter, and keeps track
42  of all the top-level Frames and Overlays.
43 <br><br>
44
45
46 <script>explorer.outline.incSymbolLevel();</script>
47 <dl>
48 <script>explorer.outline.writeEnabled = true;</script>
49 <dt><span class="decl">static Luigi
50 <span class="currsymbol">opCall</span>
51 <script>explorer.outline.addDecl('opCall');</script>
52
53 ();
54 </span></dt>
55 <script>explorer.outline.writeEnabled = false;</script>
56
57
58 <dd>Return the singleton instance
59 <br><br>
60
61 </dd>
62
63 <script>explorer.outline.writeEnabled = true;</script>
64 <dt><span class="decl">static Luigi
65 <span class="currsymbol">inst</span>
66 <script>explorer.outline.addDecl('inst');</script>
67
68 ();
69 </span></dt>
70 <script>explorer.outline.writeEnabled = false;</script>
71
72
73 <dd>Return the singleton instance
74 <br><br>
75
76 </dd>
77
78 <script>explorer.outline.writeEnabled = true;</script>
79 <dt><span class="decl">Theme
80 <span class="currsymbol">theme</span>
81 <script>explorer.outline.addDecl('theme');</script>
82
83 (Theme <span class="funcparam">th</span>);
84 </span></dt>
85 <script>explorer.outline.writeEnabled = false;</script>
86
87
88 <dd>Set the
89 <span class="currsymbol">theme</span>
90 <script>explorer.outline.addDecl('theme');</script>
91
92
93 <br><br>
94
95 </dd>
96
97 <script>explorer.outline.writeEnabled = true;</script>
98 <dt><span class="decl">Theme
99 <span class="currsymbol">theme</span>
100 <script>explorer.outline.addDecl('theme');</script>
101
102 ();
103 </span></dt>
104 <script>explorer.outline.writeEnabled = false;</script>
105
106
107 <dd>Get the current
108 <span class="currsymbol">theme</span>
109 <script>explorer.outline.addDecl('theme');</script>
110
111
112 <br><br>
113
114 </dd>
115
116 <script>explorer.outline.writeEnabled = true;</script>
117 <dt><span class="decl">void
118 <span class="currsymbol">add_overlay</span>
119 <script>explorer.outline.addDecl('add_overlay');</script>
120
121 (Overlay <span class="funcparam">ov</span>);
122 </span></dt>
123 <script>explorer.outline.writeEnabled = false;</script>
124
125
126 <dd>Add a top level overlay.
127         This is called automatically by Overlay, so typically there is no
128         reason for users to call it themselves.
129    
130 <br><br>
131
132 </dd>
133
134 <script>explorer.outline.writeEnabled = true;</script>
135 <dt><span class="decl">Size 
136 <span class="currsymbol">get_window_size</span>
137 <script>explorer.outline.addDecl('get_window_size');</script>
138
139 (WindowHandle <span class="funcparam">win</span>);
140 </span></dt>
141 <script>explorer.outline.writeEnabled = false;</script>
142
143
144 <dd>Returns the size of the specified window
145 <br><br>
146
147 </dd>
148
149 <script>explorer.outline.writeEnabled = true;</script>
150 <dt><span class="decl">void
151 <span class="currsymbol">adapter</span>
152 <script>explorer.outline.addDecl('adapter');</script>
153
154 (InputAdapter <span class="funcparam">inputsys</span>);
155 </span></dt>
156 <script>explorer.outline.writeEnabled = false;</script>
157
158
159 <dd>Set the current input
160 <span class="currsymbol">adapter</span>
161 <script>explorer.outline.addDecl('adapter');</script>
162
163  
164 <br><br>
165
166 </dd>
167
168 <script>explorer.outline.writeEnabled = true;</script>
169 <dt><span class="decl">InputAdapter
170 <span class="currsymbol">adapter</span>
171 <script>explorer.outline.addDecl('adapter');</script>
172
173 ();
174 </span></dt>
175 <script>explorer.outline.writeEnabled = false;</script>
176
177
178 <dd>Get the current input
179 <span class="currsymbol">adapter</span>
180 <script>explorer.outline.addDecl('adapter');</script>
181
182  
183 <br><br>
184
185 </dd>
186 </dl>
187 <script>explorer.outline.decSymbolLevel();</script>
188
189
190 </dd>
191
192 <script>explorer.outline.writeEnabled = true;</script>
193 <dt><span class="decl">class
194 <span class="currsymbol">Frame</span>
195 <script>explorer.outline.addDecl('Frame');</script>
196
197 ;
198 </span></dt>
199 <script>explorer.outline.writeEnabled = false;</script>
200
201
202 <dd>Represents a real OS window used exclusively by Luigi.
203  If the GUI is drawn on top of the app's GL window, use Overlay instead.
204  
205 <br><br>
206
207
208 <script>explorer.outline.incSymbolLevel();</script>
209 <dl></dl>
210 <script>explorer.outline.decSymbolLevel();</script>
211
212
213 </dd>
214
215 <script>explorer.outline.writeEnabled = true;</script>
216 <dt><span class="decl">class
217 <span class="currsymbol">Widget</span>
218 <script>explorer.outline.addDecl('Widget');</script>
219
220 : luigi.arranger.Arrangeable;
221 </span></dt>
222 <script>explorer.outline.writeEnabled = false;</script>
223
224
225 <dd>The base class for any GUI entity that occupies space on the screen.
226  
227 <br><br>
228
229
230 <script>explorer.outline.incSymbolLevel();</script>
231 <dl>
232 <script>explorer.outline.writeEnabled = true;</script>
233 <dt><span class="decl">Arranger
234 <span class="currsymbol">arranger</span>
235 <script>explorer.outline.addDecl('arranger');</script>
236
237 ();
238 </span></dt>
239 <script>explorer.outline.writeEnabled = false;</script>
240
241
242 <dd>Return the
243 <span class="currsymbol">arranger</span>
244 <script>explorer.outline.addDecl('arranger');</script>
245
246  used to arrange this widget's chilrend
247 <br><br>
248
249 </dd>
250
251 <script>explorer.outline.writeEnabled = true;</script>
252 <dt><span class="decl">Arranger
253 <span class="currsymbol">arranger</span>
254 <script>explorer.outline.addDecl('arranger');</script>
255
256 (Arranger <span class="funcparam">a</span>);
257 </span></dt>
258 <script>explorer.outline.writeEnabled = false;</script>
259
260
261 <dd>Set the
262 <span class="currsymbol">arranger</span>
263 <script>explorer.outline.addDecl('arranger');</script>
264
265  used to arrange this widget's chilren
266 <br><br>
267
268 </dd>
269
270 <script>explorer.outline.writeEnabled = true;</script>
271 <dt><span class="decl">Arranger
272 <span class="currsymbol">arranged_by</span>
273 <script>explorer.outline.addDecl('arranged_by');</script>
274
275 ();
276 </span></dt>
277 <script>explorer.outline.writeEnabled = false;</script>
278
279
280 <dd>Return the arranger used to arrange this widget
281 <br><br>
282
283 </dd>
284
285 <script>explorer.outline.writeEnabled = true;</script>
286 <dt><span class="decl">Rect 
287 <span class="currsymbol">rect</span>
288 <script>explorer.outline.addDecl('rect');</script>
289
290 ();
291 </span></dt>
292 <script>explorer.outline.writeEnabled = false;</script>
293
294
295 <dd>Return the items rectangle.
296         The rectangle coordinates are relative to the upper left corner of this
297         widget's parent.
298    
299 <br><br>
300
301 </dd>
302
303 <script>explorer.outline.writeEnabled = true;</script>
304 <dt><span class="decl">Widget
305 <span class="currsymbol">parent</span>
306 <script>explorer.outline.addDecl('parent');</script>
307
308 ();
309 </span></dt>
310 <script>explorer.outline.writeEnabled = false;</script>
311
312
313 <dd>Return the
314 <span class="currsymbol">parent</span>
315 <script>explorer.outline.addDecl('parent');</script>
316
317  of this item or <b>null</b> if it has no
318 <span class="currsymbol">parent</span>
319 <script>explorer.outline.addDecl('parent');</script>
320
321 .
322    
323 <br><br>
324
325 </dd>
326
327 <script>explorer.outline.writeEnabled = true;</script>
328 <dt><span class="decl">Widget[]
329 <span class="currsymbol">children</span>
330 <script>explorer.outline.addDecl('children');</script>
331
332 ();
333 </span></dt>
334 <script>explorer.outline.writeEnabled = false;</script>
335
336
337 <dd>Return the list of items that are parented to this one.
338         Panels are the base type for all items with
339 <span class="currsymbol">children</span>
340 <script>explorer.outline.addDecl('children');</script>
341
342 .
343    
344 <br><br>
345
346 </dd>
347
348 <script>explorer.outline.writeEnabled = true;</script>
349 <dt><span class="decl">void
350 <span class="currsymbol">transform_window_to_widget</span>
351 <script>explorer.outline.addDecl('transform_window_to_widget');</script>
352
353 (inout Size <span class="funcparam">winp</span>);
354 </span></dt>
355 <script>explorer.outline.writeEnabled = false;</script>
356
357
358 <dd>Transforms the given point from window coordinates into
359         the widget's coordinates.  In widget coordinates,
360         (rect.x,rect.y) is the upper left corner of the widget.
361    
362 <br><br>
363
364 </dd>
365
366 <script>explorer.outline.writeEnabled = true;</script>
367 <dt><span class="decl">Widget
368 <span class="currsymbol">next_item</span>
369 <script>explorer.outline.addDecl('next_item');</script>
370
371 ();
372 </span></dt>
373 <script>explorer.outline.writeEnabled = false;</script>
374
375
376 <dd>Return the item after this one in the tab traversal order
377 <br><br>
378
379 </dd>
380
381 <script>explorer.outline.writeEnabled = true;</script>
382 <dt><span class="decl">Widget
383 <span class="currsymbol">prev_item</span>
384 <script>explorer.outline.addDecl('prev_item');</script>
385
386 ();
387 </span></dt>
388 <script>explorer.outline.writeEnabled = false;</script>
389
390
391 <dd>Return the item before this one in the tab traversal order
392 <br><br>
393
394 </dd>
395
396 <script>explorer.outline.writeEnabled = true;</script>
397 <dt><span class="decl">Widget
398 <span class="currsymbol">get_root</span>
399 <script>explorer.outline.addDecl('get_root');</script>
400
401 ();
402 </span></dt>
403 <script>explorer.outline.writeEnabled = false;</script>
404
405
406 <dd>Find the widget at the root of this item's hierarchy
407 <br><br>
408
409 </dd>
410
411 <script>explorer.outline.writeEnabled = true;</script>
412 <dt><span class="decl">bool
413 <span class="currsymbol">focused</span>
414 <script>explorer.outline.addDecl('focused');</script>
415
416 ();
417 </span></dt>
418 <script>explorer.outline.writeEnabled = false;</script>
419
420
421 <dd>Returns whether this item has the keyboard focus.
422    
423 <br><br>
424
425 </dd>
426
427 <script>explorer.outline.writeEnabled = true;</script>
428 <dt><span class="decl">Widget
429 <span class="currsymbol">get_focus</span>
430 <script>explorer.outline.addDecl('get_focus');</script>
431
432 ();
433 </span></dt>
434 <script>explorer.outline.writeEnabled = false;</script>
435
436
437 <dd>Finds the keyboard focus of this widget's hierarchy.
438 <br><br>
439
440 </dd>
441
442 <script>explorer.outline.writeEnabled = true;</script>
443 <dt><span class="decl">bool
444 <span class="currsymbol">set_focus</span>
445 <script>explorer.outline.addDecl('set_focus');</script>
446
447 (Widget <span class="funcparam">newfocus</span>);
448 </span></dt>
449 <script>explorer.outline.writeEnabled = false;</script>
450
451
452 <dd>Sets the keyboard focus of this widget's hierarchy to <span class="funcparam">newfocus</span>.
453   If <span class="funcparam">newfocus</span> is <b>null</b> any current focus item in this widget tree
454   will be unfocused.
455      
456 <br><br>
457
458 </dd>
459
460 <script>explorer.outline.writeEnabled = true;</script>
461 <dt><span class="decl">bool
462 <span class="currsymbol">focus</span>
463 <script>explorer.outline.addDecl('focus');</script>
464
465 ();
466 </span></dt>
467 <script>explorer.outline.writeEnabled = false;</script>
468
469
470 <dd>Set the keyboard
471 <span class="currsymbol">focus</span>
472 <script>explorer.outline.addDecl('focus');</script>
473
474  to this item.
475         Returns <b>true</b> if successful, <b>false</b> otherwise.
476    
477 <br><br>
478
479 </dd>
480
481 <script>explorer.outline.writeEnabled = true;</script>
482 <dt><span class="decl">Widget
483 <span class="currsymbol">focus_next</span>
484 <script>explorer.outline.addDecl('focus_next');</script>
485
486 ();
487 </span></dt>
488 <script>explorer.outline.writeEnabled = false;</script>
489
490
491 <dd>Moves focus to the next item in this widget's hierarchy, or
492         to the first item if nothing is currently focused.
493         Return the newly focused item.
494    
495 <br><br>
496
497 </dd>
498
499 <script>explorer.outline.writeEnabled = true;</script>
500 <dt><span class="decl">Widget
501 <span class="currsymbol">focus_prev</span>
502 <script>explorer.outline.addDecl('focus_prev');</script>
503
504 ();
505 </span></dt>
506 <script>explorer.outline.writeEnabled = false;</script>
507
508
509 <dd>Moves focus to the previous item in this widget hierarchy
510 <br><br>
511
512 </dd>
513
514 <script>explorer.outline.writeEnabled = true;</script>
515 <dt><span class="decl">protected bool
516 <span class="currsymbol">_can_lose_focus</span>
517 <script>explorer.outline.addDecl('_can_lose_focus');</script>
518
519 ();
520 </span></dt>
521 <script>explorer.outline.writeEnabled = false;</script>
522
523
524 <dd>Used internally before focusing a new item to make sure it's ok for the
525         current item to lose focus.
526    
527 <br><br>
528
529 </dd>
530 </dl>
531 <script>explorer.outline.decSymbolLevel();</script>
532
533
534 </dd>
535
536 <script>explorer.outline.writeEnabled = true;</script>
537 <dt><span class="decl">class
538 <span class="currsymbol">Panel</span>
539 <script>explorer.outline.addDecl('Panel');</script>
540
541 : luigi.gui.Widget;
542 </span></dt>
543 <script>explorer.outline.writeEnabled = false;</script>
544
545
546 <dd>The base class for any GUI entity that occupies space on the screen and can
547   potentially have children.
548  
549 <br><br>
550
551
552 <script>explorer.outline.incSymbolLevel();</script>
553 <dl>
554 <script>explorer.outline.writeEnabled = true;</script>
555 <dt><span class="decl">Widget
556 <span class="currsymbol">find_item_at_point</span>
557 <script>explorer.outline.addDecl('find_item_at_point');</script>
558
559 (Size <span class="funcparam">pos</span>);
560 </span></dt>
561 <script>explorer.outline.writeEnabled = false;</script>
562
563
564 <dd>Find the gui item at the specified point.
565         The point p is assumed to be in the widget coordinates for this item.
566         In widget coordinates (rect.x,rect.y) is the upper left corner of this widget.
567    
568 <br><br>
569
570 </dd>
571 </dl>
572 <script>explorer.outline.decSymbolLevel();</script>
573
574
575 </dd>
576
577 <script>explorer.outline.writeEnabled = true;</script>
578 <dt><span class="decl">class
579 <span class="currsymbol">Overlay</span>
580 <script>explorer.outline.addDecl('Overlay');</script>
581
582 : luigi.gui.Panel;
583 </span></dt>
584 <script>explorer.outline.writeEnabled = false;</script>
585
586
587 <dd>Represents a GUI area laid on top of a user's OpenGL window.  The overlay always
588     stretches to cover the full extent of the actual GL window, though actual
589     layout engine and children determine how much of that area is actually used.
590 <br><br>
591 <b>Note:</b><br>
592 This usage of the term overlay should not be confused with the hardware
593     overlays supported by some OpenGL implementations
594 <br><br>
595
596
597 <script>explorer.outline.incSymbolLevel();</script>
598 <dl>
599 <script>explorer.outline.writeEnabled = true;</script>
600 <dt><span class="decl">this(WindowHandle <span class="funcparam">win</span> = null);
601 </span></dt>
602 <script>explorer.outline.writeEnabled = false;</script>
603
604
605 <dd>Constructor.  Not every toolkit supports multiple windows (e.g. GLFW,SDL).
606         If yours doesn't then you may not need the parameter.
607    
608 <br><br>
609
610 </dd>
611
612 <script>explorer.outline.writeEnabled = true;</script>
613 <dt><span class="decl">void
614 <span class="currsymbol">draw</span>
615 <script>explorer.outline.addDecl('draw');</script>
616
617 ();
618 </span></dt>
619 <script>explorer.outline.writeEnabled = false;</script>
620
621
622 <dd>Sets up the drawing state for 2D GUI drawing and draws it's children.
623 <br><br>
624
625 </dd>
626
627 <script>explorer.outline.writeEnabled = true;</script>
628 <dt><span class="decl">InputAdapter
629 <span class="currsymbol">adapter</span>
630 <script>explorer.outline.addDecl('adapter');</script>
631
632 ();
633 </span></dt>
634 <script>explorer.outline.writeEnabled = false;</script>
635
636
637 <dd>Return the input
638 <span class="currsymbol">adapter</span>
639 <script>explorer.outline.addDecl('adapter');</script>
640
641  in current use.  Equivalent to Luigi().
642 <span class="currsymbol">adapter</span>
643 <script>explorer.outline.addDecl('adapter');</script>
644
645 .
646 <br><br>
647
648 </dd>
649 </dl>
650 <script>explorer.outline.decSymbolLevel();</script>
651
652
653 </dd>
654
655 <script>explorer.outline.writeEnabled = true;</script>
656 <dt><span class="decl">class
657 <span class="currsymbol">Rollout</span>
658 <script>explorer.outline.addDecl('Rollout');</script>
659
660 : luigi.gui.Panel;
661 </span></dt>
662 <script>explorer.outline.writeEnabled = false;</script>
663
664
665 <dd>A Panel with a button at the top to open or close it
666 <br><br>
667
668
669 <script>explorer.outline.incSymbolLevel();</script>
670 <dl></dl>
671 <script>explorer.outline.decSymbolLevel();</script>
672
673
674 </dd>
675
676 <script>explorer.outline.writeEnabled = true;</script>
677 <dt><span class="decl">class
678 <span class="currsymbol">Label</span>
679 <script>explorer.outline.addDecl('Label');</script>
680
681 : luigi.gui.Widget;
682 </span></dt>
683 <script>explorer.outline.writeEnabled = false;</script>
684
685
686 <dd>A simple static text label
687 <br><br>
688
689
690 <script>explorer.outline.incSymbolLevel();</script>
691 <dl></dl>
692 <script>explorer.outline.decSymbolLevel();</script>
693
694
695 </dd>
696
697 <script>explorer.outline.writeEnabled = true;</script>
698 <dt><span class="decl">class
699 <span class="currsymbol">Button</span>
700 <script>explorer.outline.addDecl('Button');</script>
701
702 : luigi.gui.Widget, luigi.gui.Valuator;
703 </span></dt>
704 <script>explorer.outline.writeEnabled = false;</script>
705
706
707 <dd>A classic
708 <span class="currsymbol">Button</span>
709 <script>explorer.outline.addDecl('Button');</script>
710
711  widget, with optional toggle button behavior.
712 <br><br>
713
714
715 <script>explorer.outline.incSymbolLevel();</script>
716 <dl></dl>
717 <script>explorer.outline.decSymbolLevel();</script>
718
719
720 </dd>
721
722 <script>explorer.outline.writeEnabled = true;</script>
723 <dt><span class="decl">class
724 <span class="currsymbol">Checkbox</span>
725 <script>explorer.outline.addDecl('Checkbox');</script>
726
727 : luigi.gui.Button;
728 </span></dt>
729 <script>explorer.outline.writeEnabled = false;</script>
730
731
732 <dd>A checkbox is just a toggle button with an alternate theme-defined look.
733 <br><br>
734
735
736 <script>explorer.outline.incSymbolLevel();</script>
737 <dl></dl>
738 <script>explorer.outline.decSymbolLevel();</script>
739
740
741 </dd>
742
743 <script>explorer.outline.writeEnabled = true;</script>
744 <dt><span class="decl">alias
745 <span class="currsymbol">CheckBox</span>
746 <script>explorer.outline.addDecl('CheckBox');</script>
747
748 ;
749 </span></dt>
750 <script>explorer.outline.writeEnabled = false;</script>
751
752
753 <dd>An alternate spelling for Checkbox, because I can never remember which it is.
754 <br><br>
755
756 </dd>
757
758 <script>explorer.outline.writeEnabled = true;</script>
759 <dt><span class="decl">alias
760 <span class="currsymbol">Textfield</span>
761 <script>explorer.outline.addDecl('Textfield');</script>
762
763 ;
764 </span></dt>
765 <script