wxShapeEvtHandler is a class from which wxShape (and therefore all shape classes) are derived. A wxShape also contains a pointer to its current wxShapeEvtHandler. Event handlers can be swapped in and out, altering the behaviour of a shape. This allows, for example, a range of behaviours to be redefined in one class, rather than requiring each shape class to be subclassed.
Derived from
wxObject
Members
wxShapeEvtHandler::m_handlerShape
wxShapeEvtHandler::m_previousHandler
wxShapeEvtHandler::wxShapeEvtHandler
wxShapeEvtHandler::~wxShapeEvtHandler
wxShapeEvtHandler::CopyData
wxShapeEvtHandler::CreateNewCopy
wxShapeEvtHandler::GetPreviousHandler
wxShapeEvtHandler::GetShape
wxShapeEvtHandler::OnBeginDragLeft
wxShapeEvtHandler::OnBeginDragRight
wxShapeEvtHandler::OnBeginSize
wxShapeEvtHandler::OnChangeAttachment
wxShapeEvtHandler::OnDragLeft
wxShapeEvtHandler::OnDragRight
wxShapeEvtHandler::OnDraw
wxShapeEvtHandler::OnDrawContents
wxShapeEvtHandler::OnDrawControlPoints
wxShapeEvtHandler::OnDrawOutline
wxShapeEvtHandler::OnEndDragLeft
wxShapeEvtHandler::OnEndDragRight
wxShapeEvtHandler::OnEndSize
wxShapeEvtHandler::OnErase
wxShapeEvtHandler::OnEraseContents
wxShapeEvtHandler::OnEraseControlPoints
wxShapeEvtHandler::OnHighlight
wxShapeEvtHandler::OnLeftClick
wxShapeEvtHandler::OnMoveLink
wxShapeEvtHandler::OnMoveLinks
wxShapeEvtHandler::OnMovePost
wxShapeEvtHandler::OnMovePre
wxShapeEvtHandler::OnRightClick
wxShapeEvtHandler::OnSize
wxShapeEvtHandler::OnSizingBeginDragLeft
wxShapeEvtHandler::OnSizingDragLeft
wxShapeEvtHandler::OnSizingEndDragLeft
wxShapeEvtHandler::SetPreviousHandler
wxShapeEvtHandler::SetShape
wxShape* m_handlerShape
Pointer to the shape associated with this handler.
wxShapeEvtHandler* m_previousHandler
Pointer to the previous handler.
void wxShapeEvtHandler(wxShapeEvtHandler *previous = NULL, wxShape *shape = NULL)
Constructs a new event handler.
void ~wxShapeEvtHandler()
Destructor.
void CopyData(wxShapeEvtHandler& handler)
A virtual function to copy the data from this object to handler. Override if you derive from wxShapeEvtHandler and have data to copy.
wxShapeEvtHandler* CreateNewCopy()
Creates a new event handler object of the same class as this object, and then calls wxShapeEvtHandler::CopyData.
wxShapeEvtHandler* GetPreviousHandler() const
Returns the previous handler.
wxShape* GetShape() const
Returns the shape associated with this handler.
void OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0)
Called when the user is beginning to drag using the left mouse button.
void OnBeginDragRight(double x, double y, int keys=0, int attachment = 0)
Called when the user is beginning to drag using the right mouse button.
void OnBeginSize(double width, double height)
Called when a shape starts to be resized.
void OnChangeAttachment(int attachment, wxLineShape* line, wxList& ordering)
Override this to prevent or intercept line reordering. wxShape's implementation of this function calls wxShape::ApplyAttachmentOrdering to apply the new ordering.
void OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0)
Called twice when the shape is being dragged, once to allow erasing the old image, and again to allow drawing at the new position.
void OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0)
Called twice when the shape is being dragged, once to allow erasing the old image, and again to allow drawing at the new position.
void OnDraw(wxDC& dc)
Defined for each class to draw the main graphic, but not the contents.
void OnDrawContents(wxDC& dc)
Defined for each class to draw the contents of the shape, such as text.
void OnDrawControlPoints(wxDC& dc)
Called when the shape's control points (handles) should be drawn.
void OnDrawOutline(wxDC& dc)
Called when the outline of the shape should be drawn.
void OnEndDragLeft(double x, double y, int keys=0, int attachment = 0)
Called when the user is stopping dragging using the left mouse button.
void OnEndDragRight(double x, double y, int keys=0, int attachment = 0)
Called when the user is stopping dragging using the right mouse button.
void OnEndSize(double width, double height)
Called after a shape is resized.
void OnErase(wxDC& dc)
Called when the whole shape should be erased.
void OnEraseContents(wxDC& dc)
Called when the contents should be erased.
void OnEraseControlPoints(wxDC& dc)
Called when the shape's control points (handles) should be erased.
void OnHighlight(wxDC& dc)
Called when the shape should be highlighted.
void OnLeftClick(double x, double y, int keys =0, int attachment = 0)
Called when the shape receives a left mouse click event.
void OnMoveLink(wxDC& dc, bool moveControlPoints=TRUE)
Called when the line attached to an shape need to be repositioned, because the shape has moved.
void OnMoveLinks(wxDC& dc)
Called when the lines attached to an shape need to be repositioned, because the shape has moved.
bool OnMovePost(wxDC& dc, double x, double y, double oldX, double oldY, bool display = TRUE)
Called just after the shape receives a move request.
bool OnMovePre(wxDC& dc, double x, double y, double oldX, double oldY, bool display = TRUE)
Called just before the shape receives a move request. Returning TRUE allows the move to be processed; returning FALSE vetoes the move.
void OnRightClick(double x, double y, int keys = 0, int attachment = 0)
Called when the shape receives a mouse mouse click event.
void OnSize(double x, double y)
Called when the shape receives a resize request.
void OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, int keys=0, int attachment = 0)
Called when a sizing drag is beginning.
void OnSizingDragLeft(wxControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0)
Called when a sizing drag is occurring.
void OnSizingEndDragLeft(wxControlPoint* pt, double x, double y, int keys=0, int attachment = 0)
Called when a sizing drag is ending.
void SetPreviousHandler(wxShapeEvtHandler* handler)
Sets the previous handler.
void SetShape(wxShape* shape)
Sets the shape for this handler.