5 |
5 |
6 """ |
6 """ |
7 Module implementing a compatability interface class to QsciScintilla. |
7 Module implementing a compatability interface class to QsciScintilla. |
8 """ |
8 """ |
9 |
9 |
10 from PyQt4.QtCore import Qt |
10 from PyQt4.QtCore import pyqtSignal, Qt |
11 from PyQt4.QtGui import QPalette, QColor, QApplication |
11 from PyQt4.QtGui import QPalette, QColor, QApplication |
12 from PyQt4.Qsci import QsciScintilla, \ |
12 from PyQt4.Qsci import QsciScintilla, \ |
13 QSCINTILLA_VERSION as QsciQSCINTILLA_VERSION, QSCINTILLA_VERSION_STR, \ |
13 QSCINTILLA_VERSION as QsciQSCINTILLA_VERSION, QSCINTILLA_VERSION_STR, \ |
14 QsciScintillaBase |
14 QsciScintillaBase |
15 |
15 |
38 Class implementing a compatability interface to QsciScintilla. |
38 Class implementing a compatability interface to QsciScintilla. |
39 |
39 |
40 This class implements all the functions, that were added to |
40 This class implements all the functions, that were added to |
41 QsciScintilla incrementally. This class ensures compatibility |
41 QsciScintilla incrementally. This class ensures compatibility |
42 to older versions of QsciScintilla. |
42 to older versions of QsciScintilla. |
|
43 |
|
44 @signal zoomValueChanged(int) emitted to signal a change of the zoom value |
43 """ |
45 """ |
|
46 zoomValueChanged = pyqtSignal(int) |
|
47 |
44 ArrowFoldStyle = QsciScintilla.BoxedTreeFoldStyle + 1 |
48 ArrowFoldStyle = QsciScintilla.BoxedTreeFoldStyle + 1 |
45 ArrowTreeFoldStyle = ArrowFoldStyle + 1 |
49 ArrowTreeFoldStyle = ArrowFoldStyle + 1 |
46 |
50 |
47 UserSeparator = '\x04' |
51 UserSeparator = '\x04' |
48 |
52 |
302 |
306 |
303 def zoomIn(self, zoom=1): |
307 def zoomIn(self, zoom=1): |
304 """ |
308 """ |
305 Public method used to increase the zoom factor. |
309 Public method used to increase the zoom factor. |
306 |
310 |
307 @param zoom zoom factor increment |
311 @param zoom zoom factor increment (integer) |
308 """ |
312 """ |
309 self.zoom += zoom |
|
310 super().zoomIn(zoom) |
313 super().zoomIn(zoom) |
311 |
314 |
312 def zoomOut(self, zoom=1): |
315 def zoomOut(self, zoom=1): |
313 """ |
316 """ |
314 Public method used to decrease the zoom factor. |
317 Public method used to decrease the zoom factor. |
315 |
318 |
316 @param zoom zoom factor decrement |
319 @param zoom zoom factor decrement (integer) |
317 """ |
320 """ |
318 self.zoom -= zoom |
|
319 super().zoomOut(zoom) |
321 super().zoomOut(zoom) |
320 |
322 |
321 def zoomTo(self, zoom): |
323 def zoomTo(self, zoom): |
322 """ |
324 """ |
323 Public method used to zoom to a specific zoom factor. |
325 Public method used to zoom to a specific zoom factor. |
324 |
326 |
325 @param zoom zoom factor |
327 @param zoom zoom factor (integer) |
326 """ |
328 """ |
327 self.zoom = zoom |
329 self.zoom = zoom |
328 super().zoomTo(zoom) |
330 super().zoomTo(zoom) |
|
331 self.zoomValueChanged.emit(self.zoom) |
329 |
332 |
330 def getZoom(self): |
333 def getZoom(self): |
331 """ |
334 """ |
332 Public method used to retrieve the current zoom factor. |
335 Public method used to retrieve the current zoom factor. |
333 |
336 |
334 @return zoom factor (int) |
337 @return zoom factor (integer) |
335 """ |
338 """ |
336 return self.zoom |
339 return self.zoom |
337 |
340 |
338 def editorCommand(self, cmd): |
341 def editorCommand(self, cmd): |
339 """ |
342 """ |