wx.richtext.RichTextImage¶
This class implements a graphic object.
Class Hierarchy¶
Methods Summary¶
Default constructor. |
|
Returns |
|
Clones the image object. |
|
Copies the image object. |
|
Draw the item, within the given range. |
|
Edits the object’s properties via a GUI. |
|
Returns the image block containing the raw data. |
|
Returns the image cache (a scaled bitmap). |
|
Gets the image state. |
|
Returns the ‘natural’ size for this object - the image size. |
|
Gets the original image size. |
|
Returns the label to be used for the properties context menu item. |
|
Returns the object size for the given range. |
|
Returns the |
|
Imports this object from |
|
Returns |
|
Returns |
|
Lay the item out at the specified position with the given size constraint. |
|
Do the loading and scaling. |
|
Creates a cached image at the required size. |
|
Resets the image cache. |
|
Sets the image cache. |
|
Sets the image state. |
|
Sets the original image size. |
|
Returns |
Properties Summary¶
See |
|
See |
|
See |
|
See |
|
See |
Class API¶
- class wx.richtext.RichTextImage(RichTextObject)¶
Possible constructors:
RichTextImage(parent=None) -> None RichTextImage(image, parent=None, charStyle=None) -> None RichTextImage(imageBlock, parent=None, charStyle=None) -> None RichTextImage(obj) -> None
This class implements a graphic object.
Methods¶
- __init__(self, *args, **kw)¶
-
__init__ (self, parent=None)
Default constructor.
- Parameters:
parent (wx.richtext.RichTextObject)
- Return type:
None
__init__ (self, image, parent=None, charStyle=None)
Creates a wx.richtext.RichTextImage from a wx.Image.
- Parameters:
image (wx.Image)
parent (wx.richtext.RichTextObject)
charStyle (wx.richtext.RichTextAttr)
- Return type:
None
__init__ (self, imageBlock, parent=None, charStyle=None)
Creates a wx.richtext.RichTextImage from an image block.
- Parameters:
imageBlock (wx.richtext.RichTextImageBlock)
parent (wx.richtext.RichTextObject)
charStyle (wx.richtext.RichTextAttr)
- Return type:
None
__init__ (self, obj)
Copy constructor.
- Parameters:
- Return type:
None
- CanEditProperties(self)¶
Returns
True
if we can edit the object’s properties via a GUI.- Return type:
bool
- Clone(self)¶
Clones the image object.
- Return type:
- Copy(self, obj)¶
Copies the image object.
- Parameters:
- Return type:
None
- Draw(self, dc, context, range, selection, rect, descent, style)¶
Draw the item, within the given range.
Some objects may ignore the range (for example paragraphs) while others must obey it (lines, to implement wrapping)
- Parameters:
dc (wx.DC)
context (wx.richtext.RichTextDrawingContext)
range (wx.richtext.RichTextRange)
selection (wx.richtext.RichTextSelection)
rect (wx.Rect)
descent (int)
style (int)
- Return type:
bool
- EditProperties(self, parent, buffer)¶
Edits the object’s properties via a GUI.
- Parameters:
parent (wx.Window)
buffer (wx.richtext.RichTextBuffer)
- Return type:
bool
- GetImageBlock(self)¶
Returns the image block containing the raw data.
- Return type:
- GetImageCache(self)¶
Returns the image cache (a scaled bitmap).
- Return type:
Bitmap
- GetImageState(self)¶
Gets the image state.
- Return type:
int
- GetNaturalSize(self)¶
Returns the ‘natural’ size for this object - the image size.
- Return type:
- GetOriginalImageSize(self)¶
Gets the original image size.
- Return type:
Size
- GetPropertiesMenuLabel(self)¶
Returns the label to be used for the properties context menu item.
- Return type:
str
- GetRangeSize(self, range, size, descent, dc, context, flags, position=Point(0, 0), parentSize=DefaultSize, partialExtents=None)¶
Returns the object size for the given range.
Returns
False
if the range is invalid for this object.- Parameters:
range (wx.richtext.RichTextRange)
size (wx.Size)
descent (int)
dc (wx.DC)
context (wx.richtext.RichTextDrawingContext)
flags (int)
position (wx.Point)
parentSize (wx.Size)
partialExtents (list of integers)
- Return type:
bool
- GetXMLNodeName(self)¶
Returns the
XML
node name of this object.This must be overridden for XmlNode-base
XML
export to work.- Return type:
str
- ImportFromXML(self, buffer, node, handler, recurse)¶
Imports this object from
XML
.- Parameters:
buffer (wx.richtext.RichTextBuffer)
node (wx.xml.XmlNode)
handler (wx.richtext.RichTextXMLHandler)
recurse (bool)
- Return type:
bool
- IsEmpty(self)¶
Returns
True
if the object is empty.- Return type:
bool
- IsFloatable(self)¶
Returns
True
if this class of object is floatable.- Return type:
bool
- Layout(self, dc, context, rect, parentRect, style)¶
Lay the item out at the specified position with the given size constraint.
Layout must set the cached size. rect is the available space for the object, and parentRect is the container that is used to determine a relative size or position (for example if a text box must be 50% of the parent text box).
- Parameters:
dc (wx.DC)
context (wx.richtext.RichTextDrawingContext)
rect (wx.Rect)
parentRect (wx.Rect)
style (int)
- Return type:
bool
- LoadAndScaleImageCache(self, image, sz, context, changed)¶
Do the loading and scaling.
- Parameters:
image (wx.Image)
sz (wx.Size)
context (wx.richtext.RichTextDrawingContext)
changed (bool)
- Return type:
Tuple[bool, bool]
- LoadImageCache(self, dc, context, retImageSize, resetCache=False, parentSize=DefaultSize)¶
Creates a cached image at the required size.
- Parameters:
dc (wx.DC)
context (wx.richtext.RichTextDrawingContext)
retImageSize (wx.Size)
resetCache (bool)
parentSize (wx.Size)
- Return type:
bool
- ResetImageCache(self)¶
Resets the image cache.
- Return type:
None
- SetImageState(self, state)¶
Sets the image state.
- Parameters:
state (int)
- Return type:
None
- SetOriginalImageSize(self, sz)¶
Sets the original image size.
- Parameters:
sz (wx.Size)
- Return type:
None
- UsesParagraphAttributes(self)¶
Returns
True
if this object takes note of paragraph attributes (text and image objects don’t).- Return type:
bool
Properties¶
- ImageBlock¶
See
GetImageBlock
- ImageCache¶
See
GetImageCache
andSetImageCache
- ImageState¶
See
GetImageState
andSetImageState
- NaturalSize¶
See
GetNaturalSize
- OriginalImageSize¶
- PropertiesMenuLabel¶
- XMLNodeName¶
See
GetXMLNodeName