IconEditor/IconZoomDialog.py

Sat, 02 Jan 2010 15:11:35 +0000

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 02 Jan 2010 15:11:35 +0000
changeset 12
1d8dd9706f46
parent 0
de9c2efb9d02
child 13
1af94a91f439
permissions
-rw-r--r--

First commit after changing to Python 3.1.

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

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

"""
Module implementing a dialog to select the zoom factor.
"""

from PyQt4.QtGui import QDialog

from .Ui_IconZoomDialog import Ui_IconZoomDialog

class IconZoomDialog(QDialog, Ui_IconZoomDialog):
    """
    Class implementing a dialog to select the zoom factor.
    """
    def __init__(self, zoom, parent = None):
        """
        Constructor
        
        @param zoom zoom factor to show in the spinbox
        @param parent parent widget of this dialog (QWidget)
        """
        QDialog.__init__(self, parent)
        self.setupUi(self)
        
        self.zoomSpinBox.setValue(zoom * 100)
        self.zoomSpinBox.selectAll()
        
    def getZoomFactor(self):
        """
        Public method to retrieve the zoom factor.
        
        @return zoom factor (int)
        """
        return self.zoomSpinBox.value() // 100

eric ide

mercurial