Mercurial > projects > mde
comparison mde/gui/widget/layout.d @ 99:5de5810e3516
Implemented an editable TextContent widget; it's now possible to edit text options using the GUI.
The widget supports moving the text entry-point using arrows and home/end, but there's no visual indicator or edit-point setting using the mouse.
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Fri, 14 Nov 2008 12:44:32 +0000 |
parents | 2a364c7d82c9 |
children | 42e241e7be3e |
comparison
equal
deleted
inserted
replaced
98:49e7cfed4b34 | 99:5de5810e3516 |
---|---|
245 // On a subwidget; recurse call: | 245 // On a subwidget; recurse call: |
246 return subWidgets[i + j*cols].getWidget (cx, cy); | 246 return subWidgets[i + j*cols].getWidget (cx, cy); |
247 } | 247 } |
248 | 248 |
249 // Resizing columns & rows | 249 // Resizing columns & rows |
250 void clickEvent (wdabs cx, wdabs cy, ubyte b, bool state) { | 250 int clickEvent (wdabs cx, wdabs cy, ubyte b, bool state) { |
251 debug scope (failure) | 251 debug scope (failure) |
252 logger.warn ("clickEvent: failure"); | 252 logger.warn ("clickEvent: failure"); |
253 if (b == 1 && state == true) { | 253 if (b == 1 && state == true) { |
254 /* Note: Because of getWidget, this function is only called if the click is not on a | 254 /* Note: Because of getWidget, this function is only called if the click is not on a |
255 * sub-widget, so we know it's on some divisor (so at least one of resizeCol and | 255 * sub-widget, so we know it's on some divisor (so at least one of resizeCol and |
256 * resizeRow is non-negative). */ | 256 * resizeRow is non-negative). */ |
257 | 257 |
258 // find col/row's resizeD & resizeU | 258 // find col/row's resizeD & resizeU |
259 if (col.findResizeCols (cx - x) && row.findResizeCols (cy - y)) | 259 if (col.findResizeCols (cx - x) && row.findResizeCols (cy - y)) |
260 return; // unable to resize | 260 return 0; // unable to resize |
261 | 261 |
262 dragX = cx; | 262 dragX = cx; |
263 dragY = cy; | 263 dragY = cy; |
264 | 264 |
265 mgr.addClickCallback (&endCallback); | 265 mgr.addClickCallback (&endCallback); |
266 mgr.addMotionCallback (&resizeCallback); | 266 mgr.addMotionCallback (&resizeCallback); |
267 } | 267 } |
268 return 0; | |
268 } | 269 } |
269 | 270 |
270 void draw () { | 271 void draw () { |
271 super.draw (); | 272 super.draw (); |
272 | 273 |