726 |
726 |
727 def ExpandLocation(self, locations_infos, group, force = False): |
727 def ExpandLocation(self, locations_infos, group, force = False): |
728 for child in locations_infos[group]["children"]: |
728 for child in locations_infos[group]["children"]: |
729 locations_infos[child]["left"].Show() |
729 locations_infos[child]["left"].Show() |
730 locations_infos[child]["right"].Show() |
730 locations_infos[child]["right"].Show() |
731 if force or locations_infos[child]["expanded"]: |
731 if force or not locations_infos[child]["expanded"]: |
732 self.ExpandLocation(locations_infos, child, force) |
732 self.ExpandLocation(locations_infos, child, force) |
733 if force: |
733 if force: |
734 locations_infos[child]["expanded"] = True |
734 locations_infos[child]["expanded"] = True |
735 |
735 |
736 def CollapseLocation(self, locations_infos, group, force = False): |
736 def CollapseLocation(self, locations_infos, group, force = False): |
737 for child in locations_infos[group]["children"]: |
737 for child in locations_infos[group]["children"]: |
738 locations_infos[child]["left"].Hide() |
738 locations_infos[child]["left"].Hide() |
739 locations_infos[child]["right"].Hide() |
739 locations_infos[child]["right"].Hide() |
740 if force or not locations_infos[child]["expanded"]: |
740 if force or locations_infos[child]["expanded"]: |
741 self.CollapseLocation(locations_infos, child, force) |
741 self.CollapseLocation(locations_infos, child, force) |
742 if force: |
742 if force: |
743 locations_infos[child]["expanded"] = False |
743 locations_infos[child]["expanded"] = False |
744 |
744 |
745 def GenerateTreeBranch(self, plugin): |
745 def GenerateTreeBranch(self, plugin): |
958 if len(plugin_locations) > 0: |
958 if len(plugin_locations) > 0: |
959 locations_infos = self.PluginInfos[plugin]["locations_infos"] |
959 locations_infos = self.PluginInfos[plugin]["locations_infos"] |
960 for location in plugin_locations: |
960 for location in plugin_locations: |
961 locations_infos["root"]["children"].append("root.%s" % location["name"]) |
961 locations_infos["root"]["children"].append("root.%s" % location["name"]) |
962 self.GenerateLocationTreeBranch(locations_infos, "root", location) |
962 self.GenerateLocationTreeBranch(locations_infos, "root", location) |
963 if not locations_infos["root"]["expanded"]: |
963 if not locations_infos["root"]["expanded"]: |
964 self.CollapseLocation(locations_infos, "root") |
964 self.CollapseLocation(locations_infos, "root") |
965 |
965 |
966 LOCATION_BITMAP = {LOCATION_PLUGIN: "CONFIGURATION", |
966 LOCATION_BITMAP = {LOCATION_PLUGIN: "CONFIGURATION", |
967 LOCATION_MODULE: "RESOURCE", |
967 LOCATION_MODULE: "RESOURCE", |
968 LOCATION_GROUP: "PROGRAM", |
968 LOCATION_GROUP: "PROGRAM", |
969 LOCATION_VAR_INPUT: "VAR_INPUT", |
969 LOCATION_VAR_INPUT: "VAR_INPUT", |
1047 locations_infos[location_name]["children"] = [] |
1047 locations_infos[location_name]["children"] = [] |
1048 for child in location["children"]: |
1048 for child in location["children"]: |
1049 child_name = "%s.%s" % (location_name, child["name"]) |
1049 child_name = "%s.%s" % (location_name, child["name"]) |
1050 locations_infos[location_name]["children"].append(child_name) |
1050 locations_infos[location_name]["children"].append(child_name) |
1051 self.GenerateLocationTreeBranch(locations_infos, location_name, child) |
1051 self.GenerateLocationTreeBranch(locations_infos, location_name, child) |
1052 if not locations_infos[child_name]["expanded"]: |
1052 if not locations_infos[location_name]["expanded"]: |
1053 self.CollapseLocation(locations_infos, child_name) |
1053 self.CollapseLocation(locations_infos, location_name) |
1054 |
1054 |
1055 def GenerateLocationLeftDownFunction(self, infos): |
1055 def GenerateLocationLeftDownFunction(self, infos): |
1056 def OnLocationLeftDownFunction(event): |
1056 def OnLocationLeftDownFunction(event): |
1057 data = wx.TextDataObject(str((infos["location"], "location", infos["IEC_type"], infos["name"], infos["description"]))) |
1057 data = wx.TextDataObject(str((infos["location"], "location", infos["IEC_type"], infos["name"], infos["description"]))) |
1058 dragSource = wx.DropSource(self) |
1058 dragSource = wx.DropSource(self) |