QScintilla/QsciScintillaCompat.py

changeset 448
a1f1b226ff4b
parent 404
44a541bea034
child 502
7500b9d5b21d
--- a/QScintilla/QsciScintillaCompat.py	Sat Jul 31 18:58:43 2010 +0200
+++ b/QScintilla/QsciScintillaCompat.py	Sun Aug 01 13:05:08 2010 +0200
@@ -42,6 +42,8 @@
     ArrowFoldStyle      = QsciScintilla.BoxedTreeFoldStyle + 1
     ArrowTreeFoldStyle  = ArrowFoldStyle + 1
     
+    UserSeparator = '\x04'
+    
     def __init__(self, parent = None):
         """
         Constructor
@@ -1020,6 +1022,28 @@
             except AttributeError:
                 return ""
     
+    #####################################################################################
+    # replacements for buggy methods
+    #####################################################################################
+    
+    def showUserList(self, id, lst):
+        """
+        Public method to show a user supplied list.
+        
+        @param id id of the list (integer)
+        @param lst list to be show (list of strings)
+        """
+        if id <= 0:
+            return
+        
+        self.SendScintilla(QsciScintilla.SCI_AUTOCSETSEPARATOR, 
+                           ord(self.UserSeparator))
+        if self.isUtf8():
+            lst = self.UserSeparator.join(lst).encode("utf-8")
+        else:
+            lst = self.UserSeparator.join(lst).encode("latin-1")
+        self.SendScintilla(QsciScintilla.SCI_USERLISTSHOW, id, lst)
+    
 ##    #####################################################################################
 ##    # methods below have been added to QScintilla starting with version after 2.x
 ##    #####################################################################################

eric ide

mercurial