Mercurial > projects > mde
diff mde/gui/exception.d @ 27:0aa621b3e070
Some GUI work, plus a small fix in the paths module.
Implemented GUI code to load windows from file with a basic widget and draw.
Fixed a bug in mde.resource.paths.mdeDirectory.makeMTReader when called with readOrder == PRIORITY.HIGH_ONLY.
committer: Diggory Hardy <diggory.hardy@gmail.com>
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Fri, 04 Apr 2008 17:07:38 +0100 |
parents | |
children | 5132301e9ed7 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mde/gui/exception.d Fri Apr 04 17:07:38 2008 +0100 @@ -0,0 +1,49 @@ +/* LICENSE BLOCK +Part of mde: a Modular D game-oriented Engine +Copyright © 2007-2008 Diggory Hardy + +This program is free software: you can redistribute it and/or modify it under the terms +of the GNU General Public License as published by the Free Software Foundation, either +version 2 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; +without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/// All GUI Exception classes +module mde.gui.exception; + +import mde.exception; + +class GuiException : mdeException +{ + char[] getSymbol () { + return super.getSymbol ~ ".gui"; + } + + this (char[] msg) { + super(msg); + } +} + +/// Thrown when something goes wrong while loading a window (usually a data error). +class WindowLoadException : GuiException +{ + this (char[] msg) { + super(msg); + } +} + +/// Thrown when or createWidget a Widget class's this() is called with invalid data. +class WidgetDataException : WindowLoadException +{ + this () { // Default, by Widget class's this + super ("Bad widget data"); + } + this (char[] msg) { // From createWidget + super (msg); + } +}