Added methods to QsciScintillaCompat to handle multiple selections.

Sun, 19 May 2013 14:38:05 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 19 May 2013 14:38:05 +0200
changeset 2658
ec17f5d559e9
parent 2657
eb87b82eca17
child 2659
7f46c5a7ed73

Added methods to QsciScintillaCompat to handle multiple selections.

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.uninstall.html file | annotate | diff | comparison | revisions
QScintilla/QsciScintillaCompat.py file | annotate | diff | comparison | revisions
--- a/APIs/Python3/eric5.api	Mon May 13 19:58:28 2013 +0200
+++ b/APIs/Python3/eric5.api	Sun May 19 14:38:05 2013 +0200
@@ -6992,6 +6992,9 @@
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.getFoundTarget?4()
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.getLineSeparator?4()
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.getRectangularSelection?4()
+eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.getSelectionCount?4()
+eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.getSelectionN?4(index)
+eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.getSelections?4()
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.getZoom?4()
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.hasIndicator?4(indicator, pos)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.hasSelection?4()
@@ -8721,6 +8724,7 @@
 eric5.patch_modpython.modDir?7
 eric5.patch_modpython.progName?7
 eric5.patch_modpython.usage?4(rcode=2)
+eric5.uninstall.exit?4(rcode=0)
 eric5.uninstall.initGlobals?4()
 eric5.uninstall.main?4(argv)
 eric5.uninstall.progLanguages?7
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Mon May 13 19:58:28 2013 +0200
+++ b/Documentation/Help/source.qhp	Sun May 19 14:38:05 2013 +0200
@@ -8977,6 +8977,9 @@
       <keyword name="QsciScintillaCompat.getFoundTarget" id="QsciScintillaCompat.getFoundTarget" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.getFoundTarget" />
       <keyword name="QsciScintillaCompat.getLineSeparator" id="QsciScintillaCompat.getLineSeparator" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.getLineSeparator" />
       <keyword name="QsciScintillaCompat.getRectangularSelection" id="QsciScintillaCompat.getRectangularSelection" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.getRectangularSelection" />
+      <keyword name="QsciScintillaCompat.getSelectionCount" id="QsciScintillaCompat.getSelectionCount" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.getSelectionCount" />
+      <keyword name="QsciScintillaCompat.getSelectionN" id="QsciScintillaCompat.getSelectionN" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.getSelectionN" />
+      <keyword name="QsciScintillaCompat.getSelections" id="QsciScintillaCompat.getSelections" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.getSelections" />
       <keyword name="QsciScintillaCompat.getZoom" id="QsciScintillaCompat.getZoom" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.getZoom" />
       <keyword name="QsciScintillaCompat.hasIndicator" id="QsciScintillaCompat.hasIndicator" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.hasIndicator" />
       <keyword name="QsciScintillaCompat.hasSelection" id="QsciScintillaCompat.hasSelection" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.hasSelection" />
@@ -12426,6 +12429,7 @@
       <keyword name="exeDisplayData" id="exeDisplayData" ref="eric5.Plugins.PluginVcsSubversion.html#exeDisplayData" />
       <keyword name="exeDisplayDataList" id="exeDisplayDataList" ref="eric5.Plugins.PluginEricdoc.html#exeDisplayDataList" />
       <keyword name="exit" id="exit" ref="eric5.install.html#exit" />
+      <keyword name="exit" id="exit" ref="eric5.uninstall.html#exit" />
       <keyword name="expand_indent" id="expand_indent" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#expand_indent" />
       <keyword name="expand_indent" id="expand_indent" ref="eric5.UtilitiesPython2.pep8.html#expand_indent" />
       <keyword name="exportPreferences" id="exportPreferences" ref="eric5.Preferences.__init__.html#exportPreferences" />
--- a/Documentation/Source/eric5.QScintilla.QsciScintillaCompat.html	Mon May 13 19:58:28 2013 +0200
+++ b/Documentation/Source/eric5.QScintilla.QsciScintillaCompat.html	Sun May 19 14:38:05 2013 +0200
@@ -202,6 +202,15 @@
 <td><a href="#QsciScintillaCompat.getRectangularSelection">getRectangularSelection</a></td>
 <td>Public method to retrieve the start and end of a rectangular selection.</td>
 </tr><tr>
+<td><a href="#QsciScintillaCompat.getSelectionCount">getSelectionCount</a></td>
+<td>Public method to get the number of active selections.</td>
+</tr><tr>
+<td><a href="#QsciScintillaCompat.getSelectionN">getSelectionN</a></td>
+<td>Public method to get the start and end of a selection given by it's index.</td>
+</tr><tr>
+<td><a href="#QsciScintillaCompat.getSelections">getSelections</a></td>
+<td>Public method to get the start and end coordinates of all active selections.</td>
+</tr><tr>
 <td><a href="#QsciScintillaCompat.getZoom">getZoom</a></td>
 <td>Public method used to retrieve the current zoom factor.</td>
 </tr><tr>
@@ -812,6 +821,38 @@
 tuple with start line and index and end line and index
             (tuple of four int)
 </dd>
+</dl><a NAME="QsciScintillaCompat.getSelectionCount" ID="QsciScintillaCompat.getSelectionCount"></a>
+<h4>QsciScintillaCompat.getSelectionCount</h4>
+<b>getSelectionCount</b>(<i></i>)
+<p>
+        Public method to get the number of active selections.
+</p><dl>
+<dt>Returns:</dt>
+<dd>
+number of active selection (integer)
+</dd>
+</dl><a NAME="QsciScintillaCompat.getSelectionN" ID="QsciScintillaCompat.getSelectionN"></a>
+<h4>QsciScintillaCompat.getSelectionN</h4>
+<b>getSelectionN</b>(<i>index</i>)
+<p>
+        Public method to get the start and end of a selection given by it's index.
+</p><dl>
+<dt>Returns:</dt>
+<dd>
+tuple with start line and index and end line and index
+            (tuple of four int) for the given selection
+</dd>
+</dl><a NAME="QsciScintillaCompat.getSelections" ID="QsciScintillaCompat.getSelections"></a>
+<h4>QsciScintillaCompat.getSelections</h4>
+<b>getSelections</b>(<i></i>)
+<p>
+        Public method to get the start and end coordinates of all active selections.
+</p><dl>
+<dt>Returns:</dt>
+<dd>
+list of tuples with start line and index and end line and index
+            of each active selection (list of tuples of four int)
+</dd>
 </dl><a NAME="QsciScintillaCompat.getZoom" ID="QsciScintillaCompat.getZoom"></a>
 <h4>QsciScintillaCompat.getZoom</h4>
 <b>getZoom</b>(<i></i>)
--- a/Documentation/Source/eric5.uninstall.html	Mon May 13 19:58:28 2013 +0200
+++ b/Documentation/Source/eric5.uninstall.html	Sun May 19 14:38:05 2013 +0200
@@ -34,6 +34,9 @@
 <h3>Functions</h3>
 <table>
 <tr>
+<td><a href="#exit">exit</a></td>
+<td>Exit the uninstall 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>
@@ -51,6 +54,14 @@
 </tr>
 </table>
 <hr /><hr />
+<a NAME="exit" ID="exit"></a>
+<h2>exit</h2>
+<b>exit</b>(<i>rcode=0</i>)
+<p>
+    Exit the uninstall 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/QsciScintillaCompat.py	Mon May 13 19:58:28 2013 +0200
+++ b/QScintilla/QsciScintillaCompat.py	Sun May 19 14:38:05 2013 +0200
@@ -525,6 +525,40 @@
         self.SendScintilla(QsciScintilla.SCI_SETRECTANGULARSELECTIONANCHOR, startPos)
         self.SendScintilla(QsciScintilla.SCI_SETRECTANGULARSELECTIONCARET, endPos)
     
+    def getSelectionCount(self):
+        """
+        Public method to get the number of active selections.
+        
+        @return number of active selection (integer)
+        """
+        return self.SendScintilla(QsciScintilla.SCI_GETSELECTIONS)
+    
+    def getSelectionN(self, index):
+        """
+        Public method to get the start and end of a selection given by it's index.
+        
+        @return tuple with start line and index and end line and index
+            (tuple of four int) for the given selection
+        """
+        startPos = self.SendScintilla(QsciScintilla.SCI_GETSELECTIONNSTART, index)
+        endPos = self.SendScintilla(QsciScintilla.SCI_GETSELECTIONNEND, index)
+        startLine, startIndex = self.lineIndexFromPosition(startPos)
+        endLine, endIndex = self.lineIndexFromPosition(endPos)
+        
+        return (startLine, startIndex, endLine, endIndex)
+    
+    def getSelections(self):
+        """
+        Public method to get the start and end coordinates of all active selections.
+        
+        @return list of tuples with start line and index and end line and index
+            of each active selection (list of tuples of four int)
+        """
+        selections = []
+        for index in range(self.getSelectionCount()):
+            selections.append(self.getSelectionN(index))
+        return selections
+    
     def getLineSeparator(self):
         """
         Public method to get the line separator for the current eol mode.

eric ide

mercurial