comparison mde/gui/renderer/SimpleRenderer.d @ 143:2ac3e0012788

Added a simple Slider widget. Moved SwitchWidget into PopupMenuWidget's module and renamed the module ParentContent. Made editContent create DisplayContentWidgets for DebugContent (instead of ButtonContentWidgets).
author Diggory Hardy <diggory.hardy@gmail.com>
date Mon, 09 Feb 2009 23:27:41 +0000
parents b16a534f5302
children 075705ad664a
comparison
equal deleted inserted replaced
142:9dabcc44f515 143:2ac3e0012788
143 float c = pushed ? .7f : .5f; 143 float c = pushed ? .7f : .5f;
144 if (state) 144 if (state)
145 glColor3f (0f, c, 0f); 145 glColor3f (0f, c, 0f);
146 else 146 else
147 glColor3f (c, 0f, 0f); 147 glColor3f (c, 0f, 0f);
148 glRecti (x+2,y+14, x+14,y+2); 148 glRecti (x,y+16, x+16,y);
149 }
150
151 override wdimPair getSliderSize () {
152 wdimPair r;
153 r.x = 20;
154 r.y = 16;
155 return r;
156 }
157 override void drawSlider (wdim x, wdim y, wdim w, double proportion) {
158 glColor3f (0f, 0f, .5f);
159 glRecti (x,y+16, x+cast(wdim) (proportion*w),y);
149 } 160 }
150 161
151 override TextAdapter getAdapter (int col) { 162 override TextAdapter getAdapter (int col) {
152 TextAdapter a; 163 TextAdapter a;
153 a.font = defaultFont; 164 a.font = defaultFont;