wxShapeFramework  1.13.0 beta
wxSFConnectionPoint Class Reference

Class encapsulating fixed connection point assignable to shapes. The assigned fixed connection points are the only places where connected lines can start/end. More...

#include <ShapeDockpoint.h>

Inheritance diagram for wxSFConnectionPoint:
Collaboration diagram for wxSFConnectionPoint:

List of all members.

Public Types

enum  CPTYPE {
  cpUNDEF, cpTOPLEFT, cpTOPMIDDLE, cpTOPRIGHT,
  cpCENTERLEFT, cpCENTERMIDDLE, cpCENTERRIGHT, cpBOTTOMLEFT,
  cpBOTTOMMIDDLE, cpBOTTOMRIGHT, cpCUSTOM
}
 Connection point type. More...

Public Member Functions

 XS_DECLARE_CLONABLE_CLASS (wxSFConnectionPoint)
 wxSFConnectionPoint ()
 Basic constructor.
 wxSFConnectionPoint (wxSFShapeBase *parent, CPTYPE type)
 Enhanced constructor.
 wxSFConnectionPoint (wxSFShapeBase *parent, const wxRealPoint &relpos, long id=-1)
 Enhanced constructor.
 wxSFConnectionPoint (const wxSFConnectionPoint &obj)
 Copy constructor.
virtual ~wxSFConnectionPoint ()
 Destructor.
CPTYPE GetType () const
 Get connection point type.
void SetParentShape (wxSFShapeBase *parent)
 Set parent shape.
wxSFShapeBaseGetParentShape () const
 Get parent shape.
void SetRelativePosition (const wxRealPoint &relpos)
 Set relative position of custom connection point.
const wxRealPoint & GetRelativePosition () const
 Get relative position of custom connection point.
wxRealPoint GetConnectionPoint () const
 Get absolute position of the connection point.
virtual bool Contains (const wxPoint &pos) const
 Find out whether given point is inside the connection point.
void Draw (wxDC &dc)
 Draw connection point.
void Refresh ()
 Refresh (repaint) the dock point.

Protected Member Functions

virtual void DrawNormal (wxDC &dc)
 Draw the connection point in the normal way. The function can be overrided if neccessary.
virtual void DrawHover (wxDC &dc)
 Draw the connection point in the hower mode (the mouse cursor is above the shape). The function can be overrided if neccessary.

Private Member Functions

void _OnMouseMove (const wxPoint &pos)
 Event handler called when the mouse pointer is moving above shape canvas.
void MarkSerializableDataMembers ()

Private Attributes

CPTYPE m_nType
wxSFShapeBasem_pParentShape
bool m_fMouseOver
wxRealPoint m_nRelPosition

Friends

class wxSFShapeBase

Detailed Description

Class encapsulating fixed connection point assignable to shapes. The assigned fixed connection points are the only places where connected lines can start/end.

See also:
wxSFShapeBase::AddConnectionPoint()

Member Enumeration Documentation

Connection point type.

Enumerator:
cpUNDEF 
cpTOPLEFT 
cpTOPMIDDLE 
cpTOPRIGHT 
cpCENTERLEFT 
cpCENTERMIDDLE 
cpCENTERRIGHT 
cpBOTTOMLEFT 
cpBOTTOMMIDDLE 
cpBOTTOMRIGHT 
cpCUSTOM 

Constructor & Destructor Documentation

Enhanced constructor.

Parameters:
parentPointer to parent shape
typeConnection point type
wxSFConnectionPoint::wxSFConnectionPoint ( wxSFShapeBase parent,
const wxRealPoint &  relpos,
long  id = -1 
)

Enhanced constructor.

Parameters:
parentPointer to parent shape
relposRelative position in percentages
idConnection point ID

Copy constructor.

Parameters:
objReference to source object
virtual wxSFConnectionPoint::~wxSFConnectionPoint ( ) [inline, virtual]

Destructor.


Member Function Documentation

void wxSFConnectionPoint::_OnMouseMove ( const wxPoint &  pos) [private]

Event handler called when the mouse pointer is moving above shape canvas.

Parameters:
posCurrent mouse position
virtual bool wxSFConnectionPoint::Contains ( const wxPoint &  pos) const [virtual]

Find out whether given point is inside the connection point.

Parameters:
posExamined point
Returns:
TRUE if the point is inside the handle, otherwise FALSE
void wxSFConnectionPoint::Draw ( wxDC &  dc)

Draw connection point.

Parameters:
dcDevice context where the handle will be drawn
virtual void wxSFConnectionPoint::DrawHover ( wxDC &  dc) [protected, virtual]

Draw the connection point 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
virtual void wxSFConnectionPoint::DrawNormal ( wxDC &  dc) [protected, virtual]

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

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

Get absolute position of the connection point.

Returns:
Absolute position of the connection point

Get parent shape.

Returns:
Pointer to parent shape
const wxRealPoint& wxSFConnectionPoint::GetRelativePosition ( ) const [inline]

Get relative position of custom connection point.

Returns:
Relative position in percentages

Get connection point type.

Returns:
Connection point type

Refresh (repaint) the dock point.

Set parent shape.

Parameters:
parentPointer to parent shape
void wxSFConnectionPoint::SetRelativePosition ( const wxRealPoint &  relpos) [inline]

Set relative position of custom connection point.

Parameters:
relposRelative position in percetnages

Friends And Related Function Documentation

friend class wxSFShapeBase [friend]

Member Data Documentation

wxRealPoint wxSFConnectionPoint::m_nRelPosition [private]

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