traitsui.table_column module¶
Defines the table column descriptor used by the editor and editor factory classes for numeric and table editors.
- class traitsui.table_column.ExpressionColumn[source]¶
Bases:
ObjectColumn
A column for displaying computed values.
- editable = Constant(False)¶
Is this column editable?
- expression = Expression¶
The Python expression used to return the value of the column:
- globals = Dict()¶
The globals dictionary that should be passed to the expression evaluation:
- class traitsui.table_column.ListColumn[source]¶
Bases:
TableColumn
A column for editing lists.
- index = Int()¶
Index of the list element associated with this column
- class traitsui.table_column.NumericColumn[source]¶
Bases:
ObjectColumn
A column for editing Numeric arrays.
- format = Str("%s")¶
Formatting string for the cell value
- get_cell_color(object)[source]¶
Returns the cell background color for the column for a specified object row.
- get_horizontal_alignment(object)[source]¶
Returns the horizontal alignment for the column for a specified object row.
Returns the context menu to display when the user right-clicks on the column for a specified object row.
- get_vertical_alignment(object)[source]¶
Returns the vertical alignment for the column for a specified object row.
- horizontal_alignment = "center"¶
Horizontal alignment of text in the column; this value overrides the default.
- is_droppable(object, row, value)[source]¶
Returns whether a specified value is valid for dropping on the column for a specified object row.
- label = Property()¶
Column label to use for this column
- selected_cell_color = Color(0xD8FFD8)¶
Cell background color for this column when selected
- selected_text_color = Color("black")¶
Text color this column when selected
- selected_text_font = Font¶
Text font for this column when selected
- class traitsui.table_column.ObjectColumn[source]¶
Bases:
TableColumn
A column for editing objects.
- editor = Instance(EditorFactory)¶
Trait editor used to edit the contents of this column:
- format = Str("%s")¶
Format string to apply to column values:
- format_func = Callable()¶
Format function to apply to column values:
- is_droppable(object, value)[source]¶
Returns whether a specified value is valid for dropping on the column for a specified object.
- label = Property()¶
Column label to use for this column:
- name = Str()¶
Name of the object trait associated with this column:
- style = EditorStyle¶
The editor style to use to edit the contents of this column:
- class traitsui.table_column.TableColumn[source]¶
Bases:
HasPrivateTraits
Represents a column in a table editor.
- auto_editable = Bool(False)¶
Is the column automatically edited/viewed (i.e. should the column editor or popup be activated automatically on mouse over)?
- cell_color = Color("white", allow_none=True)¶
Cell background color for this column:
- cmp(object1, object2)[source]¶
Returns the result of comparing the column of two different objects.
This is deprecated.
- droppable = Bool(False)¶
Can external objects be dropped on the column?
- edit_height = Float(-1.0)¶
The height of the column cell’s row while it is being edited (< 0.0: Default, 0.0..1.0: fraction of total table height, > 1.0: absolute height in pixels):
- edit_width = Float(-1.0)¶
The width of the column while it is being edited (< 0.0: Default, 0.0..1.0: fraction of total table width, > 1.0: absolute width in pixels):
- editable = Bool(True)¶
Is this column editable?
- get_cell_color(object)[source]¶
Returns the cell background color for the column for a specified object.
- get_edit_height(object)[source]¶
Returns the height of the column cell’s row while it is being edited.
- get_graph_color(object)[source]¶
Returns the cell background graph color for the column for a specified object.
- get_horizontal_alignment(object)[source]¶
Returns the horizontal alignment for the column for a specified object.
Returns the context menu to display when the user right-clicks on the column for a specified object.
- get_tooltip(object)[source]¶
Returns the tooltip to display when the user mouses over the column for a specified object.
- get_vertical_alignment(object)[source]¶
Returns the vertical alignment for the column for a specified object.
- graph_color = Color(0xDDD9CC)¶
Cell graph color:
- horizontal_alignment = Enum("left", ["left", "center", "right"])¶
Horizontal alignment of text in the column:
- horizontal_margin = Int(4)¶
Horizontal cell margin
- image = Image¶
The image to display in the cell:
- is_auto_editable(object)[source]¶
Returns whether the column is automatically edited/viewed for a specified object.
- is_droppable(object, value)[source]¶
Returns whether a specified value is valid for dropping on the column for a specified object.
- label = Str(UndefinedLabel)¶
Column label to use for this column:
- maximum = Float(trait_value=True)¶
Optional maximum value a numeric cell value can have:
Context menu to display when this column is right-clicked:
- read_only_cell_color = Color(0xF4F3EE, allow_none=True)¶
Cell background color for non-editable columns:
- renderer = Any # A toolkit specific renderer¶
Renderer used to render the contents of this column:
- resize_mode = Enum("interactive", "fixed", "stretch", "resize_to_contents")¶
The resize mode for this column. This takes precedence over other settings (like width, above). - “interactive”: column can be resized by users or programmatically - “fixed”: users cannot resize the column, but it can be set programmatically - “stretch”: the column will be resized to fill the available space - “resize_to_contents”: column will be sized to fit the contents, but then cannot be resized
- show_checkbox = Bool(True)¶
Should a checkbox be displayed instead of True/False?
- text_color = Color("black")¶
Text color for this column:
- text_font = Union(None, Font)¶
Text font for this column:
- tooltip = Str()¶
The tooltip to display when the mouse is over the column:
- vertical_alignment = Enum("center", ["top", "center", "bottom"])¶
Vertical alignment of text in the column:
- vertical_margin = Int(3)¶
Vertical cell margin
- view = AView¶
The view (if any) to display when clicking a non-editable cell:
- visible = Bool(True)¶
Is the table column visible (i.e., viewable)?
- width = Float(-1.0)¶
The width of the column (< 0.0: Default, 0.0..1.0: fraction of total table width, > 1.0: absolute width in pixels):