|
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.E5SqueezeLabels</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>eric5.E5Gui.E5SqueezeLabels</h1> |
|
24 <p> |
|
25 Module implementing labels that squeeze their contents to fit the size of the label. |
|
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="#E5SqueezeLabel">E5SqueezeLabel</a></td> |
|
35 <td>Class implementing a label that squeezes its contents to fit it's size.</td> |
|
36 </tr><tr> |
|
37 <td><a href="#E5SqueezeLabelPath">E5SqueezeLabelPath</a></td> |
|
38 <td>Class implementing a label showing a file path compacted to fit it's size.</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="E5SqueezeLabel" ID="E5SqueezeLabel"></a> |
|
47 <h2>E5SqueezeLabel</h2> |
|
48 <p> |
|
49 Class implementing a label that squeezes its contents to fit it's size. |
|
50 </p> |
|
51 <h3>Derived from</h3> |
|
52 QLabel |
|
53 <h3>Class Attributes</h3> |
|
54 <table> |
|
55 <tr><td>None</td></tr> |
|
56 </table> |
|
57 <h3>Methods</h3> |
|
58 <table> |
|
59 <tr> |
|
60 <td><a href="#E5SqueezeLabel.__init__">E5SqueezeLabel</a></td> |
|
61 <td>Constructor</td> |
|
62 </tr><tr> |
|
63 <td><a href="#E5SqueezeLabel.paintEvent">paintEvent</a></td> |
|
64 <td>Protected method called when some painting is required.</td> |
|
65 </tr><tr> |
|
66 <td><a href="#E5SqueezeLabel.setText">setText</a></td> |
|
67 <td>Public method to set the label's text.</td> |
|
68 </tr> |
|
69 </table> |
|
70 <a NAME="E5SqueezeLabel.__init__" ID="E5SqueezeLabel.__init__"></a> |
|
71 <h4>E5SqueezeLabel (Constructor)</h4> |
|
72 <b>E5SqueezeLabel</b>(<i>parent = None</i>) |
|
73 <p> |
|
74 Constructor |
|
75 </p><dl> |
|
76 <dt><i>parent</i></dt> |
|
77 <dd> |
|
78 reference to the parent Widget (QWidget) |
|
79 </dd> |
|
80 </dl><a NAME="E5SqueezeLabel.paintEvent" ID="E5SqueezeLabel.paintEvent"></a> |
|
81 <h4>E5SqueezeLabel.paintEvent</h4> |
|
82 <b>paintEvent</b>(<i>event</i>) |
|
83 <p> |
|
84 Protected method called when some painting is required. |
|
85 </p><dl> |
|
86 <dt><i>event</i></dt> |
|
87 <dd> |
|
88 reference to the paint event (QPaintEvent) |
|
89 </dd> |
|
90 </dl><a NAME="E5SqueezeLabel.setText" ID="E5SqueezeLabel.setText"></a> |
|
91 <h4>E5SqueezeLabel.setText</h4> |
|
92 <b>setText</b>(<i>txt</i>) |
|
93 <p> |
|
94 Public method to set the label's text. |
|
95 </p><dl> |
|
96 <dt><i>txt</i></dt> |
|
97 <dd> |
|
98 the text to be shown (string) |
|
99 </dd> |
|
100 </dl> |
|
101 <div align="right"><a href="#top">Up</a></div> |
|
102 <hr /><hr /> |
|
103 <a NAME="E5SqueezeLabelPath" ID="E5SqueezeLabelPath"></a> |
|
104 <h2>E5SqueezeLabelPath</h2> |
|
105 <p> |
|
106 Class implementing a label showing a file path compacted to fit it's size. |
|
107 </p> |
|
108 <h3>Derived from</h3> |
|
109 QLabel |
|
110 <h3>Class Attributes</h3> |
|
111 <table> |
|
112 <tr><td>None</td></tr> |
|
113 </table> |
|
114 <h3>Methods</h3> |
|
115 <table> |
|
116 <tr> |
|
117 <td><a href="#E5SqueezeLabelPath.__init__">E5SqueezeLabelPath</a></td> |
|
118 <td>Constructor</td> |
|
119 </tr><tr> |
|
120 <td><a href="#E5SqueezeLabelPath.length">length</a></td> |
|
121 <td>Public method to return the length of a text in pixels.</td> |
|
122 </tr><tr> |
|
123 <td><a href="#E5SqueezeLabelPath.paintEvent">paintEvent</a></td> |
|
124 <td>Protected method called when some painting is required.</td> |
|
125 </tr><tr> |
|
126 <td><a href="#E5SqueezeLabelPath.setPath">setPath</a></td> |
|
127 <td>Public method to set the path of the label.</td> |
|
128 </tr><tr> |
|
129 <td><a href="#E5SqueezeLabelPath.setSurrounding">setSurrounding</a></td> |
|
130 <td>Public method to set the surrounding of the path string.</td> |
|
131 </tr><tr> |
|
132 <td><a href="#E5SqueezeLabelPath.setTextPath">setTextPath</a></td> |
|
133 <td>Public method to set the surrounding and the path of the label.</td> |
|
134 </tr> |
|
135 </table> |
|
136 <a NAME="E5SqueezeLabelPath.__init__" ID="E5SqueezeLabelPath.__init__"></a> |
|
137 <h4>E5SqueezeLabelPath (Constructor)</h4> |
|
138 <b>E5SqueezeLabelPath</b>(<i>parent = None</i>) |
|
139 <p> |
|
140 Constructor |
|
141 </p><dl> |
|
142 <dt><i>parent</i></dt> |
|
143 <dd> |
|
144 reference to the parent Widget (QWidget) |
|
145 </dd> |
|
146 </dl><a NAME="E5SqueezeLabelPath.length" ID="E5SqueezeLabelPath.length"></a> |
|
147 <h4>E5SqueezeLabelPath.length</h4> |
|
148 <b>length</b>(<i>txt</i>) |
|
149 <p> |
|
150 Public method to return the length of a text in pixels. |
|
151 </p><dl> |
|
152 <dt><i>txt</i></dt> |
|
153 <dd> |
|
154 text to calculate the length for after wrapped (string) |
|
155 </dd> |
|
156 </dl><dl> |
|
157 <dt>Returns:</dt> |
|
158 <dd> |
|
159 length of the wrapped text in pixels (integer) |
|
160 </dd> |
|
161 </dl><a NAME="E5SqueezeLabelPath.paintEvent" ID="E5SqueezeLabelPath.paintEvent"></a> |
|
162 <h4>E5SqueezeLabelPath.paintEvent</h4> |
|
163 <b>paintEvent</b>(<i>event</i>) |
|
164 <p> |
|
165 Protected method called when some painting is required. |
|
166 </p><dl> |
|
167 <dt><i>event</i></dt> |
|
168 <dd> |
|
169 reference to the paint event (QPaintEvent) |
|
170 </dd> |
|
171 </dl><a NAME="E5SqueezeLabelPath.setPath" ID="E5SqueezeLabelPath.setPath"></a> |
|
172 <h4>E5SqueezeLabelPath.setPath</h4> |
|
173 <b>setPath</b>(<i>path</i>) |
|
174 <p> |
|
175 Public method to set the path of the label. |
|
176 </p><dl> |
|
177 <dt><i>path</i></dt> |
|
178 <dd> |
|
179 path to be shown (string) |
|
180 </dd> |
|
181 </dl><a NAME="E5SqueezeLabelPath.setSurrounding" ID="E5SqueezeLabelPath.setSurrounding"></a> |
|
182 <h4>E5SqueezeLabelPath.setSurrounding</h4> |
|
183 <b>setSurrounding</b>(<i>surrounding</i>) |
|
184 <p> |
|
185 Public method to set the surrounding of the path string. |
|
186 </p><dl> |
|
187 <dt><i>surrounding</i></dt> |
|
188 <dd> |
|
189 the a string containg placeholders for the path (string) |
|
190 </dd> |
|
191 </dl><a NAME="E5SqueezeLabelPath.setTextPath" ID="E5SqueezeLabelPath.setTextPath"></a> |
|
192 <h4>E5SqueezeLabelPath.setTextPath</h4> |
|
193 <b>setTextPath</b>(<i>surrounding, path</i>) |
|
194 <p> |
|
195 Public method to set the surrounding and the path of the label. |
|
196 </p><dl> |
|
197 <dt><i>surrounding</i></dt> |
|
198 <dd> |
|
199 the a string containg placeholders for the path (string) |
|
200 </dd><dt><i>path</i></dt> |
|
201 <dd> |
|
202 path to be shown (string) |
|
203 </dd> |
|
204 </dl> |
|
205 <div align="right"><a href="#top">Up</a></div> |
|
206 <hr /> |
|
207 </body></html> |