QScintilla/QsciScintillaCompat.py

branch
5_0_x
changeset 450
4c6920a05411
parent 403
c5bd65142984
child 504
da6d0d7037e5
equal deleted inserted replaced
449:650ea45b8c6a 450:4c6920a05411
36 36
37 This class implements all the functions, that were added to 37 This class implements all the functions, that were added to
38 QsciScintilla incrementally. This class ensures compatibility 38 QsciScintilla incrementally. This class ensures compatibility
39 to older versions of QsciScintilla. 39 to older versions of QsciScintilla.
40 """ 40 """
41 UserSeparator = '\x04'
42
41 def __init__(self, parent = None): 43 def __init__(self, parent = None):
42 """ 44 """
43 Constructor 45 Constructor
44 46
45 @param parent parent widget (QWidget) 47 @param parent parent widget (QWidget)
913 try: 915 try:
914 return p.getFileName() 916 return p.getFileName()
915 except AttributeError: 917 except AttributeError:
916 return "" 918 return ""
917 919
920 #####################################################################################
921 # replacements for buggy methods
922 #####################################################################################
923
924 def showUserList(self, id, lst):
925 """
926 Public method to show a user supplied list.
927
928 @param id id of the list (integer)
929 @param lst list to be show (list of strings)
930 """
931 if id <= 0:
932 return
933
934 self.SendScintilla(QsciScintilla.SCI_AUTOCSETSEPARATOR,
935 ord(self.UserSeparator))
936 if self.isUtf8():
937 lst = self.UserSeparator.join(lst).encode("utf-8")
938 else:
939 lst = self.UserSeparator.join(lst).encode("latin-1")
940 self.SendScintilla(QsciScintilla.SCI_USERLISTSHOW, id, lst)
941
918 ## ##################################################################################### 942 ## #####################################################################################
919 ## # methods below have been added to QScintilla starting with version after 2.x 943 ## # methods below have been added to QScintilla starting with version after 2.x
920 ## ##################################################################################### 944 ## #####################################################################################
921 ## 945 ##
922 ## if "newMethod" not in QsciScintilla.__dict__: 946 ## if "newMethod" not in QsciScintilla.__dict__:

eric ide

mercurial