Package pyforms :: Package gui :: Package Controls :: Module ControlText |
[hide private]
[frames] | no frames]

# Source Code for Module pyforms.gui.Controls.ControlText

     1  #!/usr/bin/python
     2  # -*- coding: utf-8 -*-
     3  '''
     4  @author: Ricardo Ribeiro
     5  @credits: Ricardo Ribeiro
     6  @license: MIT
     7  @version: 0.0
     8  @maintainer: Ricardo Ribeiro
     9  @email: ricardojvr@gmail.com
    10  @status: Development
    11  @lastEditedBy: Carlos Mão de Ferro (carlos.maodeferro@neuro.fchampalimaud.org)
    12  '''
    13
    14  from pyforms.gui.Controls.ControlBase import ControlBase
    15
    16
    17 -class ControlText(ControlBase):
    18
    19 -        def initForm(self):
    20                  super(ControlText, self).initForm()
    21                  self.form.lineEdit.editingFinished.connect(self.finishEditing)
    22
    23 -        def finishEditing(self):
    24                  """Function called when the lineEdit widget is edited"""
    25                  self.changed()
    26
    27          ###################################################################
    28          ############ Properties ###########################################
    29          ###################################################################
    30
    31          @property
    32 -        def value(self):
    33                  self._value = str(self._form.lineEdit.text())
    34                  return self._value
    35
    36          @value.setter
    37 -        def value(self, value):
    38                  self._form.lineEdit.setText(value)
    39                  ControlBase.value.fset(self, value)
    40
    41          @property
    42 -        def label(self): return self.form.label.text()
    43
    44          @label.setter
    45 -        def label(self, value):
    46                  self.form.label.setText(value)
    47                  ControlBase.label.fset(self, value)
    48