|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.EricWidgets.EricZoomWidget</title> |
|
4 <meta charset="UTF-8"> |
|
5 <link rel="stylesheet" href="styles.css"> |
|
6 </head> |
|
7 <body> |
|
8 <a NAME="top" ID="top"></a> |
|
9 <h1>eric7.EricWidgets.EricZoomWidget</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing a zoom widget for the status bar. |
|
13 </p> |
|
14 <h3>Global Attributes</h3> |
|
15 |
|
16 <table> |
|
17 <tr><td>None</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 |
|
21 <table> |
|
22 |
|
23 <tr> |
|
24 <td><a href="#EricZoomWidget">EricZoomWidget</a></td> |
|
25 <td>Class implementing a zoom widget for the status bar.</td> |
|
26 </tr> |
|
27 </table> |
|
28 <h3>Functions</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <hr /> |
|
34 <hr /> |
|
35 <a NAME="EricZoomWidget" ID="EricZoomWidget"></a> |
|
36 <h2>EricZoomWidget</h2> |
|
37 |
|
38 <p> |
|
39 Class implementing a zoom widget for the status bar. |
|
40 </p> |
|
41 <h3>Signals</h3> |
|
42 <dl> |
|
43 |
|
44 <dt>valueChanged(value)</dt> |
|
45 <dd> |
|
46 emitted to indicate the new zoom value (int) |
|
47 </dd> |
|
48 </dl> |
|
49 <h3>Derived from</h3> |
|
50 QWidget, Ui_EricZoomWidget |
|
51 <h3>Class Attributes</h3> |
|
52 |
|
53 <table> |
|
54 <tr><td>None</td></tr> |
|
55 </table> |
|
56 <h3>Class Methods</h3> |
|
57 |
|
58 <table> |
|
59 <tr><td>None</td></tr> |
|
60 </table> |
|
61 <h3>Methods</h3> |
|
62 |
|
63 <table> |
|
64 |
|
65 <tr> |
|
66 <td><a href="#EricZoomWidget.__init__">EricZoomWidget</a></td> |
|
67 <td>Constructor</td> |
|
68 </tr> |
|
69 <tr> |
|
70 <td><a href="#EricZoomWidget.__indexForValue">__indexForValue</a></td> |
|
71 <td>Private method to get the nearest index for a given value.</td> |
|
72 </tr> |
|
73 <tr> |
|
74 <td><a href="#EricZoomWidget.__setValueLabelWidth">__setValueLabelWidth</a></td> |
|
75 <td>Private slot to determine the width of the zoom value label.</td> |
|
76 </tr> |
|
77 <tr> |
|
78 <td><a href="#EricZoomWidget.__zoomIn">__zoomIn</a></td> |
|
79 <td>Private slot to zoom in one step.</td> |
|
80 </tr> |
|
81 <tr> |
|
82 <td><a href="#EricZoomWidget.__zoomOut">__zoomOut</a></td> |
|
83 <td>Private slot to zoom out one step.</td> |
|
84 </tr> |
|
85 <tr> |
|
86 <td><a href="#EricZoomWidget.__zoomReset">__zoomReset</a></td> |
|
87 <td>Private slot to reset the value.</td> |
|
88 </tr> |
|
89 <tr> |
|
90 <td><a href="#EricZoomWidget._sliderValueChanged">_sliderValueChanged</a></td> |
|
91 <td>Protected slot to handle changes of the slider value.</td> |
|
92 </tr> |
|
93 <tr> |
|
94 <td><a href="#EricZoomWidget.default">default</a></td> |
|
95 <td>Public method to get the default zoom value.</td> |
|
96 </tr> |
|
97 <tr> |
|
98 <td><a href="#EricZoomWidget.isMapped">isMapped</a></td> |
|
99 <td>Public method to check for a mapped zoom widget.</td> |
|
100 </tr> |
|
101 <tr> |
|
102 <td><a href="#EricZoomWidget.isPercent">isPercent</a></td> |
|
103 <td>Public method to get the percent mode.</td> |
|
104 </tr> |
|
105 <tr> |
|
106 <td><a href="#EricZoomWidget.mapping">mapping</a></td> |
|
107 <td>Public method to get the current mapping.</td> |
|
108 </tr> |
|
109 <tr> |
|
110 <td><a href="#EricZoomWidget.maximum">maximum</a></td> |
|
111 <td>Public method to get the maximum value.</td> |
|
112 </tr> |
|
113 <tr> |
|
114 <td><a href="#EricZoomWidget.minimum">minimum</a></td> |
|
115 <td>Public method to get the minimum value.</td> |
|
116 </tr> |
|
117 <tr> |
|
118 <td><a href="#EricZoomWidget.on_slider_sliderMoved">on_slider_sliderMoved</a></td> |
|
119 <td>Private slot to handle changes of the zoom value.</td> |
|
120 </tr> |
|
121 <tr> |
|
122 <td><a href="#EricZoomWidget.pageStep">pageStep</a></td> |
|
123 <td>Public method to get the page step value.</td> |
|
124 </tr> |
|
125 <tr> |
|
126 <td><a href="#EricZoomWidget.setDefault">setDefault</a></td> |
|
127 <td>Public method to set the default zoom value.</td> |
|
128 </tr> |
|
129 <tr> |
|
130 <td><a href="#EricZoomWidget.setMapping">setMapping</a></td> |
|
131 <td>Public method to set a zoom level mapping.</td> |
|
132 </tr> |
|
133 <tr> |
|
134 <td><a href="#EricZoomWidget.setMaximum">setMaximum</a></td> |
|
135 <td>Public method to set the maximum value.</td> |
|
136 </tr> |
|
137 <tr> |
|
138 <td><a href="#EricZoomWidget.setMinimum">setMinimum</a></td> |
|
139 <td>Public method to set the minimum value.</td> |
|
140 </tr> |
|
141 <tr> |
|
142 <td><a href="#EricZoomWidget.setPageStep">setPageStep</a></td> |
|
143 <td>Public method to set the page step value.</td> |
|
144 </tr> |
|
145 <tr> |
|
146 <td><a href="#EricZoomWidget.setPercent">setPercent</a></td> |
|
147 <td>Public method to set the percent mode of the widget.</td> |
|
148 </tr> |
|
149 <tr> |
|
150 <td><a href="#EricZoomWidget.setSingleStep">setSingleStep</a></td> |
|
151 <td>Public method to set the single step value.</td> |
|
152 </tr> |
|
153 <tr> |
|
154 <td><a href="#EricZoomWidget.setValue">setValue</a></td> |
|
155 <td>Public slot to set the value.</td> |
|
156 </tr> |
|
157 <tr> |
|
158 <td><a href="#EricZoomWidget.singleStep">singleStep</a></td> |
|
159 <td>Public method to get the single step value.</td> |
|
160 </tr> |
|
161 <tr> |
|
162 <td><a href="#EricZoomWidget.value">value</a></td> |
|
163 <td>Public method to get the current value.</td> |
|
164 </tr> |
|
165 </table> |
|
166 <h3>Static Methods</h3> |
|
167 |
|
168 <table> |
|
169 <tr><td>None</td></tr> |
|
170 </table> |
|
171 |
|
172 <a NAME="EricZoomWidget.__init__" ID="EricZoomWidget.__init__"></a> |
|
173 <h4>EricZoomWidget (Constructor)</h4> |
|
174 <b>EricZoomWidget</b>(<i>outPix, inPix, resetPix, parent=None</i>) |
|
175 |
|
176 <p> |
|
177 Constructor |
|
178 </p> |
|
179 <dl> |
|
180 |
|
181 <dt><i>outPix</i></dt> |
|
182 <dd> |
|
183 pixmap for the zoom out button (QPixmap) |
|
184 </dd> |
|
185 <dt><i>inPix</i></dt> |
|
186 <dd> |
|
187 pixmap for the zoom in button (QPixmap) |
|
188 </dd> |
|
189 <dt><i>resetPix</i></dt> |
|
190 <dd> |
|
191 pixmap for the zoom reset button (QPixmap) |
|
192 </dd> |
|
193 <dt><i>parent</i></dt> |
|
194 <dd> |
|
195 reference to the parent widget (QWidget) |
|
196 </dd> |
|
197 </dl> |
|
198 <a NAME="EricZoomWidget.__indexForValue" ID="EricZoomWidget.__indexForValue"></a> |
|
199 <h4>EricZoomWidget.__indexForValue</h4> |
|
200 <b>__indexForValue</b>(<i>value</i>) |
|
201 |
|
202 <p> |
|
203 Private method to get the nearest index for a given value. |
|
204 </p> |
|
205 <dl> |
|
206 |
|
207 <dt><i>value</i></dt> |
|
208 <dd> |
|
209 value to get the index for (integer) |
|
210 </dd> |
|
211 </dl> |
|
212 <dl> |
|
213 <dt>Return:</dt> |
|
214 <dd> |
|
215 index into the mapping list or the unchanged value, |
|
216 if mapping is not set (integer) |
|
217 </dd> |
|
218 </dl> |
|
219 <a NAME="EricZoomWidget.__setValueLabelWidth" ID="EricZoomWidget.__setValueLabelWidth"></a> |
|
220 <h4>EricZoomWidget.__setValueLabelWidth</h4> |
|
221 <b>__setValueLabelWidth</b>(<i></i>) |
|
222 |
|
223 <p> |
|
224 Private slot to determine the width of the zoom value label. |
|
225 </p> |
|
226 <a NAME="EricZoomWidget.__zoomIn" ID="EricZoomWidget.__zoomIn"></a> |
|
227 <h4>EricZoomWidget.__zoomIn</h4> |
|
228 <b>__zoomIn</b>(<i></i>) |
|
229 |
|
230 <p> |
|
231 Private slot to zoom in one step. |
|
232 </p> |
|
233 <a NAME="EricZoomWidget.__zoomOut" ID="EricZoomWidget.__zoomOut"></a> |
|
234 <h4>EricZoomWidget.__zoomOut</h4> |
|
235 <b>__zoomOut</b>(<i></i>) |
|
236 |
|
237 <p> |
|
238 Private slot to zoom out one step. |
|
239 </p> |
|
240 <a NAME="EricZoomWidget.__zoomReset" ID="EricZoomWidget.__zoomReset"></a> |
|
241 <h4>EricZoomWidget.__zoomReset</h4> |
|
242 <b>__zoomReset</b>(<i></i>) |
|
243 |
|
244 <p> |
|
245 Private slot to reset the value. |
|
246 </p> |
|
247 <a NAME="EricZoomWidget._sliderValueChanged" ID="EricZoomWidget._sliderValueChanged"></a> |
|
248 <h4>EricZoomWidget._sliderValueChanged</h4> |
|
249 <b>_sliderValueChanged</b>(<i>value</i>) |
|
250 |
|
251 <p> |
|
252 Protected slot to handle changes of the slider value. |
|
253 </p> |
|
254 <dl> |
|
255 |
|
256 <dt><i>value</i></dt> |
|
257 <dd> |
|
258 slider value (integer) |
|
259 </dd> |
|
260 </dl> |
|
261 <a NAME="EricZoomWidget.default" ID="EricZoomWidget.default"></a> |
|
262 <h4>EricZoomWidget.default</h4> |
|
263 <b>default</b>(<i></i>) |
|
264 |
|
265 <p> |
|
266 Public method to get the default zoom value. |
|
267 </p> |
|
268 <dl> |
|
269 <dt>Return:</dt> |
|
270 <dd> |
|
271 default zoom value (integer) |
|
272 </dd> |
|
273 </dl> |
|
274 <a NAME="EricZoomWidget.isMapped" ID="EricZoomWidget.isMapped"></a> |
|
275 <h4>EricZoomWidget.isMapped</h4> |
|
276 <b>isMapped</b>(<i></i>) |
|
277 |
|
278 <p> |
|
279 Public method to check for a mapped zoom widget. |
|
280 </p> |
|
281 <dl> |
|
282 <dt>Return:</dt> |
|
283 <dd> |
|
284 flag indicating a mapped zoom widget (boolean) |
|
285 </dd> |
|
286 </dl> |
|
287 <a NAME="EricZoomWidget.isPercent" ID="EricZoomWidget.isPercent"></a> |
|
288 <h4>EricZoomWidget.isPercent</h4> |
|
289 <b>isPercent</b>(<i></i>) |
|
290 |
|
291 <p> |
|
292 Public method to get the percent mode. |
|
293 </p> |
|
294 <dl> |
|
295 <dt>Return:</dt> |
|
296 <dd> |
|
297 flag indicating percent mode (boolean) |
|
298 </dd> |
|
299 </dl> |
|
300 <a NAME="EricZoomWidget.mapping" ID="EricZoomWidget.mapping"></a> |
|
301 <h4>EricZoomWidget.mapping</h4> |
|
302 <b>mapping</b>(<i></i>) |
|
303 |
|
304 <p> |
|
305 Public method to get the current mapping. |
|
306 </p> |
|
307 <dl> |
|
308 <dt>Return:</dt> |
|
309 <dd> |
|
310 tuple of the mapping and the default index |
|
311 (list of integer, integer) |
|
312 </dd> |
|
313 </dl> |
|
314 <a NAME="EricZoomWidget.maximum" ID="EricZoomWidget.maximum"></a> |
|
315 <h4>EricZoomWidget.maximum</h4> |
|
316 <b>maximum</b>(<i></i>) |
|
317 |
|
318 <p> |
|
319 Public method to get the maximum value. |
|
320 </p> |
|
321 <dl> |
|
322 <dt>Return:</dt> |
|
323 <dd> |
|
324 maximum value (integer) |
|
325 </dd> |
|
326 </dl> |
|
327 <a NAME="EricZoomWidget.minimum" ID="EricZoomWidget.minimum"></a> |
|
328 <h4>EricZoomWidget.minimum</h4> |
|
329 <b>minimum</b>(<i></i>) |
|
330 |
|
331 <p> |
|
332 Public method to get the minimum value. |
|
333 </p> |
|
334 <dl> |
|
335 <dt>Return:</dt> |
|
336 <dd> |
|
337 minimum value (integer) |
|
338 </dd> |
|
339 </dl> |
|
340 <a NAME="EricZoomWidget.on_slider_sliderMoved" ID="EricZoomWidget.on_slider_sliderMoved"></a> |
|
341 <h4>EricZoomWidget.on_slider_sliderMoved</h4> |
|
342 <b>on_slider_sliderMoved</b>(<i>value</i>) |
|
343 |
|
344 <p> |
|
345 Private slot to handle changes of the zoom value. |
|
346 </p> |
|
347 <dl> |
|
348 |
|
349 <dt><i>value</i></dt> |
|
350 <dd> |
|
351 value of the slider (integer) |
|
352 </dd> |
|
353 </dl> |
|
354 <a NAME="EricZoomWidget.pageStep" ID="EricZoomWidget.pageStep"></a> |
|
355 <h4>EricZoomWidget.pageStep</h4> |
|
356 <b>pageStep</b>(<i></i>) |
|
357 |
|
358 <p> |
|
359 Public method to get the page step value. |
|
360 </p> |
|
361 <dl> |
|
362 <dt>Return:</dt> |
|
363 <dd> |
|
364 page step value (integer) |
|
365 </dd> |
|
366 </dl> |
|
367 <a NAME="EricZoomWidget.setDefault" ID="EricZoomWidget.setDefault"></a> |
|
368 <h4>EricZoomWidget.setDefault</h4> |
|
369 <b>setDefault</b>(<i>value</i>) |
|
370 |
|
371 <p> |
|
372 Public method to set the default zoom value. |
|
373 </p> |
|
374 <dl> |
|
375 |
|
376 <dt><i>value</i></dt> |
|
377 <dd> |
|
378 default zoom value (integer) |
|
379 </dd> |
|
380 </dl> |
|
381 <a NAME="EricZoomWidget.setMapping" ID="EricZoomWidget.setMapping"></a> |
|
382 <h4>EricZoomWidget.setMapping</h4> |
|
383 <b>setMapping</b>(<i>mapping, default, percent=True</i>) |
|
384 |
|
385 <p> |
|
386 Public method to set a zoom level mapping. |
|
387 </p> |
|
388 <p> |
|
389 When zoom level mapping is activated, the slider covers |
|
390 values from 0 to the max. index of the mapping list. The |
|
391 default value is the value of the default zoom level. If |
|
392 percent is given, the zoom level is shown as a percent value. |
|
393 </p> |
|
394 <dl> |
|
395 |
|
396 <dt><i>mapping</i></dt> |
|
397 <dd> |
|
398 list of mapping values (list of integer) |
|
399 </dd> |
|
400 <dt><i>default</i></dt> |
|
401 <dd> |
|
402 index of the default value (integer) |
|
403 </dd> |
|
404 <dt><i>percent</i></dt> |
|
405 <dd> |
|
406 flag indicating to show zoom value in percent |
|
407 (boolean) |
|
408 </dd> |
|
409 </dl> |
|
410 <a NAME="EricZoomWidget.setMaximum" ID="EricZoomWidget.setMaximum"></a> |
|
411 <h4>EricZoomWidget.setMaximum</h4> |
|
412 <b>setMaximum</b>(<i>maximum</i>) |
|
413 |
|
414 <p> |
|
415 Public method to set the maximum value. |
|
416 </p> |
|
417 <dl> |
|
418 |
|
419 <dt><i>maximum</i></dt> |
|
420 <dd> |
|
421 new maximum value (integer) |
|
422 </dd> |
|
423 </dl> |
|
424 <a NAME="EricZoomWidget.setMinimum" ID="EricZoomWidget.setMinimum"></a> |
|
425 <h4>EricZoomWidget.setMinimum</h4> |
|
426 <b>setMinimum</b>(<i>minimum</i>) |
|
427 |
|
428 <p> |
|
429 Public method to set the minimum value. |
|
430 </p> |
|
431 <dl> |
|
432 |
|
433 <dt><i>minimum</i></dt> |
|
434 <dd> |
|
435 new minimum value (integer) |
|
436 </dd> |
|
437 </dl> |
|
438 <a NAME="EricZoomWidget.setPageStep" ID="EricZoomWidget.setPageStep"></a> |
|
439 <h4>EricZoomWidget.setPageStep</h4> |
|
440 <b>setPageStep</b>(<i>value</i>) |
|
441 |
|
442 <p> |
|
443 Public method to set the page step value. |
|
444 </p> |
|
445 <dl> |
|
446 |
|
447 <dt><i>value</i></dt> |
|
448 <dd> |
|
449 page step value (integer) |
|
450 </dd> |
|
451 </dl> |
|
452 <a NAME="EricZoomWidget.setPercent" ID="EricZoomWidget.setPercent"></a> |
|
453 <h4>EricZoomWidget.setPercent</h4> |
|
454 <b>setPercent</b>(<i>on</i>) |
|
455 |
|
456 <p> |
|
457 Public method to set the percent mode of the widget. |
|
458 </p> |
|
459 <dl> |
|
460 |
|
461 <dt><i>on</i></dt> |
|
462 <dd> |
|
463 flag indicating percent mode (boolean) |
|
464 </dd> |
|
465 </dl> |
|
466 <a NAME="EricZoomWidget.setSingleStep" ID="EricZoomWidget.setSingleStep"></a> |
|
467 <h4>EricZoomWidget.setSingleStep</h4> |
|
468 <b>setSingleStep</b>(<i>value</i>) |
|
469 |
|
470 <p> |
|
471 Public method to set the single step value. |
|
472 </p> |
|
473 <dl> |
|
474 |
|
475 <dt><i>value</i></dt> |
|
476 <dd> |
|
477 value for the single step (integer) |
|
478 </dd> |
|
479 </dl> |
|
480 <a NAME="EricZoomWidget.setValue" ID="EricZoomWidget.setValue"></a> |
|
481 <h4>EricZoomWidget.setValue</h4> |
|
482 <b>setValue</b>(<i>value</i>) |
|
483 |
|
484 <p> |
|
485 Public slot to set the value. |
|
486 </p> |
|
487 <dl> |
|
488 |
|
489 <dt><i>value</i></dt> |
|
490 <dd> |
|
491 new zoom value (integer) |
|
492 </dd> |
|
493 </dl> |
|
494 <a NAME="EricZoomWidget.singleStep" ID="EricZoomWidget.singleStep"></a> |
|
495 <h4>EricZoomWidget.singleStep</h4> |
|
496 <b>singleStep</b>(<i></i>) |
|
497 |
|
498 <p> |
|
499 Public method to get the single step value. |
|
500 </p> |
|
501 <dl> |
|
502 <dt>Return:</dt> |
|
503 <dd> |
|
504 single step value (integer) |
|
505 </dd> |
|
506 </dl> |
|
507 <a NAME="EricZoomWidget.value" ID="EricZoomWidget.value"></a> |
|
508 <h4>EricZoomWidget.value</h4> |
|
509 <b>value</b>(<i></i>) |
|
510 |
|
511 <p> |
|
512 Public method to get the current value. |
|
513 </p> |
|
514 <dl> |
|
515 <dt>Return:</dt> |
|
516 <dd> |
|
517 current zoom value (integer) |
|
518 </dd> |
|
519 </dl> |
|
520 <div align="right"><a href="#top">Up</a></div> |
|
521 <hr /> |
|
522 </body></html> |