diff mde/gui/renderer/SimpleRenderer.d @ 38:8c4c96f04e7f

Windows can now be resized! Windows have both a resize border and a move border with independant size for each side. Windows resizing support. committer: Diggory Hardy <diggory.hardy@gmail.com>
author Diggory Hardy <diggory.hardy@gmail.com>
date Mon, 05 May 2008 17:02:21 +0100
parents 052df9b2fe07
children 5132301e9ed7
line wrap: on
line diff
--- a/mde/gui/renderer/SimpleRenderer.d	Mon May 05 14:47:25 2008 +0100
+++ b/mde/gui/renderer/SimpleRenderer.d	Mon May 05 17:02:21 2008 +0100
@@ -29,8 +29,19 @@
 * The renderer is intended to be per-GUI. */
 class SimpleRenderer : IRenderer
 {
-    int windowBorder () {
-        return 20;
+    
+    
+    BorderDimensions getBorder (BORDER_TYPES type) {
+        BorderDimensions dims;
+        with (BORDER_TYPES) with (dims) {
+            if (type == WINDOW_TOTAL) {
+                l = t = r = b = 20;
+            } else if (type == WINDOW_RESIZE) {
+                r = t = 5;
+                l = b = 20;
+            }
+        }
+        return dims;
     }
     
     int layoutSpacing () {
@@ -39,8 +50,11 @@
     
     
     void drawWindow (int x, int y, int w, int h) {
+        gl.setColor (0f, 0f, .7f);
+        gl.drawBox (x,y, w,h);
+        
         gl.setColor (0f, 0f, 1f);
-        gl.drawBox (x,y, w,h);
+        gl.drawBox (x+20,y+5, w-25,h-25);
         
         gl.setColor (.3f, .3f, .3f);
         gl.drawBox (x+20, y+20, w-40, h-40);