Mercurial > projects > mde
comparison mde/gui/widget/miscContent.d @ 99:5de5810e3516
Implemented an editable TextContent widget; it's now possible to edit text options using the GUI.
The widget supports moving the text entry-point using arrows and home/end, but there's no visual indicator or edit-point setting using the mouse.
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Fri, 14 Nov 2008 12:44:32 +0000 |
parents | 2a364c7d82c9 |
children | 71f0f1f83620 |
comparison
equal
deleted
inserted
replaced
98:49e7cfed4b34 | 99:5de5810e3516 |
---|---|
14 along with this program. If not, see <http://www.gnu.org/licenses/>. */ | 14 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
15 | 15 |
16 /** Some content widgets. */ | 16 /** Some content widgets. */ |
17 module mde.gui.widget.miscContent; | 17 module mde.gui.widget.miscContent; |
18 | 18 |
19 import mde.gui.widget.textContent; | |
19 import mde.gui.widget.Widget; | 20 import mde.gui.widget.Widget; |
20 import mde.gui.widget.TextWidget; | 21 import mde.gui.widget.TextWidget; |
21 import mde.gui.exception; | 22 import mde.gui.exception; |
22 import mde.gui.renderer.IRenderer; | 23 import mde.gui.renderer.IRenderer; |
23 | 24 |
25 | 26 |
26 /// Chooses the most appropriate content editing widget | 27 /// Chooses the most appropriate content editing widget |
27 IChildWidget editContent (IWidgetManager mgr, widgetID id, WidgetData data, IContent c) { | 28 IChildWidget editContent (IWidgetManager mgr, widgetID id, WidgetData data, IContent c) { |
28 if (cast(BoolContent) c) | 29 if (cast(BoolContent) c) |
29 return new BoolContentWidget(mgr,id,data,c); | 30 return new BoolContentWidget(mgr,id,data,c); |
31 else if (cast(TextContent) c) | |
32 return new TextContentWidget(mgr,id,data,c); | |
30 else // generic uneditable option | 33 else // generic uneditable option |
31 return new DisplayContentWidget(mgr,id,data,c); | 34 return new DisplayContentWidget(mgr,id,data,c); |
32 } | 35 } |
33 | 36 |
34 /// Just displays the content | 37 /// Just displays the content |