Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tutorius/properties.py
diff options
context:
space:
mode:
authorVincent Vinet <vince.vinet@gmail.com>2009-11-19 16:33:26 (GMT)
committer Vincent Vinet <vince.vinet@gmail.com>2009-11-19 16:34:28 (GMT)
commitdee6412f6beae82952ed0a07fc2bfdfb0cbb3e79 (patch)
tree1fa73b93a70150dc23f610d34e8b62e727f0f2da /tutorius/properties.py
parent40f836b057896469bca69772d9fc7168b2f8c644 (diff)
refac property editing in the creator
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 5422532..aab6a0c 100644
--- a/tutorius/properties.py
+++ b/tutorius/properties.py
@@ -25,6 +25,13 @@ from .constraints import Constraint, \
UpperLimitConstraint, LowerLimitConstraint, \
MaxSizeConstraint, MinSizeConstraint, \
ColorConstraint, FileConstraint, BooleanConstraint, EnumConstraint
+from .propwidgets import PropWidget, \
+ StringPropWidget, \
+ UAMPropWidget, \
+ EventTypePropWidget, \
+ IntPropWidget, \
+ FloatPropWidget, \
+ IntArrayPropWidget
class TPropContainer(object):
"""
@@ -131,6 +138,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
@@ -175,7 +183,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"
@@ -189,6 +197,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"
@@ -202,6 +211,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"
@@ -214,6 +224,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"
@@ -233,6 +244,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.
@@ -311,6 +323,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)
@@ -343,6 +356,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"