Mercurial > projects > mde
changeset 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 |
files | mde/file/mergetag/Reader.d mde/file/mergetag/Writer.d mde/file/ssi.d mde/gui/WidgetManager.d mde/gui/renderer/SimpleRenderer.d mde/gui/widget/Floating.d mde/gui/widget/PopupMenu.d mde/gui/widget/TextWidget.d mde/gui/widget/Widget.d mde/gui/widget/layout.d mde/gui/widget/miscContent.d mde/gui/widget/miscWidgets.d mde/gui/widget/textContent.d |
diffstat | 13 files changed, 122 insertions(+), 128 deletions(-) [+] |
line wrap: on
line diff
--- a/mde/file/mergetag/Reader.d Fri Dec 19 10:32:28 2008 +0000 +++ b/mde/file/mergetag/Reader.d Fri Dec 19 15:15:06 2008 +0000 @@ -215,7 +215,7 @@ // Open & read the file try { // Supports unicode files with a BOM; defaults to UTF8 when there isn't a BOM: - scope file = new UnicodeFile!(char) (path, Encoding.Unknown); + scope file = new UnicodeFile!(char) (path.toString, Encoding.Unknown); fbuf = cast(char[]) file.read(); } catch (Exception e) { throwMTErr ("Error reading file: " ~ e.msg, new MTFileIOException);
--- a/mde/file/mergetag/Writer.d Fri Dec 19 10:32:28 2008 +0000 +++ b/mde/file/mergetag/Writer.d Fri Dec 19 15:15:06 2008 +0000 @@ -36,9 +36,8 @@ // tango imports import tango.core.Exception; -import tango.io.device.FileConduit; -import tango.io.Buffer : Buffer, IBuffer; -import tango.io.Print : Print; +import tango.io.device.File; +import tango.io.stream.Buffer; import convInt = tango.text.convert.Integer; import tango.util.log.Log : Log, Logger; @@ -178,18 +177,18 @@ if (!_dataset) throwMTErr ("write(): no Dataset available to write from!", new MTNoDataSetException ()); try { - FileConduit conduit; // actual conduit; don't use directly when there's content in the buffer - IBuffer buffer; // write strings directly to this (use opCall(void[]) ) + scope File conduit; // actual conduit; don't use directly when there's content in the buffer + scope BufferOutput buffer; // write strings directly to this (use opCall(void[]) ) // Open a conduit on the file: - conduit = new FileConduit (_path, FileConduit.WriteCreate); + conduit = new File (_path, File.WriteCreate); scope(exit) conduit.close(); - buffer = new Buffer(conduit); // And a buffer + buffer = new BufferOutput(conduit); // And a buffer scope(exit) buffer.flush(); // Write the header: - buffer ("{MT" ~ MTFormatVersion.CurrentString ~ "}" ~ Eol); + buffer.append ("{MT" ~ MTFormatVersion.CurrentString ~ "}" ~ Eol); if (_dataset.header !is null) writeSection (buffer, _dataset.header); // Write the rest: @@ -209,18 +208,18 @@ } } - private void writeSectionIdentifier (IBuffer buffer, ID id) { + private void writeSectionIdentifier (BufferOutput buffer, ID id) { char[] tp = "{" ~ cast(char[])id ~ "}" ~ Eol; - buffer (tp); + buffer.append (tp); } - private void writeSection (IBuffer buffer, IDataSection sec) { + private void writeSection (BufferOutput buffer, IDataSection sec) { void writeItem (char[] tp, ID id, char[] dt) { // actually writes an item - buffer ("<" ~ tp ~ "|" ~ cast(char[])id ~"=" ~ dt ~ ">" ~ Eol); + buffer.append ("<" ~ tp ~ "|" ~ cast(char[])id ~"=" ~ dt ~ ">" ~ Eol); } sec.writeAll (&writeItem); - buffer (Eol); // blank line at end of each section + buffer.append (Eol); // blank line at end of each section } private void throwMTErr (char[] msg, Exception exc = new MTException) {
--- a/mde/file/ssi.d Fri Dec 19 10:32:28 2008 +0000 +++ b/mde/file/ssi.d Fri Dec 19 15:15:06 2008 +0000 @@ -28,7 +28,7 @@ S read(S) (FilePath path) { char[] buf; try { - scope file = new UnicodeFile!(char) (path, Encoding.Unknown); // from BOM or use UTF-8 + scope file = new UnicodeFile!(char) (path.toString, Encoding.Unknown); // from BOM or use UTF-8 buf = cast(char[]) file.read; } catch (Exception e) { throw new ioException ("While reading \""~path.toString~"\": "~e.msg); @@ -47,7 +47,7 @@ void write(S) (FilePath path, S content) { try { - scope file = new UnicodeFile!(char) (path, Encoding.UTF_8N); + scope file = new UnicodeFile!(char) (path.toString, Encoding.UTF_8N); file.write ("mdessi00\n"~serialize(content), true); } catch (Exception e) { throw new ioException ("Unable to write file "~path.toString~": "~e.msg);
--- a/mde/gui/WidgetManager.d Fri Dec 19 10:32:28 2008 +0000 +++ b/mde/gui/WidgetManager.d Fri Dec 19 15:15:06 2008 +0000 @@ -253,7 +253,7 @@ protected: /* Second stage of widget loading. * Note: sizeEvent should be called with window size before this. */ - void createRootWidget () { + final override void createRootWidget () { // The renderer needs to be created on the first load, but not after this. if (rend is null) rend = createRenderer (rendName); @@ -273,7 +273,7 @@ child.setPosition (0,0); } - void preSave () { + final override void preSave () { if (keyFocus) { keyFocus.keyFocusLost; keyFocus = null; @@ -519,22 +519,22 @@ public: //BEGIN IWidgetManager methods - IChildWidget makeWidget (widgetID id, IContent content = null) { + override IChildWidget makeWidget (widgetID id, IContent content = null) { debug (mdeWidgets) logger.trace ("Creating widget \""~id~'"'); return createWidget (this, id, curData[id], content); } - IChildWidget makeWidget (widgetID id, WidgetData data, IContent content = null) { + override IChildWidget makeWidget (widgetID id, WidgetData data, IContent content = null) { debug (mdeWidgets) logger.trace ("Creating widget \""~id~'"'); return createWidget (this, id, data, content); } - wdims dimData (widgetID id) { + override wdims dimData (widgetID id) { return curData.dims (id); } - void setData (widgetID id, WidgetData d) { + override void setData (widgetID id, WidgetData d) { changes[id] = d; // also updates WidgetDataSet in data. } - void setDimData (widgetID id, wdims d) { + override void setDimData (widgetID id, wdims d) { changes.setDims(id, d); // also updates WidgetDataSet in data. } //END IWidgetManager methods
--- a/mde/gui/renderer/SimpleRenderer.d Fri Dec 19 10:32:28 2008 +0000 +++ b/mde/gui/renderer/SimpleRenderer.d Fri Dec 19 15:15:06 2008 +0000 @@ -35,7 +35,7 @@ } alias Border.BTYPE BTYPE; - Border getBorder (BTYPE type, bool wS, bool hS) { + override Border getBorder (BTYPE type, bool wS, bool hS) { Border border; with (border) { if (type & BTYPE.RESIZE) { @@ -53,7 +53,7 @@ return border; } - wdim layoutSpacing () { + override wdim layoutSpacing () { return 5; } @@ -61,10 +61,10 @@ //FIXME - make these do something // They should restrict the drawing of floating widgets to the floating area, for instance, // although this isn't strictly necessary. - void restrict (wdim x, wdim y, wdim w, wdim h) {} - void relax () {} + override void restrict (wdim x, wdim y, wdim w, wdim h) {} + override void relax () {} - void drawWindow (Border* border, wdim x, wdim y, wdim w, wdim h) { + override void drawWindow (Border* border, wdim x, wdim y, wdim w, wdim h) { glColor3f (0f, 0f, .8f); glRecti(x, y+h, x+w, y); @@ -97,7 +97,7 @@ glRecti(x+border.x1, y+h-border.y2, x+w-border.x2, y+border.y1); } - void drawSpacers (wdabs x, wdabs y, wdsize w, wdsize h, wdims cols, wdims rows) { + override void drawSpacers (wdabs x, wdabs y, wdsize w, wdsize h, wdims cols, wdims rows) { glColor3f (.2f, .2f, .2f); glBegin (GL_LINES); wdabs t = x - cast(wdim) 3; @@ -113,19 +113,19 @@ glEnd (); } - void drawWidgetBack (wdim x, wdim y, wdim w, wdim h) { + override void drawWidgetBack (wdim x, wdim y, wdim w, wdim h) { debug { glColor3f (0f, .2f, .2f); glRecti (x,y+h, x+w,y); } } - void drawBlank (wdim x, wdim y, wdim w, wdim h) { + override void drawBlank (wdim x, wdim y, wdim w, wdim h) { glColor3f (.4f, .4f, .4f); glRecti(x, y+h, x+w, y); } - void drawButton (wdim x, wdim y, wdim w, wdim h, bool pushed) { + override void drawButton (wdim x, wdim y, wdim w, wdim h, bool pushed) { if (pushed) glColor3f (1f, 0f, 1f); else @@ -133,13 +133,13 @@ glRecti(x, y+h, x+w, y); } - wdimPair getToggleSize () { + override wdimPair getToggleSize () { wdimPair r; r.x = 16; r.y = 16; return r; } - void drawToggle (wdim x, wdim y, bool state, bool pushed) { + override void drawToggle (wdim x, wdim y, bool state, bool pushed) { float c = pushed ? .7f : .5f; if (state) glColor3f (0f, c, 0f); @@ -148,7 +148,7 @@ glRecti (x+2,y+14, x+14,y+2); } - TextAdapter getAdapter (int col) { + override TextAdapter getAdapter (int col) { TextAdapter a; a.font = defaultFont; a.colour_ = Colour (col);
--- a/mde/gui/widget/Floating.d Fri Dec 19 10:32:28 2008 +0000 +++ b/mde/gui/widget/Floating.d Fri Dec 19 15:15:06 2008 +0000 @@ -60,7 +60,7 @@ super (mgr, id, data); } - bool setup (uint n, uint flags) { + override bool setup (uint n, uint flags) { foreach (i, ref d; sWData) with (d) { auto widg = subWidgets[i]; if (!widg.setup (n, flags) && n != 0 && !(flags & 1)) @@ -77,7 +77,7 @@ return false; // floating area size is not changed } - bool saveChanges () { + override bool saveChanges () { wdim[] dd = new wdim[sWData.length*4]; foreach (i, ref d; sWData) { subWidgets[i].saveChanges (); @@ -88,7 +88,7 @@ return true; } - void setWidth (wdim nw, int) { + override void setWidth (wdim nw, int) { w = nw; // check all floating widgets are visible foreach (i, ref d; sWData) with (d) { @@ -96,7 +96,7 @@ x = (w > this.w) ? 0 : this.w - w; } } - void setHeight (wdim nh, int) { + override void setHeight (wdim nh, int) { h = nh; foreach (i, ref d; sWData) with (d) { if (y + h > this.h) @@ -104,10 +104,10 @@ } } - bool isWSizable () { return true; } - bool isHSizable () { return true; } + override bool isWSizable () { return true; } + override bool isHSizable () { return true; } - void setPosition (wdim nx, wdim ny) { + override void setPosition (wdim nx, wdim ny) { x = nx; y = ny; @@ -116,7 +116,7 @@ subWidgets[i].setPosition (x + d.x + d.border.x1, y + d.y + d.border.y1); } - void draw () { + override void draw () { super.draw; mgr.renderer.restrict (x,y, w,h); @@ -128,7 +128,7 @@ mgr.renderer.relax; } - 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, x, w, cy, y, h); debug assert (cx >= x && cx < x + w && cy >= y && cy < y + h, "getWidget: not on widget (code error)"); @@ -153,7 +153,7 @@ return this; // no match } - int clickEvent (wdabs cx, wdabs cy, ubyte b, bool state) { + override int clickEvent (wdabs cx, wdabs cy, ubyte b, bool state) { if (event > subWidgets.length) return 0; if (b == 1 && state == true) { active = event;
--- a/mde/gui/widget/PopupMenu.d Fri Dec 19 10:32:28 2008 +0000 +++ b/mde/gui/widget/PopupMenu.d Fri Dec 19 15:15:06 2008 +0000 @@ -52,7 +52,7 @@ super (mgr, id, data); } - int clickEvent (wdabs, wdabs, ubyte b, bool state) { + override int clickEvent (wdabs, wdabs, ubyte b, bool state) { if (b == 1 && state == true) { // If active, the popup is closed by WidgetManager since the click isn't on the popup. if (!pushed) { @@ -64,11 +64,11 @@ return 0; } - void popupRemoved () { + override void popupRemoved () { pushed = false; } - void draw () { + override void draw () { mgr.renderer.drawButton (x,y, w,h, pushed); adapter.draw (x,y); } @@ -110,13 +110,13 @@ super (mgr, id, data); } - bool setup (uint n, uint flags) { + override bool setup (uint n, uint flags) { if (!(flags & 3)) return false; // string or renderer (and possibly font) changed adapter.text = content.toString(1); return super.setup (n, 3); // force redimensioning } - int clickEvent (wdabs, wdabs, ubyte b, bool state) { + override int clickEvent (wdabs, wdabs, ubyte b, bool state) { if (b == 1) { // on up or down click pushed = false; mgr.requestRedraw; @@ -125,11 +125,11 @@ return 0; } - void highlight (bool state) { + override void highlight (bool state) { pushed = state; } - void draw () { + override void draw () { mgr.renderer.drawButton (x,y, w,h, pushed); adapter.draw (x,y); } @@ -159,7 +159,7 @@ super (mgr, id, data); } - bool saveChanges () { + override bool saveChanges () { return false; // sub-widgets don't have an id }
--- a/mde/gui/widget/TextWidget.d Fri Dec 19 10:32:28 2008 +0000 +++ b/mde/gui/widget/TextWidget.d Fri Dec 19 15:15:06 2008 +0000 @@ -42,7 +42,7 @@ } /** Recalculates dims if the renderer changed. */ - bool setup (uint,uint flags) { + override bool setup (uint,uint flags) { if (flags & 1) { adapter.getDimensions (mw, mh); if (mw != w || mh != h) { @@ -54,7 +54,7 @@ return false; } - void draw () { + override void draw () { super.draw(); adapter.draw (x,y); } @@ -92,7 +92,7 @@ super (mgr, id,data); } - bool setup (uint n, uint flags) { + override bool setup (uint n, uint flags) { if (!(flags & 3)) return false; // string or renderer (and possibly font) changed adapter.text = content.toString(index); return super.setup (n, 3); // force redimensioning
--- a/mde/gui/widget/Widget.d Fri Dec 19 10:32:28 2008 +0000 +++ b/mde/gui/widget/Widget.d Fri Dec 19 15:15:06 2008 +0000 @@ -55,59 +55,54 @@ } // Widgets need to do their initialization either in this() or setup(). - bool setup (uint,uint) { + override bool setup (uint,uint) { return false; } // Don't save any data: fine for many widgets. - bool saveChanges () { + override bool saveChanges () { return false; } //END Load and save //BEGIN Size and position - bool isWSizable () { return false; } - bool isHSizable () { return false; } + override bool isWSizable () { return false; } + override bool isHSizable () { return false; } /* Return minimal/fixed size. */ - wdim minWidth () { + override wdim minWidth () { return mw; } - wdim minHeight () { + override wdim minHeight () { return mh; } - wdim width () { + override wdim width () { return w; } - wdim height() { + override wdim height() { return h; } - wdabs xPos () { + override wdabs xPos () { return x; } - wdabs yPos () { + override wdabs yPos () { return y; } - deprecated void getCurrentSize (out wdim cw, out wdim ch) { - cw = w; - ch = h; - } - /* Set size: minimal size is (mw,mh). Note that both resizable and fixed widgets should allow * enlarging, so in both cases this is a correct implementation. */ - void setWidth (wdim nw, int) { + override void setWidth (wdim nw, int) { debug if (nw < mw) logger.warn ("Widget width set below minimal size"); w = (nw >= mw ? nw : mw); } - void setHeight (wdim nh, int) { + override void setHeight (wdim nh, int) { debug if (nh < mh) logger.warn ("Widget height set below minimal size"); h = (nh >= mh ? nh : mh); } - void setPosition (wdim nx, wdim ny) { + override void setPosition (wdim nx, wdim ny) { x = nx; y = ny; } @@ -116,29 +111,29 @@ //BEGIN Events /* This method is only called when the location is over this widget; hence for all widgets * without children this method is valid. */ - IChildWidget getWidget (wdim cx, wdim cy) { + override IChildWidget getWidget (wdim cx, wdim cy) { debug assert (cx >= x && cx < x + w && cy >= y && cy < y + h, "getWidget: not on widget (code error)"); return this; } /* Dummy event method (suitable for all widgets which don't respond to events). */ - int clickEvent (wdabs cx, wdabs cy, ubyte b, bool state) { + override int clickEvent (wdabs cx, wdabs cy, ubyte b, bool state) { return 0; } /* Dummy functions: suitable for widgets with no text input. */ - void keyEvent (ushort, char[]) {} - void keyFocusLost () {} + override void keyEvent (ushort, char[]) {} + override void keyFocusLost () {} // Currently only applies to popup widgets. - void highlight (bool state) {} + override void highlight (bool state) {} // Only useful to widgets creating popups. - void popupRemoved () {} + override void popupRemoved () {} //END Events /* Basic draw method: draw the background (all widgets should do this). */ - void draw () { + override void draw () { mgr.renderer.drawWidgetBack (x,y, w,h); } @@ -200,7 +195,7 @@ super (mgr, id, data); } - bool setup (uint n, uint flags) { + override bool setup (uint n, uint flags) { bool c = false; foreach (w; subWidgets) { debug assert (w); @@ -209,7 +204,7 @@ return c; } - bool saveChanges () { + override bool saveChanges () { bool c = false; foreach (w; subWidgets) c |= w.saveChanges; @@ -226,12 +221,12 @@ super (mgr, id, data); } - bool setup (uint n, uint flags) { + override bool setup (uint n, uint flags) { debug assert (subWidget); return subWidget.setup (n,flags); } - bool saveChanges () { + override bool saveChanges () { return subWidget.saveChanges; } @@ -262,8 +257,8 @@ super (mgr, id, data); } - bool isWSizable () { return true; } - bool isHSizable () { return true; } + override bool isWSizable () { return true; } + override bool isHSizable () { return true; } } /** For pressable buttons. @@ -276,12 +271,12 @@ } /// May be over-ridden. Pushed is true if the button has been pushed and not released. - void draw () { + override void draw () { mgr.renderer.drawButton (x,y, w,h, pushed); } /// Handles the down-click - int clickEvent (wdabs, wdabs, ubyte b, bool state) { + override int clickEvent (wdabs, wdabs, ubyte b, bool state) { if (b == 1 && state == true) { pushed = true; mgr.requestRedraw;
--- 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
--- a/mde/gui/widget/miscContent.d Fri Dec 19 10:32:28 2008 +0000 +++ b/mde/gui/widget/miscContent.d Fri Dec 19 15:15:06 2008 +0000 @@ -85,11 +85,11 @@ super (mgr, id, data); } - void draw () { + override void draw () { mgr.renderer.drawToggle (x,y, content(), pushed); } - void activated () { + override void activated () { content = !content(); } @@ -107,7 +107,7 @@ super (mgr, id, data); } - bool setup (uint n, uint flags) { + override bool setup (uint n, uint flags) { if (!(flags & 3)) return false; // string or renderer (and possibly font) changed adapter.text = content.toString(1); adapter.getDimensions (mw, mh); @@ -118,19 +118,19 @@ return true; } - void draw () { + override void draw () { super.draw(); adapter.draw (x,y); } - void activated () { + override void activated () { content.endEvent; } - protected: - IRenderer.TextAdapter adapter; - EventContent content; - int index; +protected: + IRenderer.TextAdapter adapter; + EventContent content; + int index; } /// Pops up a list of selectable values class EnumContentWidget : AButtonWidget @@ -154,11 +154,11 @@ h = mh; } - void activated () { + override void activated () { mgr.addPopup (this, internalWidg); } - void draw () { + override void draw () { super.draw; adapter.draw (x,y); } @@ -191,7 +191,7 @@ super (mgr, id, data); } - void draw () { + override void draw () { super.draw; foreach (i,yp; yPos) { adapters[i].draw (x,y+yp); @@ -199,7 +199,7 @@ } /// Called when a mouse click event occurs while held; handles up-click - bool clickWhilePushed (wdabs cx, wdabs cy, ubyte b, bool state) { + override bool clickWhilePushed (wdabs cx, wdabs cy, ubyte b, bool state) { if (b == 1 && state == false) { cy -= y; if (cx >= x && cx < x+w && cy >= 0 && cy < h) { @@ -222,7 +222,7 @@ return false; } - void activated () {} + override void activated () {} protected: EnumContent content;
--- a/mde/gui/widget/miscWidgets.d Fri Dec 19 10:32:28 2008 +0000 +++ b/mde/gui/widget/miscWidgets.d Fri Dec 19 15:15:06 2008 +0000 @@ -31,7 +31,7 @@ super (mgr, id, data); } - void draw () { + override void draw () { super.draw; mgr.renderer.drawBlank (x,y, w,h); @@ -46,7 +46,7 @@ super (mgr, id, data); } - void draw () { + override void draw () { super.draw; mgr.renderer.drawBlank (x,y, w,h); @@ -68,7 +68,7 @@ Stdout (" ]").newline; } - void draw () { + override void draw () { super.draw; mgr.renderer.drawBlank (x,y, w,h); @@ -85,7 +85,7 @@ super (mgr, id, data); } - void activated () { + override void activated () { Stdout ("Button clicked!").newline; } }
--- a/mde/gui/widget/textContent.d Fri Dec 19 10:32:28 2008 +0000 +++ b/mde/gui/widget/textContent.d Fri Dec 19 15:15:06 2008 +0000 @@ -57,23 +57,23 @@ super (mgr, id, data); } - bool isWSizable () { return true; } - bool isHSizable () { return true; } + override bool isWSizable () { return true; } + override bool isHSizable () { return true; } /** On click, request keyboard input. */ - int clickEvent (wdabs, wdabs, ubyte, bool state) { + override int clickEvent (wdabs, wdabs, ubyte, bool state) { adapter.index = content.editIndex; mgr.requestRedraw; return 1; // get keyboard input via keyEvent } - void keyEvent (ushort s, char[] i) { + override void keyEvent (ushort s, char[] i) { adapter.text = content.keyStroke (s, i); adapter.index = content.editIndex; adapter.getDimensions (mw, mh); // NOTE: only passively change size: next resize will see new minimal size mgr.requestRedraw; } - void keyFocusLost () { + override void keyFocusLost () { adapter.text = content.endEdit; // update other users of content relying on callbacks adapter.index; mgr.requestRedraw;