editors/DataTypeEditor.py
changeset 1833 2269739dd098
parent 1821 44a47d255d36
child 1847 6198190bc121
equal deleted inserted replaced
1832:0f1081928d65 1833:2269739dd098
    80             colname = self.GetColLabelValue(col, False)
    80             colname = self.GetColLabelValue(col, False)
    81             value = self.data[row].get(colname, "")
    81             value = self.data[row].get(colname, "")
    82 
    82 
    83             if colname == "Type" and isinstance(value, TupleType):
    83             if colname == "Type" and isinstance(value, TupleType):
    84                 if value[0] == "array":
    84                 if value[0] == "array":
    85                     return "ARRAY [%s] OF %s" % (",".join(map(lambda x: "..".join(x), value[2])), value[1])
    85                     return "ARRAY [%s] OF %s" % (",".join(map("..".join, value[2])), value[1])
    86             return value
    86             return value
    87 
    87 
    88     def SetValue(self, row, col, value):
    88     def SetValue(self, row, col, value):
    89         if col < len(self.colnames):
    89         if col < len(self.colnames):
    90             colname = self.GetColLabelValue(col, False)
    90             colname = self.GetColLabelValue(col, False)
   508                 self.EnumeratedValues.SetStrings(type_infos["values"])
   508                 self.EnumeratedValues.SetStrings(type_infos["values"])
   509                 self.RefreshEnumeratedValues()
   509                 self.RefreshEnumeratedValues()
   510                 self.EnumeratedInitialValue.SetStringSelection(type_infos["initial"])
   510                 self.EnumeratedInitialValue.SetStringSelection(type_infos["initial"])
   511             elif type_infos["type"] == "Array":
   511             elif type_infos["type"] == "Array":
   512                 self.ArrayBaseType.SetStringSelection(type_infos["base_type"])
   512                 self.ArrayBaseType.SetStringSelection(type_infos["base_type"])
   513                 self.ArrayDimensions.SetStrings(map(lambda x: "..".join(x), type_infos["dimensions"]))
   513                 self.ArrayDimensions.SetStrings(map("..".join, type_infos["dimensions"]))
   514                 self.ArrayInitialValue.SetValue(type_infos["initial"])
   514                 self.ArrayInitialValue.SetValue(type_infos["initial"])
   515             elif type_infos["type"] == "Structure":
   515             elif type_infos["type"] == "Structure":
   516                 self.StructureElementsTable.SetData(type_infos["elements"])
   516                 self.StructureElementsTable.SetData(type_infos["elements"])
   517             self.RefreshDisplayedInfos()
   517             self.RefreshDisplayedInfos()
   518         self.ShowHighlights()
   518         self.ShowHighlights()