def ShowHighlights(self):
type_infos = self.Controler.GetDataTypeInfos(self.TagName)
for infos, start, end, highlight_type in self.Highlights:
if infos[0] == "struct":
self.StructureElementsTable.AddHighlight(infos[1:], highlight_type)
else:
control = self.HighlightControls.get((type_infos["type"], infos[0]), None)
if control is not None:
if isinstance(control, (wx.ComboBox, wx.SpinCtrl)):
control.SetBackgroundColour(highlight_type[0])
control.SetForegroundColour(highlight_type[1])
elif isinstance(control, wx.TextCtrl):
control.SetStyle(start[1], end[1] + 1, wx.TextAttr(highlight_type[1], highlight_type[0]))
elif isinstance(control, wx.gizmos.EditableListBox):
listctrl = control.GetListCtrl()
listctrl.SetItemBackgroundColour(infos[1], highlight_type[0])
listctrl.SetItemTextColour(infos[1], highlight_type[1])
listctrl.Select(listctrl.FocusedItem, False)
评论列表
文章目录