Module eagle :: Class Table
[hide private]
[frames] | no frames]

Class Table
source code

object --+        
         |        
 _EGObject --+    
             |    
     _EGWidget --+
                 |
                Table

Data table.

Each column should have only one type, it will be checked. Can be accessed as a python list:
>>> t = Table( 't', 'table', [ 1, 2, 3 ] )
>>> t[ 0 ]
[ 1 ]

>>> del t[ 1 ]
>>> t[ : ]
[ 1, 3 ]


Nested Classes [hide private]
Row  
CellFormat  

Instance Methods [hide private]
  __init__(self, id, label="", items=None, types=None, headers=None, show_headers=True, editable=False, repositioning=False, expand_columns_indexes=None, hidden_columns_indexes=None, cell_format_func=None, selection_callback=None, data_changed_callback=None, expand_policy=None)
Table constructor.
  __setup_gui__(self)
  __setup_connections__(self)
  __setup_connections_changed__(self)
  __setup_connections_editable__(self)
  __setup_connections_repositioning__(self)
  __setup_connections_selection__(self)
  __create_column_cell_format_func__(self, col, cell_rend)
  __setup_table__(self)
  __setup_items__(self)
  __setup_model__(self)
  set_label(self, label)
  get_label(self)
  columns_autosize(self)
  select(self, index)
  selected(self)
  append(self, row, select=True, autosize=True)
  insert(self, index, row, select=True, autosize=True)
  __nonzero__(self)
  __len__(self)
  __iadd__(self, other)
  __setitem__(self, index, other)
  __getitem__(self, index)
  __delitem__(self, index)
  __contains__(self, row)
  __getslice__(self, start, end)
  __setslice__(self, start, end, slice)
  __delslice__(self, start, end)

Inherited from _EGWidget: __configure_orientation__, __get_widgets__, hide, set_active, set_inactive, show

Inherited from _EGObject: __repr__, __str__

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__


Class Variables [hide private]
spacing  
label  

Inherited from _EGWidget: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, app

Inherited from _EGObject: id

Inherited from object: __class__


Method Details [hide private]

__init__(self, id, label="", items=None, types=None, headers=None, show_headers=True, editable=False, repositioning=False, expand_columns_indexes=None, hidden_columns_indexes=None, cell_format_func=None, selection_callback=None, data_changed_callback=None, expand_policy=None)
(Constructor)

source code 
Table constructor.

@param id: unique identifier.
@param label: what to show on table frame
@param items: a list (single column) or list of lists (multiple
       columns)
@param types: a list of types (str, int, long, float, unicode, bool)
       for columns, if omitted, will be guessed from items.
@param headers: what to use as table header.
@param show_headers: whenever to show table headers
@param editable: if table is editable. If editable, user can change
       values inline or double-clicking, also edit buttons will
       show after the table.
@param repositioning: allow items to be moved up and down.
@param expand_columns_indexes: list of indexes that can expand size
@param cell_format_func: if define, should return a CellFormat with
       properties to be applied to cell. Only non-None properties will
       be used. Function should have the following signature:
          def func( app, table, row, col, value ):
              return Table.CellFormat( ... )
       where row and col are indexes in table.
@param selection_callback: the function (or list of functions) to
       call when selection changes. Function will get as parameters:
        - App reference
        - Table reference
        - List of pairs ( index, row_contents )
@param data_changed_callback: the function (or list of functions) to
       call when data changes. Function will get as parameters:
        - App reference
        - Table reference
        - Pair ( index, row_contents )
@param expand_policy: how this widget should fit space, see
       L{ExpandPolicy.Policy.Rule}.

@warning: although this widget contains data, it's not a
          _EGDataWidget and thus will not notify application that
          data changed, also it cannot persist it's data
          automatically, if you wish, do it manually. This behavior
          may change in future if Table show to be useful as
          _EGDataWidget.

Overrides: _EGWidget.__init__

__setup_gui__(self)

source code 

__setup_connections__(self)

source code 

__setup_connections_changed__(self)

source code 

__setup_connections_editable__(self)

source code 

__setup_connections_repositioning__(self)

source code 

__setup_connections_selection__(self)

source code 

__create_column_cell_format_func__(self, col, cell_rend)

source code 

__setup_table__(self)

source code 

__setup_items__(self)

source code 

__setup_model__(self)

source code 

set_label(self, label)

source code 

get_label(self)

source code 

columns_autosize(self)

source code 

select(self, index)

source code 

selected(self)

source code 

append(self, row, select=True, autosize=True)

source code 

insert(self, index, row, select=True, autosize=True)

source code 

__nonzero__(self)
(Boolean test operator)

source code 

__len__(self)
(Length operator)

source code 

__iadd__(self, other)

source code 

__setitem__(self, index, other)
(Index assignment operator)

source code 

__getitem__(self, index)
(Indexing operator)

source code 

__delitem__(self, index)
(Index deletion operator)

source code 

__contains__(self, row)
(In operator)

source code 

__getslice__(self, start, end)
(Slicling operator)

source code 

__setslice__(self, start, end, slice)
(Slice assignment operator)

source code 

__delslice__(self, start, end)
(Slice deletion operator)

source code 

Class Variable Details [hide private]

spacing

Value:
3                                                                      
      

label

Value:
property(get_label,set_label)