Mercurial > projects > mde
diff mde/gui/widget/layout.d @ 114:b16a534f5302
Changes for tango r4201. Added override keyword in a lot of places.
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Fri, 19 Dec 2008 15:15:06 +0000 |
parents | 9824bee909fd |
children | 1b1e2297e2fc |
line wrap: on
line diff
--- a/mde/gui/widget/layout.d Fri Dec 19 10:32:28 2008 +0000 +++ b/mde/gui/widget/layout.d Fri Dec 19 15:15:06 2008 +0000 @@ -79,7 +79,7 @@ } // Save column/row sizes. Currently always do so. - bool saveChanges () { + override bool saveChanges () { foreach (widget; subWidgets) // recurse on subwidgets widget.saveChanges (); @@ -115,7 +115,7 @@ super (mgr, id, data); } - bool saveChanges () { + override bool saveChanges () { // Since all sub-widgets have the same id, it only makes sense to call on one if (subWidgets is null) return false; @@ -168,7 +168,7 @@ /** Responsible for calculating the minimal size and initializing some stuff. * * As such, this must be the first function called after this(). */ - bool setup (uint n, uint flags) { + override bool setup (uint n, uint flags) { // Run all internal calculations regardless of changes, then check dimensions for changes. // Don't try shortcutting internal calculations when there are no changes - I've tried, and // doing so adds enough overhead to make doing so almost(?) worthless (or at least large @@ -203,23 +203,23 @@ //END Creation & saving //BEGIN Size & position - bool isWSizable () { + override bool isWSizable () { return col.firstSizable >= 0; } - bool isHSizable () { + override bool isHSizable () { return row.firstSizable >= 0; } - void setWidth (wdim nw, int dir) { + override void setWidth (wdim nw, int dir) { w = col.resizeWidth (nw, dir); // Note: setPosition must be called after! } - void setHeight (wdim nh, int dir) { + override void setHeight (wdim nh, int dir) { h = row.resizeWidth (nh, dir); // Note: setPosition must be called after! } - void setPosition (wdim x, wdim y) { + override void setPosition (wdim x, wdim y) { this.x = x; this.y = y; @@ -231,7 +231,7 @@ // Find the relevant widget. - IChildWidget getWidget (wdim cx, wdim cy) { + override IChildWidget getWidget (wdim cx, wdim cy) { debug scope (failure) logger.warn ("getWidget: failure; values: click; pos; width: {},{}; {},{}; {},{}", cx, cy, x, y, w, h); debug assert (cx >= x && cx < x + w && cy >= y && cy < y + h, "getWidget: not on widget (code error)"); @@ -247,7 +247,7 @@ } // Resizing columns & rows - int clickEvent (wdabs cx, wdabs cy, ubyte b, bool state) { + override int clickEvent (wdabs cx, wdabs cy, ubyte b, bool state) { debug scope (failure) logger.warn ("clickEvent: failure"); if (b == 1 && state == true) { @@ -268,7 +268,7 @@ return 0; } - void draw () { + override void draw () { super.draw (); foreach (widget; subWidgets) @@ -285,7 +285,7 @@ * * rows, cols and subWidgets must be set before calling. Part of the set-up for AlignColumns * (col and row). subWidgets need to know their minimal size and resizability. */ - void setupAlignDimData (uint n, uint flags) { + override void setupAlignDimData (uint n, uint flags) { if (sADD_n == n) return; // cached data is current sADD_n = n; @@ -335,12 +335,12 @@ } private: - void setColWidth (myIt i, wdim w, int dir) { + override void setColWidth (myIt i, wdim w, int dir) { for (myIt j = 0; j < rows; ++j) { subWidgets[i + cols*j].setWidth (w, dir); } } - void setRowHeight (myIt j, wdim h, int dir) { + override void setRowHeight (myIt j, wdim h, int dir) { for (myIt i = 0; i < cols; ++i) { subWidgets[i + cols*j].setHeight (h, dir); } @@ -348,7 +348,7 @@ //BEGIN Col/row resizing callback - void resizeCallback (wdim cx, wdim cy) { + override void resizeCallback (wdim cx, wdim cy) { col.resizeCols (cx - dragX); row.resizeCols (cy - dragY); @@ -361,7 +361,7 @@ y + row.pos[i / cols]); mgr.requestRedraw; } - bool endCallback (wdabs cx, wdabs cy, ubyte b, bool state) { + override bool endCallback (wdabs cx, wdabs cy, ubyte b, bool state) { if (b == 1 && state == false) { mgr.removeCallbacks (cast(void*) this); return true; // we've handled the up-click