annotate mde/gui/widget/miscContent.d @ 148:17438f17bfb5

Hooked redraws in for BoolContentWidget and SliderContentWidget.
author Diggory Hardy <diggory.hardy@gmail.com>
date Sat, 14 Mar 2009 11:05:31 +0100
parents 783969f4665c
children 2476790223b8
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;
148
17438f17bfb5 Hooked redraws in for BoolContentWidget and SliderContentWidget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 146
diff changeset
46 content_.addCallback (&contentRedraw);
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
47 }
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
48
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
49 override IContent content () {
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
50 return content_;
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
51 }
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
52
114
b16a534f5302 Changes for tango r4201. Added override keyword in a lot of places.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 113
diff changeset
53 override void draw () {
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
54 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
55 }
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
56
114
b16a534f5302 Changes for tango r4201. Added override keyword in a lot of places.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 113
diff changeset
57 override void activated () {
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
58 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
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
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
61 protected:
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
62 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
63 }
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
64
105
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
65 /// A button connected to an EventContent
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
66 class ButtonContentWidget : AButtonWidget
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
67 {
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
68 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
69 content_ = cast(Content) c;
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
70 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
71 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
72 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
73 }
1655693702fc Resolved ticket #4, allowing widgets to reload strings and recalculate sizes mid-run.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 105
diff changeset
74
114
b16a534f5302 Changes for tango r4201. Added override keyword in a lot of places.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 113
diff changeset
75 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
76 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
77 adapter.text = content_.toString(1);
105
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
78 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
79 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
80 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
81 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
82 }
1655693702fc Resolved ticket #4, allowing widgets to reload strings and recalculate sizes mid-run.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 105
diff changeset
83 return true;
105
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
84 }
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
85
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
86 override IContent content () {
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
87 return content_;
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
88 }
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
89
114
b16a534f5302 Changes for tango r4201. Added override keyword in a lot of places.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 113
diff changeset
90 override void draw () {
105
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
91 super.draw();
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
92 adapter.draw (x,y);
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
93 }
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
94
114
b16a534f5302 Changes for tango r4201. Added override keyword in a lot of places.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 113
diff changeset
95 override void activated () {
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
96 content_.endEvent;
105
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
97 }
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
98
114
b16a534f5302 Changes for tango r4201. Added override keyword in a lot of places.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 113
diff changeset
99 protected:
b16a534f5302 Changes for tango r4201. Added override keyword in a lot of places.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 113
diff changeset
100 IRenderer.TextAdapter adapter;
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
101 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
102 int index;
105
08651e8a8c51 Quit button, big changes to content system.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 103
diff changeset
103 }
125
3e648bc53bde Added a simple switch/tab widget (depends on existing EnumContent).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 121
diff changeset
104
143
2ac3e0012788 Added a simple Slider widget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 140
diff changeset
105 /// 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
106 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
107 {
143
2ac3e0012788 Added a simple Slider widget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 140
diff changeset
108 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
109 content_ = cast(DoubleContent) c;
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
110 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
111 super (mgr, parent, id);
143
2ac3e0012788 Added a simple Slider widget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 140
diff changeset
112 wdimPair s = mgr.renderer.getSliderSize;
2ac3e0012788 Added a simple Slider widget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 140
diff changeset
113 w = mw = s.x;
2ac3e0012788 Added a simple Slider widget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 140
diff changeset
114 h = mh = s.y;
148
17438f17bfb5 Hooked redraws in for BoolContentWidget and SliderContentWidget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 146
diff changeset
115 content_.addCallback (&contentRedraw);
125
3e648bc53bde Added a simple switch/tab widget (depends on existing EnumContent).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 121
diff changeset
116 }
3e648bc53bde Added a simple switch/tab widget (depends on existing EnumContent).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 121
diff changeset
117
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
118 override IContent content () {
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
119 return content_;
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
120 }
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
121
125
3e648bc53bde Added a simple switch/tab widget (depends on existing EnumContent).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 121
diff changeset
122 override bool isWSizable () {
143
2ac3e0012788 Added a simple Slider widget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 140
diff changeset
123 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
124 }
41582439a42b Added support for dynamic EnumContent loading and saving, with translation loading.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 126
diff changeset
125
125
3e648bc53bde Added a simple switch/tab widget (depends on existing EnumContent).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 121
diff changeset
126 override void draw () {
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
127 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
128 }
3e648bc53bde Added a simple switch/tab widget (depends on existing EnumContent).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 121
diff changeset
129
3e648bc53bde Added a simple switch/tab widget (depends on existing EnumContent).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 121
diff changeset
130 protected:
146
783969f4665c Simple, inefficient context menus (displaying content description).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 143
diff changeset
131 DoubleContent content_;
125
3e648bc53bde Added a simple switch/tab widget (depends on existing EnumContent).
Diggory Hardy <diggory.hardy@gmail.com>
parents: 121
diff changeset
132 }
143
2ac3e0012788 Added a simple Slider widget.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 140
diff changeset
133