40 # Helpers |
40 # Helpers |
41 #------------------------------------------------------------------------------- |
41 #------------------------------------------------------------------------------- |
42 |
42 |
43 DIMENSION_MODEL = re.compile("([0-9]+)\.\.([0-9]+)$") |
43 DIMENSION_MODEL = re.compile("([0-9]+)\.\.([0-9]+)$") |
44 |
44 |
|
45 |
45 def AppendMenu(parent, help, id, kind, text): |
46 def AppendMenu(parent, help, id, kind, text): |
46 parent.Append(help=help, id=id, kind=kind, text=text) |
47 parent.Append(help=help, id=id, kind=kind, text=text) |
|
48 |
47 |
49 |
48 def GetElementsTableColnames(): |
50 def GetElementsTableColnames(): |
49 _ = lambda x : x |
51 _ = lambda x : x |
50 return ["#", _("Name"), _("Type"), _("Initial Value")] |
52 return ["#", _("Name"), _("Type"), _("Initial Value")] |
|
53 |
51 |
54 |
52 def GetDatatypeTypes(): |
55 def GetDatatypeTypes(): |
53 _ = lambda x : x |
56 _ = lambda x : x |
54 return [_("Directly"), _("Subrange"), _("Enumerated"), _("Array"), _("Structure")] |
57 return [_("Directly"), _("Subrange"), _("Enumerated"), _("Array"), _("Structure")] |
55 DATATYPE_TYPES_DICT = dict([(_(datatype), datatype) for datatype in GetDatatypeTypes()]) |
58 DATATYPE_TYPES_DICT = dict([(_(datatype), datatype) for datatype in GetDatatypeTypes()]) |
56 |
59 |
57 #------------------------------------------------------------------------------- |
60 #------------------------------------------------------------------------------- |
58 # Structure Elements Table |
61 # Structure Elements Table |
59 #------------------------------------------------------------------------------- |
62 #------------------------------------------------------------------------------- |
|
63 |
60 |
64 |
61 class ElementsTable(CustomTable): |
65 class ElementsTable(CustomTable): |
62 |
66 |
63 """ |
67 """ |
64 A custom wx.grid.Grid Table using user supplied data |
68 A custom wx.grid.Grid Table using user supplied data |
134 col_highlights.append(highlight_type) |
138 col_highlights.append(highlight_type) |
135 |
139 |
136 #------------------------------------------------------------------------------- |
140 #------------------------------------------------------------------------------- |
137 # Datatype Editor class |
141 # Datatype Editor class |
138 #------------------------------------------------------------------------------- |
142 #------------------------------------------------------------------------------- |
|
143 |
139 |
144 |
140 class DataTypeEditor(EditorPanel): |
145 class DataTypeEditor(EditorPanel): |
141 |
146 |
142 def _init_Editor(self, parent): |
147 def _init_Editor(self, parent): |
143 self.Editor = wx.Panel(parent, style=wx.SUNKEN_BORDER) |
148 self.Editor = wx.Panel(parent, style=wx.SUNKEN_BORDER) |