Mercurial > fife-parpg
diff tools/editor/scripts/gui/layerdialog.py @ 562:e34b44afd428
Fixed the built in pychan dialogs as they didin't work at all. Updated the editor to support modal execution and now use the pychan dialog message boxes for displaying some error messages.
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Thu, 24 Jun 2010 19:58:59 +0000 |
parents | 9d94f4676d17 |
children | 0e0a30f0eb20 |
line wrap: on
line diff
--- a/tools/editor/scripts/gui/layerdialog.py Thu Jun 24 18:40:30 2010 +0000 +++ b/tools/editor/scripts/gui/layerdialog.py Thu Jun 24 19:58:59 2010 +0000 @@ -23,6 +23,7 @@ from fife import fife from fife.extensions import pychan +from fife.extensions.pychan import dialogs class LayerDialog(object): """ The B{LayerDialog} provides a gui dialog for creating and editing layers. @@ -86,33 +87,33 @@ # Collect and validate data layerId = self._widget.collectData('layerBox') if layerId == '': - print 'Please enter a layer id.' + dialogs.message(message=unicode("Please enter a layer id."), caption=unicode("Error")) return try: x_offset = float(self._widget.collectData('xOffsetBox')) y_offset = float(self._widget.collectData('yOffsetBox')) except ValueError: - print 'Please enter integer or decimal values for offset.' + dialogs.message(message=unicode("Please enter integer or decimal values for offset."), caption=unicode("Error")) return try: x_scale = float(self._widget.collectData('xScaleBox')) y_scale = float(self._widget.collectData('yScaleBox')) except ValueError: - print 'Please enter integer or decimal values for scale.' + dialogs.message(message=unicode("Please enter integer or decimal values for scale."), caption=unicode("Error")) return try: rotation = float(self._widget.collectData('rotBox')) except ValueError: - print 'Please enter integer or decimal value for rotation.' + dialogs.message(message=unicode("Please enter integer or decimal value for rotation."), caption=unicode("Error")) return try: transparency = int(self._widget.collectData('transBox')) except ValueError: - print 'Please enter an integer value in the range of 0-255 for transparency.' + dialogs.message(message=unicode("Please enter an integer value in the range of 0-255 for transparency."), caption=unicode("Error")) return @@ -170,4 +171,4 @@ self._widget.hide() if self.callback: - pychan.tools.applyOnlySuitable(self.callback, layer=layer) \ No newline at end of file + pychan.tools.applyOnlySuitable(self.callback, layer=layer)