QScintilla/QsciScintillaCompat.py

changeset 945
8cd4d08fa9f6
parent 944
1b59c4ba121e
child 1131
7781e396c903
equal deleted inserted replaced
944:1b59c4ba121e 945:8cd4d08fa9f6
29 else: 29 else:
30 return QsciQSCINTILLA_VERSION 30 return QsciQSCINTILLA_VERSION
31 31
32 ############################################################################### 32 ###############################################################################
33 33
34
34 class QsciScintillaCompat(QsciScintilla): 35 class QsciScintillaCompat(QsciScintilla):
35 """ 36 """
36 Class implementing a compatability interface to QsciScintilla. 37 Class implementing a compatability interface to QsciScintilla.
37 38
38 This class implements all the functions, that were added to 39 This class implements all the functions, that were added to
39 QsciScintilla incrementally. This class ensures compatibility 40 QsciScintilla incrementally. This class ensures compatibility
40 to older versions of QsciScintilla. 41 to older versions of QsciScintilla.
41 """ 42 """
42 ArrowFoldStyle = QsciScintilla.BoxedTreeFoldStyle + 1 43 ArrowFoldStyle = QsciScintilla.BoxedTreeFoldStyle + 1
43 ArrowTreeFoldStyle = ArrowFoldStyle + 1 44 ArrowTreeFoldStyle = ArrowFoldStyle + 1
44 45
45 UserSeparator = '\x04' 46 UserSeparator = '\x04'
46 47
47 def __init__(self, parent = None): 48 def __init__(self, parent=None):
48 """ 49 """
49 Constructor 50 Constructor
50 51
51 @param parent parent widget (QWidget) 52 @param parent parent widget (QWidget)
52 @param name name of this instance (string) 53 @param name name of this instance (string)
60 self.__targetSearchExpr = "" 61 self.__targetSearchExpr = ""
61 self.__targetSearchStart = 0 62 self.__targetSearchStart = 0
62 self.__targetSearchEnd = -1 63 self.__targetSearchEnd = -1
63 self.__targetSearchActive = False 64 self.__targetSearchActive = False
64 65
65 def setLexer(self, lex = None): 66 def setLexer(self, lex=None):
66 """ 67 """
67 Public method to set the lexer. 68 Public method to set the lexer.
68 69
69 @param lex the lexer to be set or None to reset it. 70 @param lex the lexer to be set or None to reset it.
70 """ 71 """
194 """ 195 """
195 self.SendScintilla(QsciScintilla.SCI_SETSTYLEBITS, bits) 196 self.SendScintilla(QsciScintilla.SCI_SETSTYLEBITS, bits)
196 197
197 def charAt(self, pos): 198 def charAt(self, pos):
198 """ 199 """
199 Public method to get the character at a position in the text observing 200 Public method to get the character at a position in the text observing
200 multibyte characters. 201 multibyte characters.
201 202
202 @param pos position in the text (integer) 203 @param pos position in the text (integer)
203 @return character at the requested position or empty string, if the 204 @return character at the requested position or empty string, if the
204 position is negative or past the end of the document (string) 205 position is negative or past the end of the document (string)
296 297
297 ########################################################################### 298 ###########################################################################
298 # methods below are missing from QScintilla 299 # methods below are missing from QScintilla
299 ########################################################################### 300 ###########################################################################
300 301
301 def zoomIn(self, zoom = 1): 302 def zoomIn(self, zoom=1):
302 """ 303 """
303 Public method used to increase the zoom factor. 304 Public method used to increase the zoom factor.
304 305
305 @param zoom zoom factor increment 306 @param zoom zoom factor increment
306 """ 307 """
307 self.zoom += zoom 308 self.zoom += zoom
308 QsciScintilla.zoomIn(self, zoom) 309 QsciScintilla.zoomIn(self, zoom)
309 310
310 def zoomOut(self, zoom = 1): 311 def zoomOut(self, zoom=1):
311 """ 312 """
312 Public method used to decrease the zoom factor. 313 Public method used to decrease the zoom factor.
313 314
314 @param zoom zoom factor decrement 315 @param zoom zoom factor decrement
315 """ 316 """
525 def getCursorFlashTime(self): 526 def getCursorFlashTime(self):
526 """ 527 """
527 Public method to get the flash (blink) time of the cursor in 528 Public method to get the flash (blink) time of the cursor in
528 milliseconds. 529 milliseconds.
529 530
530 The flash time is the time required to display, invert and restore the 531 The flash time is the time required to display, invert and restore the
531 caret display. Usually the text cursor is displayed for half the cursor 532 caret display. Usually the text cursor is displayed for half the cursor
532 flash time, then hidden for the same amount of time. 533 flash time, then hidden for the same amount of time.
533 534
534 @return flash time of the cursor in milliseconds (integer) 535 @return flash time of the cursor in milliseconds (integer)
535 """ 536 """
538 def setCursorFlashTime(self, time): 539 def setCursorFlashTime(self, time):
539 """ 540 """
540 Public method to get the flash (blink) time of the cursor in 541 Public method to get the flash (blink) time of the cursor in
541 milliseconds. 542 milliseconds.
542 543
543 The flash time is the time required to display, invert and restore the 544 The flash time is the time required to display, invert and restore the
544 caret display. Usually the text cursor is displayed for half the cursor 545 caret display. Usually the text cursor is displayed for half the cursor
545 flash time, then hidden for the same amount of time. 546 flash time, then hidden for the same amount of time.
546 547
547 @param time flash time of the cursor in milliseconds (integer) 548 @param time flash time of the cursor in milliseconds (integer)
548 """ 549 """
559 560
560 @param point point in the window (QPoint) 561 @param point point in the window (QPoint)
561 @return scintilla position (integer) or -1 to indicate, that the point 562 @return scintilla position (integer) or -1 to indicate, that the point
562 is not near any character 563 is not near any character
563 """ 564 """
564 return self.SendScintilla(QsciScintilla.SCI_POSITIONFROMPOINTCLOSE, 565 return self.SendScintilla(QsciScintilla.SCI_POSITIONFROMPOINTCLOSE,
565 point.x(), point.y()) 566 point.x(), point.y())
566 567
567 def positionBefore(self, pos): 568 def positionBefore(self, pos):
568 """ 569 """
569 Public method to get the position before the given position taking into 570 Public method to get the position before the given position taking into
610 self.__targetSearchEnd) 611 self.__targetSearchEnd)
611 self.SendScintilla(QsciScintilla.SCI_SETSEARCHFLAGS, 612 self.SendScintilla(QsciScintilla.SCI_SETSEARCHFLAGS,
612 self.__targetSearchFlags) 613 self.__targetSearchFlags)
613 targetSearchExpr = self._encodeString(self.__targetSearchExpr) 614 targetSearchExpr = self._encodeString(self.__targetSearchExpr)
614 pos = self.SendScintilla(QsciScintilla.SCI_SEARCHINTARGET, 615 pos = self.SendScintilla(QsciScintilla.SCI_SEARCHINTARGET,
615 len(targetSearchExpr), 616 len(targetSearchExpr),
616 targetSearchExpr) 617 targetSearchExpr)
617 618
618 if pos == -1: 619 if pos == -1:
619 self.__targetSearchActive = False 620 self.__targetSearchActive = False
620 return False 621 return False
636 epos = self.SendScintilla(QsciScintilla.SCI_GETTARGETEND) 637 epos = self.SendScintilla(QsciScintilla.SCI_GETTARGETEND)
637 return (spos, epos - spos) 638 return (spos, epos - spos)
638 else: 639 else:
639 return (0, 0) 640 return (0, 0)
640 641
641 def findFirstTarget(self, expr_, re_, cs_, wo_, 642 def findFirstTarget(self, expr_, re_, cs_, wo_,
642 begline = -1, begindex = -1, endline = -1, endindex = -1, 643 begline=-1, begindex=-1, endline=-1, endindex=-1,
643 ws_ = False): 644 ws_=False):
644 """ 645 """
645 Public method to search in a specified range of text without 646 Public method to search in a specified range of text without
646 setting the selection. 647 setting the selection.
647 648
648 @param expr_ search expression (string) 649 @param expr_ search expression (string)
655 position) (integer) 656 position) (integer)
656 @keyparam endline line number to stop at (-1 to indicate end of 657 @keyparam endline line number to stop at (-1 to indicate end of
657 document) (integer) 658 document) (integer)
658 @keyparam endindex index number to stop at (-1 to indicate end of 659 @keyparam endindex index number to stop at (-1 to indicate end of
659 document) (integer) 660 document) (integer)
660 @keyparam ws_ flag indicating a word start search (boolean) 661 @keyparam ws_ flag indicating a word start search (boolean)
661 @return flag indicating a successful search (boolean) 662 @return flag indicating a successful search (boolean)
662 """ 663 """
663 self.__targetSearchFlags = 0 664 self.__targetSearchFlags = 0
664 if re_: 665 if re_:
665 self.__targetSearchFlags |= QsciScintilla.SCFIND_REGEXP 666 self.__targetSearchFlags |= QsciScintilla.SCFIND_REGEXP
730 731
731 def indicatorDefine(self, indicator, style, color): 732 def indicatorDefine(self, indicator, style, color):
732 """ 733 """
733 Public method to define the appearance of an indicator. 734 Public method to define the appearance of an indicator.
734 735
735 @param indicator number of the indicator (integer, 736 @param indicator number of the indicator (integer,
736 QsciScintilla.INDIC_CONTAINER .. QsciScintilla.INDIC_MAX) 737 QsciScintilla.INDIC_CONTAINER .. QsciScintilla.INDIC_MAX)
737 @param style style to be used for the indicator 738 @param style style to be used for the indicator
738 (QsciScintilla.INDIC_PLAIN, QsciScintilla.INDIC_SQUIGGLE, 739 (QsciScintilla.INDIC_PLAIN, QsciScintilla.INDIC_SQUIGGLE,
739 QsciScintilla.INDIC_TT, QsciScintilla.INDIC_DIAGONAL, 740 QsciScintilla.INDIC_TT, QsciScintilla.INDIC_DIAGONAL,
740 QsciScintilla.INDIC_STRIKE, QsciScintilla.INDIC_HIDDEN, 741 QsciScintilla.INDIC_STRIKE, QsciScintilla.INDIC_HIDDEN,
760 761
761 def setCurrentIndicator(self, indicator): 762 def setCurrentIndicator(self, indicator):
762 """ 763 """
763 Public method to set the current indicator. 764 Public method to set the current indicator.
764 765
765 @param indicator number of the indicator (integer, 766 @param indicator number of the indicator (integer,
766 QsciScintilla.INDIC_CONTAINER .. QsciScintilla.INDIC_MAX) 767 QsciScintilla.INDIC_CONTAINER .. QsciScintilla.INDIC_MAX)
767 @exception ValueError the indicator or style are not valid 768 @exception ValueError the indicator or style are not valid
768 """ 769 """
769 if indicator < QsciScintilla.INDIC_CONTAINER or \ 770 if indicator < QsciScintilla.INDIC_CONTAINER or \
770 indicator > QsciScintilla.INDIC_MAX: 771 indicator > QsciScintilla.INDIC_MAX:
774 775
775 def setIndicatorRange(self, indicator, spos, length): 776 def setIndicatorRange(self, indicator, spos, length):
776 """ 777 """
777 Public method to set an indicator for the given range. 778 Public method to set an indicator for the given range.
778 779
779 @param indicator number of the indicator (integer, 780 @param indicator number of the indicator (integer,
780 QsciScintilla.INDIC_CONTAINER .. QsciScintilla.INDIC_MAX) 781 QsciScintilla.INDIC_CONTAINER .. QsciScintilla.INDIC_MAX)
781 @param spos position of the indicator start (integer) 782 @param spos position of the indicator start (integer)
782 @param length length of the indicator (integer) 783 @param length length of the indicator (integer)
783 @exception ValueError the indicator or style are not valid 784 @exception ValueError the indicator or style are not valid
784 """ 785 """
787 788
788 def setIndicator(self, indicator, sline, sindex, eline, eindex): 789 def setIndicator(self, indicator, sline, sindex, eline, eindex):
789 """ 790 """
790 Public method to set an indicator for the given range. 791 Public method to set an indicator for the given range.
791 792
792 @param indicator number of the indicator (integer, 793 @param indicator number of the indicator (integer,
793 QsciScintilla.INDIC_CONTAINER .. QsciScintilla.INDIC_MAX) 794 QsciScintilla.INDIC_CONTAINER .. QsciScintilla.INDIC_MAX)
794 @param sline line number of the indicator start (integer) 795 @param sline line number of the indicator start (integer)
795 @param sindex index of the indicator start (integer) 796 @param sindex index of the indicator start (integer)
796 @param eline line number of the indicator end (integer) 797 @param eline line number of the indicator end (integer)
797 @param eindex index of the indicator end (integer) 798 @param eindex index of the indicator end (integer)
803 804
804 def clearIndicatorRange(self, indicator, spos, length): 805 def clearIndicatorRange(self, indicator, spos, length):
805 """ 806 """
806 Public method to clear an indicator for the given range. 807 Public method to clear an indicator for the given range.
807 808
808 @param indicator number of the indicator (integer, 809 @param indicator number of the indicator (integer,
809 QsciScintilla.INDIC_CONTAINER .. QsciScintilla.INDIC_MAX) 810 QsciScintilla.INDIC_CONTAINER .. QsciScintilla.INDIC_MAX)
810 @param spos position of the indicator start (integer) 811 @param spos position of the indicator start (integer)
811 @param length length of the indicator (integer) 812 @param length length of the indicator (integer)
812 """ 813 """
813 self.setCurrentIndicator(indicator) 814 self.setCurrentIndicator(indicator)
815 816
816 def clearIndicator(self, indicator, sline, sindex, eline, eindex): 817 def clearIndicator(self, indicator, sline, sindex, eline, eindex):
817 """ 818 """
818 Public method to clear an indicator for the given range. 819 Public method to clear an indicator for the given range.
819 820
820 @param indicator number of the indicator (integer, 821 @param indicator number of the indicator (integer,
821 QsciScintilla.INDIC_CONTAINER .. QsciScintilla.INDIC_MAX) 822 QsciScintilla.INDIC_CONTAINER .. QsciScintilla.INDIC_MAX)
822 @param sline line number of the indicator start (integer) 823 @param sline line number of the indicator start (integer)
823 @param sindex index of the indicator start (integer) 824 @param sindex index of the indicator start (integer)
824 @param eline line number of the indicator end (integer) 825 @param eline line number of the indicator end (integer)
825 @param eindex index of the indicator end (integer) 826 @param eindex index of the indicator end (integer)
830 831
831 def clearAllIndicators(self, indicator): 832 def clearAllIndicators(self, indicator):
832 """ 833 """
833 Public method to clear all occurrences of an indicator. 834 Public method to clear all occurrences of an indicator.
834 835
835 @param indicator number of the indicator (integer, 836 @param indicator number of the indicator (integer,
836 QsciScintilla.INDIC_CONTAINER .. QsciScintilla.INDIC_MAX) 837 QsciScintilla.INDIC_CONTAINER .. QsciScintilla.INDIC_MAX)
837 """ 838 """
838 self.clearIndicatorRange(indicator, 0, self.length()) 839 self.clearIndicatorRange(indicator, 0, self.length())
839 840
840 def hasIndicator(self, indicator, pos): 841 def hasIndicator(self, indicator, pos):
841 """ 842 """
842 Public method to test for the existence of an indicator. 843 Public method to test for the existence of an indicator.
843 844
844 @param indicator number of the indicator (integer, 845 @param indicator number of the indicator (integer,
845 QsciScintilla.INDIC_CONTAINER .. QsciScintilla.INDIC_MAX) 846 QsciScintilla.INDIC_CONTAINER .. QsciScintilla.INDIC_MAX)
846 @param pos position to test (integer) 847 @param pos position to test (integer)
847 @return flag indicating the existence of the indicator (boolean) 848 @return flag indicating the existence of the indicator (boolean)
848 """ 849 """
849 res = self.SendScintilla(QsciScintilla.SCI_INDICATORVALUEAT, 850 res = self.SendScintilla(QsciScintilla.SCI_INDICATORVALUEAT,
852 853
853 ########################################################################### 854 ###########################################################################
854 # methods to perform folding related stuff 855 # methods to perform folding related stuff
855 ########################################################################### 856 ###########################################################################
856 857
857 def __setFoldMarker(self, marknr, mark = QsciScintilla.SC_MARK_EMPTY): 858 def __setFoldMarker(self, marknr, mark=QsciScintilla.SC_MARK_EMPTY):
858 """ 859 """
859 Private method to define a fold marker. 860 Private method to define a fold marker.
860 861
861 @param marknr marker number to define (integer) 862 @param marknr marker number to define (integer)
862 @param mark fold mark symbol to be used (integer) 863 @param mark fold mark symbol to be used (integer)
863 """ 864 """
864 self.SendScintilla(QsciScintilla.SCI_MARKERDEFINE, marknr, mark) 865 self.SendScintilla(QsciScintilla.SCI_MARKERDEFINE, marknr, mark)
865 866
866 if mark != QsciScintilla.SC_MARK_EMPTY: 867 if mark != QsciScintilla.SC_MARK_EMPTY:
867 self.SendScintilla(QsciScintilla.SCI_MARKERSETFORE, 868 self.SendScintilla(QsciScintilla.SCI_MARKERSETFORE,
868 marknr, QColor(Qt.white)) 869 marknr, QColor(Qt.white))
869 self.SendScintilla(QsciScintilla.SCI_MARKERSETBACK, 870 self.SendScintilla(QsciScintilla.SCI_MARKERSETBACK,
870 marknr, QColor(Qt.black)) 871 marknr, QColor(Qt.black))
871 872
872 def setFolding(self, style, margin = 2): 873 def setFolding(self, style, margin=2):
873 """ 874 """
874 Public method to set the folding style and margin. 875 Public method to set the folding style and margin.
875 876
876 @param style folding style to set (integer) 877 @param style folding style to set (integer)
877 @param margin margin number (integer) 878 @param margin margin number (integer)
881 else: 882 else:
882 QsciScintilla.setFolding( 883 QsciScintilla.setFolding(
883 self, QsciScintilla.PlainFoldStyle, margin) 884 self, QsciScintilla.PlainFoldStyle, margin)
884 885
885 if style == self.ArrowFoldStyle: 886 if style == self.ArrowFoldStyle:
886 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDER, 887 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDER,
887 QsciScintilla.SC_MARK_ARROW) 888 QsciScintilla.SC_MARK_ARROW)
888 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDEROPEN, 889 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDEROPEN,
889 QsciScintilla.SC_MARK_ARROWDOWN) 890 QsciScintilla.SC_MARK_ARROWDOWN)
890 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDERSUB) 891 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDERSUB)
891 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDERTAIL) 892 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDERTAIL)
892 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDEREND) 893 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDEREND)
893 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDEROPENMID) 894 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDEROPENMID)
894 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDERMIDTAIL) 895 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDERMIDTAIL)
895 elif style == self.ArrowTreeFoldStyle: 896 elif style == self.ArrowTreeFoldStyle:
896 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDER, 897 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDER,
897 QsciScintilla.SC_MARK_ARROW) 898 QsciScintilla.SC_MARK_ARROW)
898 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDEROPEN, 899 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDEROPEN,
899 QsciScintilla.SC_MARK_ARROWDOWN) 900 QsciScintilla.SC_MARK_ARROWDOWN)
900 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDERSUB, 901 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDERSUB,
901 QsciScintilla.SC_MARK_VLINE) 902 QsciScintilla.SC_MARK_VLINE)
902 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDERTAIL, 903 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDERTAIL,
903 QsciScintilla.SC_MARK_LCORNER) 904 QsciScintilla.SC_MARK_LCORNER)
904 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDEREND, 905 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDEREND,
905 QsciScintilla.SC_MARK_ARROW) 906 QsciScintilla.SC_MARK_ARROW)
906 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDEROPENMID, 907 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDEROPENMID,
907 QsciScintilla.SC_MARK_ARROWDOWN) 908 QsciScintilla.SC_MARK_ARROWDOWN)
908 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDERMIDTAIL, 909 self.__setFoldMarker(QsciScintilla.SC_MARKNUM_FOLDERMIDTAIL,
909 QsciScintilla.SC_MARK_TCORNER) 910 QsciScintilla.SC_MARK_TCORNER)
910 911
911 def setFoldMarkersColors(self, foreColor, backColor): 912 def setFoldMarkersColors(self, foreColor, backColor):
912 """ 913 """
913 Public method to set the foreground and background colors of the 914 Public method to set the foreground and background colors of the
914 fold markers. 915 fold markers.
915 916
916 @param foreColor foreground color (QColor) 917 @param foreColor foreground color (QColor)
917 @param backColor background color (QColor) 918 @param backColor background color (QColor)
918 """ 919 """
919 self.SendScintilla(QsciScintilla.SCI_MARKERSETFORE, 920 self.SendScintilla(QsciScintilla.SCI_MARKERSETFORE,
920 QsciScintilla.SC_MARKNUM_FOLDER, foreColor) 921 QsciScintilla.SC_MARKNUM_FOLDER, foreColor)
921 self.SendScintilla(QsciScintilla.SCI_MARKERSETBACK, 922 self.SendScintilla(QsciScintilla.SCI_MARKERSETBACK,
922 QsciScintilla.SC_MARKNUM_FOLDER, backColor) 923 QsciScintilla.SC_MARKNUM_FOLDER, backColor)
923 924
924 self.SendScintilla(QsciScintilla.SCI_MARKERSETFORE, 925 self.SendScintilla(QsciScintilla.SCI_MARKERSETFORE,
925 QsciScintilla.SC_MARKNUM_FOLDEROPEN, foreColor) 926 QsciScintilla.SC_MARKNUM_FOLDEROPEN, foreColor)
926 self.SendScintilla(QsciScintilla.SCI_MARKERSETBACK, 927 self.SendScintilla(QsciScintilla.SCI_MARKERSETBACK,
927 QsciScintilla.SC_MARKNUM_FOLDEROPEN, backColor) 928 QsciScintilla.SC_MARKNUM_FOLDEROPEN, backColor)
928 929
929 self.SendScintilla(QsciScintilla.SCI_MARKERSETFORE, 930 self.SendScintilla(QsciScintilla.SCI_MARKERSETFORE,
930 QsciScintilla.SC_MARKNUM_FOLDEROPENMID, foreColor) 931 QsciScintilla.SC_MARKNUM_FOLDEROPENMID, foreColor)
931 self.SendScintilla(QsciScintilla.SCI_MARKERSETBACK, 932 self.SendScintilla(QsciScintilla.SCI_MARKERSETBACK,
932 QsciScintilla.SC_MARKNUM_FOLDEROPENMID, backColor) 933 QsciScintilla.SC_MARKNUM_FOLDEROPENMID, backColor)
933 934
934 self.SendScintilla(QsciScintilla.SCI_MARKERSETFORE, 935 self.SendScintilla(QsciScintilla.SCI_MARKERSETFORE,
935 QsciScintilla.SC_MARKNUM_FOLDERSUB, foreColor) 936 QsciScintilla.SC_MARKNUM_FOLDERSUB, foreColor)
936 self.SendScintilla(QsciScintilla.SCI_MARKERSETBACK, 937 self.SendScintilla(QsciScintilla.SCI_MARKERSETBACK,
937 QsciScintilla.SC_MARKNUM_FOLDERSUB, backColor) 938 QsciScintilla.SC_MARKNUM_FOLDERSUB, backColor)
938 939
939 self.SendScintilla(QsciScintilla.SCI_MARKERSETFORE, 940 self.SendScintilla(QsciScintilla.SCI_MARKERSETFORE,
940 QsciScintilla.SC_MARKNUM_FOLDERTAIL, foreColor) 941 QsciScintilla.SC_MARKNUM_FOLDERTAIL, foreColor)
941 self.SendScintilla(QsciScintilla.SCI_MARKERSETBACK, 942 self.SendScintilla(QsciScintilla.SCI_MARKERSETBACK,
942 QsciScintilla.SC_MARKNUM_FOLDERTAIL, backColor) 943 QsciScintilla.SC_MARKNUM_FOLDERTAIL, backColor)
943 944
944 self.SendScintilla(QsciScintilla.SCI_MARKERSETFORE, 945 self.SendScintilla(QsciScintilla.SCI_MARKERSETFORE,
945 QsciScintilla.SC_MARKNUM_FOLDERMIDTAIL, foreColor) 946 QsciScintilla.SC_MARKNUM_FOLDERMIDTAIL, foreColor)
946 self.SendScintilla(QsciScintilla.SCI_MARKERSETBACK, 947 self.SendScintilla(QsciScintilla.SCI_MARKERSETBACK,
947 QsciScintilla.SC_MARKNUM_FOLDERMIDTAIL, backColor) 948 QsciScintilla.SC_MARKNUM_FOLDERMIDTAIL, backColor)
948 949
949 self.SendScintilla(QsciScintilla.SCI_MARKERSETFORE, 950 self.SendScintilla(QsciScintilla.SCI_MARKERSETFORE,
950 QsciScintilla.SC_MARKNUM_FOLDEREND, foreColor) 951 QsciScintilla.SC_MARKNUM_FOLDEREND, foreColor)
951 self.SendScintilla(QsciScintilla.SCI_MARKERSETBACK, 952 self.SendScintilla(QsciScintilla.SCI_MARKERSETBACK,
952 QsciScintilla.SC_MARKNUM_FOLDEREND, backColor) 953 QsciScintilla.SC_MARKNUM_FOLDEREND, backColor)
953 954
954 955
955 ########################################################################### 956 ###########################################################################
956 # interface methods to the standard keyboard command set 957 # interface methods to the standard keyboard command set
1016 @param lst list to be show (list of strings) 1017 @param lst list to be show (list of strings)
1017 """ 1018 """
1018 if id <= 0: 1019 if id <= 0:
1019 return 1020 return
1020 1021
1021 self.SendScintilla(QsciScintilla.SCI_AUTOCSETSEPARATOR, 1022 self.SendScintilla(QsciScintilla.SCI_AUTOCSETSEPARATOR,
1022 ord(self.UserSeparator)) 1023 ord(self.UserSeparator))
1023 self.SendScintilla(QsciScintilla.SCI_USERLISTSHOW, id, 1024 self.SendScintilla(QsciScintilla.SCI_USERLISTSHOW, id,
1024 self._encodeString(self.UserSeparator.join(lst))) 1025 self._encodeString(self.UserSeparator.join(lst)))
1025 1026
1026 ########################################################################### 1027 ###########################################################################
1027 # utility methods 1028 # utility methods
1028 ########################################################################### 1029 ###########################################################################
1118 self.foldLine(line) 1119 self.foldLine(line)
1119 1120
1120 ## ######################################################################### 1121 ## #########################################################################
1121 ## # methods below have been added to QScintilla starting with version 2.x 1122 ## # methods below have been added to QScintilla starting with version 2.x
1122 ## ######################################################################### 1123 ## #########################################################################
1123 ## 1124 ##
1124 ## if "newMethod" not in QsciScintilla.__dict__: 1125 ## if "newMethod" not in QsciScintilla.__dict__:
1125 ## def newMethod(self, param): 1126 ## def newMethod(self, param):
1126 ## """ 1127 ## """
1127 ## Public method to do something. 1128 ## Public method to do something.
1128 ## 1129 ##
1129 ## @param param parameter for method 1130 ## @param param parameter for method
1130 ## """ 1131 ## """
1131 ## pass 1132 ## pass
1132 ## 1133 ##

eric ide

mercurial