wxShapeFramework
1.13.0 beta
|
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>
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. | |
wxSFShapeBase * | GetParentShape () |
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 |
wxSFShapeBase * | m_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 |
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.
wxSFShapeHandle::wxSFShapeHandle | ( | void | ) |
Default constructor.
wxSFShapeHandle::wxSFShapeHandle | ( | wxSFShapeBase * | parent, |
HANDLETYPE | type, | ||
long | id = -1 |
||
) |
User constructor.
parent | Parent shape |
type | Handle type |
id | Handle ID (usefull only for line controls handles) |
wxSFShapeHandle::wxSFShapeHandle | ( | const wxSFShapeHandle & | obj | ) |
Copy constructor.
obj | Source object |
virtual wxSFShapeHandle::~wxSFShapeHandle | ( | void | ) | [virtual] |
Destructor.
void wxSFShapeHandle::_OnBeginDrag | ( | const wxPoint & | pos | ) | [private] |
Event handler called when the handle is started to be dragged.
pos | Current mouse position |
void wxSFShapeHandle::_OnDragging | ( | const wxPoint & | pos | ) | [private] |
Event handler called when the handle is dragged.
pos | Current mouse position |
void wxSFShapeHandle::_OnEndDrag | ( | const wxPoint & | pos | ) | [private] |
Event handler called when the handle is released.
pos | Current mouse position |
void wxSFShapeHandle::_OnMouseMove | ( | const wxPoint & | pos | ) | [private] |
Event handler called when the mouse pointer is moving above shape canvas.
pos | Current mouse position |
bool wxSFShapeHandle::Contains | ( | const wxPoint & | pos | ) |
Find out whether given point is inside the handle.
pos | Examined point |
void wxSFShapeHandle::Draw | ( | wxDC & | dc | ) | [protected] |
Draw handle.
dc | Device 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).
dc | Device context where the handle will be drawn |
void wxSFShapeHandle::DrawNormal | ( | wxDC & | dc | ) | [protected] |
Draw handle in the normal way.
dc | Device context where the handle will be drawn |
wxPoint wxSFShapeHandle::GetDelta | ( | ) | const [inline] |
Get current handle delta (difference between current and previous position).
wxRect wxSFShapeHandle::GetHandleRect | ( | ) | const [protected] |
Get handle rectangle.
long wxSFShapeHandle::GetId | ( | ) | [inline] |
Get handle's ID.
wxSFShapeBase* wxSFShapeHandle::GetParentShape | ( | ) | [inline] |
Get parent shape.
wxPoint wxSFShapeHandle::GetPosition | ( | ) | const [inline] |
Get current 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).
HANDLETYPE wxSFShapeHandle::GetType | ( | ) | [inline] |
bool wxSFShapeHandle::IsVisible | ( | ) | [inline] |
Function returns TRUE if the handle is visible, otherwise FALSE.
void wxSFShapeHandle::Refresh | ( | ) |
Refresh (repaint) the handle.
void wxSFShapeHandle::SetId | ( | long | id | ) | [inline] |
Set handle's ID.
id | Handle's ID |
void wxSFShapeHandle::SetParentShape | ( | wxSFShapeBase * | parent | ) | [inline, protected] |
Set parent shape.
parent | Pointer to parent shape |
void wxSFShapeHandle::SetType | ( | HANDLETYPE | type | ) | [inline] |
void wxSFShapeHandle::Show | ( | bool | show | ) | [inline] |
Show/hide handle.
show | TRUE if the handle should be visible (active), otherwise FALSE |
friend class wxSFShapeBase [friend] |
friend class wxSFShapeCanvas [friend] |
bool wxSFShapeHandle::m_fMouseOver [protected] |
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] |
HANDLETYPE wxSFShapeHandle::m_nType [protected] |
wxSFShapeBase* wxSFShapeHandle::m_pParentShape [protected] |