comparison mde/gui/widget/textContent.d @ 101:71f0f1f83620

Some path adjustments for windows (untested) and fonts. All types of option can be edited. paths: support for getting the full path for a font when just the file name is entered, in order to unify usage on windows and linux. paths: Used getSpecialPath for some windows paths; needs testing. Content: Moved line-editing code to abstract ValueContent class and added some conversion functions, so that any type of ValueContent can be edited as text.
author Diggory Hardy <diggory.hardy@gmail.com>
date Sun, 16 Nov 2008 17:03:47 +0000
parents 0ea4a3e651ae
children 42e241e7be3e
comparison
equal deleted inserted replaced
100:0ea4a3e651ae 101:71f0f1f83620
29 static this () { 29 static this () {
30 logger = Log.getLogger ("mde.gui.widget.textContent"); 30 logger = Log.getLogger ("mde.gui.widget.textContent");
31 } 31 }
32 } 32 }
33 33
34 34 /// Capable of editing any ValueContent class
35 class TextContentWidget : ATextWidget 35 class ValueContentWidget : ATextWidget
36 { 36 {
37 this (IWidgetManager mgr, widgetID id, WidgetData data, IContent c) { 37 this (IWidgetManager mgr, widgetID id, WidgetData data, IContent c) {
38 WDCheck(data, 1); 38 WDCheck(data, 1);
39 content = cast(TextContent) c; 39 content = cast(ValueContent) c;
40 if (!content) content = new TextContent (null, null); 40 if (!content) //content = new TextContent (null, null);
41 //throw new ContentException (); 41 throw new ContentException ();
42 adapter = mgr.renderer.getAdapter (content.toString(0)); 42 adapter = mgr.renderer.getAdapter (content.toString(0));
43 super (mgr, id, data); 43 super (mgr, id, data);
44 } 44 }
45 45
46 /** On click, request keyboard input. */ 46 /** On click, request keyboard input. */
61 content.endEdit; // update other users of content relying on callbacks 61 content.endEdit; // update other users of content relying on callbacks
62 mgr.requestRedraw; 62 mgr.requestRedraw;
63 } 63 }
64 64
65 protected: 65 protected:
66 TextContent content; 66 ValueContent content;
67 } 67 }