IDEFrame.py
changeset 1763 bcc07ff2362c
parent 1762 fcc406143e5b
child 1765 ccf59c1f0b45
equal deleted inserted replaced
1762:fcc406143e5b 1763:bcc07ff2362c
   784                     pos = child.GetPosition()
   784                     pos = child.GetPosition()
   785                     tab = {"pos": (pos.x, pos.y), "pages": []}
   785                     tab = {"pos": (pos.x, pos.y), "pages": []}
   786                     tab_size = child.GetSize()
   786                     tab_size = child.GetSize()
   787                     for page_idx in xrange(child.GetPageCount()):
   787                     for page_idx in xrange(child.GetPageCount()):
   788                         page = child.GetWindowFromIdx(page_idx)
   788                         page = child.GetWindowFromIdx(page_idx)
   789                         if not tab.has_key("size"):
   789                         if not "size" in tab:
   790                             tab["size"] = (tab_size[0], tab_size[1] + page.GetSize()[1])
   790                             tab["size"] = (tab_size[0], tab_size[1] + page.GetSize()[1])
   791                         tab_infos = self.GetTabInfos(page)
   791                         tab_infos = self.GetTabInfos(page)
   792                         if tab_infos is not None:
   792                         if tab_infos is not None:
   793                             tab["pages"].append((tab_infos, page_idx == child.GetActivePage()))
   793                             tab["pages"].append((tab_infos, page_idx == child.GetActivePage()))
   794                     tabs.append(tab)
   794                     tabs.append(tab)
   820         if isinstance(tabs, ListType):
   820         if isinstance(tabs, ListType):
   821             if len(tabs) == 0:
   821             if len(tabs) == 0:
   822                 return
   822                 return
   823             raise ValueError, "Not supported"
   823             raise ValueError, "Not supported"
   824 
   824 
   825         if tabs.has_key("split"):
   825         if "split" in tabs:
   826             self.LoadTabLayout(notebook, tabs["others"])
   826             self.LoadTabLayout(notebook, tabs["others"])
   827 
   827 
   828             split_dir, split_ratio = tabs["split"]
   828             split_dir, split_ratio = tabs["split"]
   829             first_index = self.LoadTabLayout(notebook, tabs["tab"], mode="first")
   829             first_index = self.LoadTabLayout(notebook, tabs["tab"], mode="first")
   830             notebook.Split(first_index, split_dir)
   830             notebook.Split(first_index, split_dir)
  1512         if infos["type"] == ITEM_POU:
  1512         if infos["type"] == ITEM_POU:
  1513             self.ProjectTree.SetItemImage(root,
  1513             self.ProjectTree.SetItemImage(root,
  1514                 self.TreeImageDict[self.Controler.GetPouBodyType(infos["name"])])
  1514                 self.TreeImageDict[self.Controler.GetPouBodyType(infos["name"])])
  1515             if item_alone:
  1515             if item_alone:
  1516                 self.ProjectTree.SetItemExtraImage(root, self.Controler.GetPouType(infos["name"]))
  1516                 self.ProjectTree.SetItemExtraImage(root, self.Controler.GetPouType(infos["name"]))
  1517         elif infos.has_key("icon") and infos["icon"] is not None:
  1517         elif "icon" in infos and infos["icon"] is not None:
  1518             icon_name = infos["icon"]
  1518             icon_name = infos["icon"]
  1519             if not self.TreeImageDict.has_key(icon_name):
  1519             if not icon_name in self.TreeImageDict:
  1520                 self.TreeImageDict[icon_name] = self.TreeImageList.Add(GetBitmap(icon_name))
  1520                 self.TreeImageDict[icon_name] = self.TreeImageList.Add(GetBitmap(icon_name))
  1521             self.ProjectTree.SetItemImage(root, self.TreeImageDict[icon_name])
  1521             self.ProjectTree.SetItemImage(root, self.TreeImageDict[icon_name])
  1522         elif self.TreeImageDict.has_key(infos["type"]):
  1522         elif infos["type"] in self.TreeImageDict:
  1523             self.ProjectTree.SetItemImage(root, self.TreeImageDict[infos["type"]])
  1523             self.ProjectTree.SetItemImage(root, self.TreeImageDict[infos["type"]])
  1524 
  1524 
  1525         item, root_cookie = self.ProjectTree.GetFirstChild(root)
  1525         item, root_cookie = self.ProjectTree.GetFirstChild(root)
  1526         for values in infos["values"]:
  1526         for values in infos["values"]:
  1527             if values["type"] not in ITEMS_UNEDITABLE or len(values["values"]) > 0:
  1527             if values["type"] not in ITEMS_UNEDITABLE or len(values["values"]) > 0: