Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tutorius/properties.py
diff options
context:
space:
mode:
Diffstat (limited to 'tutorius/properties.py')
-rw-r--r--tutorius/properties.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/tutorius/properties.py b/tutorius/properties.py
index 6bd16ee..a462782 100644
--- a/tutorius/properties.py
+++ b/tutorius/properties.py
@@ -27,6 +27,13 @@ from .constraints import Constraint, \
ColorConstraint, FileConstraint, BooleanConstraint, EnumConstraint, \
ResourceConstraint
+from .propwidgets import PropWidget, \
+ StringPropWidget, \
+ UAMPropWidget, \
+ EventTypePropWidget, \
+ IntPropWidget, \
+ FloatPropWidget, \
+ IntArrayPropWidget
class TPropContainer(object):
"""
@@ -148,6 +155,7 @@ class TutoriusProperty(object):
get_contraints() : the constraints inserted on this property. They define
what is acceptable or not as values.
"""
+ widget_class = PropWidget
def __init__(self):
super(TutoriusProperty, self).__init__()
self.type = None
@@ -192,7 +200,7 @@ class TIntProperty(TutoriusProperty):
Represents an integer. Can have an upper value limit and/or a lower value
limit.
"""
-
+ widget_class = IntPropWidget
def __init__(self, value, lower_limit=None, upper_limit=None):
TutoriusProperty.__init__(self)
self.type = "int"
@@ -206,6 +214,7 @@ class TFloatProperty(TutoriusProperty):
Represents a floating point number. Can have an upper value limit and/or
a lower value limit.
"""
+ widget_class = FloatPropWidget
def __init__(self, value, lower_limit=None, upper_limit=None):
TutoriusProperty.__init__(self)
self.type = "float"
@@ -219,6 +228,7 @@ class TStringProperty(TutoriusProperty):
"""
Represents a string. Can have a maximum size limit.
"""
+ widget_class = StringPropWidget
def __init__(self, value, size_limit=None):
TutoriusProperty.__init__(self)
self.type = "string"
@@ -231,6 +241,7 @@ class TArrayProperty(TutoriusProperty):
Represents an array of properties. Can have a maximum number of element
limit, but there are no constraints on the content of the array.
"""
+ widget_class = IntArrayPropWidget
def __init__(self, value, min_size_limit=None, max_size_limit=None):
TutoriusProperty.__init__(self)
self.type = "array"
@@ -250,6 +261,7 @@ class TArrayProperty(TutoriusProperty):
min_size_limit=self.min_size_limit.limit,
value=self.value,
)
+
class TColorProperty(TutoriusProperty):
"""
Represents a RGB color with 3 8-bit integer values.
@@ -359,6 +371,7 @@ class TUAMProperty(TutoriusProperty):
"""
Represents a widget of the interface by storing its UAM.
"""
+ widget_class = UAMPropWidget
def __init__(self, value=None):
TutoriusProperty.__init__(self)
@@ -391,6 +404,7 @@ class TEventType(TutoriusProperty):
"""
Represents an GUI signal for a widget.
"""
+ widget_class = EventTypePropWidget
def __init__(self, value):
super(TEventType, self).__init__()
self.type = "gtk-signal"