wxShapeFramework
1.13.0 beta
|
Class encapsulates basic rectangle shape which is used as a base class for many other shapes that can be bounded by a simple rectangle. The class provides all functionality needed for manipulating the rectangle's (bounding box) size and position. More...
#include <RectShape.h>
Public Member Functions | |
XS_DECLARE_CLONABLE_CLASS (wxSFRectShape) | |
wxSFRectShape (void) | |
Default constructor. | |
wxSFRectShape (const wxRealPoint &pos, const wxRealPoint &size, wxSFDiagramManager *manager) | |
User constructor. | |
wxSFRectShape (const wxSFRectShape &obj) | |
Copy constructor. | |
virtual | ~wxSFRectShape (void) |
Destructor. | |
virtual wxRect | GetBoundingBox () |
Get shapes's bounding box. The function can be overrided if neccessary. | |
virtual wxRealPoint | GetBorderPoint (const wxRealPoint &start, const wxRealPoint &end) |
Get intersection point of the shape border and a line leading from 'start' point to 'end' point. The function can be overrided if neccessary. | |
virtual void | CreateHandles () |
Function called by the framework responsible for creation of shape handles at the creation time. The function can be overrided 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 | OnBeginHandle (wxSFShapeHandle &handle) |
Event handler called when the user started to drag the shape handle. The function can be overrided if necessary. | |
virtual void | FitToChildren () |
Resize the shape to bound all child shapes. The function can be overrided if neccessary. | |
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). | |
void | SetFill (const wxBrush &brush) |
Set rectangle's fill style. | |
wxBrush | GetFill () const |
Get current fill style. | |
void | SetBorder (const wxPen &pen) |
Set rectangle's border style. | |
wxPen | GetBorder () const |
Get current border style. | |
void | SetRectSize (const wxRealPoint &size) |
Set the rectangle size. | |
void | SetRectSize (double x, double y) |
Set the rectangle size. | |
wxRealPoint | GetRectSize () const |
Get the rectangle size. | |
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 void | OnRightHandle (wxSFShapeHandle &handle) |
Event handler called during dragging of the right shape handle. The function can be overrided if neccessary. | |
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 | OnBottomHandle (wxSFShapeHandle &handle) |
Event handler called during dragging of the bottom shape handle. The function can be overrided if neccessary. | |
Protected Attributes | |
wxPen | m_Border |
Pen object used for drawing of the rectangle border. | |
wxBrush | m_Fill |
Brush object used for drawing of the rectangle body. | |
wxRealPoint | m_nRectSize |
The rectangle size. | |
Private Member Functions | |
void | MarkSerializableDataMembers () |
Initialize serializable properties. | |
Private Attributes | |
wxRealPoint | m_nPrevSize |
Auxiliary data member. | |
wxRealPoint | m_nPrevPosition |
Auxiliary data member. |
Class encapsulates basic rectangle shape which is used as a base class for many other shapes that can be bounded by a simple rectangle. The class provides all functionality needed for manipulating the rectangle's (bounding box) size and position.
wxSFRectShape::wxSFRectShape | ( | void | ) |
Default constructor.
wxSFRectShape::wxSFRectShape | ( | const wxRealPoint & | pos, |
const wxRealPoint & | size, | ||
wxSFDiagramManager * | manager | ||
) |
User constructor.
pos | Initial position |
size | Initial size |
manager | Pointer to parent diagram manager |
wxSFRectShape::wxSFRectShape | ( | const wxSFRectShape & | obj | ) |
Copy constructor.
obj | Reference to the source object |
virtual wxSFRectShape::~wxSFRectShape | ( | void | ) | [virtual] |
Destructor.
virtual void wxSFRectShape::CreateHandles | ( | ) | [virtual] |
Function called by the framework responsible for creation of shape handles at the creation time. The function can be overrided if neccesary.
Reimplemented from wxSFShapeBase.
virtual void wxSFRectShape::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 wxSFShapeBase.
Reimplemented in wxSFPolygonShape, wxSFBitmapShape, wxSFTextShape, wxSFRoundRectShape, wxSFEllipseShape, and wxSFCircleShape.
virtual void wxSFRectShape::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 wxSFShapeBase.
Reimplemented in wxSFPolygonShape, wxSFBitmapShape, wxSFTextShape, wxSFRoundRectShape, wxSFEllipseShape, and wxSFCircleShape.
virtual void wxSFRectShape::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 wxSFShapeBase.
Reimplemented in wxSFPolygonShape, wxSFBitmapShape, wxSFTextShape, wxSFRoundRectShape, wxSFEllipseShape, and wxSFCircleShape.
virtual void wxSFRectShape::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 wxSFShapeBase.
Reimplemented in wxSFPolygonShape, wxSFTextShape, wxSFRoundRectShape, wxSFEllipseShape, and wxSFCircleShape.
virtual void wxSFRectShape::FitToChildren | ( | ) | [virtual] |
Resize the shape to bound all child shapes. The function can be overrided if neccessary.
Reimplemented from wxSFShapeBase.
Reimplemented in wxSFControlShape, wxSFGridShape, and wxSFPolygonShape.
wxPen wxSFRectShape::GetBorder | ( | ) | const [inline] |
Get current border style.
virtual wxRealPoint wxSFRectShape::GetBorderPoint | ( | const wxRealPoint & | start, |
const wxRealPoint & | end | ||
) | [virtual] |
Get intersection point of the shape border and a line leading from 'start' point to 'end' point. The function can be overrided if neccessary.
start | Starting point of the virtual intersection line |
end | Ending point of the virtual intersection line |
Reimplemented from wxSFShapeBase.
Reimplemented in wxSFPolygonShape, wxSFEllipseShape, and wxSFCircleShape.
virtual wxRect wxSFRectShape::GetBoundingBox | ( | ) | [virtual] |
Get shapes's bounding box. The function can be overrided if neccessary.
Reimplemented from wxSFShapeBase.
wxBrush wxSFRectShape::GetFill | ( | ) | const [inline] |
Get current fill style.
wxRealPoint wxSFRectShape::GetRectSize | ( | ) | const [inline] |
Get the rectangle size.
void wxSFRectShape::MarkSerializableDataMembers | ( | ) | [private] |
Initialize serializable properties.
Reimplemented from wxSFShapeBase.
Reimplemented in wxSFControlShape, wxSFTextShape, wxSFPolygonShape, wxSFGridShape, wxSFBitmapShape, and wxSFRoundRectShape.
virtual void wxSFRectShape::OnBeginHandle | ( | wxSFShapeHandle & | handle | ) | [virtual] |
Event handler called when the user started to drag the shape handle. The function can be overrided if necessary.
The function is called by the framework (by the shape canvas).
handle | Reference to dragged handle |
Reimplemented from wxSFShapeBase.
Reimplemented in wxSFControlShape, wxSFBitmapShape, and wxSFMultiSelRect.
virtual void wxSFRectShape::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 in wxSFTextShape, and wxSFMultiSelRect.
virtual void wxSFRectShape::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).
handle | Reference to dragged handle |
Reimplemented from wxSFShapeBase.
Reimplemented in wxSFControlShape, wxSFPolygonShape, wxSFBitmapShape, wxSFTextShape, wxSFSquareShape, and wxSFMultiSelRect.
virtual void wxSFRectShape::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 in wxSFTextShape, and wxSFMultiSelRect.
virtual void wxSFRectShape::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 in wxSFTextShape, and wxSFMultiSelRect.
virtual void wxSFRectShape::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 in wxSFTextShape, and wxSFMultiSelRect.
virtual void wxSFRectShape::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 wxSFShapeBase.
Reimplemented in wxSFControlShape, wxSFPolygonShape, wxSFTextShape, wxSFBitmapShape, and wxSFSquareShape.
void wxSFRectShape::SetBorder | ( | const wxPen & | pen | ) | [inline] |
Set rectangle's border style.
pen | Reference to a pen object |
void wxSFRectShape::SetFill | ( | const wxBrush & | brush | ) | [inline] |
Set rectangle's fill style.
brush | Refernce to a brush object |
void wxSFRectShape::SetRectSize | ( | const wxRealPoint & | size | ) | [inline] |
Set the rectangle size.
size | New size |
void wxSFRectShape::SetRectSize | ( | double | x, |
double | y | ||
) | [inline] |
Set the rectangle size.
x | Horizontal size |
y | Verical size |
wxPen wxSFRectShape::m_Border [protected] |
Pen object used for drawing of the rectangle border.
wxBrush wxSFRectShape::m_Fill [protected] |
Brush object used for drawing of the rectangle body.
wxRealPoint wxSFRectShape::m_nPrevPosition [private] |
Auxiliary data member.
wxRealPoint wxSFRectShape::m_nPrevSize [private] |
Auxiliary data member.
wxRealPoint wxSFRectShape::m_nRectSize [protected] |
The rectangle size.