controls/SearchResultPanel.py
changeset 2551 245644bfcd24
parent 2529 efb532295607
child 2737 38afed869ff6
equal deleted inserted replaced
2550:f2af2a655868 2551:245644bfcd24
   129                 ("RESOURCE",       ITEM_RESOURCE),
   129                 ("RESOURCE",       ITEM_RESOURCE),
   130                 ("DATATYPE",       ITEM_DATATYPE),
   130                 ("DATATYPE",       ITEM_DATATYPE),
   131                 ("ACTION",         "action_block"),
   131                 ("ACTION",         "action_block"),
   132                 ("IL",             "IL"),
   132                 ("IL",             "IL"),
   133                 ("ST",             "ST"),
   133                 ("ST",             "ST"),
   134                 ("FILE",           ITEM_CONFNODE),
   134                 ("FILE",           ITEM_CONFNODE)]:
   135                 ]:
       
   136             self.TreeImageDict[itemtype] = self.TreeImageList.Add(GetBitmap(imgname))
   135             self.TreeImageDict[itemtype] = self.TreeImageList.Add(GetBitmap(imgname))
   137 
   136 
   138         for itemtype in ["function", "functionBlock", "program",
   137         for itemtype in ["function", "functionBlock", "program",
   139                          "comment", "block", "io_variable",
   138                          "comment", "block", "io_variable",
   140                          "connector", "contact", "coil",
   139                          "connector", "contact", "coil",
   203                                  "matches": len(results)}
   202                                  "matches": len(results)}
   204 
   203 
   205                 children = element_infos.setdefault("children", [])
   204                 children = element_infos.setdefault("children", [])
   206                 for infos, start, end, text in results:
   205                 for infos, start, end, text in results:
   207                     if len(words) == 1:  # CTN match
   206                     if len(words) == 1:  # CTN match
   208                         child_name = {"body":str(start[0])+":",
   207                         child_name = {"body": str(start[0])+":",
   209                                       "var_inout":_("Variable:")}[infos[1]]
   208                                       "var_inout": _("Variable:")}[infos[1]]
   210                         child_type = {"body":ITEM_CONFNODE,
   209                         child_type = {"body": ITEM_CONFNODE,
   211                                       "var_inout":"var_inout"}[infos[1]]
   210                                       "var_inout": "var_inout"}[infos[1]]
   212                     elif infos[1] == "name" or element_type == ITEM_DATATYPE:
   211                     elif infos[1] == "name" or element_type == ITEM_DATATYPE:
   213                         child_name = GenerateName(infos[1:])
   212                         child_name = GenerateName(infos[1:])
   214                         child_type = element_type
   213                         child_type = element_type
   215                     else:
   214                     else:
   216                         if element_type == ITEM_RESOURCE:
   215                         if element_type == ITEM_RESOURCE: