Inherits from
- EditorFactory: enthought.traits.ui.editor_factory.EditorFactory
Attributes
- alt_theme
The theme to use for alternate row cells (defaults to 'cell_theme):
alt_theme = Any
- auto_add
Should a new row automatically be added to the end of the table to allow the user to create new entries? If True, row_factory must be set.
auto_add = Bool(False)
- auto_size
Should the cells of the table automatically size to the optimal size?
auto_size = Bool(True)
- cell_bg_color
Color to use for cell backgrounds The default is the "WindowColor" constant declared in ui.api: we shall set the value in a trait initializer method, in order to avoid circular imports.
cell_bg_color = Color
- cell_color
Color to use for text in cells
cell_color = Color('black')
- cell_font
Font to use for text in cells
cell_font = Font
- cell_read_only_bg_color
Color to use for read-only cell backgrounds
cell_read_only_bg_color = Color(16316401)
- cell_theme
The theme to use for normal cells:
cell_theme = Any
- click
The optional extended trait name of the trait that should be assigned an ( object, column ) tuple when a table cell is clicked on (Note: If you want to receive repeated clicks on the same cell, make sure the trait is defined as an Event):
click = Str
- column_label_height
Height (in pixels) of column labels
column_label_height = Int(25)
- columns
List of initial table column descriptors
columns = List(Instance('enthought.traits.ui.table_column.TableColumn'))
- columns_name
The object trait containing the list of column descriptors
columns_name = Str
- configurable
Can the user configure the table columns?
configurable = Bool(True)
- dclick
The optional extended trait name of the trait that should be assigned an ( object, column ) tuple when a table cell is double-clicked on (Note: if you want to receive repeated double-clicks on the same cell, make sure the trait is defined as an Event):
dclick = Str
- deletable
Are objects deletable from the table?
deletable = BoolOrCallable(False)
- dock_theme
The DockWindow graphical theme:
dock_theme = Any
- edit_on_first_click
Should the editor become active after the first click
edit_on_first_click = Bool(True)
- edit_view
View to use when editing table items. NOTE: If not specified, the table items are not editable in a separate pane of the editor.
edit_view = AView(' ')
- edit_view_handler
The handler to apply to edit_view
edit_view_handler = Instance(Handler)
- edit_view_height
Height to use for the edit view
edit_view_height = Float(-Const(1.0))
- edit_view_width
Width to use for the edit view
edit_view_width = Float(-Const(1.0))
- editable
Is the table editable?
editable = Bool(True)
- filter
Initial filter that should be applied to the table
filter = Instance('enthought.traits.ui.table_filter.TableFilter')
- filter_name
The optional extended name of the trait used to specify an external filter for the table data. The value of the trait must either be an instance of TableEditor, a callable that accepts one argument (a table row) and returns True or False to indicate whether the specified object passes the filter or not, or None to indicate that no filter is to be applied:
filter_name = Str
- filtered_indices
The optional extended name of the trait that the indices of the items currently passing the table filter are synced with:
filtered_indices = Str
- filters
List of available filters that can be applied to the table
filters = List(Instance('enthought.traits.ui.table_filter.TableFilter'))
- label_bg_color
Color to use for label backgrounds
label_bg_color = Color(14144191)
- label_color
Color to use for text in labels
label_color = Color('black')
- label_font
Font to use for text in labels
label_font = Font
- line_color
Grid line color
line_color = Color(12894377)
- on_dclick
Called when a table item is double clicked
on_dclick = Any
- on_select
Called when a table item is selected
on_select = Any
- orientation
Layout orientation of the table and its associated editor pane. This attribute applies only if edit_view is not ' '.
orientation = Orientation
- other_columns
List of other table column descriptors (not initially displayed)
other_columns = List(Instance('enthought.traits.ui.table_column.TableColumn'))
- reorderable
Can the user reorder the items in the table?
reorderable = Bool(False)
- reverse
Should the table items be presented in reverse order?
reverse = Bool(False)
- row_factory
A factory to generate new rows. NOTE: If None, then the user will not be able to add new rows to the table. If not None, then it must be a callable that accepts row_factory_args and row_factory_kw and returns a new object that can be added to the table.
row_factory = Any
- row_factory_args
Arguments to pass to the row_factory callable when a new row is created
row_factory_args = Tuple
- row_factory_kw
Keyword arguments to pass to the row_factory callable when a new row is created
row_factory_kw = Dict
- row_height
The initial height of each row (<= 0 means use default value):
row_height = Int(0)
- row_label_width
Width (in pixels) of row labels
row_label_width = Int(82)
- rows
The desired number of visible rows in the table
rows = Int
- scroll_dy
The vertical scroll increment for the table:
scroll_dy = Range(1, 32)
- search
Filter object used to allow a user to search the table. NOTE: If left as None, the table will not be searchable.
search = Instance('enthought.traits.ui.table_filter.TableFilter')
- selected
The optional extended name of the trait that the current selection is synced with:
selected = Str
- selected_indices
The optional extended trait name of the trait that the indices of the current selection are synced with:
selected_indices = Str
- selected_theme
The theme to use for selected cells:
selected_theme = Any
- selection_bg_color
Background color of selected item
selection_bg_color = Color(860895, allow_none = True)
- selection_color
Color of selected text
selection_color = Color('white')
- selection_mode
The selection mode of the table. The meaning of the various values are as follows:
- row
- Entire rows are selected. At most one row can be selected at once. This is the default.
- rows
- Entire rows are selected. More than one row can be selected at once.
- column
- Entire columns are selected. At most one column can be selected at once.
- columns
- Entire columns are selected. More than one column can be selected at once.
- cell
- Single cells are selected. Only one cell can be selected at once.
- cells
- Single cells are selected. More than one cell can be selected at once.
selection_mode = Enum('row', 'rows', 'column', 'columns', 'cell', 'cells')
- show_column_labels
Show column labels?
show_column_labels = Bool(True)
- show_lines
Should grid lines be shown on the table?
show_lines = Bool(True)
- show_toolbar
Should the toolbar be displayed? (Note that False will override settings such as 'configurable', etc., and is a quick way to prevent the toolbar from being displayed; but True will not cause a toolbar to appear if one would not otherwise have been displayed)
show_toolbar = Bool(False)
- sort_model
Does sorting affect the model (vs. just the view)?
sort_model = Bool(False)
- sortable
Is the table sortable by clicking on the column headers?
sortable = Bool(True)
- traits_view
traits_view = View([ '{Initial columns}@', Item('columns', resizable = True), '{Other columns}@', Item('other_columns', resizable = True), '|{Columns}<>' ], [ [ 'deletable{Are items deletable?}', '9', 'editable{Are items editable?}', '9', '-[Item Options]>' ], [ 'show_column_labels{Show column labels?}', '9', 'configurable{Are columns user configurable?}', '9', 'auto_size{Should columns auto size?}', '-[Column Options]>' ], [ 'sortable{Are columns sortable?}', Item('sort_model{Does sorting affect the model?}', enabled_when = 'sortable'), '-[Sorting Options]>' ], [ [ 'show_lines{Show grid lines?}', '|>' ], [ '_', 'line_color{Grid line color}@', '|<>' ], '|[Grid Line Options]' ], '|{Options}' ], [ [ 'cell_color{Text color}@', 'cell_bg_color{Background color}@', 'cell_read_only_bg_color{Read only color}@', '|[Cell Colors]' ], [ 'cell_font', '|[Cell Font]<>' ], '|{Cell}' ], [ [ 'label_color{Text color}@', 'label_bg_color{Background color}@', '|[Label Colors]' ], [ 'label_font@', '|[Label Font]<>' ], '|{Label}' ], [ [ 'selection_color{Text color}@', 'selection_bg_color{Background color}@', '|[Selection Colors]' ], '|{Selection}' ], height = 0.5)
Inherited from base classes
Method summary
- readonly_editor(self, ui, object, name, description, parent)
Inherited from base classes
- __deepcopy__(self, memo)
- __getstate__(self)
- __prefix_trait__(self, name, is_set)
- __reduce_ex__(self, protocol)
- __setstate__(self, state, trait_change_notify = True)
- add_class_trait(cls, name, *trait)
- add_trait(self, name, *trait)
- add_trait_category(cls, category)
- add_trait_listener(self, object, prefix = '')
- all_trait_names(self)
- base_trait(self, name)
- class_default_traits_view(cls)
- class_editable_traits(cls)
- class_trait_names(cls, **metadata)
- class_trait_view(cls, name = None, view_element = None)
- class_trait_view_elements(cls)
- class_traits(cls, **metadata)
- clone_traits(self, traits = None, memo = None, copy = None, **metadata)
- configure_traits(self, filename = None, view = None, kind = None, edit = True, context = None, handler = None, id = '', scrollable = None, **args)
- copy_traits(self, other, traits = None, memo = None, copy = None, **metadata)
- copyable_trait_names(self, **metadata)
- default_traits_view(self)
- edit_traits(self, view = None, parent = None, kind = None, context = None, handler = None, id = '', scrollable = None, **args)
- editable_traits(self)
- has_traits_interface(self, *interfaces)
- on_trait_change(self, handler, name = None, remove = False, dispatch = 'same', priority = False, deferred = False)
- print_traits(self, show_help = False, **metadata)
- remove_trait(self, name)
- remove_trait_listener(self, object, prefix = '')
- reset_traits(self, traits = None, **metadata)
- set_trait_dispatch_handler(cls, name, klass, override = False)
- sync_trait(self, trait_name, object, alias = None, mutual = True, remove = False)
- trait(self, name, force = False, copy = False)
- trait_context(self)
- trait_get(self, *names, **metadata)
- trait_monitor(cls, handler, remove = False)
- trait_names(self, **metadata)
- trait_set(self, trait_change_notify = True, **traits)
- trait_setq(self, **traits)
- trait_subclasses(cls, all = False)
- trait_view(self, name = None, view_element = None)
- trait_view_elements(self)
- trait_views(self, klass = None)
- traits(self, **metadata)
- validate_trait(self, name, value)
Methods
- readonly_editor(self, ui, object, name, description, parent)
Generates an "editor" that is read-only. Overridden to set the value of the editable trait to False before generating the editor.