annotate mde/gui/widget/miscContent.d @ 146:783969f4665c

Simple, inefficient context menus (displaying content description).
author Diggory Hardy <diggory.hardy@gmail.com>
date Wed, 11 Feb 2009 12:00:12 +0000
parents 2ac3e0012788
children 17438f17bfb5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
95
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
1 /* LICENSE BLOCK
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
2 Part of mde: a Modular D game-oriented Engine
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
3 Copyright © 2007-2008 Diggory Hardy
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
4
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
5 This program is free software: you can redistribute it and/or modify it under the terms
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
6 of the GNU General Public License as published by the Free Software Foundation, either
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
7 version 2 of the License, or (at your option) any later version.
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
8
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
10 without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
11 See the GNU General Public License for more details.
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
12
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
13 You should have received a copy of the GNU General Public License
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
14 along with this program. If not, see <http://www.gnu.org/licenses/>. */
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
15
131
9cff74f68b84 Major revisions to popup handling. Buttons can close menus now, plus some smaller impovements. Removed Widget module.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 130
diff changeset
16 /******************************************************************************
143
2ac3e0012788 Added a simple Slider widget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 140
diff changeset
17 * Some non-parent widgets for displaying or editing content.
2ac3e0012788 Added a simple Slider widget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 140
diff changeset
18 *
2ac3e0012788 Added a simple Slider widget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 140
diff changeset
19 * (There are other non-parent content widgets in TextWidget).
131
9cff74f68b84 Major revisions to popup handling. Buttons can close menus now, plus some smaller impovements. Removed Widget module.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 130
diff changeset
20 *****************************************************************************/
95
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
21 module mde.gui.widget.miscContent;
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
22
143
2ac3e0012788 Added a simple Slider widget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 140
diff changeset
23 import mde.gui.widget.AChildWidget;
2ac3e0012788 Added a simple Slider widget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 140
diff changeset
24 import mde.content.AStringContent;
103
42e241e7be3e ContentList content type; getting content items/lists from Options generically via content.Items, and a new addContent widget function. Several improvements to generic handling of content. New button-with-text widget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 101
diff changeset
25 import mde.gui.exception;
42e241e7be3e ContentList content type; getting content items/lists from Options generically via content.Items, and a new addContent widget function. Several improvements to generic handling of content. New button-with-text widget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 101
diff changeset
26
95
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
27
112
fe061009029d EnumContent; log level can be selected from a popup list.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 111
diff changeset
28 debug {
fe061009029d EnumContent; log level can be selected from a popup list.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 111
diff changeset
29 import tango.util.log.Log : Log, Logger;
fe061009029d EnumContent; log level can be selected from a popup list.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 111
diff changeset
30 private Logger logger;
fe061009029d EnumContent; log level can be selected from a popup list.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 111
diff changeset
31 static this () {
fe061009029d EnumContent; log level can be selected from a popup list.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 111
diff changeset
32 logger = Log.getLogger ("mde.gui.widget.miscContent");
fe061009029d EnumContent; log level can be selected from a popup list.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 111
diff changeset
33 }
fe061009029d EnumContent; log level can be selected from a popup list.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 111
diff changeset
34 }
fe061009029d EnumContent; log level can be selected from a popup list.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 111
diff changeset
35
95
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
36 /// Editable boolean widget
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
37 class BoolContentWidget : AButtonWidget
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
38 {
121
5b37d0400732 Widgets now receive and store their parent (IParentWidget). Infinite widget recursion checks. WidgetManager code redistributed.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 119
diff changeset
39 this (IWidgetManager mgr, IParentWidget parent, widgetID id, WidgetData, IContent c) {
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
40 content_ = cast(BoolContent) c;
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
41 if (content_ is null) throw new ContentException (this);
121
5b37d0400732 Widgets now receive and store their parent (IParentWidget). Infinite widget recursion checks. WidgetManager code redistributed.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 119
diff changeset
42 super (mgr, parent, id);
95
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
43 wdimPair s = mgr.renderer.getToggleSize;
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
44 w = mw = s.x;
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
45 h = mh = s.y;
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
46 }
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
47
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
48 override IContent content () {
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
49 return content_;
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
50 }
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
51
114
b16a534f5302 Changes for tango r4201. Added override keyword in a lot of places.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 113
diff changeset
52 override void draw () {
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
53 mgr.renderer.drawToggle (x,y, content_(), pushed);
95
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
54 }
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
55
114
b16a534f5302 Changes for tango r4201. Added override keyword in a lot of places.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 113
diff changeset
56 override void activated () {
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
57 content_ = !content_();
95
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
58 }
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
59
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
60 protected:
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
61 BoolContent content_;
95
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
62 }
2a364c7d82c9 Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
63
105
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
64 /// A button connected to an EventContent
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
65 class ButtonContentWidget : AButtonWidget
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
66 {
121
5b37d0400732 Widgets now receive and store their parent (IParentWidget). Infinite widget recursion checks. WidgetManager code redistributed.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 119
diff changeset
67 this (IWidgetManager mgr, IParentWidget parent, widgetID id, WidgetData, IContent c) {
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
68 content_ = cast(Content) c;
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
69 if (content_ is null) throw new ContentException (this);
121
5b37d0400732 Widgets now receive and store their parent (IParentWidget). Infinite widget recursion checks. WidgetManager code redistributed.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 119
diff changeset
70 adapter = mgr.renderer.getAdapter ();
5b37d0400732 Widgets now receive and store their parent (IParentWidget). Infinite widget recursion checks. WidgetManager code redistributed.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 119
diff changeset
71 super (mgr, parent, id);
111
1655693702fc Resolved ticket #4, allowing widgets to reload strings and recalculate sizes mid-run.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 105
diff changeset
72 }
1655693702fc Resolved ticket #4, allowing widgets to reload strings and recalculate sizes mid-run.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 105
diff changeset
73
114
b16a534f5302 Changes for tango r4201. Added override keyword in a lot of places.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 113
diff changeset
74 override bool setup (uint n, uint flags) {
111
1655693702fc Resolved ticket #4, allowing widgets to reload strings and recalculate sizes mid-run.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 105
diff changeset
75 if (!(flags & 3)) return false; // string or renderer (and possibly font) changed
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
76 adapter.text = content_.toString(1);
105
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
77 adapter.getDimensions (mw, mh);
111
1655693702fc Resolved ticket #4, allowing widgets to reload strings and recalculate sizes mid-run.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 105
diff changeset
78 if (mw != w || mh != h) {
1655693702fc Resolved ticket #4, allowing widgets to reload strings and recalculate sizes mid-run.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 105
diff changeset
79 w = mw;
1655693702fc Resolved ticket #4, allowing widgets to reload strings and recalculate sizes mid-run.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 105
diff changeset
80 h = mh;
1655693702fc Resolved ticket #4, allowing widgets to reload strings and recalculate sizes mid-run.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 105
diff changeset
81 }
1655693702fc Resolved ticket #4, allowing widgets to reload strings and recalculate sizes mid-run.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 105
diff changeset
82 return true;
105
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
83 }
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
84
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
85 override IContent content () {
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
86 return content_;
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
87 }
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
88
114
b16a534f5302 Changes for tango r4201. Added override keyword in a lot of places.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 113
diff changeset
89 override void draw () {
105
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
90 super.draw();
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
91 adapter.draw (x,y);
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
92 }
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
93
114
b16a534f5302 Changes for tango r4201. Added override keyword in a lot of places.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 113
diff changeset
94 override void activated () {
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
95 content_.endEvent;
105
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
96 }
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
97
114
b16a534f5302 Changes for tango r4201. Added override keyword in a lot of places.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 113
diff changeset
98 protected:
b16a534f5302 Changes for tango r4201. Added override keyword in a lot of places.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 113
diff changeset
99 IRenderer.TextAdapter adapter;
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
100 Content content_;
114
b16a534f5302 Changes for tango r4201. Added override keyword in a lot of places.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 113
diff changeset
101 int index;
105
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
102 }
125
3e648bc53bde Added a simple switch/tab widget (depends on existing EnumContent).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 121
diff changeset
103
143
2ac3e0012788 Added a simple Slider widget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 140
diff changeset
104 /// Display a double in a progress bar/slider. Non-editable.
2ac3e0012788 Added a simple Slider widget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 140
diff changeset
105 class SliderContentWidget : AChildWidget
125
3e648bc53bde Added a simple switch/tab widget (depends on existing EnumContent).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 121
diff changeset
106 {
143
2ac3e0012788 Added a simple Slider widget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 140
diff changeset
107 this (IWidgetManager mgr, IParentWidget parent, widgetID id, WidgetData, IContent c) {
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
108 content_ = cast(DoubleContent) c;
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
109 if (content_ is null) throw new ContentException (this);
125
3e648bc53bde Added a simple switch/tab widget (depends on existing EnumContent).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 121
diff changeset
110 super (mgr, parent, id);
143
2ac3e0012788 Added a simple Slider widget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 140
diff changeset
111 wdimPair s = mgr.renderer.getSliderSize;
2ac3e0012788 Added a simple Slider widget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 140
diff changeset
112 w = mw = s.x;
2ac3e0012788 Added a simple Slider widget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 140
diff changeset
113 h = mh = s.y;
125
3e648bc53bde Added a simple switch/tab widget (depends on existing EnumContent).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 121
diff changeset
114 }
3e648bc53bde Added a simple switch/tab widget (depends on existing EnumContent).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 121
diff changeset
115
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
116 override IContent content () {
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
117 return content_;
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
118 }
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
119
125
3e648bc53bde Added a simple switch/tab widget (depends on existing EnumContent).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 121
diff changeset
120 override bool isWSizable () {
143
2ac3e0012788 Added a simple Slider widget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 140
diff changeset
121 return true;
128
41582439a42b Added support for dynamic EnumContent loading and saving, with translation loading.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 126
diff changeset
122 }
41582439a42b Added support for dynamic EnumContent loading and saving, with translation loading.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 126
diff changeset
123
125
3e648bc53bde Added a simple switch/tab widget (depends on existing EnumContent).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 121
diff changeset
124 override void draw () {
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
125 mgr.renderer.drawSlider (x,y, w, content_());
125
3e648bc53bde Added a simple switch/tab widget (depends on existing EnumContent).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 121
diff changeset
126 }
3e648bc53bde Added a simple switch/tab widget (depends on existing EnumContent).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 121
diff changeset
127
3e648bc53bde Added a simple switch/tab widget (depends on existing EnumContent).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 121
diff changeset
128 protected:
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
129 DoubleContent content_;
125
3e648bc53bde Added a simple switch/tab widget (depends on existing EnumContent).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 121
diff changeset
130 }
143
2ac3e0012788 Added a simple Slider widget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 140
diff changeset
131