600 |
600 |
601 class AllGridCellEditor(wx.grid.GridCellTextEditor): |
601 class AllGridCellEditor(wx.grid.GridCellTextEditor): |
602 def __init__(self, table, row, col): |
602 def __init__(self, table, row, col): |
603 wx.grid.GridCellTextEditor.__init__(self) |
603 wx.grid.GridCellTextEditor.__init__(self) |
604 |
604 |
|
605 |
605 class ClassGridCellEditor(wx.grid.GridCellChoiceEditor): |
606 class ClassGridCellEditor(wx.grid.GridCellChoiceEditor): |
606 def __init__(self, table, row, col): |
607 def __init__(self, table, row, col): |
607 wx.grid.GridCellChoiceEditor.__init__(self) |
608 wx.grid.GridCellChoiceEditor.__init__(self) |
608 self.SetParameters("input,memory,output") |
609 self.SetParameters("input,memory,output") |
609 |
610 |
610 |
611 |
611 class VariablesTable(CustomTable): |
612 class VariablesTable(CustomTable): |
612 __defaultColumnType = dict( |
613 __defaultColumnType = dict( |
613 [(name, AllGridCellEditor) for name in |
614 [(name, AllGridCellEditor) for name in |
614 ["Name", "Initial", "Description", "OnChange", "Options"]] + |
615 ["Name", "Initial", "Description", "OnChange", "Options"]] + |
615 [('Class', ClassGridCellEditor), ('Type', None)]) |
616 [('Class', ClassGridCellEditor), ('Type', None)]) |
616 |
617 |
617 def __init__(self, *args, **kwargs): |
618 def __init__(self, *args, **kwargs): |
618 my_columns = kwargs.pop("additional_columns") |
619 my_columns = kwargs.pop("additional_columns") |
619 super(VariablesTable, self).__init__(*args, **kwargs) |
620 super(VariablesTable, self).__init__(*args, **kwargs) |
620 self.columnTypes = dict(self.__defaultColumnType) |
621 self.columnTypes = dict(self.__defaultColumnType) |