diff mde/gui/renderer/SimpleRenderer.d @ 95:2a364c7d82c9

Boolean options can be adjusted from the gui now (using a very basic widget). Also some bug-fixes. Fixed a minor bug where layouts with the same id but without shared alignments would be messed up. Tracked down the "nothing trawn until a resize" bug (see jobs.txt). If widgets throw during creation they're now replaced by debug widgets. Function pointers are converted to delegates using a safer method.
author Diggory Hardy <diggory.hardy@gmail.com>
date Thu, 06 Nov 2008 11:07:18 +0000
parents 08a4ae11454b
children 30470bc19ca4
line wrap: on
line diff
--- a/mde/gui/renderer/SimpleRenderer.d	Thu Oct 23 17:45:49 2008 +0100
+++ b/mde/gui/renderer/SimpleRenderer.d	Thu Nov 06 11:07:18 2008 +0000
@@ -119,6 +119,21 @@
         gl.drawBox (x,y, w,h);
     }
     
+    wdimPair getToggleSize () {
+        wdimPair r;
+        r.x = 16;
+        r.y = 16;
+        return r;
+    }
+    void drawToggle (wdim x, wdim y, bool state, bool pushed) {
+        float c = pushed ? .7f : .5f;
+        if (state)
+            gl.setColor (0f, c, 0f);
+        else
+            gl.setColor (c, 0f, 0f);
+        gl.drawBox (x+2,y+2, 12,12);
+    }
+    
     TextAdapter getAdapter (char[] text, int col) {
         TextAdapter a;
         a.font = defaultFont;