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>

Collaboration diagram for wxSFShapeHandle:

List of all members.

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

Protected Member Functions

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

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.
void _OnBeginDrag (const wxPoint &pos)
 Event handler called when the handle is started to be dragged.
void _OnDragging (const wxPoint &pos)
 Event handler called when the handle is dragged.
void _OnEndDrag (const wxPoint &pos)
 Event handler called when the handle is released.

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

Handle type.

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

Constructor & Destructor Documentation

Default constructor.

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

User constructor.

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

Copy constructor.

Parameters:
objSource object
virtual wxSFShapeHandle::~wxSFShapeHandle ( void  ) [virtual]

Destructor.


Member Function Documentation

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

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

Parameters:
posCurrent mouse position
void wxSFShapeHandle::_OnDragging ( const wxPoint &  pos) [private]

Event handler called when the handle is dragged.

Parameters:
posCurrent mouse position
void wxSFShapeHandle::_OnEndDrag ( const wxPoint &  pos) [private]

Event handler called when the handle is released.

Parameters:
posCurrent mouse position
void wxSFShapeHandle::_OnMouseMove ( const wxPoint &  pos) [private]

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

Parameters:
posCurrent mouse position
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
void wxSFShapeHandle::Draw ( wxDC &  dc) [protected]

Draw handle.

Parameters:
dcDevice context where the handle will be drawn
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
void wxSFShapeHandle::DrawNormal ( wxDC &  dc) [protected]

Draw handle in the normal way.

Parameters:
dcDevice context where the handle will be drawn
wxPoint wxSFShapeHandle::GetDelta ( ) const [inline]

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

Returns:
Handle delta
wxRect wxSFShapeHandle::GetHandleRect ( ) const [protected]

Get handle rectangle.

Returns:
Handle rectangle
long wxSFShapeHandle::GetId ( ) [inline]

Get handle's ID.

Returns:
id Handle's ID

Get parent shape.

Returns:
Pointer to parent shape
wxPoint wxSFShapeHandle::GetPosition ( ) const [inline]

Get current handle position.

Returns:
Handle position
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

Get handle type.

Returns:
Handle type
See also:
HANDLETYPE
bool wxSFShapeHandle::IsVisible ( ) [inline]

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

Refresh (repaint) the handle.

void wxSFShapeHandle::SetId ( long  id) [inline]

Set handle's ID.

Parameters:
idHandle's ID
void wxSFShapeHandle::SetParentShape ( wxSFShapeBase parent) [inline, protected]

Set parent shape.

Parameters:
parentPointer to parent shape
void wxSFShapeHandle::SetType ( HANDLETYPE  type) [inline]

Set handle type.

Parameters:
typeHandle type
See also:
HANDLETYPE
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

friend class wxSFShapeBase [friend]
friend class wxSFShapeCanvas [friend]

Member Data Documentation

bool wxSFShapeHandle::m_fVisible [protected]
wxPoint wxSFShapeHandle::m_nCurrPos [private]
long wxSFShapeHandle::m_nId [private]
wxPoint wxSFShapeHandle::m_nPrevPos [private]
wxPoint wxSFShapeHandle::m_nStartPos [private]

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