diff mde/gui/renderer/IRenderer.d @ 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. Some tidy-up. Some name changes, to increase uniformity. Bug-fix: floating widgets of fixed size could previously be made larger than intended from config dimdata.
author Diggory Hardy <diggory.hardy@gmail.com>
date Tue, 25 Nov 2008 18:01:44 +0000
parents 0ea4a3e651ae
children c9fc2d303178
line wrap: on
line diff
--- a/mde/gui/renderer/IRenderer.d	Sat Nov 22 20:59:36 2008 +0000
+++ b/mde/gui/renderer/IRenderer.d	Tue Nov 25 18:01:44 2008 +0000
@@ -87,17 +87,21 @@
      * NOTE: currently inflexible. Could use (function) pointers, class interfaces or struct
      * interfaces when available to allow flexibility. */
     struct TextAdapter {
-        void setText (char[] c) {
-            content = c;
+	char[] text () {
+	    return content;
+	}
+        void text (char[] str) {
+            content = str;
 	    textCache.cacheVer = -1;	// force update
         }
 	
-	void setColour (int col = 0xFFFFFF) {
-	    colour = Colour (col);
+	void colour (int colour = 0xFFFFFF) {
+	    colour_ = Colour (colour);
 	}
 	
-	void setIndex (size_t index = size_t.max) {
-	    this.index = index;
+	/** If not size_t.max, an edit marker is drawn before character index. */
+	void index (size_t index = size_t.max) {
+	    index_ = index;
 	}
         
         void getDimensions (out wdsize w, out wdsize h) {
@@ -107,13 +111,13 @@
         }
         
         void draw (wdabs x, wdabs y) {
-            font.textBlock (x,y, content, textCache, colour, index);
+            font.textBlock (x,y, content, textCache, colour_, index_);
         }
         
         char[] content;
         TextBlock textCache;
-	size_t index;
-        Colour colour;
+	size_t index_;
+        Colour colour_;
         FontStyle font;
     }
     //END Types