|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' |
|
3 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> |
|
4 <html><head> |
|
5 <title>eric4.QScintilla.MiniEditor</title> |
|
6 <style> |
|
7 body { |
|
8 background:white; |
|
9 margin: 0em 1em 10em 1em; |
|
10 color: black; |
|
11 } |
|
12 |
|
13 h1 { color: white; background: #4FA4FF; } |
|
14 h2 { color: white; background: #4FA4FF; } |
|
15 h3 { color: white; background: #00557F; } |
|
16 h4 { color: white; background: #00557F; } |
|
17 |
|
18 a { color: #AA5500; } |
|
19 |
|
20 </style> |
|
21 </head> |
|
22 <body><a NAME="top" ID="top"></a> |
|
23 <h1>eric4.QScintilla.MiniEditor</h1> |
|
24 <p> |
|
25 Module implementing a minimalistic editor for simple editing tasks. |
|
26 </p> |
|
27 <h3>Global Attributes</h3> |
|
28 <table> |
|
29 <tr><td>None</td></tr> |
|
30 </table> |
|
31 <h3>Classes</h3> |
|
32 <table> |
|
33 <tr> |
|
34 <td><a href="#MiniEditor">MiniEditor</a></td> |
|
35 <td>Class implementing a minimalistic editor for simple editing tasks.</td> |
|
36 </tr><tr> |
|
37 <td><a href="#MiniScintilla">MiniScintilla</a></td> |
|
38 <td>Class implementing a QsciScintillaCompat subclass for handling focus events.</td> |
|
39 </tr> |
|
40 </table> |
|
41 <h3>Functions</h3> |
|
42 <table> |
|
43 <tr><td>None</td></tr> |
|
44 </table> |
|
45 <hr /><hr /> |
|
46 <a NAME="MiniEditor" ID="MiniEditor"></a> |
|
47 <h2>MiniEditor</h2> |
|
48 <p> |
|
49 Class implementing a minimalistic editor for simple editing tasks. |
|
50 </p><h4>Signals</h4> |
|
51 <dl> |
|
52 <dt>editorSaved</dt> |
|
53 <dd> |
|
54 emitted after the file has been saved |
|
55 </dd> |
|
56 </dl> |
|
57 <h3>Derived from</h3> |
|
58 QMainWindow |
|
59 <h3>Class Attributes</h3> |
|
60 <table> |
|
61 <tr><td>None</td></tr> |
|
62 </table> |
|
63 <h3>Methods</h3> |
|
64 <table> |
|
65 <tr> |
|
66 <td><a href="#MiniEditor.__init__">MiniEditor</a></td> |
|
67 <td>Constructor</td> |
|
68 </tr><tr> |
|
69 <td><a href="#MiniEditor.__about">__about</a></td> |
|
70 <td>Private slot to show a little About message.</td> |
|
71 </tr><tr> |
|
72 <td><a href="#MiniEditor.__aboutQt">__aboutQt</a></td> |
|
73 <td>Private slot to handle the About Qt dialog.</td> |
|
74 </tr><tr> |
|
75 <td><a href="#MiniEditor.__bindLexer">__bindLexer</a></td> |
|
76 <td>Private slot to set the correct lexer depending on language.</td> |
|
77 </tr><tr> |
|
78 <td><a href="#MiniEditor.__bindName">__bindName</a></td> |
|
79 <td>Private method to generate a dummy filename for binding a lexer.</td> |
|
80 </tr><tr> |
|
81 <td><a href="#MiniEditor.__checkActions">__checkActions</a></td> |
|
82 <td>Private slot to check some actions for their enable/disable status and set the statusbar info.</td> |
|
83 </tr><tr> |
|
84 <td><a href="#MiniEditor.__checkLanguage">__checkLanguage</a></td> |
|
85 <td>Private method to check the selected language of the language submenu.</td> |
|
86 </tr><tr> |
|
87 <td><a href="#MiniEditor.__contextMenuRequested">__contextMenuRequested</a></td> |
|
88 <td>Private slot to show the context menu.</td> |
|
89 </tr><tr> |
|
90 <td><a href="#MiniEditor.__createActions">__createActions</a></td> |
|
91 <td>Private method to create the actions.</td> |
|
92 </tr><tr> |
|
93 <td><a href="#MiniEditor.__createEditActions">__createEditActions</a></td> |
|
94 <td>Private method to create the Edit actions.</td> |
|
95 </tr><tr> |
|
96 <td><a href="#MiniEditor.__createFileActions">__createFileActions</a></td> |
|
97 <td>Private method to create the File actions.</td> |
|
98 </tr><tr> |
|
99 <td><a href="#MiniEditor.__createHelpActions">__createHelpActions</a></td> |
|
100 <td>Private method to create the Help actions.</td> |
|
101 </tr><tr> |
|
102 <td><a href="#MiniEditor.__createMenus">__createMenus</a></td> |
|
103 <td>Private method to create the menus of the menu bar.</td> |
|
104 </tr><tr> |
|
105 <td><a href="#MiniEditor.__createSearchActions">__createSearchActions</a></td> |
|
106 <td>Private method defining the user interface actions for the search commands.</td> |
|
107 </tr><tr> |
|
108 <td><a href="#MiniEditor.__createStatusBar">__createStatusBar</a></td> |
|
109 <td>Private method to initialize the status bar.</td> |
|
110 </tr><tr> |
|
111 <td><a href="#MiniEditor.__createToolBars">__createToolBars</a></td> |
|
112 <td>Private method to create the various toolbars.</td> |
|
113 </tr><tr> |
|
114 <td><a href="#MiniEditor.__cursorPositionChanged">__cursorPositionChanged</a></td> |
|
115 <td>Private slot to handle the cursorPositionChanged signal.</td> |
|
116 </tr><tr> |
|
117 <td><a href="#MiniEditor.__deselectAll">__deselectAll</a></td> |
|
118 <td>Private slot handling the deselect all context menu action.</td> |
|
119 </tr><tr> |
|
120 <td><a href="#MiniEditor.__documentWasModified">__documentWasModified</a></td> |
|
121 <td>Private slot to handle a change in the documents modification status.</td> |
|
122 </tr><tr> |
|
123 <td><a href="#MiniEditor.__getCurrentWord">__getCurrentWord</a></td> |
|
124 <td>Private method to get the word at the current position.</td> |
|
125 </tr><tr> |
|
126 <td><a href="#MiniEditor.__getWord">__getWord</a></td> |
|
127 <td>Private method to get the word at a position.</td> |
|
128 </tr><tr> |
|
129 <td><a href="#MiniEditor.__initContextMenu">__initContextMenu</a></td> |
|
130 <td>Private method used to setup the context menu</td> |
|
131 </tr><tr> |
|
132 <td><a href="#MiniEditor.__initContextMenuLanguages">__initContextMenuLanguages</a></td> |
|
133 <td>Private method used to setup the Languages context sub menu.</td> |
|
134 </tr><tr> |
|
135 <td><a href="#MiniEditor.__languageMenuTriggered">__languageMenuTriggered</a></td> |
|
136 <td>Private method to handle the selection of a lexer language.</td> |
|
137 </tr><tr> |
|
138 <td><a href="#MiniEditor.__loadFile">__loadFile</a></td> |
|
139 <td>Private method to load the given file.</td> |
|
140 </tr><tr> |
|
141 <td><a href="#MiniEditor.__markOccurrences">__markOccurrences</a></td> |
|
142 <td>Private method to mark all occurrences of the current word.</td> |
|
143 </tr><tr> |
|
144 <td><a href="#MiniEditor.__maybeSave">__maybeSave</a></td> |
|
145 <td>Private method to ask the user to save the file, if it was modified.</td> |
|
146 </tr><tr> |
|
147 <td><a href="#MiniEditor.__modificationChanged">__modificationChanged</a></td> |
|
148 <td>Private slot to handle the modificationChanged signal.</td> |
|
149 </tr><tr> |
|
150 <td><a href="#MiniEditor.__newFile">__newFile</a></td> |
|
151 <td>Private slot to create a new file.</td> |
|
152 </tr><tr> |
|
153 <td><a href="#MiniEditor.__open">__open</a></td> |
|
154 <td>Private slot to open a file.</td> |
|
155 </tr><tr> |
|
156 <td><a href="#MiniEditor.__printFile">__printFile</a></td> |
|
157 <td>Private slot to print the text.</td> |
|
158 </tr><tr> |
|
159 <td><a href="#MiniEditor.__printPreview">__printPreview</a></td> |
|
160 <td>Private slot to generate a print preview.</td> |
|
161 </tr><tr> |
|
162 <td><a href="#MiniEditor.__printPreviewFile">__printPreviewFile</a></td> |
|
163 <td>Private slot to show a print preview of the text.</td> |
|
164 </tr><tr> |
|
165 <td><a href="#MiniEditor.__readSettings">__readSettings</a></td> |
|
166 <td>Private method to read the settings remembered last time.</td> |
|
167 </tr><tr> |
|
168 <td><a href="#MiniEditor.__readShortcut">__readShortcut</a></td> |
|
169 <td>Private function to read a single keyboard shortcut from the settings.</td> |
|
170 </tr><tr> |
|
171 <td><a href="#MiniEditor.__redo">__redo</a></td> |
|
172 <td>Public method to redo the last recorded change.</td> |
|
173 </tr><tr> |
|
174 <td><a href="#MiniEditor.__replace">__replace</a></td> |
|
175 <td>Private method to handle the replace action.</td> |
|
176 </tr><tr> |
|
177 <td><a href="#MiniEditor.__resetLanguage">__resetLanguage</a></td> |
|
178 <td>Private method used to reset the language selection.</td> |
|
179 </tr><tr> |
|
180 <td><a href="#MiniEditor.__save">__save</a></td> |
|
181 <td>Private slot to save a file.</td> |
|
182 </tr><tr> |
|
183 <td><a href="#MiniEditor.__saveAs">__saveAs</a></td> |
|
184 <td>Private slot to save a file with a new name.</td> |
|
185 </tr><tr> |
|
186 <td><a href="#MiniEditor.__saveFile">__saveFile</a></td> |
|
187 <td>Private method to save to the given file.</td> |
|
188 </tr><tr> |
|
189 <td><a href="#MiniEditor.__search">__search</a></td> |
|
190 <td>Private method to handle the search action.</td> |
|
191 </tr><tr> |
|
192 <td><a href="#MiniEditor.__searchClearMarkers">__searchClearMarkers</a></td> |
|
193 <td>Private method to clear the search markers of the active window.</td> |
|
194 </tr><tr> |
|
195 <td><a href="#MiniEditor.__selectAll">__selectAll</a></td> |
|
196 <td>Private slot handling the select all context menu action.</td> |
|
197 </tr><tr> |
|
198 <td><a href="#MiniEditor.__selectPygmentsLexer">__selectPygmentsLexer</a></td> |
|
199 <td>Private method to select a specific pygments lexer.</td> |
|
200 </tr><tr> |
|
201 <td><a href="#MiniEditor.__setCurrentFile">__setCurrentFile</a></td> |
|
202 <td>Private method to register the file name of the current file.</td> |
|
203 </tr><tr> |
|
204 <td><a href="#MiniEditor.__setEolMode">__setEolMode</a></td> |
|
205 <td>Private method to configure the eol mode of the editor.</td> |
|
206 </tr><tr> |
|
207 <td><a href="#MiniEditor.__setMargins">__setMargins</a></td> |
|
208 <td>Private method to configure the margins.</td> |
|
209 </tr><tr> |
|
210 <td><a href="#MiniEditor.__setMonospaced">__setMonospaced</a></td> |
|
211 <td>Private method to set/reset a monospaced font.</td> |
|
212 </tr><tr> |
|
213 <td><a href="#MiniEditor.__setSbFile">__setSbFile</a></td> |
|
214 <td>Private method to set the file info in the status bar.</td> |
|
215 </tr><tr> |
|
216 <td><a href="#MiniEditor.__setTextDisplay">__setTextDisplay</a></td> |
|
217 <td>Private method to configure the text display.</td> |
|
218 </tr><tr> |
|
219 <td><a href="#MiniEditor.__showContextMenuLanguages">__showContextMenuLanguages</a></td> |
|
220 <td>Private slot handling the aboutToShow signal of the languages context menu.</td> |
|
221 </tr><tr> |
|
222 <td><a href="#MiniEditor.__strippedName">__strippedName</a></td> |
|
223 <td>Private method to return the filename part of the given path.</td> |
|
224 </tr><tr> |
|
225 <td><a href="#MiniEditor.__styleNeeded">__styleNeeded</a></td> |
|
226 <td>Private slot to handle the need for more styling.</td> |
|
227 </tr><tr> |
|
228 <td><a href="#MiniEditor.__undo">__undo</a></td> |
|
229 <td>Public method to undo the last recorded change.</td> |
|
230 </tr><tr> |
|
231 <td><a href="#MiniEditor.__whatsThis">__whatsThis</a></td> |
|
232 <td>Private slot called in to enter Whats This mode.</td> |
|
233 </tr><tr> |
|
234 <td><a href="#MiniEditor.__writeSettings">__writeSettings</a></td> |
|
235 <td>Private method to write the settings for reuse.</td> |
|
236 </tr><tr> |
|
237 <td><a href="#MiniEditor.activeWindow">activeWindow</a></td> |
|
238 <td>Public method to fulfill the ViewManager interface.</td> |
|
239 </tr><tr> |
|
240 <td><a href="#MiniEditor.clearSearchIndicators">clearSearchIndicators</a></td> |
|
241 <td>Public method to clear all search indicators.</td> |
|
242 </tr><tr> |
|
243 <td><a href="#MiniEditor.closeEvent">closeEvent</a></td> |
|
244 <td>Public method to handle the close event.</td> |
|
245 </tr><tr> |
|
246 <td><a href="#MiniEditor.getFileName">getFileName</a></td> |
|
247 <td>Public method to return the name of the file being displayed.</td> |
|
248 </tr><tr> |
|
249 <td><a href="#MiniEditor.getLanguage">getLanguage</a></td> |
|
250 <td>Public method to retrieve the language of the editor.</td> |
|
251 </tr><tr> |
|
252 <td><a href="#MiniEditor.getSRHistory">getSRHistory</a></td> |
|
253 <td>Public method to get the search or replace history list.</td> |
|
254 </tr><tr> |
|
255 <td><a href="#MiniEditor.readLine0">readLine0</a></td> |
|
256 <td>Public slot to read the first line from a file.</td> |
|
257 </tr><tr> |
|
258 <td><a href="#MiniEditor.setLanguage">setLanguage</a></td> |
|
259 <td>Public method to set a lexer language.</td> |
|
260 </tr><tr> |
|
261 <td><a href="#MiniEditor.setSearchIndicator">setSearchIndicator</a></td> |
|
262 <td>Public method to set a search indicator for the given range.</td> |
|
263 </tr><tr> |
|
264 <td><a href="#MiniEditor.setText">setText</a></td> |
|
265 <td>Public method to set the text programatically.</td> |
|
266 </tr><tr> |
|
267 <td><a href="#MiniEditor.textForFind">textForFind</a></td> |
|
268 <td>Public method to determine the selection or the current word for the next find operation.</td> |
|
269 </tr> |
|
270 </table> |
|
271 <a NAME="MiniEditor.__init__" ID="MiniEditor.__init__"></a> |
|
272 <h4>MiniEditor (Constructor)</h4> |
|
273 <b>MiniEditor</b>(<i>filename = "", filetype = "", parent = None, name = None</i>) |
|
274 <p> |
|
275 Constructor |
|
276 </p><dl> |
|
277 <dt><i>filename</i></dt> |
|
278 <dd> |
|
279 name of the file to open (string) |
|
280 </dd><dt><i>filetype</i></dt> |
|
281 <dd> |
|
282 type of the source file (string) |
|
283 </dd><dt><i>parent</i></dt> |
|
284 <dd> |
|
285 reference to the parent widget (QWidget) |
|
286 </dd><dt><i>name</i></dt> |
|
287 <dd> |
|
288 object name of the window (string) |
|
289 </dd> |
|
290 </dl><a NAME="MiniEditor.__about" ID="MiniEditor.__about"></a> |
|
291 <h4>MiniEditor.__about</h4> |
|
292 <b>__about</b>(<i></i>) |
|
293 <p> |
|
294 Private slot to show a little About message. |
|
295 </p><a NAME="MiniEditor.__aboutQt" ID="MiniEditor.__aboutQt"></a> |
|
296 <h4>MiniEditor.__aboutQt</h4> |
|
297 <b>__aboutQt</b>(<i></i>) |
|
298 <p> |
|
299 Private slot to handle the About Qt dialog. |
|
300 </p><a NAME="MiniEditor.__bindLexer" ID="MiniEditor.__bindLexer"></a> |
|
301 <h4>MiniEditor.__bindLexer</h4> |
|
302 <b>__bindLexer</b>(<i>filename, pyname = ""</i>) |
|
303 <p> |
|
304 Private slot to set the correct lexer depending on language. |
|
305 </p><dl> |
|
306 <dt><i>filename</i></dt> |
|
307 <dd> |
|
308 filename used to determine the associated lexer language (string) |
|
309 </dd><dt><i>pyname=</i></dt> |
|
310 <dd> |
|
311 name of the pygments lexer to use (string) |
|
312 </dd> |
|
313 </dl><a NAME="MiniEditor.__bindName" ID="MiniEditor.__bindName"></a> |
|
314 <h4>MiniEditor.__bindName</h4> |
|
315 <b>__bindName</b>(<i>line0</i>) |
|
316 <p> |
|
317 Private method to generate a dummy filename for binding a lexer. |
|
318 </p><dl> |
|
319 <dt><i>line0</i></dt> |
|
320 <dd> |
|
321 first line of text to use in the generation process (string) |
|
322 </dd> |
|
323 </dl><a NAME="MiniEditor.__checkActions" ID="MiniEditor.__checkActions"></a> |
|
324 <h4>MiniEditor.__checkActions</h4> |
|
325 <b>__checkActions</b>(<i>setSb = True</i>) |
|
326 <p> |
|
327 Private slot to check some actions for their enable/disable status |
|
328 and set the statusbar info. |
|
329 </p><dl> |
|
330 <dt><i>setSb</i></dt> |
|
331 <dd> |
|
332 flag indicating an update of the status bar is wanted (boolean) |
|
333 </dd> |
|
334 </dl><a NAME="MiniEditor.__checkLanguage" ID="MiniEditor.__checkLanguage"></a> |
|
335 <h4>MiniEditor.__checkLanguage</h4> |
|
336 <b>__checkLanguage</b>(<i></i>) |
|
337 <p> |
|
338 Private method to check the selected language of the language submenu. |
|
339 </p><a NAME="MiniEditor.__contextMenuRequested" ID="MiniEditor.__contextMenuRequested"></a> |
|
340 <h4>MiniEditor.__contextMenuRequested</h4> |
|
341 <b>__contextMenuRequested</b>(<i>coord</i>) |
|
342 <p> |
|
343 Private slot to show the context menu. |
|
344 </p><dl> |
|
345 <dt><i>coord</i></dt> |
|
346 <dd> |
|
347 the position of the mouse pointer (QPoint) |
|
348 </dd> |
|
349 </dl><a NAME="MiniEditor.__createActions" ID="MiniEditor.__createActions"></a> |
|
350 <h4>MiniEditor.__createActions</h4> |
|
351 <b>__createActions</b>(<i></i>) |
|
352 <p> |
|
353 Private method to create the actions. |
|
354 </p><a NAME="MiniEditor.__createEditActions" ID="MiniEditor.__createEditActions"></a> |
|
355 <h4>MiniEditor.__createEditActions</h4> |
|
356 <b>__createEditActions</b>(<i></i>) |
|
357 <p> |
|
358 Private method to create the Edit actions. |
|
359 </p><a NAME="MiniEditor.__createFileActions" ID="MiniEditor.__createFileActions"></a> |
|
360 <h4>MiniEditor.__createFileActions</h4> |
|
361 <b>__createFileActions</b>(<i></i>) |
|
362 <p> |
|
363 Private method to create the File actions. |
|
364 </p><a NAME="MiniEditor.__createHelpActions" ID="MiniEditor.__createHelpActions"></a> |
|
365 <h4>MiniEditor.__createHelpActions</h4> |
|
366 <b>__createHelpActions</b>(<i></i>) |
|
367 <p> |
|
368 Private method to create the Help actions. |
|
369 </p><a NAME="MiniEditor.__createMenus" ID="MiniEditor.__createMenus"></a> |
|
370 <h4>MiniEditor.__createMenus</h4> |
|
371 <b>__createMenus</b>(<i></i>) |
|
372 <p> |
|
373 Private method to create the menus of the menu bar. |
|
374 </p><a NAME="MiniEditor.__createSearchActions" ID="MiniEditor.__createSearchActions"></a> |
|
375 <h4>MiniEditor.__createSearchActions</h4> |
|
376 <b>__createSearchActions</b>(<i></i>) |
|
377 <p> |
|
378 Private method defining the user interface actions for the search commands. |
|
379 </p><a NAME="MiniEditor.__createStatusBar" ID="MiniEditor.__createStatusBar"></a> |
|
380 <h4>MiniEditor.__createStatusBar</h4> |
|
381 <b>__createStatusBar</b>(<i></i>) |
|
382 <p> |
|
383 Private method to initialize the status bar. |
|
384 </p><a NAME="MiniEditor.__createToolBars" ID="MiniEditor.__createToolBars"></a> |
|
385 <h4>MiniEditor.__createToolBars</h4> |
|
386 <b>__createToolBars</b>(<i></i>) |
|
387 <p> |
|
388 Private method to create the various toolbars. |
|
389 </p><a NAME="MiniEditor.__cursorPositionChanged" ID="MiniEditor.__cursorPositionChanged"></a> |
|
390 <h4>MiniEditor.__cursorPositionChanged</h4> |
|
391 <b>__cursorPositionChanged</b>(<i>line, pos</i>) |
|
392 <p> |
|
393 Private slot to handle the cursorPositionChanged signal. |
|
394 </p><dl> |
|
395 <dt><i>line</i></dt> |
|
396 <dd> |
|
397 line number of the cursor |
|
398 </dd><dt><i>pos</i></dt> |
|
399 <dd> |
|
400 position in line of the cursor |
|
401 </dd> |
|
402 </dl><a NAME="MiniEditor.__deselectAll" ID="MiniEditor.__deselectAll"></a> |
|
403 <h4>MiniEditor.__deselectAll</h4> |
|
404 <b>__deselectAll</b>(<i></i>) |
|
405 <p> |
|
406 Private slot handling the deselect all context menu action. |
|
407 </p><a NAME="MiniEditor.__documentWasModified" ID="MiniEditor.__documentWasModified"></a> |
|
408 <h4>MiniEditor.__documentWasModified</h4> |
|
409 <b>__documentWasModified</b>(<i></i>) |
|
410 <p> |
|
411 Private slot to handle a change in the documents modification status. |
|
412 </p><a NAME="MiniEditor.__getCurrentWord" ID="MiniEditor.__getCurrentWord"></a> |
|
413 <h4>MiniEditor.__getCurrentWord</h4> |
|
414 <b>__getCurrentWord</b>(<i></i>) |
|
415 <p> |
|
416 Private method to get the word at the current position. |
|
417 </p><dl> |
|
418 <dt>Returns:</dt> |
|
419 <dd> |
|
420 the word at that current position |
|
421 </dd> |
|
422 </dl><a NAME="MiniEditor.__getWord" ID="MiniEditor.__getWord"></a> |
|
423 <h4>MiniEditor.__getWord</h4> |
|
424 <b>__getWord</b>(<i>line, index</i>) |
|
425 <p> |
|
426 Private method to get the word at a position. |
|
427 </p><dl> |
|
428 <dt><i>line</i></dt> |
|
429 <dd> |
|
430 number of line to look at (int) |
|
431 </dd><dt><i>index</i></dt> |
|
432 <dd> |
|
433 position to look at (int) |
|
434 </dd> |
|
435 </dl><dl> |
|
436 <dt>Returns:</dt> |
|
437 <dd> |
|
438 the word at that position (string) |
|
439 </dd> |
|
440 </dl><a NAME="MiniEditor.__initContextMenu" ID="MiniEditor.__initContextMenu"></a> |
|
441 <h4>MiniEditor.__initContextMenu</h4> |
|
442 <b>__initContextMenu</b>(<i></i>) |
|
443 <p> |
|
444 Private method used to setup the context menu |
|
445 </p><a NAME="MiniEditor.__initContextMenuLanguages" ID="MiniEditor.__initContextMenuLanguages"></a> |
|
446 <h4>MiniEditor.__initContextMenuLanguages</h4> |
|
447 <b>__initContextMenuLanguages</b>(<i></i>) |
|
448 <p> |
|
449 Private method used to setup the Languages context sub menu. |
|
450 </p><a NAME="MiniEditor.__languageMenuTriggered" ID="MiniEditor.__languageMenuTriggered"></a> |
|
451 <h4>MiniEditor.__languageMenuTriggered</h4> |
|
452 <b>__languageMenuTriggered</b>(<i>act</i>) |
|
453 <p> |
|
454 Private method to handle the selection of a lexer language. |
|
455 </p><dl> |
|
456 <dt><i>act</i></dt> |
|
457 <dd> |
|
458 reference to the action that was triggered (QAction) |
|
459 </dd> |
|
460 </dl><a NAME="MiniEditor.__loadFile" ID="MiniEditor.__loadFile"></a> |
|
461 <h4>MiniEditor.__loadFile</h4> |
|
462 <b>__loadFile</b>(<i>fileName, filetype = None</i>) |
|
463 <p> |
|
464 Private method to load the given file. |
|
465 </p><dl> |
|
466 <dt><i>fileName</i></dt> |
|
467 <dd> |
|
468 name of the file to load (string) |
|
469 </dd><dt><i>filetype</i></dt> |
|
470 <dd> |
|
471 type of the source file (string) |
|
472 </dd> |
|
473 </dl><a NAME="MiniEditor.__markOccurrences" ID="MiniEditor.__markOccurrences"></a> |
|
474 <h4>MiniEditor.__markOccurrences</h4> |
|
475 <b>__markOccurrences</b>(<i></i>) |
|
476 <p> |
|
477 Private method to mark all occurrences of the current word. |
|
478 </p><a NAME="MiniEditor.__maybeSave" ID="MiniEditor.__maybeSave"></a> |
|
479 <h4>MiniEditor.__maybeSave</h4> |
|
480 <b>__maybeSave</b>(<i></i>) |
|
481 <p> |
|
482 Private method to ask the user to save the file, if it was modified. |
|
483 </p><dl> |
|
484 <dt>Returns:</dt> |
|
485 <dd> |
|
486 flag indicating, if it is ok to continue (boolean) |
|
487 </dd> |
|
488 </dl><a NAME="MiniEditor.__modificationChanged" ID="MiniEditor.__modificationChanged"></a> |
|
489 <h4>MiniEditor.__modificationChanged</h4> |
|
490 <b>__modificationChanged</b>(<i>m</i>) |
|
491 <p> |
|
492 Private slot to handle the modificationChanged signal. |
|
493 </p><dl> |
|
494 <dt><i>m</i></dt> |
|
495 <dd> |
|
496 modification status |
|
497 </dd> |
|
498 </dl><a NAME="MiniEditor.__newFile" ID="MiniEditor.__newFile"></a> |
|
499 <h4>MiniEditor.__newFile</h4> |
|
500 <b>__newFile</b>(<i></i>) |
|
501 <p> |
|
502 Private slot to create a new file. |
|
503 </p><a NAME="MiniEditor.__open" ID="MiniEditor.__open"></a> |
|
504 <h4>MiniEditor.__open</h4> |
|
505 <b>__open</b>(<i></i>) |
|
506 <p> |
|
507 Private slot to open a file. |
|
508 </p><a NAME="MiniEditor.__printFile" ID="MiniEditor.__printFile"></a> |
|
509 <h4>MiniEditor.__printFile</h4> |
|
510 <b>__printFile</b>(<i></i>) |
|
511 <p> |
|
512 Private slot to print the text. |
|
513 </p><a NAME="MiniEditor.__printPreview" ID="MiniEditor.__printPreview"></a> |
|
514 <h4>MiniEditor.__printPreview</h4> |
|
515 <b>__printPreview</b>(<i>printer</i>) |
|
516 <p> |
|
517 Private slot to generate a print preview. |
|
518 </p><dl> |
|
519 <dt><i>printer</i></dt> |
|
520 <dd> |
|
521 reference to the printer object (QScintilla.Printer.Printer) |
|
522 </dd> |
|
523 </dl><a NAME="MiniEditor.__printPreviewFile" ID="MiniEditor.__printPreviewFile"></a> |
|
524 <h4>MiniEditor.__printPreviewFile</h4> |
|
525 <b>__printPreviewFile</b>(<i></i>) |
|
526 <p> |
|
527 Private slot to show a print preview of the text. |
|
528 </p><a NAME="MiniEditor.__readSettings" ID="MiniEditor.__readSettings"></a> |
|
529 <h4>MiniEditor.__readSettings</h4> |
|
530 <b>__readSettings</b>(<i></i>) |
|
531 <p> |
|
532 Private method to read the settings remembered last time. |
|
533 </p><a NAME="MiniEditor.__readShortcut" ID="MiniEditor.__readShortcut"></a> |
|
534 <h4>MiniEditor.__readShortcut</h4> |
|
535 <b>__readShortcut</b>(<i>act, category</i>) |
|
536 <p> |
|
537 Private function to read a single keyboard shortcut from the settings. |
|
538 </p><dl> |
|
539 <dt><i>act</i></dt> |
|
540 <dd> |
|
541 reference to the action object (E4Action) |
|
542 </dd><dt><i>category</i></dt> |
|
543 <dd> |
|
544 category the action belongs to (string) |
|
545 </dd><dt><i>prefClass</i></dt> |
|
546 <dd> |
|
547 preferences class used as the storage area |
|
548 </dd> |
|
549 </dl><a NAME="MiniEditor.__redo" ID="MiniEditor.__redo"></a> |
|
550 <h4>MiniEditor.__redo</h4> |
|
551 <b>__redo</b>(<i></i>) |
|
552 <p> |
|
553 Public method to redo the last recorded change. |
|
554 </p><a NAME="MiniEditor.__replace" ID="MiniEditor.__replace"></a> |
|
555 <h4>MiniEditor.__replace</h4> |
|
556 <b>__replace</b>(<i></i>) |
|
557 <p> |
|
558 Private method to handle the replace action. |
|
559 </p><a NAME="MiniEditor.__resetLanguage" ID="MiniEditor.__resetLanguage"></a> |
|
560 <h4>MiniEditor.__resetLanguage</h4> |
|
561 <b>__resetLanguage</b>(<i></i>) |
|
562 <p> |
|
563 Private method used to reset the language selection. |
|
564 </p><a NAME="MiniEditor.__save" ID="MiniEditor.__save"></a> |
|
565 <h4>MiniEditor.__save</h4> |
|
566 <b>__save</b>(<i></i>) |
|
567 <p> |
|
568 Private slot to save a file. |
|
569 </p><a NAME="MiniEditor.__saveAs" ID="MiniEditor.__saveAs"></a> |
|
570 <h4>MiniEditor.__saveAs</h4> |
|
571 <b>__saveAs</b>(<i></i>) |
|
572 <p> |
|
573 Private slot to save a file with a new name. |
|
574 </p><a NAME="MiniEditor.__saveFile" ID="MiniEditor.__saveFile"></a> |
|
575 <h4>MiniEditor.__saveFile</h4> |
|
576 <b>__saveFile</b>(<i>fileName</i>) |
|
577 <p> |
|
578 Private method to save to the given file. |
|
579 </p><dl> |
|
580 <dt><i>fileName</i></dt> |
|
581 <dd> |
|
582 name of the file to save to (string) |
|
583 </dd> |
|
584 </dl><dl> |
|
585 <dt>Returns:</dt> |
|
586 <dd> |
|
587 flag indicating success (boolean) |
|
588 </dd> |
|
589 </dl><a NAME="MiniEditor.__search" ID="MiniEditor.__search"></a> |
|
590 <h4>MiniEditor.__search</h4> |
|
591 <b>__search</b>(<i></i>) |
|
592 <p> |
|
593 Private method to handle the search action. |
|
594 </p><a NAME="MiniEditor.__searchClearMarkers" ID="MiniEditor.__searchClearMarkers"></a> |
|
595 <h4>MiniEditor.__searchClearMarkers</h4> |
|
596 <b>__searchClearMarkers</b>(<i></i>) |
|
597 <p> |
|
598 Private method to clear the search markers of the active window. |
|
599 </p><a NAME="MiniEditor.__selectAll" ID="MiniEditor.__selectAll"></a> |
|
600 <h4>MiniEditor.__selectAll</h4> |
|
601 <b>__selectAll</b>(<i></i>) |
|
602 <p> |
|
603 Private slot handling the select all context menu action. |
|
604 </p><a NAME="MiniEditor.__selectPygmentsLexer" ID="MiniEditor.__selectPygmentsLexer"></a> |
|
605 <h4>MiniEditor.__selectPygmentsLexer</h4> |
|
606 <b>__selectPygmentsLexer</b>(<i></i>) |
|
607 <p> |
|
608 Private method to select a specific pygments lexer. |
|
609 </p><dl> |
|
610 <dt>Returns:</dt> |
|
611 <dd> |
|
612 name of the selected pygments lexer (string) |
|
613 </dd> |
|
614 </dl><a NAME="MiniEditor.__setCurrentFile" ID="MiniEditor.__setCurrentFile"></a> |
|
615 <h4>MiniEditor.__setCurrentFile</h4> |
|
616 <b>__setCurrentFile</b>(<i>fileName</i>) |
|
617 <p> |
|
618 Private method to register the file name of the current file. |
|
619 </p><dl> |
|
620 <dt><i>fileName</i></dt> |
|
621 <dd> |
|
622 name of the file to register (string) |
|
623 </dd> |
|
624 </dl><a NAME="MiniEditor.__setEolMode" ID="MiniEditor.__setEolMode"></a> |
|
625 <h4>MiniEditor.__setEolMode</h4> |
|
626 <b>__setEolMode</b>(<i></i>) |
|
627 <p> |
|
628 Private method to configure the eol mode of the editor. |
|
629 </p><a NAME="MiniEditor.__setMargins" ID="MiniEditor.__setMargins"></a> |
|
630 <h4>MiniEditor.__setMargins</h4> |
|
631 <b>__setMargins</b>(<i></i>) |
|
632 <p> |
|
633 Private method to configure the margins. |
|
634 </p><a NAME="MiniEditor.__setMonospaced" ID="MiniEditor.__setMonospaced"></a> |
|
635 <h4>MiniEditor.__setMonospaced</h4> |
|
636 <b>__setMonospaced</b>(<i>on</i>) |
|
637 <p> |
|
638 Private method to set/reset a monospaced font. |
|
639 </p><dl> |
|
640 <dt><i>on</i></dt> |
|
641 <dd> |
|
642 flag to indicate usage of a monospace font (boolean) |
|
643 </dd> |
|
644 </dl><a NAME="MiniEditor.__setSbFile" ID="MiniEditor.__setSbFile"></a> |
|
645 <h4>MiniEditor.__setSbFile</h4> |
|
646 <b>__setSbFile</b>(<i>line = None, pos = None</i>) |
|
647 <p> |
|
648 Private method to set the file info in the status bar. |
|
649 </p><dl> |
|
650 <dt><i>line</i></dt> |
|
651 <dd> |
|
652 line number to display (int) |
|
653 </dd><dt><i>pos</i></dt> |
|
654 <dd> |
|
655 character position to display (int) |
|
656 </dd> |
|
657 </dl><a NAME="MiniEditor.__setTextDisplay" ID="MiniEditor.__setTextDisplay"></a> |
|
658 <h4>MiniEditor.__setTextDisplay</h4> |
|
659 <b>__setTextDisplay</b>(<i></i>) |
|
660 <p> |
|
661 Private method to configure the text display. |
|
662 </p><a NAME="MiniEditor.__showContextMenuLanguages" ID="MiniEditor.__showContextMenuLanguages"></a> |
|
663 <h4>MiniEditor.__showContextMenuLanguages</h4> |
|
664 <b>__showContextMenuLanguages</b>(<i></i>) |
|
665 <p> |
|
666 Private slot handling the aboutToShow signal of the languages context menu. |
|
667 </p><a NAME="MiniEditor.__strippedName" ID="MiniEditor.__strippedName"></a> |
|
668 <h4>MiniEditor.__strippedName</h4> |
|
669 <b>__strippedName</b>(<i>fullFileName</i>) |
|
670 <p> |
|
671 Private method to return the filename part of the given path. |
|
672 </p><dl> |
|
673 <dt><i>fullFileName</i></dt> |
|
674 <dd> |
|
675 full pathname of the given file (string) |
|
676 </dd> |
|
677 </dl><dl> |
|
678 <dt>Returns:</dt> |
|
679 <dd> |
|
680 filename part (string) |
|
681 </dd> |
|
682 </dl><a NAME="MiniEditor.__styleNeeded" ID="MiniEditor.__styleNeeded"></a> |
|
683 <h4>MiniEditor.__styleNeeded</h4> |
|
684 <b>__styleNeeded</b>(<i>position</i>) |
|
685 <p> |
|
686 Private slot to handle the need for more styling. |
|
687 </p><dl> |
|
688 <dt><i>position</i></dt> |
|
689 <dd> |
|
690 end position, that needs styling (integer) |
|
691 </dd> |
|
692 </dl><a NAME="MiniEditor.__undo" ID="MiniEditor.__undo"></a> |
|
693 <h4>MiniEditor.__undo</h4> |
|
694 <b>__undo</b>(<i></i>) |
|
695 <p> |
|
696 Public method to undo the last recorded change. |
|
697 </p><a NAME="MiniEditor.__whatsThis" ID="MiniEditor.__whatsThis"></a> |
|
698 <h4>MiniEditor.__whatsThis</h4> |
|
699 <b>__whatsThis</b>(<i></i>) |
|
700 <p> |
|
701 Private slot called in to enter Whats This mode. |
|
702 </p><a NAME="MiniEditor.__writeSettings" ID="MiniEditor.__writeSettings"></a> |
|
703 <h4>MiniEditor.__writeSettings</h4> |
|
704 <b>__writeSettings</b>(<i></i>) |
|
705 <p> |
|
706 Private method to write the settings for reuse. |
|
707 </p><a NAME="MiniEditor.activeWindow" ID="MiniEditor.activeWindow"></a> |
|
708 <h4>MiniEditor.activeWindow</h4> |
|
709 <b>activeWindow</b>(<i></i>) |
|
710 <p> |
|
711 Public method to fulfill the ViewManager interface. |
|
712 </p><dl> |
|
713 <dt>Returns:</dt> |
|
714 <dd> |
|
715 reference to the text edit component (QsciScintillaCompat) |
|
716 </dd> |
|
717 </dl><a NAME="MiniEditor.clearSearchIndicators" ID="MiniEditor.clearSearchIndicators"></a> |
|
718 <h4>MiniEditor.clearSearchIndicators</h4> |
|
719 <b>clearSearchIndicators</b>(<i></i>) |
|
720 <p> |
|
721 Public method to clear all search indicators. |
|
722 </p><a NAME="MiniEditor.closeEvent" ID="MiniEditor.closeEvent"></a> |
|
723 <h4>MiniEditor.closeEvent</h4> |
|
724 <b>closeEvent</b>(<i>event</i>) |
|
725 <p> |
|
726 Public method to handle the close event. |
|
727 </p><dl> |
|
728 <dt><i>event</i></dt> |
|
729 <dd> |
|
730 close event (QCloseEvent) |
|
731 </dd> |
|
732 </dl><a NAME="MiniEditor.getFileName" ID="MiniEditor.getFileName"></a> |
|
733 <h4>MiniEditor.getFileName</h4> |
|
734 <b>getFileName</b>(<i></i>) |
|
735 <p> |
|
736 Public method to return the name of the file being displayed. |
|
737 </p><dl> |
|
738 <dt>Returns:</dt> |
|
739 <dd> |
|
740 filename of the displayed file (string) |
|
741 </dd> |
|
742 </dl><a NAME="MiniEditor.getLanguage" ID="MiniEditor.getLanguage"></a> |
|
743 <h4>MiniEditor.getLanguage</h4> |
|
744 <b>getLanguage</b>(<i></i>) |
|
745 <p> |
|
746 Public method to retrieve the language of the editor. |
|
747 </p><dl> |
|
748 <dt>Returns:</dt> |
|
749 <dd> |
|
750 language of the editor (string) |
|
751 </dd> |
|
752 </dl><a NAME="MiniEditor.getSRHistory" ID="MiniEditor.getSRHistory"></a> |
|
753 <h4>MiniEditor.getSRHistory</h4> |
|
754 <b>getSRHistory</b>(<i>key</i>) |
|
755 <p> |
|
756 Public method to get the search or replace history list. |
|
757 </p><dl> |
|
758 <dt><i>key</i></dt> |
|
759 <dd> |
|
760 list to return (must be 'search' or 'replace') |
|
761 </dd> |
|
762 </dl><dl> |
|
763 <dt>Returns:</dt> |
|
764 <dd> |
|
765 the requested history list (list of strings) |
|
766 </dd> |
|
767 </dl><a NAME="MiniEditor.readLine0" ID="MiniEditor.readLine0"></a> |
|
768 <h4>MiniEditor.readLine0</h4> |
|
769 <b>readLine0</b>(<i>fn, createIt = False</i>) |
|
770 <p> |
|
771 Public slot to read the first line from a file. |
|
772 </p><dl> |
|
773 <dt><i>fn</i></dt> |
|
774 <dd> |
|
775 filename to read from (string) |
|
776 </dd><dt><i>createIt</i></dt> |
|
777 <dd> |
|
778 flag indicating the creation of a new file, if the given |
|
779 one doesn't exist (boolean) |
|
780 </dd> |
|
781 </dl><dl> |
|
782 <dt>Returns:</dt> |
|
783 <dd> |
|
784 first line of the file (string) |
|
785 </dd> |
|
786 </dl><a NAME="MiniEditor.setLanguage" ID="MiniEditor.setLanguage"></a> |
|
787 <h4>MiniEditor.setLanguage</h4> |
|
788 <b>setLanguage</b>(<i>filename, initTextDisplay = True, pyname = ""</i>) |
|
789 <p> |
|
790 Public method to set a lexer language. |
|
791 </p><dl> |
|
792 <dt><i>filename</i></dt> |
|
793 <dd> |
|
794 filename used to determine the associated lexer language (string) |
|
795 </dd><dt><i>initTextDisplay</i></dt> |
|
796 <dd> |
|
797 flag indicating an initialization of the text display |
|
798 is required as well (boolean) |
|
799 </dd><dt><i>pyname=</i></dt> |
|
800 <dd> |
|
801 name of the pygments lexer to use (string) |
|
802 </dd> |
|
803 </dl><a NAME="MiniEditor.setSearchIndicator" ID="MiniEditor.setSearchIndicator"></a> |
|
804 <h4>MiniEditor.setSearchIndicator</h4> |
|
805 <b>setSearchIndicator</b>(<i>startPos, indicLength</i>) |
|
806 <p> |
|
807 Public method to set a search indicator for the given range. |
|
808 </p><dl> |
|
809 <dt><i>startPos</i></dt> |
|
810 <dd> |
|
811 start position of the indicator (integer) |
|
812 </dd><dt><i>indicLength</i></dt> |
|
813 <dd> |
|
814 length of the indicator (integer) |
|
815 </dd> |
|
816 </dl><a NAME="MiniEditor.setText" ID="MiniEditor.setText"></a> |
|
817 <h4>MiniEditor.setText</h4> |
|
818 <b>setText</b>(<i>txt, filetype = None</i>) |
|
819 <p> |
|
820 Public method to set the text programatically. |
|
821 </p><dl> |
|
822 <dt><i>txt</i></dt> |
|
823 <dd> |
|
824 text to be set (string) |
|
825 </dd><dt><i>filetype</i></dt> |
|
826 <dd> |
|
827 type of the source file (string) |
|
828 </dd> |
|
829 </dl><a NAME="MiniEditor.textForFind" ID="MiniEditor.textForFind"></a> |
|
830 <h4>MiniEditor.textForFind</h4> |
|
831 <b>textForFind</b>(<i></i>) |
|
832 <p> |
|
833 Public method to determine the selection or the current word for the next |
|
834 find operation. |
|
835 </p><dl> |
|
836 <dt>Returns:</dt> |
|
837 <dd> |
|
838 selection or current word (string) |
|
839 </dd> |
|
840 </dl> |
|
841 <div align="right"><a href="#top">Up</a></div> |
|
842 <hr /><hr /> |
|
843 <a NAME="MiniScintilla" ID="MiniScintilla"></a> |
|
844 <h2>MiniScintilla</h2> |
|
845 <p> |
|
846 Class implementing a QsciScintillaCompat subclass for handling focus events. |
|
847 </p> |
|
848 <h3>Derived from</h3> |
|
849 QsciScintillaCompat |
|
850 <h3>Class Attributes</h3> |
|
851 <table> |
|
852 <tr><td>None</td></tr> |
|
853 </table> |
|
854 <h3>Methods</h3> |
|
855 <table> |
|
856 <tr> |
|
857 <td><a href="#MiniScintilla.__init__">MiniScintilla</a></td> |
|
858 <td>Constructor</td> |
|
859 </tr><tr> |
|
860 <td><a href="#MiniScintilla.focusInEvent">focusInEvent</a></td> |
|
861 <td>Protected method called when the editor receives focus.</td> |
|
862 </tr><tr> |
|
863 <td><a href="#MiniScintilla.focusOutEvent">focusOutEvent</a></td> |
|
864 <td>Public method called when the editor loses focus.</td> |
|
865 </tr> |
|
866 </table> |
|
867 <a NAME="MiniScintilla.__init__" ID="MiniScintilla.__init__"></a> |
|
868 <h4>MiniScintilla (Constructor)</h4> |
|
869 <b>MiniScintilla</b>(<i>parent = None</i>) |
|
870 <p> |
|
871 Constructor |
|
872 </p><dl> |
|
873 <dt><i>parent</i></dt> |
|
874 <dd> |
|
875 parent widget (QWidget) |
|
876 </dd><dt><i>name</i></dt> |
|
877 <dd> |
|
878 name of this instance (string) |
|
879 </dd><dt><i>flags</i></dt> |
|
880 <dd> |
|
881 window flags |
|
882 </dd> |
|
883 </dl><a NAME="MiniScintilla.focusInEvent" ID="MiniScintilla.focusInEvent"></a> |
|
884 <h4>MiniScintilla.focusInEvent</h4> |
|
885 <b>focusInEvent</b>(<i>event</i>) |
|
886 <p> |
|
887 Protected method called when the editor receives focus. |
|
888 </p><p> |
|
889 This method checks for modifications of the current file and |
|
890 rereads it upon request. The cursor is placed at the current position |
|
891 assuming, that it is in the vicinity of the old position after the reread. |
|
892 </p><dl> |
|
893 <dt><i>event</i></dt> |
|
894 <dd> |
|
895 the event object (QFocusEvent) |
|
896 </dd> |
|
897 </dl><a NAME="MiniScintilla.focusOutEvent" ID="MiniScintilla.focusOutEvent"></a> |
|
898 <h4>MiniScintilla.focusOutEvent</h4> |
|
899 <b>focusOutEvent</b>(<i>event</i>) |
|
900 <p> |
|
901 Public method called when the editor loses focus. |
|
902 </p><dl> |
|
903 <dt><i>event</i></dt> |
|
904 <dd> |
|
905 the event object (QFocusEvent) |
|
906 </dd> |
|
907 </dl> |
|
908 <div align="right"><a href="#top">Up</a></div> |
|
909 <hr /> |
|
910 </body></html> |