This class implements a graphic object.
See also
wx.richtext.RichTextBuffer, wx.richtext.RichTextCtrl, wx.richtext.RichTextImageBlock
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 |
See |
|
See |
|
See |
|
See |
|
See |
wx.richtext.
RichTextImage
(RichTextObject)¶Possible constructors:
RichTextImage(parent=None)
RichTextImage(image, parent=None, charStyle=None)
RichTextImage(imageBlock, parent=None, charStyle=None)
RichTextImage(obj)
This class implements a graphic object.
__init__
(self, *args, **kw)¶__init__ (self, parent=None)
Default constructor.
parent (wx.richtext.RichTextObject) –
__init__ (self, image, parent=None, charStyle=None)
Creates a wx.richtext.RichTextImage from a wx.Image.
image (wx.Image) –
parent (wx.richtext.RichTextObject) –
charStyle (wx.richtext.RichTextAttr) –
__init__ (self, imageBlock, parent=None, charStyle=None)
Creates a wx.richtext.RichTextImage from an image block.
imageBlock (wx.richtext.RichTextImageBlock) –
parent (wx.richtext.RichTextObject) –
charStyle (wx.richtext.RichTextAttr) –
__init__ (self, obj)
Copy constructor.
obj (wx.richtext.RichTextImage) –
CanEditProperties
(self)¶Returns True
if we can edit the object’s properties via a GUI.
bool
Clone
(self)¶Clones the image object.
Copy
(self, obj)¶Copies the image object.
obj (wx.richtext.RichTextImage) –
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)
dc (wx.DC) –
context (wx.richtext.RichTextDrawingContext) –
range (wx.richtext.RichTextRange) –
selection (wx.richtext.RichTextSelection) –
rect (wx.Rect) –
descent (int) –
style (int) –
bool
EditProperties
(self, parent, buffer)¶Edits the object’s properties via a GUI.
parent (wx.Window) –
buffer (wx.richtext.RichTextBuffer) –
bool
GetImageBlock
(self)¶Returns the image block containing the raw data.
GetImageCache
(self)¶Returns the image cache (a scaled bitmap).
Bitmap
GetImageState
(self)¶Gets the image state.
int
GetNaturalSize
(self)¶Returns the ‘natural’ size for this object - the image size.
GetOriginalImageSize
(self)¶Gets the original image size.
Size
GetPropertiesMenuLabel
(self)¶Returns the label to be used for the properties context menu item.
string
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.
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) –
bool
GetXMLNodeName
(self)¶Returns the XML
node name of this object.
This must be overridden for XmlNode-base XML
export to work.
string
ImportFromXML
(self, buffer, node, handler, recurse)¶Imports this object from XML
.
buffer (wx.richtext.RichTextBuffer) –
node (wx.xml.XmlNode) –
handler (wx.richtext.RichTextXMLHandler) –
recurse (bool) –
bool
IsEmpty
(self)¶Returns True
if the object is empty.
bool
IsFloatable
(self)¶Returns True
if this class of object is floatable.
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).
dc (wx.DC) –
context (wx.richtext.RichTextDrawingContext) –
rect (wx.Rect) –
parentRect (wx.Rect) –
style (int) –
bool
LoadAndScaleImageCache
(self, image, sz, context, changed)¶Do the loading and scaling.
image (wx.Image) –
sz (wx.Size) –
context (wx.richtext.RichTextDrawingContext) –
changed (bool) –
tuple
( bool, changed )
LoadImageCache
(self, dc, context, retImageSize, resetCache=False, parentSize=DefaultSize)¶Creates a cached image at the required size.
dc (wx.DC) –
context (wx.richtext.RichTextDrawingContext) –
retImageSize (wx.Size) –
resetCache (bool) –
parentSize (wx.Size) –
bool
ResetImageCache
(self)¶Resets the image cache.
SetImageState
(self, state)¶Sets the image state.
state (int) –
UsesParagraphAttributes
(self)¶Returns True
if this object takes note of paragraph attributes (text and image objects don’t).
bool
ImageBlock
¶See GetImageBlock
ImageCache
¶See GetImageCache
and SetImageCache
ImageState
¶See GetImageState
and SetImageState
NaturalSize
¶See GetNaturalSize
OriginalImageSize
¶PropertiesMenuLabel
¶XMLNodeName
¶See GetXMLNodeName