editors/DataTypeEditor.py
changeset 1735 c02818d7e29f
parent 1734 750eeb7230a1
child 1736 7e61baa047f0
equal deleted inserted replaced
1734:750eeb7230a1 1735:c02818d7e29f
    72         if row < self.GetNumberRows():
    72         if row < self.GetNumberRows():
    73             if col == 0:
    73             if col == 0:
    74                 return row + 1
    74                 return row + 1
    75             colname = self.GetColLabelValue(col, False)
    75             colname = self.GetColLabelValue(col, False)
    76             value = self.data[row].get(colname, "")
    76             value = self.data[row].get(colname, "")
    77                
    77 
    78             if colname == "Type" and isinstance(value, TupleType):
    78             if colname == "Type" and isinstance(value, TupleType):
    79                 if value[0] == "array":
    79                 if value[0] == "array":
    80                     return "ARRAY [%s] OF %s" % (",".join(map(lambda x : "..".join(x), value[2])), value[1])
    80                     return "ARRAY [%s] OF %s" % (",".join(map(lambda x : "..".join(x), value[2])), value[1])
    81             return value
    81             return value
    82 
    82 
   572 
   572 
   573     def ShowErrorMessage(self, message):
   573     def ShowErrorMessage(self, message):
   574         dialog = wx.MessageDialog(self, message, _("Error"), wx.OK|wx.ICON_ERROR)
   574         dialog = wx.MessageDialog(self, message, _("Error"), wx.OK|wx.ICON_ERROR)
   575         dialog.ShowModal()
   575         dialog.ShowModal()
   576         dialog.Destroy()
   576         dialog.Destroy()
   577         
   577 
   578     def OnStructureElementsGridCellChange(self, event):
   578     def OnStructureElementsGridCellChange(self, event):
   579         row, col = event.GetRow(), event.GetCol()
   579         row, col = event.GetRow(), event.GetCol()
   580         colname = self.StructureElementsTable.GetColLabelValue(col, False)
   580         colname = self.StructureElementsTable.GetColLabelValue(col, False)
   581         value = self.StructureElementsTable.GetValue(row, col)
   581         value = self.StructureElementsTable.GetValue(row, col)
   582         if colname == "Name":
   582         if colname == "Name":
   810                     elif isinstance(control, wx.gizmos.EditableListBox):
   810                     elif isinstance(control, wx.gizmos.EditableListBox):
   811                         listctrl = control.GetListCtrl()
   811                         listctrl = control.GetListCtrl()
   812                         listctrl.SetItemBackgroundColour(infos[1], highlight_type[0])
   812                         listctrl.SetItemBackgroundColour(infos[1], highlight_type[0])
   813                         listctrl.SetItemTextColour(infos[1], highlight_type[1])
   813                         listctrl.SetItemTextColour(infos[1], highlight_type[1])
   814                         listctrl.Select(listctrl.FocusedItem, False)
   814                         listctrl.Select(listctrl.FocusedItem, False)
   815