wx.lib.agw.infobar.AutoWrapStaticText¶
A simple class derived from lib.stattext
that implements auto-wrapping
behaviour depending on the parent size.
Added in version 0.9.5.
Class Hierarchy¶
Known Superclasses¶
Methods Summary¶
Defsult class constructor. |
|
Handles the |
|
Sets the |
|
This functions wraps the controls label so that each of its lines becomes at |
Class API¶
- class AutoWrapStaticText(StaticText)¶
A simple class derived from
lib.stattext
that implements auto-wrapping behaviour depending on the parent size.Added in version 0.9.5.
Methods¶
- __init__(self, parent, label)¶
Defsult class constructor.
- Parameters:
parent (wx.Window) – a subclass of
wx.Window
, must not beNone
;label (string) – the
AutoWrapStaticText
text label.
- OnSize(self, event)¶
Handles the
wx.EVT_SIZE
event forAutoWrapStaticText
.- Parameters:
event – a
wx.SizeEvent
event to be processed.
- SetLabel(self, label, wrapped=False)¶
Sets the
AutoWrapStaticText
label.All “&” characters in the label are special and indicate that the following character is a mnemonic for this control and can be used to activate it from the keyboard (typically by using
Alt
key in combination with it). To insert a literal ampersand character, you need to double it, i.e. use “&&”. If this behaviour is undesirable, useSetLabelText
instead.- Parameters:
label (string) – the new
AutoWrapStaticText
text label;wrapped (bool) –
True
if this method was called by the developer usingSetLabel
,False
if it comes from theOnSize
event handler.
Note
Reimplemented from
wx.Control
.
- Wrap(self, width)¶
This functions wraps the controls label so that each of its lines becomes at most width pixels wide if possible (the lines are broken at words boundaries so it might not be the case if words are too long).
If width is negative, no wrapping is done.
- Parameters:
width (integer) – the maximum available width for the text, in pixels.
Note
Note that this width is not necessarily the total width of the control, since a few pixels for the border (depending on the controls border style) may be added.