[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form - vocabularywidget.py:1.11

Fred L. Drake, Jr. fred@zope.com
Thu, 29 May 2003 11:38:51 -0400


Update of /cvs-repository/Zope3/src/zope/app/browser/form
In directory cvs.zope.org:/tmp/cvs-serv4611

Modified Files:
	vocabularywidget.py 
Log Message:
Introduce classes specifically for single-select widgets that use
select-list and dropdown-list form fields.


=== Zope3/src/zope/app/browser/form/vocabularywidget.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/browser/form/vocabularywidget.py:1.10	Thu May 29 10:35:06 2003
+++ Zope3/src/zope/app/browser/form/vocabularywidget.py	Thu May 29 11:38:51 2003
@@ -327,7 +327,7 @@
                                     selected=None)
 
 
-class VocabularyEditWidget(VocabularyEditWidgetBase):
+class SelectListWidget(VocabularyEditWidgetBase):
     """Vocabulary-backed single-selection edit widget.
 
     This widget can be used when the number of selections isn't going
@@ -368,6 +368,13 @@
                                     id=self.name,
                                     value=self._showData())
 
+# more general alias
+VocabularyEditWidget = SelectListWidget
+
+class DropdownListWidget(SelectListWidget):
+    """Variation of the SelectListWidget that uses a drop-down list."""
+
+    size = 1
 
 class VocabularyMultiEditWidget(VocabularyEditWidgetBase):
     """Vocabulary-backed widget supporting multiple selections."""