wxShapeFramework  1.13.0 beta
wxSFTextShape Class Reference

Class encapsulates basic non-editable text shape which is suitable for displaying of various text information in the canvas. More...

#include <TextShape.h>

Inheritance diagram for wxSFTextShape:
Collaboration diagram for wxSFTextShape:

List of all members.

Public Member Functions

 XS_DECLARE_CLONABLE_CLASS (wxSFTextShape)
 wxSFTextShape (void)
 Default constructor.
 wxSFTextShape (const wxRealPoint &pos, const wxString &txt, wxSFDiagramManager *manager)
 User constructor.
 wxSFTextShape (const wxSFTextShape &obj)
 Copy constructor.
virtual ~wxSFTextShape ()
 Destructor.
void SetFont (const wxFont &font)
 Set text font.
wxFont & GetFont ()
 Get text font.
void SetText (const wxString &txt)
 Set text.
wxString GetText () const
 Get text.
void SetTextColour (const wxColour &col)
 Set text color.
wxColour GetTextColour () const
 Get text color.
virtual void Scale (double x, double y, bool children=sfWITHCHILDREN)
 Scale the shape size by in both directions. The function can be overrided if necessary (new implementation should call default one ore scale shape's children manualy if neccesary).
virtual void OnHandle (wxSFShapeHandle &handle)
 Event handler called during dragging of the shape handle. The function can be overrided if necessary.
virtual void Update ()
 Upate shape (align all child shapes an resize it to fit them)
wxSize GetTextExtent ()
void UpdateRectSize ()

Protected Member Functions

virtual void DrawNormal (wxDC &dc)
 Draw the shape in the normal way. The function can be overrided if neccessary.
virtual void DrawHover (wxDC &dc)
 Draw the shape in the hower mode (the mouse cursor is above the shape). The function can be overrided if neccessary.
virtual void DrawHighlighted (wxDC &dc)
 Draw the shape in the highlighted mode (another shape is dragged over this shape and this shape will accept the dragged one if it will be dropped on it). The function can be overrided if neccessary.
virtual void DrawShadow (wxDC &dc)
 Draw shadow under the shape. The function can be overrided if neccessary.
virtual wxXmlNode * Serialize (wxXmlNode *node)
 Serialize shape's properties to the given XML node. The serialization routine is automatically called by the framework and should take care about serialization of all specific (non-standard) shape's properties.
virtual void Deserialize (wxXmlNode *node)
 Deserialize shape's properties from the given XML node. The routine is automatically called by the framework and should take care about deserialization of all specific (non-standard) shape's properties.
virtual void OnLeftHandle (wxSFShapeHandle &handle)
 Event handler called during dragging of the left shape handle. The function can be overrided if neccessary.
virtual void OnTopHandle (wxSFShapeHandle &handle)
 Event handler called during dragging of the top shape handle. The function can be overrided if neccessary.
virtual void OnRightHandle (wxSFShapeHandle &handle)
 Event handler called during dragging of the right shape handle. The function can be overrided if neccessary.
virtual void OnBottomHandle (wxSFShapeHandle &handle)
 Event handler called during dragging of the bottom shape handle. The function can be overrided if neccessary.
void DrawTextContent (wxDC &dc)
 Draw text shape.

Protected Attributes

wxFont m_Font
wxColour m_TextColor
wxString m_sText

Private Member Functions

void MarkSerializableDataMembers ()
 Initialize serializable properties.

Private Attributes

wxCoord m_nLineHeight

Detailed Description

Class encapsulates basic non-editable text shape which is suitable for displaying of various text information in the canvas.

See also:
wxSFEditTextShape

Constructor & Destructor Documentation

Default constructor.

wxSFTextShape::wxSFTextShape ( const wxRealPoint &  pos,
const wxString &  txt,
wxSFDiagramManager manager 
)

User constructor.

Parameters:
posInitial position
txtText content
managerPointer to parent diagram manager

Copy constructor.

Parameters:
objSource objct
virtual wxSFTextShape::~wxSFTextShape ( ) [virtual]

Destructor.


Member Function Documentation

virtual void wxSFTextShape::Deserialize ( wxXmlNode *  node) [protected, virtual]

Deserialize shape's properties from the given XML node. The routine is automatically called by the framework and should take care about deserialization of all specific (non-standard) shape's properties.

Parameters:
nodePointer to a source XML node containig the shape's property nodes
See also:
xsSerializable::Deserialize

Reimplemented from wxSFShapeBase.

virtual void wxSFTextShape::DrawHighlighted ( wxDC &  dc) [protected, virtual]

Draw the shape in the highlighted mode (another shape is dragged over this shape and this shape will accept the dragged one if it will be dropped on it). The function can be overrided if neccessary.

Parameters:
dcReference to device context where the shape will be drawn to

Reimplemented from wxSFRectShape.

virtual void wxSFTextShape::DrawHover ( wxDC &  dc) [protected, virtual]

Draw the shape in the hower mode (the mouse cursor is above the shape). The function can be overrided if neccessary.

Parameters:
dcReference to device context where the shape will be drawn to

Reimplemented from wxSFRectShape.

virtual void wxSFTextShape::DrawNormal ( wxDC &  dc) [protected, virtual]

Draw the shape in the normal way. The function can be overrided if neccessary.

Parameters:
dcReference to device context where the shape will be drawn to

Reimplemented from wxSFRectShape.

virtual void wxSFTextShape::DrawShadow ( wxDC &  dc) [protected, virtual]

Draw shadow under the shape. The function can be overrided if neccessary.

Parameters:
dcReference to device context where the shadow will be drawn to

Reimplemented from wxSFRectShape.

void wxSFTextShape::DrawTextContent ( wxDC &  dc) [protected]

Draw text shape.

Parameters:
dcDevice context where the text shape will be drawn to
wxFont& wxSFTextShape::GetFont ( ) [inline]

Get text font.

Returns:
Font
wxString wxSFTextShape::GetText ( ) const [inline]

Get text.

Returns:
Current text content
wxColour wxSFTextShape::GetTextColour ( ) const [inline]

Get text color.

Returns:
Current text color

Initialize serializable properties.

Reimplemented from wxSFRectShape.

virtual void wxSFTextShape::OnBottomHandle ( wxSFShapeHandle handle) [protected, virtual]

Event handler called during dragging of the bottom shape handle. The function can be overrided if neccessary.

Parameters:
handleReference to dragged shape handle

Reimplemented from wxSFRectShape.

virtual void wxSFTextShape::OnHandle ( wxSFShapeHandle handle) [virtual]

Event handler called during dragging of the shape handle. The function can be overrided if necessary.

The function is called by the framework (by the shape canvas). Default implementation does nothing.

Parameters:
handleReference to dragged handle

Reimplemented from wxSFRectShape.

virtual void wxSFTextShape::OnLeftHandle ( wxSFShapeHandle handle) [protected, virtual]

Event handler called during dragging of the left shape handle. The function can be overrided if neccessary.

Parameters:
handleReference to dragged shape handle

Reimplemented from wxSFRectShape.

virtual void wxSFTextShape::OnRightHandle ( wxSFShapeHandle handle) [protected, virtual]

Event handler called during dragging of the right shape handle. The function can be overrided if neccessary.

Parameters:
handleReference to dragged shape handle

Reimplemented from wxSFRectShape.

virtual void wxSFTextShape::OnTopHandle ( wxSFShapeHandle handle) [protected, virtual]

Event handler called during dragging of the top shape handle. The function can be overrided if neccessary.

Parameters:
handleReference to dragged shape handle

Reimplemented from wxSFRectShape.

virtual void wxSFTextShape::Scale ( double  x,
double  y,
bool  children = sfWITHCHILDREN 
) [virtual]

Scale the shape size by in both directions. The function can be overrided if necessary (new implementation should call default one ore scale shape's children manualy if neccesary).

Parameters:
xHorizontal scale factor
yVertical scale factor
childrenTRUE if the shape's children shoould be scaled as well, otherwise the shape will be updated after scaling via Update() function.

Reimplemented from wxSFRectShape.

virtual wxXmlNode* wxSFTextShape::Serialize ( wxXmlNode *  node) [protected, virtual]

Serialize shape's properties to the given XML node. The serialization routine is automatically called by the framework and should take care about serialization of all specific (non-standard) shape's properties.

Parameters:
nodePointer to XML node where the shape's property nodes will be appended to
See also:
xsSerializable::Serialize

Reimplemented from wxSFShapeBase.

void wxSFTextShape::SetFont ( const wxFont &  font)

Set text font.

Parameters:
fontFont
void wxSFTextShape::SetText ( const wxString &  txt)

Set text.

Parameters:
txtText content
void wxSFTextShape::SetTextColour ( const wxColour &  col) [inline]

Set text color.

Parameters:
colText color
virtual void wxSFTextShape::Update ( ) [virtual]

Upate shape (align all child shapes an resize it to fit them)

Reimplemented from wxSFShapeBase.


Member Data Documentation

wxFont wxSFTextShape::m_Font [protected]
wxCoord wxSFTextShape::m_nLineHeight [private]
wxString wxSFTextShape::m_sText [protected]
wxColour wxSFTextShape::m_TextColor [protected]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines