view mde/gui/exception.d @ 39:5132301e9ed7

Implemented widget saving. Widget creation data saving (sub-widgets, etc:) code there but not used. Widget mutable data saving & loading: window size/position, row/column dimensions saved (still needs a fix in GridWidget.setSize()). committer: Diggory Hardy <diggory.hardy@gmail.com>
author Diggory Hardy <diggory.hardy@gmail.com>
date Wed, 07 May 2008 13:07:03 +0100
parents 0aa621b3e070
children b28d7adc786b
line wrap: on
line source

/* 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 createWidget or 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);
    }
}

/// Thrown when a Widget class's adjust() is called with invalid data.
class MutableDataException : WindowLoadException
{
    this () {   // Default, by Widget class's this
        super ("Bad widget mutable data");
    }
    this (char[] msg) { // From createWidget
        super (msg);
    }
}