Added code to adjust the cursor flash time of the editor to the global settings.

Sun, 25 Jul 2010 12:02:49 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 25 Jul 2010 12:02:49 +0200
changeset 404
44a541bea034
parent 401
54b80c7a802b
child 405
374066392929

Added code to adjust the cursor flash time of the editor to the global settings.

APIs/Python3/eric5.api file | annotate | diff | comparison | revisions
Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
Documentation/Source/eric5.QScintilla.QsciScintillaCompat.html file | annotate | diff | comparison | revisions
QScintilla/Editor.py file | annotate | diff | comparison | revisions
QScintilla/MiniEditor.py file | annotate | diff | comparison | revisions
QScintilla/QsciScintillaCompat.py file | annotate | diff | comparison | revisions
QScintilla/Shell.py file | annotate | diff | comparison | revisions
QScintilla/Terminal.py file | annotate | diff | comparison | revisions
changelog file | annotate | diff | comparison | revisions
--- a/APIs/Python3/eric5.api	Sun Jul 25 10:21:34 2010 +0200
+++ b/APIs/Python3/eric5.api	Sun Jul 25 12:02:49 2010 +0200
@@ -4963,6 +4963,7 @@
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.foldFlagsAt?4(line)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.foldHeaderAt?4(line)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.foldLevelAt?4(line)
+eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.getCursorFlashTime?4()
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.getEndStyled?4()
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.getEolIndicator?4()
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.getFileName?4()
@@ -4990,6 +4991,7 @@
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.replaceTarget?4(replaceStr)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.scrollVertical?4(lines)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.setCurrentIndicator?4(indicator)
+eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.setCursorFlashTime?4(time)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.setEolModeByEolString?4(eolStr)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.setFoldMarkersColors?4(foreColor, backColor)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.setFolding?4(style, margin = 2)
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Sun Jul 25 10:21:34 2010 +0200
+++ b/Documentation/Help/source.qhp	Sun Jul 25 12:02:49 2010 +0200
@@ -5470,6 +5470,7 @@
       <keyword name="QsciScintillaCompat.foldFlagsAt" id="QsciScintillaCompat.foldFlagsAt" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.foldFlagsAt" />
       <keyword name="QsciScintillaCompat.foldHeaderAt" id="QsciScintillaCompat.foldHeaderAt" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.foldHeaderAt" />
       <keyword name="QsciScintillaCompat.foldLevelAt" id="QsciScintillaCompat.foldLevelAt" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.foldLevelAt" />
+      <keyword name="QsciScintillaCompat.getCursorFlashTime" id="QsciScintillaCompat.getCursorFlashTime" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.getCursorFlashTime" />
       <keyword name="QsciScintillaCompat.getEndStyled" id="QsciScintillaCompat.getEndStyled" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.getEndStyled" />
       <keyword name="QsciScintillaCompat.getEolIndicator" id="QsciScintillaCompat.getEolIndicator" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.getEolIndicator" />
       <keyword name="QsciScintillaCompat.getFileName" id="QsciScintillaCompat.getFileName" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.getFileName" />
@@ -5497,6 +5498,7 @@
       <keyword name="QsciScintillaCompat.replaceTarget" id="QsciScintillaCompat.replaceTarget" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.replaceTarget" />
       <keyword name="QsciScintillaCompat.scrollVertical" id="QsciScintillaCompat.scrollVertical" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.scrollVertical" />
       <keyword name="QsciScintillaCompat.setCurrentIndicator" id="QsciScintillaCompat.setCurrentIndicator" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.setCurrentIndicator" />
+      <keyword name="QsciScintillaCompat.setCursorFlashTime" id="QsciScintillaCompat.setCursorFlashTime" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.setCursorFlashTime" />
       <keyword name="QsciScintillaCompat.setEolModeByEolString" id="QsciScintillaCompat.setEolModeByEolString" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.setEolModeByEolString" />
       <keyword name="QsciScintillaCompat.setFoldMarkersColors" id="QsciScintillaCompat.setFoldMarkersColors" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.setFoldMarkersColors" />
       <keyword name="QsciScintillaCompat.setFolding" id="QsciScintillaCompat.setFolding" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.setFolding" />
--- a/Documentation/Source/eric5.QScintilla.QsciScintillaCompat.html	Sun Jul 25 10:21:34 2010 +0200
+++ b/Documentation/Source/eric5.QScintilla.QsciScintillaCompat.html	Sun Jul 25 12:02:49 2010 +0200
@@ -163,6 +163,9 @@
 <td><a href="#QsciScintillaCompat.foldLevelAt">foldLevelAt</a></td>
 <td>Public method to get the fold level of a line of the document.</td>
 </tr><tr>
+<td><a href="#QsciScintillaCompat.getCursorFlashTime">getCursorFlashTime</a></td>
+<td>Public method to get the flash (blink) time of the cursor in milliseconds.</td>
+</tr><tr>
 <td><a href="#QsciScintillaCompat.getEndStyled">getEndStyled</a></td>
 <td>Public method to get the last styled position.</td>
 </tr><tr>
@@ -244,6 +247,9 @@
 <td><a href="#QsciScintillaCompat.setCurrentIndicator">setCurrentIndicator</a></td>
 <td>Public method to set the current indicator.</td>
 </tr><tr>
+<td><a href="#QsciScintillaCompat.setCursorFlashTime">setCursorFlashTime</a></td>
+<td>Public method to get the flash (blink) time of the cursor in milliseconds.</td>
+</tr><tr>
 <td><a href="#QsciScintillaCompat.setEolModeByEolString">setEolModeByEolString</a></td>
 <td>Public method to set the eol mode given the eol string.</td>
 </tr><tr>
@@ -654,6 +660,20 @@
 <dd>
 fold level of the given line (integer)
 </dd>
+</dl><a NAME="QsciScintillaCompat.getCursorFlashTime" ID="QsciScintillaCompat.getCursorFlashTime"></a>
+<h4>QsciScintillaCompat.getCursorFlashTime</h4>
+<b>getCursorFlashTime</b>(<i></i>)
+<p>
+        Public method to get the flash (blink) time of the cursor in milliseconds.
+</p><p>
+        The flash time is the time required to display, invert and restore the 
+        caret display. Usually the text cursor is displayed for half the cursor 
+        flash time, then hidden for the same amount of time.
+</p><dl>
+<dt>Returns:</dt>
+<dd>
+flash time of the cursor in milliseconds (integer)
+</dd>
 </dl><a NAME="QsciScintillaCompat.getEndStyled" ID="QsciScintillaCompat.getEndStyled"></a>
 <h4>QsciScintillaCompat.getEndStyled</h4>
 <b>getEndStyled</b>(<i></i>)
@@ -968,6 +988,20 @@
 <dd>
 the indicator or style are not valid
 </dd>
+</dl><a NAME="QsciScintillaCompat.setCursorFlashTime" ID="QsciScintillaCompat.setCursorFlashTime"></a>
+<h4>QsciScintillaCompat.setCursorFlashTime</h4>
+<b>setCursorFlashTime</b>(<i>time</i>)
+<p>
+        Public method to get the flash (blink) time of the cursor in milliseconds.
+</p><p>
+        The flash time is the time required to display, invert and restore the 
+        caret display. Usually the text cursor is displayed for half the cursor 
+        flash time, then hidden for the same amount of time.
+</p><dl>
+<dt><i>time</i></dt>
+<dd>
+flash time of the cursor in milliseconds (integer)
+</dd>
 </dl><a NAME="QsciScintillaCompat.setEolModeByEolString" ID="QsciScintillaCompat.setEolModeByEolString"></a>
 <h4>QsciScintillaCompat.setEolModeByEolString</h4>
 <b>setEolModeByEolString</b>(<i>eolStr</i>)
--- a/QScintilla/Editor.py	Sun Jul 25 10:21:34 2010 +0200
+++ b/QScintilla/Editor.py	Sun Jul 25 12:02:49 2010 +0200
@@ -3340,6 +3340,8 @@
             Preferences.getEditorColour("SpellingMarkers"))
         self.__setSpelling()
         
+        self.setCursorFlashTime(QApplication.cursorFlashTime())
+        
     def __setEolMode(self):
         """
         Private method to configure the eol mode of the editor.
@@ -4806,6 +4808,8 @@
                     self.lastModified = QFileInfo(self.fileName).lastModified()
                 self.inReopenPrompt = False
         
+        self.setCursorFlashTime(QApplication.cursorFlashTime())
+        
         QsciScintillaCompat.focusInEvent(self, event)
         
     def focusOutEvent(self, event):
--- a/QScintilla/MiniEditor.py	Sun Jul 25 10:21:34 2010 +0200
+++ b/QScintilla/MiniEditor.py	Sun Jul 25 12:02:49 2010 +0200
@@ -68,6 +68,8 @@
         except AttributeError:
             pass
         
+        self.setCursorFlashTime(QApplication.cursorFlashTime())
+        
         QsciScintillaCompat.focusInEvent(self, event)
     
     def focusOutEvent(self, event):
@@ -1767,6 +1769,8 @@
         self.searchIndicator = QsciScintilla.INDIC_CONTAINER
         self.__textEdit.indicatorDefine(self.searchIndicator, QsciScintilla.INDIC_BOX, 
             Preferences.getEditorColour("SearchMarkers"))
+        
+        self.__textEdit.setCursorFlashTime(QApplication.cursorFlashTime())
     
     def __setEolMode(self):
         """
--- a/QScintilla/QsciScintillaCompat.py	Sun Jul 25 10:21:34 2010 +0200
+++ b/QScintilla/QsciScintillaCompat.py	Sun Jul 25 12:02:49 2010 +0200
@@ -514,6 +514,30 @@
         else:
             return None
     
+    def getCursorFlashTime(self):
+        """
+        Public method to get the flash (blink) time of the cursor in milliseconds.
+        
+        The flash time is the time required to display, invert and restore the 
+        caret display. Usually the text cursor is displayed for half the cursor 
+        flash time, then hidden for the same amount of time.
+        
+        @return flash time of the cursor in milliseconds (integer)
+        """
+        return 2 * self.SendScintilla(QsciScintilla.SCI_GETCARETPERIOD)
+    
+    def setCursorFlashTime(self, time):
+        """
+        Public method to get the flash (blink) time of the cursor in milliseconds.
+        
+        The flash time is the time required to display, invert and restore the 
+        caret display. Usually the text cursor is displayed for half the cursor 
+        flash time, then hidden for the same amount of time.
+        
+        @param time flash time of the cursor in milliseconds (integer)
+        """
+        self.SendScintilla(QsciScintilla.SCI_SETCARETPERIOD, time // 2)
+    
     #####################################################################################
     # methods to perform searches in target range
     #####################################################################################
--- a/QScintilla/Shell.py	Sun Jul 25 10:21:34 2010 +0200
+++ b/QScintilla/Shell.py	Sun Jul 25 12:02:49 2010 +0200
@@ -326,6 +326,8 @@
         self.useMonospaced = Preferences.getShell("UseMonospacedFont")
         self.__setMonospaced(self.useMonospaced)
         
+        self.setCursorFlashTime(QApplication.cursorFlashTime())
+        
     def __setMonospaced(self, on):
         """
         Private method to set/reset a monospaced font.
@@ -1395,6 +1397,8 @@
         except AttributeError:
             pass
         self.setCaretWidth(self.caretWidth)
+        self.setCursorFlashTime(QApplication.cursorFlashTime())
+        
         QsciScintillaCompat.focusInEvent(self, event)
         
     def focusOutEvent(self, event):
--- a/QScintilla/Terminal.py	Sun Jul 25 10:21:34 2010 +0200
+++ b/QScintilla/Terminal.py	Sun Jul 25 12:02:49 2010 +0200
@@ -328,6 +328,8 @@
         self.useMonospaced = Preferences.getTerminal("UseMonospacedFont")
         self.__setMonospaced(self.useMonospaced)
         
+        self.setCursorFlashTime(QApplication.cursorFlashTime())
+        
     def __setMonospaced(self, on):
         """
         Private method to set/reset a monospaced font.
@@ -893,6 +895,8 @@
         except AttributeError:
             pass
         self.setCaretWidth(self.caretWidth)
+        self.setCursorFlashTime(QApplication.cursorFlashTime())
+        
         QsciScintillaCompat.focusInEvent(self, event)
         
     def focusOutEvent(self, event):
--- a/changelog	Sun Jul 25 10:21:34 2010 +0200
+++ b/changelog	Sun Jul 25 12:02:49 2010 +0200
@@ -2,7 +2,8 @@
 ----------
 Version 5.1-snapshot-2010mmdd:
 - bug fixes
-- added action to copy the editor path to the clipboard to the tab context menu
+- added action to copy the editor path to the clipboard to the tab context menu
+- added code to adjust the cursor flash time of the editor to the global settings
 
 Version 5.1-snapshot-20100718:
 - bug fixes

eric ide

mercurial