Version: 2.9.4
Public Member Functions | Protected Attributes
wxRichTextImage Class Reference

#include </home/zeitlin/src/wx/github/interface/wx/richtext/richtextbuffer.h>

Inheritance diagram for wxRichTextImage:

Detailed Description

This class implements a graphic object.

Library:  wxRichText
Category:  Rich Text
参照:
wxRichTextBuffer, wxRichTextCtrl, wxRichTextImageBlock

Public Member Functions

 wxRichTextImage (wxRichTextObject *parent=NULL)
 Default constructor.
 wxRichTextImage (const wxImage &image, wxRichTextObject *parent=NULL, wxRichTextAttr *charStyle=NULL)
 Creates a wxRichTextImage from a wxImage.
 wxRichTextImage (const wxRichTextImageBlock &imageBlock, wxRichTextObject *parent=NULL, wxRichTextAttr *charStyle=NULL)
 Creates a wxRichTextImage from an image block.
 wxRichTextImage (const wxRichTextImage &obj)
 Copy constructor.
virtual bool Draw (wxDC &dc, wxRichTextDrawingContext &context, const wxRichTextRange &range, const wxRichTextSelection &selection, const wxRect &rect, int descent, int style)
 Draw the item, within the given range.
virtual bool Layout (wxDC &dc, wxRichTextDrawingContext &context, const wxRect &rect, const wxRect &parentRect, int style)
 Lay the item out at the specified position with the given size constraint.
virtual bool GetRangeSize (const wxRichTextRange &range, wxSize &size, int &descent, wxDC &dc, wxRichTextDrawingContext &context, int flags, wxPoint position=wxPoint(0, 0), wxArrayInt *partialExtents=NULL) const
 Returns the object size for the given range.
virtual wxTextAttrSize GetNaturalSize () const
 Returns the 'natural' size for this object - the image size.
virtual bool IsEmpty () const
 Returns true if the object is empty.
virtual bool CanEditProperties () const
 Returns true if we can edit the object's properties via a GUI.
virtual bool EditProperties (wxWindow *parent, wxRichTextBuffer *buffer)
virtual wxString GetPropertiesMenuLabel () const
 Returns the label to be used for the properties context menu item.
virtual bool UsesParagraphAttributes () const
 Returns true if this object takes note of paragraph attributes (text and image objects don't).
virtual bool IsFloatable () const
 Returns true if this class of object is floatable.
virtual wxString GetXMLNodeName () const
 Returns the XML node name of this object.
const wxBitmapGetImageCache () const
 Returns the image cache (a scaled bitmap).
void SetImageCache (const wxBitmap &bitmap)
 Sets the image cache.
void ResetImageCache ()
 Resets the image cache.
wxRichTextImageBlockGetImageBlock ()
 Returns the image block containing the raw data.
wxSize GetOriginalImageSize () const
 Gets the original image size.
void SetOriginalImageSize (const wxSize &sz)
 Sets the original image size.
void Copy (const wxRichTextImage &obj)
 Copies the image object.
virtual wxRichTextObjectClone () const
 Clones the image object.
virtual bool LoadImageCache (wxDC &dc, bool resetCache=false)
 Creates a cached image at the required size.

Protected Attributes

wxRichTextImageBlock m_imageBlock
wxBitmap m_imageCache

List of all members.


Constructor & Destructor Documentation

wxRichTextImage::wxRichTextImage ( wxRichTextObject parent = NULL) [inline]

Default constructor.

wxRichTextImage::wxRichTextImage ( const wxImage image,
wxRichTextObject parent = NULL,
wxRichTextAttr charStyle = NULL 
)

Creates a wxRichTextImage from a wxImage.

wxRichTextImage::wxRichTextImage ( const wxRichTextImageBlock imageBlock,
wxRichTextObject parent = NULL,
wxRichTextAttr charStyle = NULL 
)

Creates a wxRichTextImage from an image block.

wxRichTextImage::wxRichTextImage ( const wxRichTextImage obj) [inline]

Copy constructor.


Member Function Documentation

virtual bool wxRichTextImage::CanEditProperties ( ) const [inline, virtual]

Returns true if we can edit the object's properties via a GUI.

Reimplemented from wxRichTextObject.

virtual wxRichTextObject* wxRichTextImage::Clone ( ) const [inline, virtual]

Clones the image object.

Reimplemented from wxRichTextObject.

void wxRichTextImage::Copy ( const wxRichTextImage obj)

Copies the image object.

virtual bool wxRichTextImage::Draw ( wxDC dc,
wxRichTextDrawingContext context,
const wxRichTextRange range,
const wxRichTextSelection selection,
const wxRect rect,
int  descent,
int  style 
) [virtual]

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)

Implements wxRichTextObject.

virtual bool wxRichTextImage::EditProperties ( wxWindow parent,
wxRichTextBuffer buffer 
) [virtual]
wxRichTextImageBlock& wxRichTextImage::GetImageBlock ( ) [inline]

Returns the image block containing the raw data.

const wxBitmap& wxRichTextImage::GetImageCache ( ) const [inline]

Returns the image cache (a scaled bitmap).

virtual wxTextAttrSize wxRichTextImage::GetNaturalSize ( ) const [virtual]

Returns the 'natural' size for this object - the image size.

Reimplemented from wxRichTextObject.

wxSize wxRichTextImage::GetOriginalImageSize ( ) const

Gets the original image size.

virtual wxString wxRichTextImage::GetPropertiesMenuLabel ( ) const [inline, virtual]

Returns the label to be used for the properties context menu item.

Reimplemented from wxRichTextObject.

virtual bool wxRichTextImage::GetRangeSize ( const wxRichTextRange range,
wxSize size,
int &  descent,
wxDC dc,
wxRichTextDrawingContext context,
int  flags,
wxPoint  position = wxPoint(0, 0),
wxArrayInt partialExtents = NULL 
) const [virtual]

Returns the object size for the given range.

Returns false if the range is invalid for this object.

Implements wxRichTextObject.

virtual wxString wxRichTextImage::GetXMLNodeName ( ) const [inline, virtual]

Returns the XML node name of this object.

This must be overridden for wxXmlNode-base XML export to work.

Reimplemented from wxRichTextObject.

virtual bool wxRichTextImage::IsEmpty ( ) const [inline, virtual]

Returns true if the object is empty.

Reimplemented from wxRichTextObject.

virtual bool wxRichTextImage::IsFloatable ( ) const [inline, virtual]

Returns true if this class of object is floatable.

Reimplemented from wxRichTextObject.

virtual bool wxRichTextImage::Layout ( wxDC dc,
wxRichTextDrawingContext context,
const wxRect rect,
const wxRect parentRect,
int  style 
) [virtual]

Lay the item out at the specified position with the given size constraint.

Layout must set the cached size. 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).

Implements wxRichTextObject.

virtual bool wxRichTextImage::LoadImageCache ( wxDC dc,
bool  resetCache = false 
) [virtual]

Creates a cached image at the required size.

void wxRichTextImage::ResetImageCache ( ) [inline]

Resets the image cache.

void wxRichTextImage::SetImageCache ( const wxBitmap bitmap) [inline]

Sets the image cache.

void wxRichTextImage::SetOriginalImageSize ( const wxSize sz)

Sets the original image size.

virtual bool wxRichTextImage::UsesParagraphAttributes ( ) const [inline, virtual]

Returns true if this object takes note of paragraph attributes (text and image objects don't).

Reimplemented from wxRichTextObject.


Member Data Documentation

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines