wxShapeFramework  1.13.0 beta
wxSFShapeHandle Class Reference

Class encapsulates shape's handle. The class shouldn't be used separately; see wxSFShapeBase class for more detailed information about functions used for managing of shape handles and handling their events. More...

#include <ShapeHandle.h>

Inheritance diagram for wxSFShapeHandle:
Collaboration diagram for wxSFShapeHandle:

Public Types

enum  HANDLETYPE {
  hndLEFTTOP , hndTOP , hndRIGHTTOP , hndRIGHT ,
  hndRIGHTBOTTOM , hndBOTTOM , hndLEFTBOTTOM , hndLEFT ,
  hndLINECTRL , hndLINESTART , hndLINEEND , hndUNDEF
}
 Handle type. More...
 

Public Member Functions

 DECLARE_DYNAMIC_CLASS (wxSFShapeHandle)
 
 wxSFShapeHandle (void)
 Default constructor. More...
 
 wxSFShapeHandle (wxSFShapeBase *parent, HANDLETYPE type, long id=-1)
 User constructor. More...
 
 wxSFShapeHandle (const wxSFShapeHandle &obj)
 Copy constructor. More...
 
virtual ~wxSFShapeHandle (void)
 Destructor. More...
 
wxPoint GetPosition () const
 Get current handle position. More...
 
wxPoint GetDelta () const
 Get current handle delta (difference between current and previous position). More...
 
wxPoint GetTotalDelta () const
 Get current total handle delta (difference between current and starting position stored at the begining of the dragging process). More...
 
void SetType (HANDLETYPE type)
 Set handle type. More...
 
HANDLETYPE GetType ()
 Get handle type. More...
 
void Show (bool show)
 Show/hide handle. More...
 
bool IsVisible ()
 Function returns TRUE if the handle is visible, otherwise FALSE. More...
 
wxSFShapeBaseGetParentShape ()
 Get parent shape. More...
 
void SetId (long id)
 Set handle's ID. More...
 
long GetId ()
 Get handle's ID. More...
 
void Refresh ()
 Refresh (repaint) the handle. More...
 
bool Contains (const wxPoint &pos)
 Find out whether given point is inside the handle. More...
 

Protected Member Functions

void Draw (wxDC &dc)
 Draw handle. More...
 
void DrawNormal (wxDC &dc)
 Draw handle in the normal way. More...
 
void DrawHover (wxDC &dc)
 Draw handle in the "hover" way (the mouse pointer is above the handle area). More...
 
void SetParentShape (wxSFShapeBase *parent)
 Set parent shape. More...
 
wxRect GetHandleRect () const
 Get handle rectangle. More...
 

Protected Attributes

HANDLETYPE m_nType
 
wxSFShapeBasem_pParentShape
 
bool m_fVisible
 
bool m_fMouseOver
 

Private Member Functions

void _OnMouseMove (const wxPoint &pos)
 Event handler called when the mouse pointer is moving above shape canvas. More...
 
void _OnBeginDrag (const wxPoint &pos)
 Event handler called when the handle is started to be dragged. More...
 
void _OnDragging (const wxPoint &pos)
 Event handler called when the handle is dragged. More...
 
void _OnEndDrag (const wxPoint &pos)
 Event handler called when the handle is released. More...
 

Private Attributes

wxPoint m_nStartPos
 
wxPoint m_nPrevPos
 
wxPoint m_nCurrPos
 
long m_nId
 

Friends

class wxSFShapeBase
 
class wxSFShapeCanvas
 

Detailed Description

Class encapsulates shape's handle. The class shouldn't be used separately; see wxSFShapeBase class for more detailed information about functions used for managing of shape handles and handling their events.

Member Enumeration Documentation

◆ HANDLETYPE

Handle type.

Enumerator
hndLEFTTOP 
hndTOP 
hndRIGHTTOP 
hndRIGHT 
hndRIGHTBOTTOM 
hndBOTTOM 
hndLEFTBOTTOM 
hndLEFT 
hndLINECTRL 
hndLINESTART 
hndLINEEND 
hndUNDEF 

Constructor & Destructor Documentation

◆ wxSFShapeHandle() [1/3]

wxSFShapeHandle::wxSFShapeHandle ( void  )

Default constructor.

◆ wxSFShapeHandle() [2/3]

wxSFShapeHandle::wxSFShapeHandle ( wxSFShapeBase parent,
HANDLETYPE  type,
long  id = -1 
)

User constructor.

Parameters
parentParent shape
typeHandle type
idHandle ID (usefull only for line controls handles)

◆ wxSFShapeHandle() [3/3]

wxSFShapeHandle::wxSFShapeHandle ( const wxSFShapeHandle obj)

Copy constructor.

Parameters
objSource object

◆ ~wxSFShapeHandle()

virtual wxSFShapeHandle::~wxSFShapeHandle ( void  )
virtual

Destructor.

Member Function Documentation

◆ _OnBeginDrag()

void wxSFShapeHandle::_OnBeginDrag ( const wxPoint &  pos)
private

Event handler called when the handle is started to be dragged.

Parameters
posCurrent mouse position

◆ _OnDragging()

void wxSFShapeHandle::_OnDragging ( const wxPoint &  pos)
private

Event handler called when the handle is dragged.

Parameters
posCurrent mouse position

◆ _OnEndDrag()

void wxSFShapeHandle::_OnEndDrag ( const wxPoint &  pos)
private

Event handler called when the handle is released.

Parameters
posCurrent mouse position

◆ _OnMouseMove()

void wxSFShapeHandle::_OnMouseMove ( const wxPoint &  pos)
private

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

Parameters
posCurrent mouse position

◆ Contains()

bool wxSFShapeHandle::Contains ( const wxPoint &  pos)

Find out whether given point is inside the handle.

Parameters
posExamined point
Returns
TRUE if the point is inside the handle, otherwise FALSE

◆ DECLARE_DYNAMIC_CLASS()

wxSFShapeHandle::DECLARE_DYNAMIC_CLASS ( wxSFShapeHandle  )

◆ Draw()

void wxSFShapeHandle::Draw ( wxDC &  dc)
protected

Draw handle.

Parameters
dcDevice context where the handle will be drawn

◆ DrawHover()

void wxSFShapeHandle::DrawHover ( wxDC &  dc)
protected

Draw handle in the "hover" way (the mouse pointer is above the handle area).

Parameters
dcDevice context where the handle will be drawn

◆ DrawNormal()

void wxSFShapeHandle::DrawNormal ( wxDC &  dc)
protected

Draw handle in the normal way.

Parameters
dcDevice context where the handle will be drawn

◆ GetDelta()

wxPoint wxSFShapeHandle::GetDelta ( ) const
inline

Get current handle delta (difference between current and previous position).

Returns
Handle delta

◆ GetHandleRect()

wxRect wxSFShapeHandle::GetHandleRect ( ) const
protected

Get handle rectangle.

Returns
Handle rectangle

◆ GetId()

long wxSFShapeHandle::GetId ( )
inline

Get handle's ID.

Returns
id Handle's ID

◆ GetParentShape()

wxSFShapeBase* wxSFShapeHandle::GetParentShape ( )
inline

Get parent shape.

Returns
Pointer to parent shape

◆ GetPosition()

wxPoint wxSFShapeHandle::GetPosition ( ) const
inline

Get current handle position.

Returns
Handle position

◆ GetTotalDelta()

wxPoint wxSFShapeHandle::GetTotalDelta ( ) const
inline

Get current total handle delta (difference between current and starting position stored at the begining of the dragging process).

Returns
Total handle delta

◆ GetType()

HANDLETYPE wxSFShapeHandle::GetType ( )
inline

Get handle type.

Returns
Handle type
See also
HANDLETYPE

◆ IsVisible()

bool wxSFShapeHandle::IsVisible ( )
inline

Function returns TRUE if the handle is visible, otherwise FALSE.

◆ Refresh()

void wxSFShapeHandle::Refresh ( )

Refresh (repaint) the handle.

◆ SetId()

void wxSFShapeHandle::SetId ( long  id)
inline

Set handle's ID.

Parameters
idHandle's ID

◆ SetParentShape()

void wxSFShapeHandle::SetParentShape ( wxSFShapeBase parent)
inlineprotected

Set parent shape.

Parameters
parentPointer to parent shape

◆ SetType()

void wxSFShapeHandle::SetType ( HANDLETYPE  type)
inline

Set handle type.

Parameters
typeHandle type
See also
HANDLETYPE

◆ Show()

void wxSFShapeHandle::Show ( bool  show)
inline

Show/hide handle.

Parameters
showTRUE if the handle should be visible (active), otherwise FALSE

Friends And Related Function Documentation

◆ wxSFShapeBase

friend class wxSFShapeBase
friend

◆ wxSFShapeCanvas

friend class wxSFShapeCanvas
friend

Member Data Documentation

◆ m_fMouseOver

bool wxSFShapeHandle::m_fMouseOver
protected

◆ m_fVisible

bool wxSFShapeHandle::m_fVisible
protected

◆ m_nCurrPos

wxPoint wxSFShapeHandle::m_nCurrPos
private

◆ m_nId

long wxSFShapeHandle::m_nId
private

◆ m_nPrevPos

wxPoint wxSFShapeHandle::m_nPrevPos
private

◆ m_nStartPos

wxPoint wxSFShapeHandle::m_nStartPos
private

◆ m_nType

HANDLETYPE wxSFShapeHandle::m_nType
protected

◆ m_pParentShape

wxSFShapeBase* wxSFShapeHandle::m_pParentShape
protected

The documentation for this class was generated from the following file: