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