Index: /trunk/camelot/types/__init__.py
===================================================================
--- /trunk/camelot/types/__init__.py (revision 1153)
+++ /trunk/camelot/types/__init__.py (revision 1179)
@@ -99,4 +99,6 @@
   
     eg: ``['08', 'AB']`` is stored as ``08.AB``
+    
+    .. image:: ../_static/editors/CodeEditor_editable.png
     """
     
@@ -154,5 +156,6 @@
       rating = Field(camelot.types.Rating())
       
-  .. image:: ../_static/rating.png"""
+  .. image:: ../_static/editors/StarEditor_editable.png
+"""
     
     impl = types.Integer
@@ -162,5 +165,6 @@
   rendered in a rich text editor.  
   
-  .. image:: ../_static/richtext.png"""
+    .. image:: ../_static/editors/RichTextEditor_editable.png
+"""
     
     impl = types.UnicodeText
@@ -199,7 +203,6 @@
     class MovieType(Entity):
       color = Field(camelot.types.Color())
-  
-  .. image:: ../_static/color.png
-  
+
+  .. image:: ../_static/editors/ColorEditor_editable.png  
   
   The colors are stored in the database as strings 
@@ -255,5 +258,5 @@
                                               index=True, required=True, default='planning')
   
-  .. image:: ../_static/enumeration.png  
+  .. image:: ../_static/editors/ChoicesEditor_editable.png  
   """
     
@@ -312,5 +315,5 @@
       script = Field(camelot.types.File(upload_to='script'))
       
-  .. image:: ../_static/file_delegate.png
+  .. image:: ../_static/editors/FileEditor_editable.png
     """
     
@@ -361,5 +364,5 @@
   the files stored should be images.
   
-  .. image:: ../_static/image.png  
+  .. image:: ../_static/editors/ImageEditor_editable.png
     """
   
Index: /trunk/camelot/view/field_attributes.py
===================================================================
--- /trunk/camelot/view/field_attributes.py (revision 1175)
+++ /trunk/camelot/view/field_attributes.py (revision 1179)
@@ -34,5 +34,4 @@
 from controls import delegates
 from camelot.core import constants
-from camelot.core.utils import ugettext as _
 from camelot.view.utils import (
     bool_from_string,
@@ -279,6 +278,6 @@
     row = row_format%(field_type.__name__, delegate.__name__, '.. image:: ../_static/editors/%s_editable.png'%(delegate.editor.__name__))
     doc += row + """
-  """ + row_separator + """
-  """
+""" + row_separator + """
+"""
 
 doc += """
Index: /trunk/camelot/view/controls/delegates/__init__.py
===================================================================
--- /trunk/camelot/view/controls/delegates/__init__.py (revision 1150)
+++ /trunk/camelot/view/controls/delegates/__init__.py (revision 1179)
@@ -1,10 +1,3 @@
 
-"""Camelot includes a number of Qt delegates, most of them are used as default
-delegates for the various sqlalchemy and camelot field types.
-
-Some delegates take specific arguments into account for their construction.
-All :attr:`field_attributes` specified for a certain field will be propagated
-towards the constructor of the delegate.
-"""
 
 from delegatemanager import DelegateManager
@@ -37,2 +30,23 @@
 from notedelegate import NoteDelegate
 from labeldelegate import LabelDelegate
+
+doc = """Camelot includes a number of Qt delegates, most of them are used as default
+delegates for the various sqlalchemy and camelot field types.
+
+Some delegates take specific arguments into account for their construction.
+All :attr:`field_attributes` specified for a certain field will be propagated
+towards the constructor of the delegate.  Some of them will be used by the delegate
+itself, others will be used by the editor, created by the delegate.
+
+"""
+
+custom_delegates = list(CustomDelegate.__subclasses__())
+custom_delegates.sort(key=lambda d:d.__name__)
+for custom_delegate in custom_delegates:
+    doc = doc + custom_delegate.__name__ + '\n' + '-'*len(custom_delegate.__name__) + '\n'
+    if hasattr(custom_delegate, '__doc__'):
+        doc = doc + custom_delegate.__doc__ + '\n'
+    
+print doc
+
+__doc__ = doc
Index: /trunk/camelot/view/controls/delegates/comboboxdelegate.py
===================================================================
--- /trunk/camelot/view/controls/delegates/comboboxdelegate.py (revision 1085)
+++ /trunk/camelot/view/controls/delegates/comboboxdelegate.py (revision 1179)
@@ -109,214 +109,2 @@
                          unicode(value))
         painter.restore()
-
-
-class ComboBoxEditorDelegate(ComboBoxDelegate):
-    """Delegate for combobox which makes sure that the editor (of the combobox)
-is visible even if it isn't selected"""
-
-    def __init__(self, choices, parent=None, editable=True, **kwargs):
-        ComboBoxDelegate.__init__(self, parent, choices, editable, **kwargs)
-
-    def setEditorData(self, editor, index):
-        value = variant_to_pyobject(index.data(Qt.EditRole))
-
-        def create_choices_getter(model, row):
-
-            def choices_getter():
-                print 'in set editor data', self.choices(None)
-                return list(self.choices(None))
-
-            return choices_getter
-
-        #editor.set_value(value)
-        post(create_choices_getter(index.model(),index.row()),
-             editor.set_choices)
-
-    def setModelData(self, editor, model, index):
-        return None
-        #model.setData(index, create_constant_function(editor.get_value()))
-
-    def paint(self, painter, option, index):
-        """adapted from booldelegate"""
-
-        painter.save()
-        self.drawBackground(painter, option, index)
-        #checked = index.model().data(index, Qt.EditRole).toString().__str__()
-        value = index.model().data(index, Qt.DisplayRole).toString().__str__()
-        #c = index.model().data(index, Qt.BackgroundRole)
-        #background_color = QtGui.QColor(c)
-        background_color = QtGui.QColor(Qt.blue)
-
-        #check_option = QtGui.QStyleOptionComboBox()
-        #check_option = QtGui.QStyleOptionButton()
-        check_option = QtGui.QStyleOptionMenuItem()
-        #check_option.OptionType = QStyleOption.SO_ComboBox
-
-        #check_option.text = QString('choice')    
-    
-class ComboBoxEditorDelegate(ComboBoxDelegate):  
-    
-    editor = editors.ChoicesEditor
-    
-    """ 
-        Delegate for combobox which makes sure that the editor (of the combobox) is visible
-        even if it isn't selected
-    """
-    def __init__(self, choices, parent=None, editable=True, **kwargs):
-         ComboBoxDelegate.__init__(self, parent, choices, editable, **kwargs)
-         
-    def setEditorData(self, editor, index):
-        value = variant_to_pyobject(index.data(Qt.EditRole))
-
-        def create_choices_getter(model, row):
-          
-          def choices_getter():
-
-            return list(self.choices(None))
-          
-          return choices_getter
-        
-        #editor.set_value(value)
-        post(create_choices_getter(index.model(),index.row()), editor.set_choices)
-    
-    def setModelData(self, editor, model, index):
-        return None
-        #model.setData(index, create_constant_function(editor.get_value()))
-    
-    """ adapted from booldelegate """     
-    def paint(self, painter, option, index):
-        painter.save()
-        self.drawBackground(painter, option, index)
-        #checked = index.model().data(index, Qt.EditRole).toString().__str__()
-        value = index.model().data(index, Qt.DisplayRole).toString().__str__()
-        print "index value in delegate", value
-        
-        #background_color = QtGui.QColor(index.model().data(index, Qt.BackgroundRole))
-        background_color = QtGui.QColor(Qt.blue)
-        
-        #check_option = QtGui.QStyleOptionComboBox()
-        #check_option = QtGui.QStyleOptionButton()
-        check_option = QtGui.QStyleOptionMenuItem()
-        #check_option.OptionType = QStyleOption.SO_ComboBox
-        
-        #check_option.text = QString('choice')
-        
-        rect = QtCore.QRect(option.rect.left(),
-                            option.rect.top(),
-                            option.rect.width(),
-                            option.rect.height())
-
-        #check_option.rect = rect
-        check_option.palette = option.palette
-        
-        #if (option.state & QtGui.QStyle.State_Selected):
-        #  painter.fillRect(option.rect, option.palette.highlight())
-        #elif not self.editable:
-        #  painter.fillRect(option.rect, option.palette.window())
-        #else:
-        painter.fillRect(option.rect, background_color)
-          
-        #if checked:
-          #check_option.state = option.state | QtGui.QStyle.State_On
-          #check_option.state = QtGui.QStyle.State_On
-        #else:
-      #check_option.state = option.state | QtGui.QStyle.State_Off
-          #check_option.state = QtGui.QStyle.State_On
-          
-        check_option.state = QtGui.QStyle.State_DownArrow  
-          
-        QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_MenuBarItem,
-                                               check_option,
-                                               painter)
-        
-        QtGui.QApplication.style().drawItemText(painter, rect, 0, option.palette, True, QString(value))
-        painter.restore()
-
-             
-class TestComboBoxDelegate(QItemDelegate):
-
-
-    def __init__(self, choices, parent = None):
-
-        QItemDelegate.__init__(self, parent)
-        self.choices = choices
-
-    
-    def createEditor(self, parent, option, index):
-        editor = QComboBox( parent )
-        i = 0
-        for choice in self.choices:
-            editor.insertItem(i, unicode(choice), QVariant(QString(choice)))
-            i = i + 1
-        return editor
-
-    def setEditorData( self, comboBox, index ):
-        value = index.model().data(index, Qt.DisplayRole).toInt()
-        comboBox.setCurrentIndex(value[0])
-
-    def setModelData(self, editor, model, index):
-        value = editor.currentIndex()
-        model.setData( index, editor.itemData( value, Qt.DisplayRole ) )
-
-    def updateEditorGeometry( self, editor, option, index ):
-
-        editor.setGeometry(option.rect)
-        rect = QtCore.QRect(option.rect.left(),
-                            option.rect.top(),
-                            option.rect.width(),
-                            option.rect.height())
-
-        #check_option.rect = rect
-        check_option.palette = option.palette
-
-        #if (option.state & QtGui.QStyle.State_Selected):
-        #    painter.fillRect(option.rect, option.palette.highlight())
-        #elif not self.editable:
-        #    painter.fillRect(option.rect, option.palette.window())
-        #else:
-        #    painter.fillRect(option.rect, background_color)
-
-        #if checked:
-        #    check_option.state = option.state | QtGui.QStyle.State_On
-        #else:
-        #    check_option.state = option.state | QtGui.QStyle.State_Off
-        check_option.state = QtGui.QStyle.State_DownArrow
-
-        QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_MenuBarItem,
-                                               check_option,
-                                               painter)
-
-        QtGui.QApplication.style().drawItemText(painter,
-                                                rect,
-                                                0,
-                                                option.palette,
-                                                True,
-                                                QString('choice'))
-
-        painter.restore()
-
-
-class TestComboBoxDelegate(QItemDelegate):
-
-    def __init__(self, choices, parent=None):
-        QItemDelegate.__init__(self, parent)
-        self.choices = choices
-
-    def createEditor(self, parent, option, index):
-        editor = QComboBox(parent)
-        i = 0
-        for choice in self.choices:
-            editor.insertItem(i, unicode(choice), QVariant(QString(choice)))
-            i = i + 1
-        return editor
-
-    def setEditorData(self, comboBox, index):
-        value = index.model().data(index, Qt.DisplayRole).toInt()
-        comboBox.setCurrentIndex(value[0])
-
-    def setModelData(self, editor, model, index):
-        value = editor.currentIndex()
-        model.setData(index, editor.itemData(value, Qt.DisplayRole))
-
-    def updateEditorGeometry(self, editor, option, index):
-        editor.setGeometry(option.rect)
Index: /trunk/camelot/view/controls/delegates/customdelegate.py
===================================================================
--- /trunk/camelot/view/controls/delegates/customdelegate.py (revision 1086)
+++ /trunk/camelot/view/controls/delegates/customdelegate.py (revision 1179)
@@ -46,7 +46,20 @@
 .. image:: ../_static/delegates/%s_unselected_disabled.png
 .. image:: ../_static/delegates/%s_unselected_editable.png
+
 .. image:: ../_static/delegates/%s_selected_disabled.png
 .. image:: ../_static/delegates/%s_selected_editable.png
-"""%(name, name, name, name)
+
+"""%(name, name, name, name,)
+
+    if 'editor' in dct:
+        dct['__doc__'] = dct['__doc__'] + '.. image:: ../_static/editors/%s_editable.png'%dct['editor'].__name__ + '\n'
+        
+    if '__init__' in dct:
+        dct['__doc__'] = dct['__doc__'] + 'Field attributes supported by this delegate : \n'
+        import inspect
+        args, _varargs, _varkw,  _defaults = inspect.getargspec(dct['__init__'])
+        for arg in args:
+            if arg not in ['self', 'parent']:
+                dct['__doc__'] = dct['__doc__'] + '\n * %s'%arg
     return type(name, bases, dct)
 
Index: /trunk/camelot/view/controls/delegates/labeldelegate.py
===================================================================
--- /trunk/camelot/view/controls/delegates/labeldelegate.py (revision 1150)
+++ /trunk/camelot/view/controls/delegates/labeldelegate.py (revision 1179)
@@ -32,5 +32,5 @@
             
         QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_CheckBox,
-                                               check_option,
+                                               checked,
                                                painter)
         painter.restore()
