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

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

      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
     12
     13  import os
     14  import pickle
     15  from PyQt4 import uic, QtGui
     16  from PyQt4 import QtCore
     17  import pyforms.Utils.tools as tools
     18  from pyforms.gui.Controls.ControlBase import ControlBase
     19
     20
     21 -class ControlHidden(ControlBase):
     22
     23      _value = None
     24      _form = None
     25      _label = None
     26
     27 -    def __init__(self, label = "", defaultValue = ""):
     28          self._value = defaultValue
     29          self._parent = 1
     30          self._label = label
     31          self.initForm()
     32
     33 -    def initForm(self): pass
     34
     35 -    def finishEditing(self):
     36          self.changed()
     37
     38 -    def changed(self): pass
     39
     40 -    def load(self, data):
     41          if 'value' in data: self.value = data['value']
     42
     43 -    def save(self, data):
     44          if self.value: data['value'] = self.value
     45
     46
     47 -    def show(self): pass
     48
     49 -    def hide(self): pass
     50
     51      ############################################################################
     52      ############ Properties ####################################################
     53      ############################################################################
     54
     55      @property
     56 -    def enabled(self): return True
     57
     58      @enabled.setter
     59 -    def enabled(self, value): pass
     60
     61      ############################################################################
     62
     63      @property
     64 -    def value(self): return self._value
     65
     66      @value.setter
     67 -    def value(self, value):
     68          oldvalue = self._value
     69          self._value = value
     70          if oldvalue!=value: self.changed()
     71
     72      ############################################################################
     73
     74      @property
     75 -    def label(self): return self._label
     76
     77      @label.setter
     78 -    def label(self, value): self._label = value
     79
     80      ############################################################################
     81
     82      @property
     83 -    def form(self): return None
     84
     85      ############################################################################
     86
     87      @property
     88 -    def parent(self): return self._parent
     89
     90      @parent.setter
     91 -    def parent(self, value): self._parent = value
     92
     93
     94
     95      @property
     96 -    def maxWidth(self): return 0
     97
     98      @maxWidth.setter
     99 -    def maxWidth(self, value): 0
    100
    101      @property
    102 -    def minWidth(self): return 0
    103
    104      @minWidth.setter
    105 -    def minWidth(self, value): 0
    106
    107
    108      @property
    109 -    def maxHeight(self): return 0
    110
    111      @maxHeight.setter
    112 -    def maxHeight(self, value): 0
    113
    114      @property
    115 -    def minHeight(self): return 0
    116
    117      @minHeight.setter
    118 -    def minHeight(self, value): 0
    119