Version: 2.9.4
Public Types | Public Member Functions | Protected Attributes
wxRichTextFieldTypeStandard Class Reference

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

Inheritance diagram for wxRichTextFieldTypeStandard:

Detailed Description

A field type that can handle fields with text or bitmap labels, with a small range of styles for implementing rectangular fields and fields that can be used for start and end tags.

The border, text and background colours can be customised; the default is white text on a black background.

The following display styles can be used.

Styles

This class supports the following styles:

Library:  wxRichText
Category:  Rich Text
参照:
wxRichTextFieldType, wxRichTextField, wxRichTextBuffer, wxRichTextCtrl

Public Types

enum  {
  wxRICHTEXT_FIELD_STYLE_COMPOSITE = 0x01,
  wxRICHTEXT_FIELD_STYLE_RECTANGLE = 0x02,
  wxRICHTEXT_FIELD_STYLE_NO_BORDER = 0x04,
  wxRICHTEXT_FIELD_STYLE_START_TAG = 0x08,
  wxRICHTEXT_FIELD_STYLE_END_TAG = 0x10
}

Public Member Functions

 wxRichTextFieldTypeStandard (const wxString &name, const wxString &label, int displayStyle=wxRICHTEXT_FIELD_STYLE_RECTANGLE)
 Constructor, creating a field type definition with a text label.
 wxRichTextFieldTypeStandard (const wxString &name, const wxBitmap &bitmap, int displayStyle=wxRICHTEXT_FIELD_STYLE_NO_BORDER)
 Constructor, creating a field type definition with a bitmap label.
 wxRichTextFieldTypeStandard ()
 The default constructor.
 wxRichTextFieldTypeStandard (const wxRichTextFieldTypeStandard &field)
 The copy constructor.
void Init ()
 Initialises the object.
void Copy (const wxRichTextFieldTypeStandard &field)
 Copies the object.
void operator= (const wxRichTextFieldTypeStandard &field)
 The assignment operator.
virtual bool Draw (wxRichTextField *obj, 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 (wxRichTextField *obj, 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 (wxRichTextField *obj, 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.
wxSize GetSize (wxRichTextField *obj, wxDC &dc, wxRichTextDrawingContext &context, int style) const
 Get the size of the field, given the label, font size, and so on.
virtual bool IsTopLevel (wxRichTextField *WXUNUSED(obj)) const
 Returns true if the display type is wxRICHTEXT_FIELD_STYLE_COMPOSITE, false otherwise.
void SetLabel (const wxString &label)
 Sets the text label for fields of this type.
const wxStringGetLabel () const
 Returns the text label for fields of this type.
void SetBitmap (const wxBitmap &bitmap)
 Sets the bitmap label for fields of this type.
const wxBitmapGetBitmap () const
 Gets the bitmap label for fields of this type.
int GetDisplayStyle () const
 Gets the display style for fields of this type.
void SetDisplayStyle (int displayStyle)
 Sets the display style for fields of this type.
const wxFontGetFont () const
 Gets the font used for drawing the text label.
void SetFont (const wxFont &font)
 Sets the font used for drawing the text label.
const wxColourGetTextColour () const
 Gets the colour used for drawing the text label.
void SetTextColour (const wxColour &colour)
 Sets the colour used for drawing the text label.
const wxColourGetBorderColour () const
 Gets the colour used for drawing the field border.
void SetBorderColour (const wxColour &colour)
 Sets the colour used for drawing the field border.
const wxColourGetBackgroundColour () const
 Gets the colour used for drawing the field background.
void SetBackgroundColour (const wxColour &colour)
 Sets the colour used for drawing the field background.
void SetVerticalPadding (int padding)
 Sets the vertical padding (the distance between the border and the text).
int GetVerticalPadding () const
 Gets the vertical padding (the distance between the border and the text).
void SetHorizontalPadding (int padding)
 Sets the horizontal padding (the distance between the border and the text).
int GetHorizontalPadding () const
 Sets the horizontal padding (the distance between the border and the text).
void SetHorizontalMargin (int margin)
 Sets the horizontal margin surrounding the field object.
int GetHorizontalMargin () const
 Gets the horizontal margin surrounding the field object.
void SetVerticalMargin (int margin)
 Sets the vertical margin surrounding the field object.
int GetVerticalMargin () const
 Gets the vertical margin surrounding the field object.

Protected Attributes

wxString m_label
int m_displayStyle
wxFont m_font
wxColour m_textColour
wxColour m_borderColour
wxColour m_backgroundColour
int m_verticalPadding
int m_horizontalPadding
int m_horizontalMargin
int m_verticalMargin
wxBitmap m_bitmap

List of all members.


Member Enumeration Documentation

anonymous enum
Enumerator:
wxRICHTEXT_FIELD_STYLE_COMPOSITE 
wxRICHTEXT_FIELD_STYLE_RECTANGLE 
wxRICHTEXT_FIELD_STYLE_NO_BORDER 
wxRICHTEXT_FIELD_STYLE_START_TAG 
wxRICHTEXT_FIELD_STYLE_END_TAG 

Constructor & Destructor Documentation

wxRichTextFieldTypeStandard::wxRichTextFieldTypeStandard ( const wxString name,
const wxString label,
int  displayStyle = wxRICHTEXT_FIELD_STYLE_RECTANGLE 
)

Constructor, creating a field type definition with a text label.

Parameters:
parentThe name of the type definition. This must be unique, and is the type name used when adding a field to a control.
labelThe text label to be shown on the field.
displayStyleThe display style: one of wxRICHTEXT_FIELD_STYLE_RECTANGLE, wxRICHTEXT_FIELD_STYLE_NO_BORDER, wxRICHTEXT_FIELD_STYLE_START_TAG, wxRICHTEXT_FIELD_STYLE_END_TAG.
wxRichTextFieldTypeStandard::wxRichTextFieldTypeStandard ( const wxString name,
const wxBitmap bitmap,
int  displayStyle = wxRICHTEXT_FIELD_STYLE_NO_BORDER 
)

Constructor, creating a field type definition with a bitmap label.

Parameters:
parentThe name of the type definition. This must be unique, and is the type name used when adding a field to a control.
labelThe bitmap label to be shown on the field.
displayStyleThe display style: one of wxRICHTEXT_FIELD_STYLE_RECTANGLE, wxRICHTEXT_FIELD_STYLE_NO_BORDER, wxRICHTEXT_FIELD_STYLE_START_TAG, wxRICHTEXT_FIELD_STYLE_END_TAG.
wxRichTextFieldTypeStandard::wxRichTextFieldTypeStandard ( ) [inline]

The default constructor.

wxRichTextFieldTypeStandard::wxRichTextFieldTypeStandard ( const wxRichTextFieldTypeStandard field) [inline]

The copy constructor.


Member Function Documentation

void wxRichTextFieldTypeStandard::Copy ( const wxRichTextFieldTypeStandard field)

Copies the object.

virtual bool wxRichTextFieldTypeStandard::Draw ( wxRichTextField obj,
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 wxRichTextFieldType.

const wxColour& wxRichTextFieldTypeStandard::GetBackgroundColour ( ) const [inline]

Gets the colour used for drawing the field background.

const wxBitmap& wxRichTextFieldTypeStandard::GetBitmap ( ) const [inline]

Gets the bitmap label for fields of this type.

const wxColour& wxRichTextFieldTypeStandard::GetBorderColour ( ) const [inline]

Gets the colour used for drawing the field border.

int wxRichTextFieldTypeStandard::GetDisplayStyle ( ) const [inline]

Gets the display style for fields of this type.

const wxFont& wxRichTextFieldTypeStandard::GetFont ( ) const [inline]

Gets the font used for drawing the text label.

int wxRichTextFieldTypeStandard::GetHorizontalMargin ( ) const [inline]

Gets the horizontal margin surrounding the field object.

int wxRichTextFieldTypeStandard::GetHorizontalPadding ( ) const [inline]

Sets the horizontal padding (the distance between the border and the text).

const wxString& wxRichTextFieldTypeStandard::GetLabel ( ) const [inline]

Returns the text label for fields of this type.

virtual bool wxRichTextFieldTypeStandard::GetRangeSize ( wxRichTextField obj,
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 wxRichTextFieldType.

wxSize wxRichTextFieldTypeStandard::GetSize ( wxRichTextField obj,
wxDC dc,
wxRichTextDrawingContext context,
int  style 
) const

Get the size of the field, given the label, font size, and so on.

const wxColour& wxRichTextFieldTypeStandard::GetTextColour ( ) const [inline]

Gets the colour used for drawing the text label.

int wxRichTextFieldTypeStandard::GetVerticalMargin ( ) const [inline]

Gets the vertical margin surrounding the field object.

int wxRichTextFieldTypeStandard::GetVerticalPadding ( ) const [inline]

Gets the vertical padding (the distance between the border and the text).

void wxRichTextFieldTypeStandard::Init ( )

Initialises the object.

virtual bool wxRichTextFieldTypeStandard::IsTopLevel ( wxRichTextField WXUNUSEDobj) const [inline, virtual]

Returns true if the display type is wxRICHTEXT_FIELD_STYLE_COMPOSITE, false otherwise.

Reimplemented from wxRichTextFieldType.

virtual bool wxRichTextFieldTypeStandard::Layout ( wxRichTextField obj,
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 wxRichTextFieldType.

void wxRichTextFieldTypeStandard::operator= ( const wxRichTextFieldTypeStandard field) [inline]

The assignment operator.

void wxRichTextFieldTypeStandard::SetBackgroundColour ( const wxColour colour) [inline]

Sets the colour used for drawing the field background.

void wxRichTextFieldTypeStandard::SetBitmap ( const wxBitmap bitmap) [inline]

Sets the bitmap label for fields of this type.

void wxRichTextFieldTypeStandard::SetBorderColour ( const wxColour colour) [inline]

Sets the colour used for drawing the field border.

void wxRichTextFieldTypeStandard::SetDisplayStyle ( int  displayStyle) [inline]

Sets the display style for fields of this type.

void wxRichTextFieldTypeStandard::SetFont ( const wxFont font) [inline]

Sets the font used for drawing the text label.

void wxRichTextFieldTypeStandard::SetHorizontalMargin ( int  margin) [inline]

Sets the horizontal margin surrounding the field object.

void wxRichTextFieldTypeStandard::SetHorizontalPadding ( int  padding) [inline]

Sets the horizontal padding (the distance between the border and the text).

void wxRichTextFieldTypeStandard::SetLabel ( const wxString label) [inline]

Sets the text label for fields of this type.

void wxRichTextFieldTypeStandard::SetTextColour ( const wxColour colour) [inline]

Sets the colour used for drawing the text label.

void wxRichTextFieldTypeStandard::SetVerticalMargin ( int  margin) [inline]

Sets the vertical margin surrounding the field object.

void wxRichTextFieldTypeStandard::SetVerticalPadding ( int  padding) [inline]

Sets the vertical padding (the distance between the border and the text).


Member Data Documentation

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines