|
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.E5Gui.E5ZoomWidget</title> |
|
6 <style> |
|
7 body { |
|
8 background: #EDECE6; |
|
9 margin: 0em 1em 10em 1em; |
|
10 color: black; |
|
11 } |
|
12 |
|
13 h1 { color: white; background: #85774A; } |
|
14 h2 { color: white; background: #85774A; } |
|
15 h3 { color: white; background: #9D936E; } |
|
16 h4 { color: white; background: #9D936E; } |
|
17 |
|
18 a { color: #BA6D36; } |
|
19 |
|
20 </style> |
|
21 </head> |
|
22 <body><a NAME="top" ID="top"></a> |
|
23 <h1>eric5.E5Gui.E5ZoomWidget</h1> |
|
24 <p> |
|
25 Module implementing a zoom widget for the status bar. |
|
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="#E5ZoomWidget">E5ZoomWidget</a></td> |
|
35 <td>Class implementing a zoom widget for the status bar.</td> |
|
36 </tr> |
|
37 </table> |
|
38 <h3>Functions</h3> |
|
39 <table> |
|
40 <tr><td>None</td></tr> |
|
41 </table> |
|
42 <hr /><hr /> |
|
43 <a NAME="E5ZoomWidget" ID="E5ZoomWidget"></a> |
|
44 <h2>E5ZoomWidget</h2> |
|
45 <p> |
|
46 Class implementing a zoom widget for the status bar. |
|
47 </p> |
|
48 <h3>Derived from</h3> |
|
49 QWidget, Ui_E5ZoomWidget |
|
50 <h3>Class Attributes</h3> |
|
51 <table> |
|
52 <tr><td>None</td></tr> |
|
53 </table> |
|
54 <h3>Class Methods</h3> |
|
55 <table> |
|
56 <tr><td>None</td></tr> |
|
57 </table> |
|
58 <h3>Methods</h3> |
|
59 <table> |
|
60 <tr> |
|
61 <td><a href="#E5ZoomWidget.__init__">E5ZoomWidget</a></td> |
|
62 <td>Constructor</td> |
|
63 </tr><tr> |
|
64 <td><a href="#E5ZoomWidget.__indexForValue">__indexForValue</a></td> |
|
65 <td>Private method to get the nearest index for a given value.</td> |
|
66 </tr><tr> |
|
67 <td><a href="#E5ZoomWidget.__setValueLabelWidth">__setValueLabelWidth</a></td> |
|
68 <td>Private slot to determine the width of the zoom value label.</td> |
|
69 </tr><tr> |
|
70 <td><a href="#E5ZoomWidget.__zoomIn">__zoomIn</a></td> |
|
71 <td>Private slot to zoom in one step.</td> |
|
72 </tr><tr> |
|
73 <td><a href="#E5ZoomWidget.__zoomOut">__zoomOut</a></td> |
|
74 <td>Private slot to zoom out one step.</td> |
|
75 </tr><tr> |
|
76 <td><a href="#E5ZoomWidget.__zoomReset">__zoomReset</a></td> |
|
77 <td>Private slot to reset the value.</td> |
|
78 </tr><tr> |
|
79 <td><a href="#E5ZoomWidget._sliderValueChanged">_sliderValueChanged</a></td> |
|
80 <td>Protected slot to handle changes of the slider value.</td> |
|
81 </tr><tr> |
|
82 <td><a href="#E5ZoomWidget.default">default</a></td> |
|
83 <td>Public method to get the default zoom value.</td> |
|
84 </tr><tr> |
|
85 <td><a href="#E5ZoomWidget.isMapped">isMapped</a></td> |
|
86 <td>Public method to check for a mapped zoom widget.</td> |
|
87 </tr><tr> |
|
88 <td><a href="#E5ZoomWidget.isPercent">isPercent</a></td> |
|
89 <td>Public method to get the percent mode.</td> |
|
90 </tr><tr> |
|
91 <td><a href="#E5ZoomWidget.mapping">mapping</a></td> |
|
92 <td>Public method to get the current mapping.</td> |
|
93 </tr><tr> |
|
94 <td><a href="#E5ZoomWidget.maximum">maximum</a></td> |
|
95 <td>Public method to get the maximum value.</td> |
|
96 </tr><tr> |
|
97 <td><a href="#E5ZoomWidget.minimum">minimum</a></td> |
|
98 <td>Public method to get the minimum value.</td> |
|
99 </tr><tr> |
|
100 <td><a href="#E5ZoomWidget.on_slider_sliderMoved">on_slider_sliderMoved</a></td> |
|
101 <td>Public slot to handle changes of the zoom value.</td> |
|
102 </tr><tr> |
|
103 <td><a href="#E5ZoomWidget.pageStep">pageStep</a></td> |
|
104 <td>Public method to get the page step value.</td> |
|
105 </tr><tr> |
|
106 <td><a href="#E5ZoomWidget.setDefault">setDefault</a></td> |
|
107 <td>Public method to set the default zoom value.</td> |
|
108 </tr><tr> |
|
109 <td><a href="#E5ZoomWidget.setMapping">setMapping</a></td> |
|
110 <td>Public method to set a zoom level mapping.</td> |
|
111 </tr><tr> |
|
112 <td><a href="#E5ZoomWidget.setMaximum">setMaximum</a></td> |
|
113 <td>Public method to set the maximum value.</td> |
|
114 </tr><tr> |
|
115 <td><a href="#E5ZoomWidget.setMinimum">setMinimum</a></td> |
|
116 <td>Public method to set the minimum value.</td> |
|
117 </tr><tr> |
|
118 <td><a href="#E5ZoomWidget.setPageStep">setPageStep</a></td> |
|
119 <td>Public method to set the page step value.</td> |
|
120 </tr><tr> |
|
121 <td><a href="#E5ZoomWidget.setPercent">setPercent</a></td> |
|
122 <td>Public method to set the percent mode of the widget.</td> |
|
123 </tr><tr> |
|
124 <td><a href="#E5ZoomWidget.setSingleStep">setSingleStep</a></td> |
|
125 <td>Public method to set the single step value.</td> |
|
126 </tr><tr> |
|
127 <td><a href="#E5ZoomWidget.setValue">setValue</a></td> |
|
128 <td>Public slot to set the value.</td> |
|
129 </tr><tr> |
|
130 <td><a href="#E5ZoomWidget.singleStep">singleStep</a></td> |
|
131 <td>Public method to get the single step value.</td> |
|
132 </tr><tr> |
|
133 <td><a href="#E5ZoomWidget.value">value</a></td> |
|
134 <td>Public method to get the current value.</td> |
|
135 </tr> |
|
136 </table> |
|
137 <h3>Static Methods</h3> |
|
138 <table> |
|
139 <tr><td>None</td></tr> |
|
140 </table> |
|
141 <a NAME="E5ZoomWidget.__init__" ID="E5ZoomWidget.__init__"></a> |
|
142 <h4>E5ZoomWidget (Constructor)</h4> |
|
143 <b>E5ZoomWidget</b>(<i>outPix, inPix, resetPix, parent=None</i>) |
|
144 <p> |
|
145 Constructor |
|
146 </p><dl> |
|
147 <dt><i>outPix</i></dt> |
|
148 <dd> |
|
149 pixmap for the zoom out button (QPixmap) |
|
150 </dd><dt><i>inPix</i></dt> |
|
151 <dd> |
|
152 pixmap for the zoom in button (QPixmap) |
|
153 </dd><dt><i>resetPix</i></dt> |
|
154 <dd> |
|
155 pixmap for the zoom reset button (QPixmap) |
|
156 </dd><dt><i>parent</i></dt> |
|
157 <dd> |
|
158 reference to the parent widget (QWidget) |
|
159 </dd> |
|
160 </dl><a NAME="E5ZoomWidget.__indexForValue" ID="E5ZoomWidget.__indexForValue"></a> |
|
161 <h4>E5ZoomWidget.__indexForValue</h4> |
|
162 <b>__indexForValue</b>(<i>value</i>) |
|
163 <p> |
|
164 Private method to get the nearest index for a given value. |
|
165 </p><dl> |
|
166 <dt><i>value</i></dt> |
|
167 <dd> |
|
168 value to get the index for (integer) |
|
169 </dd> |
|
170 </dl><dl> |
|
171 <dt>Returns:</dt> |
|
172 <dd> |
|
173 index into the mapping list or the unchanged value, |
|
174 if mapping is not set (integer) |
|
175 </dd> |
|
176 </dl><a NAME="E5ZoomWidget.__setValueLabelWidth" ID="E5ZoomWidget.__setValueLabelWidth"></a> |
|
177 <h4>E5ZoomWidget.__setValueLabelWidth</h4> |
|
178 <b>__setValueLabelWidth</b>(<i></i>) |
|
179 <p> |
|
180 Private slot to determine the width of the zoom value label. |
|
181 </p><a NAME="E5ZoomWidget.__zoomIn" ID="E5ZoomWidget.__zoomIn"></a> |
|
182 <h4>E5ZoomWidget.__zoomIn</h4> |
|
183 <b>__zoomIn</b>(<i></i>) |
|
184 <p> |
|
185 Private slot to zoom in one step. |
|
186 </p><a NAME="E5ZoomWidget.__zoomOut" ID="E5ZoomWidget.__zoomOut"></a> |
|
187 <h4>E5ZoomWidget.__zoomOut</h4> |
|
188 <b>__zoomOut</b>(<i></i>) |
|
189 <p> |
|
190 Private slot to zoom out one step. |
|
191 </p><a NAME="E5ZoomWidget.__zoomReset" ID="E5ZoomWidget.__zoomReset"></a> |
|
192 <h4>E5ZoomWidget.__zoomReset</h4> |
|
193 <b>__zoomReset</b>(<i></i>) |
|
194 <p> |
|
195 Private slot to reset the value. |
|
196 </p><a NAME="E5ZoomWidget._sliderValueChanged" ID="E5ZoomWidget._sliderValueChanged"></a> |
|
197 <h4>E5ZoomWidget._sliderValueChanged</h4> |
|
198 <b>_sliderValueChanged</b>(<i>value</i>) |
|
199 <p> |
|
200 Protected slot to handle changes of the slider value. |
|
201 </p><dl> |
|
202 <dt><i>value</i></dt> |
|
203 <dd> |
|
204 slider value (integer) |
|
205 </dd> |
|
206 </dl><a NAME="E5ZoomWidget.default" ID="E5ZoomWidget.default"></a> |
|
207 <h4>E5ZoomWidget.default</h4> |
|
208 <b>default</b>(<i></i>) |
|
209 <p> |
|
210 Public method to get the default zoom value. |
|
211 </p><dl> |
|
212 <dt>Returns:</dt> |
|
213 <dd> |
|
214 default zoom value (integer) |
|
215 </dd> |
|
216 </dl><a NAME="E5ZoomWidget.isMapped" ID="E5ZoomWidget.isMapped"></a> |
|
217 <h4>E5ZoomWidget.isMapped</h4> |
|
218 <b>isMapped</b>(<i></i>) |
|
219 <p> |
|
220 Public method to check for a mapped zoom widget. |
|
221 </p><dl> |
|
222 <dt>Returns:</dt> |
|
223 <dd> |
|
224 flag indicating a mapped zoom widget (boolean) |
|
225 </dd> |
|
226 </dl><a NAME="E5ZoomWidget.isPercent" ID="E5ZoomWidget.isPercent"></a> |
|
227 <h4>E5ZoomWidget.isPercent</h4> |
|
228 <b>isPercent</b>(<i></i>) |
|
229 <p> |
|
230 Public method to get the percent mode. |
|
231 </p><dl> |
|
232 <dt>Returns:</dt> |
|
233 <dd> |
|
234 flag indicating percent mode (boolean) |
|
235 </dd> |
|
236 </dl><a NAME="E5ZoomWidget.mapping" ID="E5ZoomWidget.mapping"></a> |
|
237 <h4>E5ZoomWidget.mapping</h4> |
|
238 <b>mapping</b>(<i></i>) |
|
239 <p> |
|
240 Public method to get the current mapping. |
|
241 </p><dl> |
|
242 <dt>Returns:</dt> |
|
243 <dd> |
|
244 tuple of the mapping and the default index (list of integer, integer) |
|
245 </dd> |
|
246 </dl><a NAME="E5ZoomWidget.maximum" ID="E5ZoomWidget.maximum"></a> |
|
247 <h4>E5ZoomWidget.maximum</h4> |
|
248 <b>maximum</b>(<i></i>) |
|
249 <p> |
|
250 Public method to get the maximum value. |
|
251 </p><dl> |
|
252 <dt>Returns:</dt> |
|
253 <dd> |
|
254 maximum value (integer) |
|
255 </dd> |
|
256 </dl><a NAME="E5ZoomWidget.minimum" ID="E5ZoomWidget.minimum"></a> |
|
257 <h4>E5ZoomWidget.minimum</h4> |
|
258 <b>minimum</b>(<i></i>) |
|
259 <p> |
|
260 Public method to get the minimum value. |
|
261 </p><dl> |
|
262 <dt>Returns:</dt> |
|
263 <dd> |
|
264 minimum value (integer) |
|
265 </dd> |
|
266 </dl><a NAME="E5ZoomWidget.on_slider_sliderMoved" ID="E5ZoomWidget.on_slider_sliderMoved"></a> |
|
267 <h4>E5ZoomWidget.on_slider_sliderMoved</h4> |
|
268 <b>on_slider_sliderMoved</b>(<i>value</i>) |
|
269 <p> |
|
270 Public slot to handle changes of the zoom value. |
|
271 </p><a NAME="E5ZoomWidget.pageStep" ID="E5ZoomWidget.pageStep"></a> |
|
272 <h4>E5ZoomWidget.pageStep</h4> |
|
273 <b>pageStep</b>(<i></i>) |
|
274 <p> |
|
275 Public method to get the page step value. |
|
276 </p><dl> |
|
277 <dt>Returns:</dt> |
|
278 <dd> |
|
279 page step value (integer) |
|
280 </dd> |
|
281 </dl><a NAME="E5ZoomWidget.setDefault" ID="E5ZoomWidget.setDefault"></a> |
|
282 <h4>E5ZoomWidget.setDefault</h4> |
|
283 <b>setDefault</b>(<i>value</i>) |
|
284 <p> |
|
285 Public method to set the default zoom value. |
|
286 </p><dl> |
|
287 <dt><i>value</i></dt> |
|
288 <dd> |
|
289 default zoom value (integer) |
|
290 </dd> |
|
291 </dl><a NAME="E5ZoomWidget.setMapping" ID="E5ZoomWidget.setMapping"></a> |
|
292 <h4>E5ZoomWidget.setMapping</h4> |
|
293 <b>setMapping</b>(<i>mapping, default, percent=True</i>) |
|
294 <p> |
|
295 Public method to set a zoom level mapping. |
|
296 </p><p> |
|
297 When zoom level mapping is activated, the slider covers |
|
298 values from 0 to the max. index of the mapping list. The |
|
299 default value is the value of the default zoom level. If |
|
300 percent is given, the zoom level is shown as a percent value. |
|
301 </p><dl> |
|
302 <dt><i>mapping</i></dt> |
|
303 <dd> |
|
304 list of mapping values (list of integer) |
|
305 </dd><dt><i>default</i></dt> |
|
306 <dd> |
|
307 index of the default value (integer) |
|
308 </dd><dt><i>percent=</i></dt> |
|
309 <dd> |
|
310 flag indicating to show zoom value in percent (boolean) |
|
311 </dd> |
|
312 </dl><a NAME="E5ZoomWidget.setMaximum" ID="E5ZoomWidget.setMaximum"></a> |
|
313 <h4>E5ZoomWidget.setMaximum</h4> |
|
314 <b>setMaximum</b>(<i>maximum</i>) |
|
315 <p> |
|
316 Public method to set the maximum value. |
|
317 </p><dl> |
|
318 <dt><i>minimum</i></dt> |
|
319 <dd> |
|
320 new maximum value (integer) |
|
321 </dd> |
|
322 </dl><a NAME="E5ZoomWidget.setMinimum" ID="E5ZoomWidget.setMinimum"></a> |
|
323 <h4>E5ZoomWidget.setMinimum</h4> |
|
324 <b>setMinimum</b>(<i>minimum</i>) |
|
325 <p> |
|
326 Public method to set the minimum value. |
|
327 </p><dl> |
|
328 <dt><i>minimum</i></dt> |
|
329 <dd> |
|
330 new minimum value (integer) |
|
331 </dd> |
|
332 </dl><a NAME="E5ZoomWidget.setPageStep" ID="E5ZoomWidget.setPageStep"></a> |
|
333 <h4>E5ZoomWidget.setPageStep</h4> |
|
334 <b>setPageStep</b>(<i>value</i>) |
|
335 <p> |
|
336 Public method to set the page step value. |
|
337 </p><dl> |
|
338 <dt><i>value</i></dt> |
|
339 <dd> |
|
340 page step value (integer) |
|
341 </dd> |
|
342 </dl><a NAME="E5ZoomWidget.setPercent" ID="E5ZoomWidget.setPercent"></a> |
|
343 <h4>E5ZoomWidget.setPercent</h4> |
|
344 <b>setPercent</b>(<i>on</i>) |
|
345 <p> |
|
346 Public method to set the percent mode of the widget. |
|
347 </p><dl> |
|
348 <dt><i>on</i></dt> |
|
349 <dd> |
|
350 flag indicating percent mode (boolean) |
|
351 </dd> |
|
352 </dl><a NAME="E5ZoomWidget.setSingleStep" ID="E5ZoomWidget.setSingleStep"></a> |
|
353 <h4>E5ZoomWidget.setSingleStep</h4> |
|
354 <b>setSingleStep</b>(<i>value</i>) |
|
355 <p> |
|
356 Public method to set the single step value. |
|
357 </p><dl> |
|
358 <dt><i>value</i></dt> |
|
359 <dd> |
|
360 value for the single step (integer) |
|
361 </dd> |
|
362 </dl><a NAME="E5ZoomWidget.setValue" ID="E5ZoomWidget.setValue"></a> |
|
363 <h4>E5ZoomWidget.setValue</h4> |
|
364 <b>setValue</b>(<i>value</i>) |
|
365 <p> |
|
366 Public slot to set the value. |
|
367 </p><dl> |
|
368 <dt><i>value</i></dt> |
|
369 <dd> |
|
370 new zoom value (integer) |
|
371 </dd> |
|
372 </dl><a NAME="E5ZoomWidget.singleStep" ID="E5ZoomWidget.singleStep"></a> |
|
373 <h4>E5ZoomWidget.singleStep</h4> |
|
374 <b>singleStep</b>(<i></i>) |
|
375 <p> |
|
376 Public method to get the single step value. |
|
377 </p><dl> |
|
378 <dt>Returns:</dt> |
|
379 <dd> |
|
380 single step value (integer) |
|
381 </dd> |
|
382 </dl><a NAME="E5ZoomWidget.value" ID="E5ZoomWidget.value"></a> |
|
383 <h4>E5ZoomWidget.value</h4> |
|
384 <b>value</b>(<i></i>) |
|
385 <p> |
|
386 Public method to get the current value. |
|
387 </p><dl> |
|
388 <dt>Returns:</dt> |
|
389 <dd> |
|
390 current zoom value (integer) |
|
391 </dd> |
|
392 </dl> |
|
393 <div align="right"><a href="#top">Up</a></div> |
|
394 <hr /> |
|
395 </body></html> |