Sat, 26 Apr 2025 12:34:32 +0200
MicroPython
- Added a configuration option to disable the support for the no longer produced Pimoroni Pico Wireless Pack.
<!DOCTYPE html> <html><head> <title>eric7.EricWidgets.EricSqueezeLabels</title> <meta charset="UTF-8"> <link rel="stylesheet" href="styles.css"> </head> <body> <a NAME="top" ID="top"></a> <h1>eric7.EricWidgets.EricSqueezeLabels</h1> <p> Module implementing labels that squeeze their contents to fit the size of the label. </p> <h3>Global Attributes</h3> <table> <tr><td>None</td></tr> </table> <h3>Classes</h3> <table> <tr> <td><a href="#EricSqueezeLabel">EricSqueezeLabel</a></td> <td>Class implementing a label that squeezes its contents to fit its size.</td> </tr> <tr> <td><a href="#EricSqueezeLabelPath">EricSqueezeLabelPath</a></td> <td>Class implementing a label showing a file path compacted to fit its size.</td> </tr> </table> <h3>Functions</h3> <table> <tr><td>None</td></tr> </table> <hr /> <hr /> <a NAME="EricSqueezeLabel" ID="EricSqueezeLabel"></a> <h2>EricSqueezeLabel</h2> <p> Class implementing a label that squeezes its contents to fit its size. </p> <h3>Derived from</h3> QLabel <h3>Class Attributes</h3> <table> <tr><td>None</td></tr> </table> <h3>Class Methods</h3> <table> <tr><td>None</td></tr> </table> <h3>Methods</h3> <table> <tr> <td><a href="#EricSqueezeLabel.__init__">EricSqueezeLabel</a></td> <td>Constructor</td> </tr> <tr> <td><a href="#EricSqueezeLabel.paintEvent">paintEvent</a></td> <td>Protected method called when some painting is required.</td> </tr> <tr> <td><a href="#EricSqueezeLabel.setText">setText</a></td> <td>Public method to set the label's text.</td> </tr> </table> <h3>Static Methods</h3> <table> <tr><td>None</td></tr> </table> <a NAME="EricSqueezeLabel.__init__" ID="EricSqueezeLabel.__init__"></a> <h4>EricSqueezeLabel (Constructor)</h4> <b>EricSqueezeLabel</b>(<i>parent=None</i>) <p> Constructor </p> <dl> <dt><i>parent</i> (QWidget)</dt> <dd> reference to the parent Widget </dd> </dl> <a NAME="EricSqueezeLabel.paintEvent" ID="EricSqueezeLabel.paintEvent"></a> <h4>EricSqueezeLabel.paintEvent</h4> <b>paintEvent</b>(<i>event</i>) <p> Protected method called when some painting is required. </p> <dl> <dt><i>event</i> (QPaintEvent)</dt> <dd> reference to the paint event </dd> </dl> <a NAME="EricSqueezeLabel.setText" ID="EricSqueezeLabel.setText"></a> <h4>EricSqueezeLabel.setText</h4> <b>setText</b>(<i>txt</i>) <p> Public method to set the label's text. </p> <dl> <dt><i>txt</i> (str)</dt> <dd> the text to be shown </dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr /> <hr /> <a NAME="EricSqueezeLabelPath" ID="EricSqueezeLabelPath"></a> <h2>EricSqueezeLabelPath</h2> <p> Class implementing a label showing a file path compacted to fit its size. </p> <h3>Derived from</h3> QLabel <h3>Class Attributes</h3> <table> <tr><td>None</td></tr> </table> <h3>Class Methods</h3> <table> <tr><td>None</td></tr> </table> <h3>Methods</h3> <table> <tr> <td><a href="#EricSqueezeLabelPath.__init__">EricSqueezeLabelPath</a></td> <td>Constructor</td> </tr> <tr> <td><a href="#EricSqueezeLabelPath.__compactPath">__compactPath</a></td> <td>Private method to return a compacted path fitting inside the label width.</td> </tr> <tr> <td><a href="#EricSqueezeLabelPath.length">length</a></td> <td>Public method to return the length of a text in pixels.</td> </tr> <tr> <td><a href="#EricSqueezeLabelPath.paintEvent">paintEvent</a></td> <td>Protected method called when some painting is required.</td> </tr> <tr> <td><a href="#EricSqueezeLabelPath.setPath">setPath</a></td> <td>Public method to set the path of the label.</td> </tr> <tr> <td><a href="#EricSqueezeLabelPath.setSurrounding">setSurrounding</a></td> <td>Public method to set the surrounding of the path string.</td> </tr> <tr> <td><a href="#EricSqueezeLabelPath.setTextPath">setTextPath</a></td> <td>Public method to set the surrounding and the path of the label.</td> </tr> </table> <h3>Static Methods</h3> <table> <tr><td>None</td></tr> </table> <a NAME="EricSqueezeLabelPath.__init__" ID="EricSqueezeLabelPath.__init__"></a> <h4>EricSqueezeLabelPath (Constructor)</h4> <b>EricSqueezeLabelPath</b>(<i>parent=None</i>) <p> Constructor </p> <dl> <dt><i>parent</i> (QWidget)</dt> <dd> reference to the parent Widget </dd> </dl> <a NAME="EricSqueezeLabelPath.__compactPath" ID="EricSqueezeLabelPath.__compactPath"></a> <h4>EricSqueezeLabelPath.__compactPath</h4> <b>__compactPath</b>(<i></i>) <p> Private method to return a compacted path fitting inside the label width. </p> <dl> <dt>Return:</dt> <dd> compacted path </dd> </dl> <dl> <dt>Return Type:</dt> <dd> str </dd> </dl> <a NAME="EricSqueezeLabelPath.length" ID="EricSqueezeLabelPath.length"></a> <h4>EricSqueezeLabelPath.length</h4> <b>length</b>(<i>txt</i>) <p> Public method to return the length of a text in pixels. </p> <dl> <dt><i>txt</i> (str)</dt> <dd> text to calculate the length for after wrapped </dd> </dl> <dl> <dt>Return:</dt> <dd> length of the wrapped text in pixels </dd> </dl> <dl> <dt>Return Type:</dt> <dd> int </dd> </dl> <a NAME="EricSqueezeLabelPath.paintEvent" ID="EricSqueezeLabelPath.paintEvent"></a> <h4>EricSqueezeLabelPath.paintEvent</h4> <b>paintEvent</b>(<i>event</i>) <p> Protected method called when some painting is required. </p> <dl> <dt><i>event</i> (QPaintEvent)</dt> <dd> reference to the paint event </dd> </dl> <a NAME="EricSqueezeLabelPath.setPath" ID="EricSqueezeLabelPath.setPath"></a> <h4>EricSqueezeLabelPath.setPath</h4> <b>setPath</b>(<i>path</i>) <p> Public method to set the path of the label. </p> <dl> <dt><i>path</i> (str)</dt> <dd> path to be shown </dd> </dl> <a NAME="EricSqueezeLabelPath.setSurrounding" ID="EricSqueezeLabelPath.setSurrounding"></a> <h4>EricSqueezeLabelPath.setSurrounding</h4> <b>setSurrounding</b>(<i>surrounding</i>) <p> Public method to set the surrounding of the path string. </p> <dl> <dt><i>surrounding</i> (str)</dt> <dd> the a string containing placeholders for the path </dd> </dl> <a NAME="EricSqueezeLabelPath.setTextPath" ID="EricSqueezeLabelPath.setTextPath"></a> <h4>EricSqueezeLabelPath.setTextPath</h4> <b>setTextPath</b>(<i>surrounding, path</i>) <p> Public method to set the surrounding and the path of the label. </p> <dl> <dt><i>surrounding</i> (str)</dt> <dd> the a string containing placeholders for the path </dd> <dt><i>path</i> (str)</dt> <dd> path to be shown </dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr /> </body></html>