Graphics/ZoomDialog.py

Sun, 08 Dec 2013 12:26:22 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 08 Dec 2013 12:26:22 +0100
branch
5_3_x
changeset 3133
95f357148982
parent 2302
f29e9405c851
child 3163
9f50365a0870
permissions
-rw-r--r--

Prepared new stable release.

# -*- coding: utf-8 -*-

# Copyright (c) 2006 - 2013 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module implementing a zoom dialog for a graphics canvas.
"""

from PyQt4.QtGui import QDialog

from .Ui_ZoomDialog import Ui_ZoomDialog


class ZoomDialog(QDialog, Ui_ZoomDialog):
    """
    Class implementing a zoom dialog for a graphics canvas.
    """
    def __init__(self, zoom, parent=None, name=None):
        """
        Constructor
        
        @param zoom zoom factor to show in the spinbox (float)
        @param parent parent widget of this dialog (QWidget)
        @param name name of this dialog (string)
        """
        super().__init__(parent)
        if name:
            self.setObjectName(name)
        else:
            self.setObjectName("ZoomDialog")
        self.setupUi(self)
        self.zoomSpinBox.setValue(zoom)
        
    def getZoomSize(self):
        """
        Public method to retrieve the zoom size.
        
        @return zoom size (double)
        """
        return self.zoomSpinBox.value()

eric ide

mercurial