diff mde/gui/widget/createWidget.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 49e7cfed4b34
children 71f0f1f83620
line wrap: on
line diff
--- a/mde/gui/widget/createWidget.d	Wed Nov 12 13:18:51 2008 +0000
+++ b/mde/gui/widget/createWidget.d	Fri Nov 14 12:44:32 2008 +0000
@@ -28,6 +28,7 @@
 import mde.gui.widget.miscWidgets;
 import mde.gui.widget.TextWidget;
 import mde.gui.widget.miscContent;
+import mde.gui.widget.textContent;
 import mde.gui.widget.Floating;
 import tango.util.log.Log : Log, Logger;
 
@@ -82,34 +83,35 @@
 private:
 /// Widget types.
 enum WIDGET_TYPE : int {
-    FUNCTION                = 0x2000,   // Function called instead of widget created (no "Widget" appended to fct name)
-    TAKES_CONTENT           = 0x4000,   // Flag indicates widget's this should be passed an IContent reference.
-    PARENT                  = 0x8000,   // widget can have children; not used by code (except in data files)
+    FUNCTION		= 0x2000,   // Function called instead of widget created (no "Widget" appended to fct name)
+    TAKES_CONTENT	= 0x4000,   // Flag indicates widget's this should be passed an IContent reference.
+    PARENT		= 0x8000,   // widget can have children; not used by code (except in data files)
     
     // Use widget names rather than usual capitals convention
-    Unnamed                 = 0x0,      // Only for use by widgets not created with createWidget
+    Unnamed		= 0x0,      // Only for use by widgets not created with createWidget
     
     // blank: 0x1
-    FixedBlank              = 0x1,
-    SizableBlank            = 0x2,
-    Debug                   = 0xF,
+    FixedBlank		= 0x1,
+    SizableBlank	= 0x2,
+    Debug		= 0xF,
     
     // buttons: 0x10
-    Button                  = 0x10,
+    Button		= 0x10,
     
     // labels: 0x20
-    ContentLabel	    = TAKES_CONTENT | 0x20,
-    TextLabel               = 0x21,
+    ContentLabel	= TAKES_CONTENT | 0x20,
+    TextLabel		= 0x21,
     
     // content editables: 0x30
-    editContent             = FUNCTION | TAKES_CONTENT | 0x30,
-    DisplayContent          = TAKES_CONTENT | 0x30,
-    BoolContent             = TAKES_CONTENT | 0x31,
+    editContent		= FUNCTION | TAKES_CONTENT | 0x30,
+    DisplayContent	= TAKES_CONTENT | 0x30,
+    BoolContent		= TAKES_CONTENT | 0x31,
+    TextContent		= TAKES_CONTENT | 0x32,
     
-    GridLayout              = TAKES_CONTENT | PARENT | 0x100,
-    TrialContentLayout      = PARENT | 0x110,
+    GridLayout		= TAKES_CONTENT | PARENT | 0x100,
+    TrialContentLayout	= PARENT | 0x110,
     
-    FloatingArea            = PARENT | 0x200,
+    FloatingArea	= PARENT | 0x200,
 }
 
 //const char[][int] WIDGET_NAMES;
@@ -124,6 +126,7 @@
         "ContentLabel",
         "DisplayContent",
         "BoolContent",
+	"TextContent",
         "editContent",
         "TrialContentLayout",
         "FloatingArea",