[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form -
widget.py:1.64.4.5
Dave Fregon
axxs at axxs.org
Sun Feb 8 00:36:39 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/browser/form
In directory cvs.zope.org:/tmp/cvs-serv9116/src/zope/app/browser/form
Modified Files:
Tag: ozzope-widgets-branch
widget.py
Log Message:
Removed propertyNames and added implements for classes
=== Zope3/src/zope/app/browser/form/widget.py 1.64.4.4 => 1.64.4.5 ===
--- Zope3/src/zope/app/browser/form/widget.py:1.64.4.4 Sat Feb 7 23:36:00 2004
+++ Zope3/src/zope/app/browser/form/widget.py Sun Feb 8 00:36:09 2004
@@ -496,7 +496,8 @@
/>
"""
- propertyNames = ['displayWidth', 'displayMaxWidth', 'extra', 'default']
+ implements(interfaces.ITextWidget)
+
default = ''
displayWidth = 20
displayMaxWidth = ""
@@ -560,6 +561,7 @@
>>> widget.getInputValue()
'Bob'
"""
+ implements(interfaces.IBytesWidget)
class ASCII(Bytes):
""" ASCII
@@ -570,8 +572,11 @@
Single-line data (string) input
"""
+ implements(interfaces.IASCIIWidget)
class IntWidget(TextWidget):
+
+ implements(interfaces.IIntWidget)
displayWidth = 10
def _convert(self, value):
@@ -584,6 +589,8 @@
raise ConversionError("Invalid integer data", v)
class FloatWidget(TextWidget):
+
+ implements(interfaces.IFloatWidget)
displayWidth = 10
def _convert(self, value):
@@ -597,6 +604,8 @@
class DatetimeWidget(TextWidget):
"""Datetime entry widget."""
+
+ implements(interfaces.IDatetimeWidget)
displayWidth = 20
def _convert(self, value):
@@ -611,6 +620,8 @@
class DateWidget(TextWidget):
"""Date entry widget.
"""
+
+ implements(interfaces.IDateWidget)
displayWidth = 20
def _convert(self, value):
@@ -672,7 +683,8 @@
dude!</textarea>
"""
- propertyNames = ['width', 'height', 'extra']
+
+ implements(interfaces.ITextAreaWidget)
default = ""
width = 60
@@ -720,9 +732,12 @@
"""
+ implements(interfaces.IBytesAreaWidget)
+
class PasswordWidget(TextWidget):
"""Password Widget"""
-
+
+ implements(interfaces.IPasswordWidget)
inputType = 'password'
def __call__(self):
@@ -755,7 +770,8 @@
class FileWidget(TextWidget):
"""File Widget"""
-
+
+ implements(interfaces.IFileWidget)
inputType = 'file'
def __call__(self):
@@ -817,11 +833,13 @@
"""A widget that has a number of items in it."""
# What the heck is this for?
-
+ implements(interfaces.IItemsWidget)
class SingleItemsWidget(ItemsWidget):
"""A widget with a number of items that has only a single
selectable item."""
+
+ implements(interfaces.ISingleItemsWidget)
default = ""
firstItem = False
@@ -876,7 +894,8 @@
class ListWidget(SingleItemsWidget):
"""List widget."""
- propertyNames = ['firstItem', 'items', 'size', 'extra']
+
+ implements(interfaces.IListWidget)
size = 5
def __call__(self):
@@ -900,7 +919,7 @@
class RadioWidget(SingleItemsWidget):
"""Radio buttons widget."""
- propertyNames = ['firstItem', 'orientation']
+ implements(interfaces.ISingleItemsWidget)
orientation = "vertical"
def __call__(self):
@@ -953,6 +972,8 @@
class MultiItemsWidget(ItemsWidget):
"""A widget with a number of items that has multiple selectable items."""
+
+ implements(interfaces.IMultiItemsWidget)
default = []
def _convert(self, value):
@@ -1001,7 +1022,8 @@
class MultiListWidget(MultiItemsWidget):
"""List widget with multiple select."""
- propertyNames = ['size', 'extra']
+
+ implements(interfaces.IMultiListWidget)
size = 5
def __call__(self):
@@ -1025,7 +1047,9 @@
class MultiCheckBoxWidget(MultiItemsWidget):
"""Multiple checkbox widget."""
- propertyNames = ['orientation']
+
+
+ implements(interfaces.IMultiCheckBoxWidget)
orientation = "vertical"
def __call__(self):
@@ -1059,6 +1083,8 @@
subwidget - Optional CustomWidget used to generate widgets for the
items in the sequence
"""
+
+ implements(interfaces.ISequenceWidget)
_type = tuple
_data = () # pre-existing sequence items (from setRenderedValue)
@@ -1254,9 +1280,13 @@
return sequence
class TupleSequenceWidget(SequenceWidget):
+
+ implements(interfaces.ITupleSequenceWidget)
pass
class ListSequenceWidget(SequenceWidget):
+
+ implements(interfaces.IListSequenceWidget)
_type = list
class ObjectWidget(BrowserWidget):
@@ -1267,6 +1297,8 @@
*_widget - Optional CustomWidgets used to generate widgets for the
fields in this widget
"""
+
+ implements(interfaces.IObjectWidget)
_object = None # the object value (from setRenderedValue & request)
_request_parsed = False
More information about the Zope3-Checkins
mailing list