eric6/QScintilla/EditorAssembly.py

changeset 8089
e43bf8d7baf9
parent 8088
7c454b82b6ed
child 8131
f2129bb79269
equal deleted inserted replaced
8088:7c454b82b6ed 8089:e43bf8d7baf9
195 if entryName in self.__module.classes: 195 if entryName in self.__module.classes:
196 entry = self.__module.classes[entryName] 196 entry = self.__module.classes[entryName]
197 elif entryName in self.__module.modules: 197 elif entryName in self.__module.modules:
198 entry = self.__module.modules[entryName] 198 entry = self.__module.modules[entryName]
199 # step 2.0: add module classes 199 # step 2.0: add module classes
200 items = {} 200 items = []
201 for cl in entry.classes.values(): 201 for cl in entry.classes.values():
202 if cl.isPrivate(): 202 if cl.isPrivate():
203 icon = UI.PixmapCache.getIcon("class_private") 203 icon = UI.PixmapCache.getIcon("class_private")
204 elif cl.isProtected(): 204 elif cl.isProtected():
205 icon = UI.PixmapCache.getIcon( 205 icon = UI.PixmapCache.getIcon(
206 "class_protected") 206 "class_protected")
207 else: 207 else:
208 icon = UI.PixmapCache.getIcon("class") 208 icon = UI.PixmapCache.getIcon("class")
209 items[cl.name] = (icon, cl.lineno, cl.endlineno) 209 items.append((icon, cl.name, cl.lineno, cl.endlineno))
210 for key in sorted(items.keys()): 210 for itm in sorted(items, key=lambda x: (x[1], x[2])):
211 itm = items[key] 211 self.__membersCombo.addItem(itm[0], itm[1], itm[2])
212 self.__membersCombo.addItem(itm[0], key, itm[1])
213 memberIndex += 1 212 memberIndex += 1
214 self.__membersBoundaries[(itm[1], itm[2])] = ( 213 self.__membersBoundaries[(itm[2], itm[3])] = (
215 memberIndex 214 memberIndex
216 ) 215 )
217 else: 216 else:
218 return 217 return
219 218
255 254
256 # step 2.3: add class attributes 255 # step 2.3: add class attributes
257 items = [] 256 items = []
258 icon = UI.PixmapCache.getIcon("attribute_class") 257 icon = UI.PixmapCache.getIcon("attribute_class")
259 for globalVar in entry.globals.values(): 258 for globalVar in entry.globals.values():
260 items.append((icon, globalVar.nameglobalVar.lineno)) 259 items.append((icon, globalVar.name, globalVar.lineno))
261 for itm in sorted(items, key=lambda x: (x[1], x[2])): 260 for itm in sorted(items, key=lambda x: (x[1], x[2])):
262 self.__membersCombo.addItem(itm[0], itm[1], itm[2]) 261 self.__membersCombo.addItem(itm[0], itm[1], itm[2])
263 262
264 def __membersActivated(self, index, moveCursor=True): 263 def __membersActivated(self, index, moveCursor=True):
265 """ 264 """
370 icon = UI.PixmapCache.getIcon( 369 icon = UI.PixmapCache.getIcon(
371 "attribute_protected") 370 "attribute_protected")
372 else: 371 else:
373 icon = UI.PixmapCache.getIcon("attribute") 372 icon = UI.PixmapCache.getIcon("attribute")
374 items.append( 373 items.append(
375 (icon, globalValue.nameglobalValue.lineno) 374 (icon, globalValue.name, globalValue.lineno)
376 ) 375 )
377 for itm in sorted(items, key=lambda x: (x[1], x[2])): 376 for itm in sorted(items, key=lambda x: (x[1], x[2])):
378 self.__globalsCombo.addItem(itm[0], itm[1], itm[2]) 377 self.__globalsCombo.addItem(itm[0], itm[1], itm[2])
379 378
380 # reset the currently selected entries without moving the 379 # reset the currently selected entries without moving the

eric ide

mercurial