Mercurial > projects > mde
comparison 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 |
comparison
equal
deleted
inserted
replaced
94:9520cc0448e5 | 95:2a364c7d82c9 |
---|---|
117 else | 117 else |
118 gl.setColor (.6f, 0f, .6f); | 118 gl.setColor (.6f, 0f, .6f); |
119 gl.drawBox (x,y, w,h); | 119 gl.drawBox (x,y, w,h); |
120 } | 120 } |
121 | 121 |
122 wdimPair getToggleSize () { | |
123 wdimPair r; | |
124 r.x = 16; | |
125 r.y = 16; | |
126 return r; | |
127 } | |
128 void drawToggle (wdim x, wdim y, bool state, bool pushed) { | |
129 float c = pushed ? .7f : .5f; | |
130 if (state) | |
131 gl.setColor (0f, c, 0f); | |
132 else | |
133 gl.setColor (c, 0f, 0f); | |
134 gl.drawBox (x+2,y+2, 12,12); | |
135 } | |
136 | |
122 TextAdapter getAdapter (char[] text, int col) { | 137 TextAdapter getAdapter (char[] text, int col) { |
123 TextAdapter a; | 138 TextAdapter a; |
124 a.font = defaultFont; | 139 a.font = defaultFont; |
125 a.set (text, col); | 140 a.set (text, col); |
126 return a; | 141 return a; |