parameters: (self, parent, tab, objpanel=None, attrconfigs=None, ids=None, show_ids=True,
                   func_change_obj=None,
                   func_choose_id=None,
                   func_choose_attr=None,
                   func_apply=None,
                   mainframe=None, **args)
docstring: parent: parent widget, containing the grid
          tab:    table containing the actual data of an object
docstring_summary: parent: parent widget, containing the grid
          tab:    table containing the actual data of an object
docstring_tokens: parent : parent widget containing the grid tab : table containing the actual data of an object
function: def __init__(self, parent, tab, objpanel=None, attrconfigs=None, ids=None, show_ids=True,
                   func_change_obj=None,
                   func_choose_id=None,
                   func_choose_attr=None,
                   func_apply=None,
                   mainframe=None, **args):
          """
          parent: parent widget, containing the grid
          tab:    table containing the actual data of an object
          """
          # TODO: Attention: parent is always the main object panel
  
          # print '  gridlib.Grid',dir(gridlib.Grid)
          gridlib.Grid.__init__(self, parent, -1)  # , style =wx.EXPAND| wx.ALL)#wx.EAST | wx.WEST) )
  
          # parent must be panel, scrolled panel or similar
          self.parent = parent
          self.tab = tab
          self._objpanel = objpanel
          self.func_change_obj = func_change_obj
          self.func_choose_id = func_choose_id
          self.func_choose_attr = func_choose_attr
          self.func_apply = func_apply
          self.mainframe = mainframe
  
          if ids is None:
              # show all ids
              ids = tab.get_ids()  # ordered=True
  
          if attrconfigs is None:
              # show all array type attributes
              attrconfigs = tab.get_colconfigs()
  
          # print 'init TablePanel',tab.get_ident(),ids
          # print '  start init TableGrid',len(ids),len(attrconfigs)
          # this table contains the gui functionalily of the grid
          table = TableGrid(self, tab, attrconfigs=attrconfigs, ids=ids,
                            show_ids=show_ids, **args)
          # print '  end init TableGrid'
          # The second parameter means that the grid is to take ownership of the
          # table and will destroy it when done.  Otherwise you would need to keep
          # a reference to it and call it's Destroy method later.
          self.SetTable(table, True)
          # print '  done SetTable'
          # self.SetRowLabelSize(16)
          # self.SetColLabelSize(16)
          # self.SetRowLabelSize(table.ComputeRowLabelSize())
          self.SetColLabelSize(table.ComputeColLabelSize())
          # print '  done SetColLabelSize'
          #self.AutoSize ()
  
          # for col in xrange(len(attrconfigs)):
          #    self.AutoSizeColLabelSize (col)
  
          # these operations are nice but slow for huge tables!!
          if len(ids) < 100:
              self.AutoSizeColumns(True)
          # print '  done AutoSizeColumns'
          if len(ids) < 100:
              self.AutoSizeRows(True)
          # print '  done AutoSizeRows'
  
          # self.Bind(gridlib.EVT_GRID_CELL_CHANGE, self.on_cell_change) #works, but not used
  
          # EVT_GRID_CELL_RIGHT_CLICK(self, self.OnRightDown)  #added
          gridlib.EVT_GRID_CELL_RIGHT_CLICK(self, self.on_contextmenu)  # added
          self.Bind(gridlib.EVT_GRID_LABEL_RIGHT_CLICK, self.on_contextmenu_label)
  
          # does not seem to work
          gridlib.EVT_GRID_CELL_LEFT_DCLICK(self, self.on_edit_cell)
          gridlib.EVT_GRID_CELL_LEFT_CLICK(self, self.on_click_cell)
  
          gridlib.EVT_GRID_LABEL_LEFT_DCLICK(self, self.OnLabelLeftDoubleClick)
function_tokens: def __init__ ( self , parent , tab , objpanel = None , attrconfigs = None , ids = None , show_ids = True , func_change_obj = None , func_choose_id = None , func_choose_attr = None , func_apply = None , mainframe = None , * * args ) : # TODO: Attention: parent is always the main object panel # print '  gridlib.Grid',dir(gridlib.Grid) gridlib . Grid . __init__ ( self , parent , - 1 ) # , style =wx.EXPAND| wx.ALL)#wx.EAST | wx.WEST) ) # parent must be panel, scrolled panel or similar self . parent = parent self . tab = tab self . _objpanel = objpanel self . func_change_obj = func_change_obj self . func_choose_id = func_choose_id self . func_choose_attr = func_choose_attr self . func_apply = func_apply self . mainframe = mainframe if ids is None : # show all ids ids = tab . get_ids ( ) # ordered=True if attrconfigs is None : # show all array type attributes attrconfigs = tab . get_colconfigs ( ) # print 'init TablePanel',tab.get_ident(),ids # print '  start init TableGrid',len(ids),len(attrconfigs) # this table contains the gui functionalily of the grid table = TableGrid ( self , tab , attrconfigs = attrconfigs , ids = ids , show_ids = show_ids , * * args ) # print '  end init TableGrid' # The second parameter means that the grid is to take ownership of the # table and will destroy it when done.  Otherwise you would need to keep # a reference to it and call it's Destroy method later. self . SetTable ( table , True ) # print '  done SetTable' # self.SetRowLabelSize(16) # self.SetColLabelSize(16) # self.SetRowLabelSize(table.ComputeRowLabelSize()) self . SetColLabelSize ( table . ComputeColLabelSize ( ) ) # print '  done SetColLabelSize' #self.AutoSize () # for col in xrange(len(attrconfigs)): #    self.AutoSizeColLabelSize (col) # these operations are nice but slow for huge tables!! if len ( ids ) < 100 : self . AutoSizeColumns ( True ) # print '  done AutoSizeColumns' if len ( ids ) < 100 : self . AutoSizeRows ( True ) # print '  done AutoSizeRows' # self.Bind(gridlib.EVT_GRID_CELL_CHANGE, self.on_cell_change) #works, but not used # EVT_GRID_CELL_RIGHT_CLICK(self, self.OnRightDown)  #added gridlib . EVT_GRID_CELL_RIGHT_CLICK ( self , self . on_contextmenu ) # added self . Bind ( gridlib . EVT_GRID_LABEL_RIGHT_CLICK , self . on_contextmenu_label ) # does not seem to work gridlib . EVT_GRID_CELL_LEFT_DCLICK ( self , self . on_edit_cell ) gridlib . EVT_GRID_CELL_LEFT_CLICK ( self , self . on_click_cell ) gridlib . EVT_GRID_LABEL_LEFT_DCLICK ( self , self . OnLabelLeftDoubleClick )