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

Sun, 25 Jul 2010 12:01:06 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 25 Jul 2010 12:01:06 +0200
branch
5_0_x
changeset 403
c5bd65142984
parent 402
2cd7333e0202
child 419
3b6f9355d02f

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
Documentation/Source/eric5.install.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:22:05 2010 +0200
+++ b/APIs/Python3/eric5.api	Sun Jul 25 12:01:06 2010 +0200
@@ -4916,10 +4916,12 @@
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.extendSelectionWordRight?4()
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.findFirstTarget?4(expr_, re_, cs_, wo_, begline = -1, begindex = -1, endline = -1, endindex = -1, ws_ = False)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.findNextTarget?4()
+eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.focusOutEvent?4(event)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.foldExpandedAt?4(line)
 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()
@@ -4947,6 +4949,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.setIndentationGuideView?4(view)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.setIndicator?4(indicator, sline, sindex, eline, eindex)
@@ -6084,6 +6087,7 @@
 eric5.install.doCleanup?7
 eric5.install.doCompile?7
 eric5.install.doDependancyChecks?4()
+eric5.install.exit?4(rcode = 0)
 eric5.install.initGlobals?4()
 eric5.install.installEric?4()
 eric5.install.main?4(argv)
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Sun Jul 25 10:22:05 2010 +0200
+++ b/Documentation/Help/source.qhp	Sun Jul 25 12:01:06 2010 +0200
@@ -835,6 +835,7 @@
       <keyword name="createInstallConfig" id="createInstallConfig" ref="eric5.install.html#createInstallConfig" />
       <keyword name="createPyWrapper" id="createPyWrapper" ref="eric5.install.html#createPyWrapper" />
       <keyword name="doDependancyChecks" id="doDependancyChecks" ref="eric5.install.html#doDependancyChecks" />
+      <keyword name="exit" id="exit" ref="eric5.install.html#exit" />
       <keyword name="initGlobals" id="initGlobals" ref="eric5.install.html#initGlobals" />
       <keyword name="installEric" id="installEric" ref="eric5.install.html#installEric" />
       <keyword name="main" id="main" ref="eric5.install.html#main" />
@@ -5365,10 +5366,12 @@
       <keyword name="QsciScintillaCompat.extendSelectionWordRight" id="QsciScintillaCompat.extendSelectionWordRight" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.extendSelectionWordRight" />
       <keyword name="QsciScintillaCompat.findFirstTarget" id="QsciScintillaCompat.findFirstTarget" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.findFirstTarget" />
       <keyword name="QsciScintillaCompat.findNextTarget" id="QsciScintillaCompat.findNextTarget" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.findNextTarget" />
+      <keyword name="QsciScintillaCompat.focusOutEvent" id="QsciScintillaCompat.focusOutEvent" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.focusOutEvent" />
       <keyword name="QsciScintillaCompat.foldExpandedAt" id="QsciScintillaCompat.foldExpandedAt" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.foldExpandedAt" />
       <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" />
@@ -5396,6 +5399,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.setIndentationGuideView" id="QsciScintillaCompat.setIndentationGuideView" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.setIndentationGuideView" />
       <keyword name="QsciScintillaCompat.setIndicator" id="QsciScintillaCompat.setIndicator" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.setIndicator" />
--- a/Documentation/Source/eric5.QScintilla.QsciScintillaCompat.html	Sun Jul 25 10:22:05 2010 +0200
+++ b/Documentation/Source/eric5.QScintilla.QsciScintillaCompat.html	Sun Jul 25 12:01:06 2010 +0200
@@ -145,6 +145,9 @@
 <td><a href="#QsciScintillaCompat.findNextTarget">findNextTarget</a></td>
 <td>Public method to find the next occurrence in the target range.</td>
 </tr><tr>
+<td><a href="#QsciScintillaCompat.focusOutEvent">focusOutEvent</a></td>
+<td>Public method called when the editor loses focus.</td>
+</tr><tr>
 <td><a href="#QsciScintillaCompat.foldExpandedAt">foldExpandedAt</a></td>
 <td>Public method to determine, if a fold is expanded.</td>
 </tr><tr>
@@ -157,6 +160,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>
@@ -238,6 +244,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>
@@ -559,6 +568,16 @@
 <dd>
 flag indicating a successful search (boolean)
 </dd>
+</dl><a NAME="QsciScintillaCompat.focusOutEvent" ID="QsciScintillaCompat.focusOutEvent"></a>
+<h4>QsciScintillaCompat.focusOutEvent</h4>
+<b>focusOutEvent</b>(<i>event</i>)
+<p>
+        Public method called when the editor loses focus.
+</p><dl>
+<dt><i>event</i></dt>
+<dd>
+the event object (QFocusEvent)
+</dd>
 </dl><a NAME="QsciScintillaCompat.foldExpandedAt" ID="QsciScintillaCompat.foldExpandedAt"></a>
 <h4>QsciScintillaCompat.foldExpandedAt</h4>
 <b>foldExpandedAt</b>(<i>line</i>)
@@ -619,6 +638,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>)
@@ -933,6 +966,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/Documentation/Source/eric5.install.html	Sun Jul 25 10:22:05 2010 +0200
+++ b/Documentation/Source/eric5.install.html	Sun Jul 25 12:01:06 2010 +0200
@@ -68,6 +68,9 @@
 <td><a href="#doDependancyChecks">doDependancyChecks</a></td>
 <td>Perform some dependency checks.</td>
 </tr><tr>
+<td><a href="#exit">exit</a></td>
+<td>Exit the install script.</td>
+</tr><tr>
 <td><a href="#initGlobals">initGlobals</a></td>
 <td>Sets the values of globals that need more than a simple assignment.</td>
 </tr><tr>
@@ -245,6 +248,14 @@
 </p>
 <div align="right"><a href="#top">Up</a></div>
 <hr /><hr />
+<a NAME="exit" ID="exit"></a>
+<h2>exit</h2>
+<b>exit</b>(<i>rcode = 0</i>)
+<p>
+    Exit the install script.
+</p>
+<div align="right"><a href="#top">Up</a></div>
+<hr /><hr />
 <a NAME="initGlobals" ID="initGlobals"></a>
 <h2>initGlobals</h2>
 <b>initGlobals</b>(<i></i>)
--- a/QScintilla/Editor.py	Sun Jul 25 10:22:05 2010 +0200
+++ b/QScintilla/Editor.py	Sun Jul 25 12:01:06 2010 +0200
@@ -3342,6 +3342,8 @@
             Preferences.getEditorColour("SpellingMarkers"))
         self.__setSpelling()
         
+        self.setCursorFlashTime(QApplication.cursorFlashTime())
+        
     def __setEolMode(self):
         """
         Private method to configure the eol mode of the editor.
@@ -4808,6 +4810,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:22:05 2010 +0200
+++ b/QScintilla/MiniEditor.py	Sun Jul 25 12:01:06 2010 +0200
@@ -68,6 +68,8 @@
         except AttributeError:
             pass
         
+        self.setCursorFlashTime(QApplication.cursorFlashTime())
+        
         QsciScintillaCompat.focusInEvent(self, event)
     
     def focusOutEvent(self, event):
@@ -1764,6 +1766,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:22:05 2010 +0200
+++ b/QScintilla/QsciScintillaCompat.py	Sun Jul 25 12:01:06 2010 +0200
@@ -510,6 +510,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:22:05 2010 +0200
+++ b/QScintilla/Shell.py	Sun Jul 25 12:01:06 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:22:05 2010 +0200
+++ b/QScintilla/Terminal.py	Sun Jul 25 12:01:06 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:22:05 2010 +0200
+++ b/changelog	Sun Jul 25 12:01:06 2010 +0200
@@ -1,5 +1,9 @@
 Change Log
 ----------
+Version 5.0.1:
+- bug fixes
+- added code to adjust the cursor flash time of the editor to the global settings
+
 Version 5.0.0:
 - first formal release of the Python3 variant of eric
 

eric ide

mercurial