QScintilla/Editor.py

changeset 3591
2f2a4a76dd22
parent 3583
3e8e0346d639
child 3621
15f23ed3f216
equal deleted inserted replaced
3590:5280e37405b8 3591:2f2a4a76dd22
2031 self.markerDeleteHandle(handle) 2031 self.markerDeleteHandle(handle)
2032 self.__markerMap.update() 2032 self.__markerMap.update()
2033 2033
2034 def newBreakpointWithProperties(self, line, properties): 2034 def newBreakpointWithProperties(self, line, properties):
2035 """ 2035 """
2036 Private method to set a new breakpoint and its properties. 2036 Public method to set a new breakpoint and its properties.
2037 2037
2038 @param line line number of the breakpoint (integer) 2038 @param line line number of the breakpoint (integer)
2039 @param properties properties for the breakpoint (tuple) 2039 @param properties properties for the breakpoint (tuple)
2040 (condition, temporary flag, enabled flag, ignore count) 2040 (condition, temporary flag, enabled flag, ignore count)
2041 """ 2041 """
3154 elif self.markersAtLine(line) & (1 << self.warning): 3154 elif self.markersAtLine(line) & (1 << self.warning):
3155 self.__showWarning(line) 3155 self.__showWarning(line)
3156 3156
3157 def handleMonospacedEnable(self): 3157 def handleMonospacedEnable(self):
3158 """ 3158 """
3159 Private slot to handle the Use Monospaced Font context menu entry. 3159 Public slot to handle the Use Monospaced Font context menu entry.
3160 """ 3160 """
3161 if self.menuActs["MonospacedFont"].isChecked(): 3161 if self.menuActs["MonospacedFont"].isChecked():
3162 if not self.lexer_: 3162 if not self.lexer_:
3163 self.setMonospaced(True) 3163 self.setMonospaced(True)
3164 else: 3164 else:
4349 ## Support for autocompletion hook methods 4349 ## Support for autocompletion hook methods
4350 ################################################################# 4350 #################################################################
4351 4351
4352 def __charAdded(self, charNumber): 4352 def __charAdded(self, charNumber):
4353 """ 4353 """
4354 Public slot called to handle the user entering a character. 4354 Private slot called to handle the user entering a character.
4355 4355
4356 @param charNumber value of the character entered (integer) 4356 @param charNumber value of the character entered (integer)
4357 """ 4357 """
4358 if self.isListActive(): 4358 if self.isListActive():
4359 char = chr(charNumber) 4359 char = chr(charNumber)
4640 return margin 4640 return margin
4641 return -1 4641 return -1
4642 4642
4643 def contextMenuEvent(self, evt): 4643 def contextMenuEvent(self, evt):
4644 """ 4644 """
4645 Private method implementing the context menu event. 4645 Protected method implementing the context menu event.
4646 4646
4647 @param evt the context menu event (QContextMenuEvent) 4647 @param evt the context menu event (QContextMenuEvent)
4648 """ 4648 """
4649 evt.accept() 4649 evt.accept()
4650 if self.__marginNumber(evt.x()) == -1: 4650 if self.__marginNumber(evt.x()) == -1:
5654 """ 5654 """
5655 self.__clearTypedWarning(Editor.WarningStyle) 5655 self.__clearTypedWarning(Editor.WarningStyle)
5656 5656
5657 def __clearTypedWarning(self, warningKind): 5657 def __clearTypedWarning(self, warningKind):
5658 """ 5658 """
5659 Public method to clear warnings of a specific kind. 5659 Private method to clear warnings of a specific kind.
5660 5660
5661 @param warningKind kind of warning to clear (Editor.WarningCode, 5661 @param warningKind kind of warning to clear (Editor.WarningCode,
5662 Editor.WarningStyle) 5662 Editor.WarningStyle)
5663 """ 5663 """
5664 assert warningKind in [Editor.WarningCode, Editor.WarningStyle] 5664 assert warningKind in [Editor.WarningCode, Editor.WarningStyle]
6058 6058
6059 super(Editor, self).close() 6059 super(Editor, self).close()
6060 6060
6061 def keyPressEvent(self, ev): 6061 def keyPressEvent(self, ev):
6062 """ 6062 """
6063 Re-implemented to handle the user input a key at a time. 6063 Protected method to handle the user input a key at a time.
6064 6064
6065 @param ev key event (QKeyEvent) 6065 @param ev key event (QKeyEvent)
6066 """ 6066 """
6067 txt = ev.text() 6067 txt = ev.text()
6068 6068
6128 6128
6129 super(Editor, self).focusInEvent(event) 6129 super(Editor, self).focusInEvent(event)
6130 6130
6131 def focusOutEvent(self, event): 6131 def focusOutEvent(self, event):
6132 """ 6132 """
6133 Public method called when the editor loses focus. 6133 Protected method called when the editor loses focus.
6134 6134
6135 @param event the event object (QFocusEvent) 6135 @param event the event object (QFocusEvent)
6136 """ 6136 """
6137 self.vm.editorActGrp.setEnabled(False) 6137 self.vm.editorActGrp.setEnabled(False)
6138 self.setCaretWidth(0) 6138 self.setCaretWidth(0)
6196 6196
6197 super(Editor, self).wheelEvent(evt) 6197 super(Editor, self).wheelEvent(evt)
6198 6198
6199 def event(self, evt): 6199 def event(self, evt):
6200 """ 6200 """
6201 Protected method handling events. 6201 Public method handling events.
6202 6202
6203 @param evt reference to the event (QEvent) 6203 @param evt reference to the event (QEvent)
6204 @return flag indicating, if the event was handled (boolean) 6204 @return flag indicating, if the event was handled (boolean)
6205 """ 6205 """
6206 if evt.type() == QEvent.Gesture: 6206 if evt.type() == QEvent.Gesture:
6828 return True 6828 return True
6829 6829
6830 @pyqtSlot(int) 6830 @pyqtSlot(int)
6831 def __spellCharAdded(self, charNumber): 6831 def __spellCharAdded(self, charNumber):
6832 """ 6832 """
6833 Public slot called to handle the user entering a character. 6833 Private slot called to handle the user entering a character.
6834 6834
6835 @param charNumber value of the character entered (integer) 6835 @param charNumber value of the character entered (integer)
6836 """ 6836 """
6837 if self.spell: 6837 if self.spell:
6838 if not chr(charNumber).isalnum(): 6838 if not chr(charNumber).isalnum():
7232 """ 7232 """
7233 self.__searchCurrentWord(forward=False) 7233 self.__searchCurrentWord(forward=False)
7234 7234
7235 def __searchCurrentWord(self, forward=True): 7235 def __searchCurrentWord(self, forward=True):
7236 """ 7236 """
7237 Public slot to search the next occurrence of the current word. 7237 Private slot to search the next occurrence of the current word.
7238 7238
7239 @param forward flag indicating the search direction (boolean) 7239 @param forward flag indicating the search direction (boolean)
7240 """ 7240 """
7241 self.hideFindIndicator() 7241 self.hideFindIndicator()
7242 line, index = self.getCursorPosition() 7242 line, index = self.getCursorPosition()

eric ide

mercurial