wxShapeFramework
1.13.0 beta
|
Class encapsulates basic non-editable text shape which is suitable for displaying of various text information in the canvas. More...
#include <TextShape.h>
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 |
Class encapsulates basic non-editable text shape which is suitable for displaying of various text information in the canvas.
wxSFTextShape::wxSFTextShape | ( | void | ) |
Default constructor.
wxSFTextShape::wxSFTextShape | ( | const wxRealPoint & | pos, |
const wxString & | txt, | ||
wxSFDiagramManager * | manager | ||
) |
User constructor.
pos | Initial position |
txt | Text content |
manager | Pointer to parent diagram manager |
wxSFTextShape::wxSFTextShape | ( | const wxSFTextShape & | obj | ) |
Copy constructor.
obj | Source objct |
virtual wxSFTextShape::~wxSFTextShape | ( | ) | [virtual] |
Destructor.
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.
node | Pointer to a source XML node containig the shape's property nodes |
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.
dc | Reference 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.
dc | Reference 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.
dc | Reference 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.
dc | Reference to device context where the shadow will be drawn to |
Reimplemented from wxSFRectShape.
void wxSFTextShape::DrawTextContent | ( | wxDC & | dc | ) | [protected] |
Draw text shape.
dc | Device context where the text shape will be drawn to |
wxFont& wxSFTextShape::GetFont | ( | ) | [inline] |
Get text font.
wxString wxSFTextShape::GetText | ( | ) | const [inline] |
Get text.
wxColour wxSFTextShape::GetTextColour | ( | ) | const [inline] |
Get text color.
wxSize wxSFTextShape::GetTextExtent | ( | ) |
void wxSFTextShape::MarkSerializableDataMembers | ( | ) | [private] |
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.
handle | Reference 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.
handle | Reference 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.
handle | Reference 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.
handle | Reference 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.
handle | Reference 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).
x | Horizontal scale factor |
y | Vertical scale factor |
children | TRUE 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.
node | Pointer to XML node where the shape's property nodes will be appended to |
Reimplemented from wxSFShapeBase.
void wxSFTextShape::SetFont | ( | const wxFont & | font | ) |
Set text font.
font | Font |
void wxSFTextShape::SetText | ( | const wxString & | txt | ) |
Set text.
txt | Text content |
void wxSFTextShape::SetTextColour | ( | const wxColour & | col | ) | [inline] |
Set text color.
col | Text color |
virtual void wxSFTextShape::Update | ( | ) | [virtual] |
Upate shape (align all child shapes an resize it to fit them)
Reimplemented from wxSFShapeBase.
void wxSFTextShape::UpdateRectSize | ( | ) |
wxFont wxSFTextShape::m_Font [protected] |
wxCoord wxSFTextShape::m_nLineHeight [private] |
wxString wxSFTextShape::m_sText [protected] |
wxColour wxSFTextShape::m_TextColor [protected] |