wxShapeFramework  1.13.0 beta
wxSFShapeBase Class Reference

Base class for all shapes providing fundamental functionality and publishing set of virtual functions which must be defined by the user in derived shapes. This class shouldn't be used as it is. More...

#include <ShapeBase.h>

Inheritance diagram for wxSFShapeBase:
Collaboration diagram for wxSFShapeBase:

Public Types

enum  BBMODE {
  bbSELF = 1 , bbCHILDREN = 2 , bbCONNECTIONS = 4 , bbSHADOW = 8 ,
  bbALL = 15
}
 Bit flags for wxSFShapeBase::GetCompleteBoundingBox function. More...
 
enum  CONNECTMODE { lineSTARTING , lineENDING , lineBOTH }
 Search mode flags for GetAssignedConnections function. More...
 
enum  VALIGN {
  valignNONE , valignTOP , valignMIDDLE , valignBOTTOM ,
  valignEXPAND , valignLINE_START , valignLINE_END
}
 Flags for SetVAlign function. More...
 
enum  HALIGN {
  halignNONE , halignLEFT , halignCENTER , halignRIGHT ,
  halignEXPAND , halignLINE_START , halignLINE_END
}
 Flags for SetHAlign function. More...
 
enum  STYLE {
  sfsPARENT_CHANGE = 1 , sfsPOSITION_CHANGE = 2 , sfsSIZE_CHANGE = 4 , sfsHOVERING = 8 ,
  sfsHIGHLIGHTING = 16 , sfsALWAYS_INSIDE = 32 , sfsDELETE_USER_DATA = 64 , sfsPROCESS_DEL = 128 ,
  sfsSHOW_HANDLES = 256 , sfsSHOW_SHADOW = 512 , sfsLOCK_CHILDREN = 1024 , sfsEMIT_EVENTS = 2048 ,
  sfsPROPAGATE_DRAGGING = 4096 , sfsPROPAGATE_SELECTION = 8192 , sfsPROPAGATE_INTERACTIVE_CONNECTION = 16384 , sfsNO_FIT_TO_CHILDREN = 32768 ,
  sfsPROPAGATE_HOVERING = 65536 , sfsPROPAGATE_HIGHLIGHTING = 131072 , sfsDEFAULT_SHAPE_STYLE = sfsPARENT_CHANGE | sfsPOSITION_CHANGE | sfsSIZE_CHANGE | sfsHOVERING | sfsHIGHLIGHTING | sfsSHOW_HANDLES | sfsALWAYS_INSIDE | sfsDELETE_USER_DATA
}
 Basic shape's styles used with SetStyle() function. More...
 
- Public Types inherited from xsSerializable
enum  SEARCHMODE { searchDFS , searchBFS }
 

Public Member Functions

 XS_DECLARE_CLONABLE_CLASS (wxSFShapeBase)
 
 wxSFShapeBase (void)
 Basic constructor. More...
 
 wxSFShapeBase (const wxRealPoint &pos, wxSFDiagramManager *manager)
 Enhanced constructor. More...
 
 wxSFShapeBase (const wxSFShapeBase &obj)
 Copy constructor. More...
 
virtual ~wxSFShapeBase (void)
 Destructor. More...
 
void Refresh (bool delayed=false)
 Refresh (redraw) the shape. More...
 
virtual void Draw (wxDC &dc, bool children=sfWITHCHILDREN)
 Draw shape. Default implementation tests basic shape visual states (normal/ready, mouse is over the shape, dragged shape can be accepted) and call appropriate virtual functions (DrawNormal, DrawHover, DrawHighlighted) for its visualisation. The function can be overrided if neccessary. More...
 
virtual bool Contains (const wxPoint &pos)
 
virtual bool IsInside (const wxRect &rct)
 
virtual bool Intersects (const wxRect &rct)
 Test whether the given rectangle intersects the shape. More...
 
virtual wxRealPoint GetAbsolutePosition ()
 Get the shape's absolute position in the canvas (calculated as a sumation of all relative positions in the shapes' hierarchy. The function can be overrided if neccessary. More...
 
virtual wxRealPoint GetBorderPoint (const wxRealPoint &start, const wxRealPoint &end)
 
virtual wxRealPoint GetCenter ()
 Get shape's center. Default implementation does nothing. The function can be overrided if neccessary. More...
 
virtual void CreateHandles ()
 
void ShowHandles (bool show)
 Show/hide shape handles. Hidden handles are inactive. More...
 
void SetStyle (long style)
 Set shape's style. More...
 
long GetStyle () const
 Get current shape style. More...
 
void AddStyle (STYLE style)
 
void RemoveStyle (STYLE style)
 
bool ContainsStyle (STYLE style) const
 
void GetChildShapes (wxClassInfo *type, ShapeList &children, bool recursive=false, xsSerializable::SEARCHMODE mode=xsSerializable::searchBFS)
 
void GetNeighbours (ShapeList &neighbours, wxClassInfo *shapeInfo, CONNECTMODE condir, bool direct=true)
 Get neighbour shapes connected to this shape. More...
 
void GetAssignedConnections (wxClassInfo *shapeInfo, wxSFShapeBase::CONNECTMODE mode, ShapeList &lines)
 Get list of connections assigned to this shape. More...
 
virtual wxRect GetBoundingBox ()
 
void GetCompleteBoundingBox (wxRect &rct, int mask=bbALL)
 Get shape's bounding box which includes also associated child shapes and connections. More...
 
virtual void Scale (double x, double y, bool children=sfWITHCHILDREN)
 
void Scale (const wxRealPoint &scale, bool children=sfWITHCHILDREN)
 
void ScaleChildren (double x, double y)
 Scale shape's children. More...
 
virtual void MoveTo (double x, double y)
 Move the shape to the given absolute position. The function can be overrided if necessary. More...
 
void MoveTo (const wxRealPoint &pos)
 Move the shape to the given absolute position. More...
 
virtual void MoveBy (double x, double y)
 Move the shape by the given offset. The function can be overrided if neccessary. More...
 
void MoveBy (const wxRealPoint &delta)
 Move the shape by the given offset. More...
 
void DoAlignment ()
 Update the shape's position in order to its alignment. More...
 
virtual void Update ()
 Upate shape (align all child shapes an resize it to fit them) More...
 
virtual void FitToChildren ()
 Resize the shape to bound all child shapes. The function can be overrided if neccessary. More...
 
bool IsSelected () const
 Function returns TRUE if the shape is selected, otherwise returns FALSE. More...
 
void Select (bool state)
 Set the shape as a selected/deselected one. More...
 
void SetRelativePosition (const wxRealPoint &pos)
 
void SetRelativePosition (double x, double y)
 
wxRealPoint GetRelativePosition () const
 
void SetVAlign (VALIGN val)
 Set vertical alignment of this shape inside its parent. More...
 
VALIGN GetVAlign () const
 Get vertical alignment of this shape inside its parent. More...
 
void SetHAlign (HALIGN val)
 Set horizontal alignment of this shape inside its parent. More...
 
HALIGN GetHAlign () const
 Get horizontal alignment of this shape inside its parent. More...
 
void SetVBorder (double border)
 Set vertical border between this shape and its parent (is vertical alignment is set). More...
 
double GetVBorder () const
 Get vertical border between this shape and its parent (is vertical alignment is set). More...
 
void SetHBorder (double border)
 Set horizontal border between this shape and its parent (is horizontal alignment is set). More...
 
double GetHBorder () const
 Get horizontal border between this shape and its parent (is horizontal alignment is set). More...
 
void SetCustomDockPoint (int dp)
 Set custom dock point used if the shape is child shape of a line shape. More...
 
int GetCustomDockPoint ()
 Get custom dock point used if the shape is child shape of a line shape. More...
 
wxSFShapeBaseGetParentShape ()
 Get pointer to a parent shape. More...
 
wxSFShapeBaseGetGrandParentShape ()
 Get pointer to the topmost parent shape. More...
 
bool IsAncestor (wxSFShapeBase *child)
 Determine whether this shape is ancestor of given child shape. More...
 
bool IsDescendant (wxSFShapeBase *parent)
 Determine whether this shape is descendant of given parent shape. More...
 
void SetUserData (xsSerializable *data)
 Associate user data with the shape. More...
 
xsSerializableGetUserData ()
 Get associated user data. More...
 
wxSFDiagramManagerGetShapeManager ()
 Get shape's parent diagram manager. More...
 
wxSFShapeCanvasGetParentCanvas ()
 Get shape's parent canvas. More...
 
bool IsVisible () const
 Get the shape's visibility status. More...
 
void Show (bool show)
 Show/hide shape. More...
 
void SetHoverColour (const wxColour &col)
 Set shape's hover color. More...
 
wxColour GetHoverColour () const
 Get shape's hover color. More...
 
bool IsActive () const
 Function returns value of a shape's activation flag. More...
 
void Activate (bool active)
 Shape's activation/deactivation. More...
 
bool IsChildAccepted (const wxString &type)
 Tells whether the given shape type is accepted by this shape (it means whether this shape can be its parent). More...
 
bool AcceptCurrentlyDraggedShapes ()
 Function returns TRUE if all currently dragged shapes can be accepted as children of this shape. More...
 
void AcceptChild (const wxString &type)
 Add given shape type to an acceptance list. The acceptance list contains class names of the shapes which can be accepted as children of this shape. Note: Keyword 'All' behaves like any class name. More...
 
wxArrayString & GetAcceptedChildren ()
 Get shape types acceptance list. More...
 
bool IsConnectionAccepted (const wxString &type)
 Tells whether the given connection type is accepted by this shape (it means whether this shape can be connected to another one by a connection of given type). More...
 
void AcceptConnection (const wxString &type)
 Add given connection type to an acceptance list. The acceptance list contains class names of the connection which can be accepted by this shape. Note: Keyword 'All' behaves like any class name. More...
 
wxArrayString & GetAcceptedConnections ()
 Get connection types acceptance list. More...
 
bool IsSrcNeighbourAccepted (const wxString &type)
 Tells whether the given shape type is accepted by this shape as its source neighbour(it means whether this shape can be connected from another one of given type). More...
 
void AcceptSrcNeighbour (const wxString &type)
 Add given shape type to an source neighbours' acceptance list. The acceptance list contains class names of the shape types which can be accepted by this shape as its source neighbour. Note: Keyword 'All' behaves like any class name. More...
 
wxArrayString & GetAcceptedSrcNeighbours ()
 Get source neighbour types acceptance list. More...
 
bool IsTrgNeighbourAccepted (const wxString &type)
 Tells whether the given shape type is accepted by this shape as its target neighbour(it means whether this shape can be connected to another one of given type). More...
 
void AcceptTrgNeighbour (const wxString &type)
 Add given shape type to an target neighbours' acceptance list. The acceptance list contains class names of the shape types which can be accepted by this shape as its target neighbour. Note: Keyword 'All' behaves like any class name. More...
 
wxArrayString & GetAcceptedTrgNeighbours ()
 Get target neighbour types acceptance list. More...
 
void ClearAcceptedChilds ()
 Clear shape object acceptance list. More...
 
void ClearAcceptedConnections ()
 Clear connection object acceptance list. More...
 
void ClearAcceptedSrcNeighbours ()
 Clear source neighbour objects acceptance list. More...
 
void ClearAcceptedTrgNeighbours ()
 Clear target neighbour objects acceptance list. More...
 
HandleList & GetHandles ()
 Get list of currently assigned shape handles. More...
 
wxSFShapeHandleGetHandle (wxSFShapeHandle::HANDLETYPE type, long id=-1)
 Get shape handle. More...
 
void AddHandle (wxSFShapeHandle::HANDLETYPE type, long id=-1)
 Add new handle to the shape. More...
 
void RemoveHandle (wxSFShapeHandle::HANDLETYPE type, long id=-1)
 Remove given shape handle (if exists). More...
 
ConnectionPointListGetConnectionPoints ()
 Get reference to connection points list. More...
 
wxSFConnectionPointGetConnectionPoint (wxSFConnectionPoint::CPTYPE type, long id=-1)
 Get connection point of given type assigned to the shape. More...
 
wxSFConnectionPointGetNearestConnectionPoint (const wxRealPoint &pos)
 Get connection point closest to the diven position. More...
 
wxSFConnectionPointAddConnectionPoint (wxSFConnectionPoint::CPTYPE type, bool persistent=true)
 Assign connection point of given type to the shape. More...
 
void AddConnectionPoint (wxSFConnectionPoint *cp, bool persistent=true)
 Assigned given connection point to the shape. More...
 
wxSFConnectionPointAddConnectionPoint (const wxRealPoint &relpos, long id=-1, bool persistent=true)
 Assign custom connection point to the shape. More...
 
void RemoveConnectionPoint (wxSFConnectionPoint::CPTYPE type)
 Remove connection point of given type from the shape (if pressent). More...
 
virtual void OnLeftClick (const wxPoint &pos)
 Event handler called when the shape is clicked by the left mouse button. The function can be overrided if necessary. More...
 
virtual void OnRightClick (const wxPoint &pos)
 Event handler called when the shape is clicked by the right mouse button. The function can be overrided if necessary. More...
 
virtual void OnLeftDoubleClick (const wxPoint &pos)
 Event handler called when the shape is double-clicked by the left mouse button. The function can be overrided if necessary. More...
 
virtual void OnRightDoubleClick (const wxPoint &pos)
 Event handler called when the shape is double-clicked by the right mouse button. The function can be overrided if necessary. More...
 
virtual void OnBeginDrag (const wxPoint &pos)
 Event handler called at the begining of the shape dragging process. The function can be overrided if necessary. More...
 
virtual void OnDragging (const wxPoint &pos)
 Event handler called during the shape dragging process. The function can be overrided if necessary. More...
 
virtual void OnEndDrag (const wxPoint &pos)
 Event handler called at the end of the shape dragging process. The function can be overrided if necessary. More...
 
virtual void OnBeginHandle (wxSFShapeHandle &handle)
 Event handler called when the user started to drag the shape handle. The function can be overrided if necessary. More...
 
virtual void OnHandle (wxSFShapeHandle &handle)
 Event handler called during dragging of the shape handle. The function can be overrided if necessary. More...
 
virtual void OnEndHandle (wxSFShapeHandle &handle)
 Event handler called when the user finished dragging of the shape handle. The function can be overrided if necessary. More...
 
virtual void OnMouseEnter (const wxPoint &pos)
 Event handler called when a mouse pointer enters the shape area. The function can be overrided if necessary. More...
 
virtual void OnMouseOver (const wxPoint &pos)
 Event handler called when a mouse pointer moves above the shape area. The function can be overrided if necessary. More...
 
virtual void OnMouseLeave (const wxPoint &pos)
 Event handler called when a mouse pointer leaves the shape area. The function can be overrided if necessary. More...
 
virtual bool OnKey (int key)
 Event handler called when any key is pressed (in the shape canvas). The function can be overrided if necessary. More...
 
virtual void OnChildDropped (const wxRealPoint &pos, wxSFShapeBase *child)
 Event handler called when any shape is dropped above this shape (and the dropped shape is accepted as a child of this shape). The function can be overrided if necessary. More...
 
- Public Member Functions inherited from xsSerializable
 XS_DECLARE_CLONABLE_CLASS (xsSerializable)
 
 xsSerializable ()
 Constructor. More...
 
 xsSerializable (const xsSerializable &obj)
 Copy constructor. More...
 
 ~xsSerializable ()
 Destructor. More...
 
xsSerializableGetParent ()
 Get serializable parent object. More...
 
wxXmlSerializerGetParentManager ()
 Get parent data manager (instance of wxXmlSerializer). More...
 
xsSerializableGetFirstChild ()
 Get first serializable child object. More...
 
xsSerializableGetFirstChild (wxClassInfo *type)
 Get first serializable child object of given type. More...
 
xsSerializableGetLastChild ()
 Get last serializable child object. More...
 
xsSerializableGetLastChild (wxClassInfo *type)
 Get last serializable child object of given type. More...
 
xsSerializableGetSibbling ()
 Get next serializable sibbling object. More...
 
xsSerializableGetSibbling (wxClassInfo *type)
 Get next serializable sibbling object of given type. More...
 
xsSerializableGetChild (long id, bool recursive=xsNORECURSIVE)
 Get child item with given ID if exists. More...
 
bool HasChildren () const
 Function finds out whether this serializable item has some children. More...
 
SerializableListGetChildrenList ()
 Get list of children (serializable objects) of this object. More...
 
void GetChildren (wxClassInfo *type, SerializableList &list)
 Get children of given type. More...
 
void GetChildrenRecursively (wxClassInfo *type, SerializableList &list, SEARCHMODE mode=searchBFS)
 Get all children of given type recursively (i.e. children of children of .... ). More...
 
SerializableList::compatibility_iterator GetFirstChildNode () const
 Get pointer to list node containing first serializable child object. More...
 
SerializableList::compatibility_iterator GetLastChildNode () const
 Get pointer to list node containing last serializable child object. More...
 
void SetParent (xsSerializable *parent)
 Set serializable parent object. More...
 
void SetParentManager (wxXmlSerializer *parent)
 Set parent data manager. More...
 
xsSerializableAddChild (xsSerializable *child)
 Add serializable child object to this object. More...
 
xsSerializableInsertChild (size_t pos, xsSerializable *child)
 Insert serializable child object to this object at given position. More...
 
void RemoveChild (xsSerializable *child)
 Remove serializable child item from this object (the child item will be destroyed). More...
 
void RemoveChildren ()
 Remove all child items (all items will be destroyed). More...
 
void Reparent (xsSerializable *parent)
 Assign this object as a child to given parent object. More...
 
void SetId (long id)
 Set ID of this object. Can be used for further objects' handling by wxXmlSerializer class (default ID value is -1). This functions should NOT be used directly; it is called by wxXmlSerializer object in the case that this serializable object is attached to another one (or directly to root node of wxXmlSerializer) by wxXmlSerializer::AddItem() member function. More...
 
long GetId () const
 Get object ID. More...
 
wxXmlNode * SerializeObject (wxXmlNode *node)
 Create new 'object' XML node and serialize all marked class data members (properties) into it. More...
 
void DeserializeObject (wxXmlNode *node)
 Deserialize marked class data members (properties) from appropriate fields of given parent 'object' XML node. More...
 
void AddProperty (xsProperty *property)
 Add new property to the property list. More...
 
void RemoveProperty (xsProperty *property)
 Remove given property from the property list. More...
 
xsPropertyGetProperty (const wxString &field)
 Get serialized property of given name. More...
 
PropertyList & GetProperties ()
 Get reference to properties list. More...
 
void EnablePropertySerialization (const wxString &field, bool enab)
 Enable/disable serialization of given property. More...
 
bool IsPropertySerialized (const wxString &field)
 Returns information whether the given property is serialized or not. More...
 
void EnableSerialization (bool enab)
 Enable/disable object serialization. More...
 
bool IsSerialized () const
 Returns information whether the object can be serialized or not. More...
 
void EnableCloning (bool enab)
 Enable/disable object cloning. More...
 
bool IsCloningEnabled () const
 Returns information whether the object can be cloned or not. More...
 
xsSerializableoperator<< (xsSerializable *child)
 Add serializable child object to this object. More...
 

Protected Member Functions

virtual void DrawNormal (wxDC &dc)
 Draw the shape in the normal way. The function can be overrided if neccessary. More...
 
virtual void DrawSelected (wxDC &dc)
 Draw the shape in the selected way. The function can be overrided if neccessary. More...
 
virtual void DrawHover (wxDC &dc)
 Draw the shape in the hower mode (the mouse cursor is above the shape). The function can be overrided if neccessary. More...
 
virtual void DrawHighlighted (wxDC &dc)
 Draw the shape in the highlighted mode (another shape is dragged over this shape and this shape will accept the dragged one if it will be dropped on it). The function can be overrided if neccessary. More...
 
virtual void DrawShadow (wxDC &dc)
 Draw shadow under the shape. The function can be overrided if neccessary. More...
 
virtual wxXmlNode * Serialize (wxXmlNode *node)
 Serialize shape's properties to the given XML node. The serialization routine is automatically called by the framework and should take care about serialization of all specific (non-standard) shape's properties. More...
 
virtual void Deserialize (wxXmlNode *node)
 Deserialize shape's properties from the given XML node. The routine is automatically called by the framework and should take care about deserialization of all specific (non-standard) shape's properties. More...
 
void Refresh (const wxRect &rct, bool delayed=false)
 Repaint the shape. More...
 
wxRealPoint GetParentAbsolutePosition ()
 Get absolute position of the shape parent. More...
 
- Protected Member Functions inherited from xsSerializable
void InitChild (xsSerializable *child)
 Initialize new child object. More...
 

Protected Attributes

bool m_fSelected
 Selection flag. More...
 
bool m_fVisible
 Visibility flag. More...
 
bool m_fActive
 Activation flag. More...
 
long m_nStyle
 Shape's style mask. More...
 
wxColour m_nHoverColor
 
wxRealPoint m_nRelativePosition
 
wxArrayString m_arrAcceptedChildren
 String list with class names of accepted child shapes. More...
 
wxArrayString m_arrAcceptedConnections
 String list with class names of accepted connections. More...
 
wxArrayString m_arrAcceptedSrcNeighbours
 String list with class names of accepted source neighbour shapes. More...
 
wxArrayString m_arrAcceptedTrgNeighbours
 String list with class names of accepted target neighbour shapes. More...
 
double m_nVBorder
 Value of vertical border used by AlignV function. More...
 
double m_nHBorder
 Value of horizontal border used by AlignH function. More...
 
VALIGN m_nVAlign
 Vertical alignment of child shapes. More...
 
HALIGN m_nHAlign
 Horizontal alignment of child shapes. More...
 
int m_nCustomDockPoint
 Custom line dock point. More...
 
HandleList m_lstHandles
 Handle list. More...
 
ConnectionPointList m_lstConnectionPts
 
xsSerializablem_pUserData
 Container for serializable user data associated with the shape. More...
 
- Protected Attributes inherited from xsSerializable
PropertyList m_lstProperties
 List of serialized properties. More...
 
SerializableList m_lstChildItems
 List of child objects. More...
 
xsSerializablem_pParentItem
 Pointer to parent serializable object. More...
 
wxXmlSerializerm_pParentManager
 Pointer to parent data manager. More...
 
bool m_fSerialize
 Object serialization flag. More...
 
bool m_fClone
 Object cloning flag. More...
 

Private Member Functions

void MarkSerializableDataMembers ()
 Initialize serializable properties. More...
 
void _GetNeighbours (ShapeList &neighbours, wxClassInfo *shapeInfo, CONNECTMODE condir, bool direct)
 Auxiliary function called by GetNeighbours function. More...
 
void _GetCompleteBoundingBox (wxRect &rct, int mask=bbALL)
 Auxiliary function called by GetCompleteBoundingBox function. More...
 
void _OnMouseMove (const wxPoint &pos)
 Original protected event handler called when the mouse pointer is moving around the shape canvas. More...
 
void _OnBeginDrag (const wxPoint &pos)
 Original protected event handler called at the begininig of dragging process. More...
 
void _OnDragging (const wxPoint &pos)
 Original protected event handler called during a dragging process. More...
 
void _OnEndDrag (const wxPoint &pos)
 Original protected event handler called at the end of dragging process. More...
 
void _OnKey (int key)
 Original protected event handler called when any key is pressed (in the shape canvas). More...
 
void _OnHandle (wxSFShapeHandle &handle)
 Original protected event handler called during dragging of the shape handle. More...
 

Private Attributes

bool m_fMouseOver
 
bool m_fFirstMove
 
bool m_fHighlighParent
 
wxRealPoint m_nMouseOffset
 

Friends

class wxSFShapeCanvas
 
class wxSFDiagramManager
 
class wxSFShapeHandle
 

Detailed Description

Base class for all shapes providing fundamental functionality and publishing set of virtual functions which must be defined by the user in derived shapes. This class shouldn't be used as it is.

Shape objects derived from this class use hierarchical approach. It means that every shape must have defined parent shape (can be NULL for topmost shapes). An absolute shape position is then calculated as a sumation of all relative positions of all parent shapes. Also the size of the parent shape can be limited be a boundind box of all children shapes.

This class also declares set of virtual functions used as event handlers for various events (moving, sizing, drawing, mouse events, serialization and deserialization requests, ...) mostly triggered by a parent shape canvas.

Member Enumeration Documentation

◆ BBMODE

Bit flags for wxSFShapeBase::GetCompleteBoundingBox function.

Enumerator
bbSELF 
bbCHILDREN 
bbCONNECTIONS 
bbSHADOW 
bbALL 

◆ CONNECTMODE

Search mode flags for GetAssignedConnections function.

Enumerator
lineSTARTING 

Search for connection starting in examined shape.

lineENDING 

Search for connection ending in examined shape.

lineBOTH 

Search for both starting and ending connections.

◆ HALIGN

Flags for SetHAlign function.

Enumerator
halignNONE 
halignLEFT 
halignCENTER 
halignRIGHT 
halignEXPAND 
halignLINE_START 
halignLINE_END 

◆ STYLE

Basic shape's styles used with SetStyle() function.

Enumerator
sfsPARENT_CHANGE 

Interactive parent change is allowed.

sfsPOSITION_CHANGE 

Interactive position change is allowed.

sfsSIZE_CHANGE 

Interactive size change is allowed.

sfsHOVERING 

Shape is highlighted at mouse hovering.

sfsHIGHLIGHTING 

Shape is highlighted at shape dragging.

sfsALWAYS_INSIDE 

Shape is always inside its parent.

sfsDELETE_USER_DATA 

User data is destroyed at the shape deletion.

sfsPROCESS_DEL 

The DEL key is processed by the shape (not by the shape canvas)

sfsSHOW_HANDLES 

Show handles if the shape is selected.

sfsSHOW_SHADOW 

Show shadow under the shape.

sfsLOCK_CHILDREN 

Lock children relative position if the parent is resized.

sfsEMIT_EVENTS 

Emit events (catchable in shape canvas)

sfsPROPAGATE_DRAGGING 

Propagate mouse dragging event to parent shape.

sfsPROPAGATE_SELECTION 

Propagate selection to parent shape (it means this shape cannot be selected because its focus is redirected to its parent shape)

sfsPROPAGATE_INTERACTIVE_CONNECTION 

Propagate interactive connection request to parent shape (it means this shape cannot be connected interactively because this feature is redirected to its parent shape)

sfsNO_FIT_TO_CHILDREN 

Do no resize the shape to fit its children automatically.

sfsPROPAGATE_HOVERING 

Propagate hovering to parent.

sfsPROPAGATE_HIGHLIGHTING 

Propagate hovering to parent.

sfsDEFAULT_SHAPE_STYLE 

Default shape style.

◆ VALIGN

Flags for SetVAlign function.

Enumerator
valignNONE 
valignTOP 
valignMIDDLE 
valignBOTTOM 
valignEXPAND 
valignLINE_START 
valignLINE_END 

Constructor & Destructor Documentation

◆ wxSFShapeBase() [1/3]

wxSFShapeBase::wxSFShapeBase ( void  )

Basic constructor.

◆ wxSFShapeBase() [2/3]

wxSFShapeBase::wxSFShapeBase ( const wxRealPoint &  pos,
wxSFDiagramManager manager 
)

Enhanced constructor.

Parameters
posInitial relative position
managerPointer to parent diagram manager

◆ wxSFShapeBase() [3/3]

wxSFShapeBase::wxSFShapeBase ( const wxSFShapeBase obj)

Copy constructor.

Parameters
objReference to the source object

◆ ~wxSFShapeBase()

virtual wxSFShapeBase::~wxSFShapeBase ( void  )
virtual

Destructor.

Member Function Documentation

◆ _GetCompleteBoundingBox()

void wxSFShapeBase::_GetCompleteBoundingBox ( wxRect &  rct,
int  mask = bbALL 
)
private

Auxiliary function called by GetCompleteBoundingBox function.

Parameters
rctReturned bounding rectangle
maskBit mask of object types which should be included into calculation
See also
BBMODE

◆ _GetNeighbours()

void wxSFShapeBase::_GetNeighbours ( ShapeList &  neighbours,
wxClassInfo *  shapeInfo,
CONNECTMODE  condir,
bool  direct 
)
private

Auxiliary function called by GetNeighbours function.

Parameters
neighboursList of neighbour shapes
shapeInfoLine object type
condirConnection direction
directSet this flag to TRUE if only closest shapes should be found, otherwise also shapes connected by forked lines will be found (also constants sfDIRECT and sfINDIRECT can be used)
See also
GetNeighbours

◆ _OnBeginDrag()

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

Original protected event handler called at the begininig of dragging process.

The function is called by the framework (by the shape canvas). After processing the event
an overridable event handler is called.
Parameters
posCurrent mouse position
See also
wxShapeBase::OnBeginDrag

◆ _OnDragging()

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

Original protected event handler called during a dragging process.

The function is called by the framework (by the shape canvas). After processing the event
an overridable event handler is called.
Parameters
posCurrent mouse position
See also
wxShapeBase::OnDragging

◆ _OnEndDrag()

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

Original protected event handler called at the end of dragging process.

The function is called by the framework (by the shape canvas). After processing the event
an overridable event handler is called.
Parameters
posCurrent mouse position
See also
wxShapeBase::OnEndDrag

◆ _OnHandle()

void wxSFShapeBase::_OnHandle ( wxSFShapeHandle handle)
private

Original protected event handler called during dragging of the shape handle.

The function is called by the framework (by the shape canvas). Default implementation manages the child shapes' alignment (if set).

Parameters
handleReference to dragged handle

◆ _OnKey()

void wxSFShapeBase::_OnKey ( int  key)
private

Original protected event handler called when any key is pressed (in the shape canvas).

The function is called by the framework (by the shape canvas). Default implementation performs operations necessary for proper shape's moving and repainting.

Parameters
keyThe key code
See also
wxSFShapeBase::OnKey

◆ _OnMouseMove()

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

Original protected event handler called when the mouse pointer is moving around the shape canvas.

The function is called by the framework (by the shape canvas). After processing the event
relevant overridable event handlers are called.
Parameters
posCurrent mouse position
See also
wxShapeBase::OnMouseEnter, wxShapeBase::OnMouseOver, wxShapeBase::OnMouseLeave

◆ AcceptChild()

void wxSFShapeBase::AcceptChild ( const wxString &  type)
inline

Add given shape type to an acceptance list. The acceptance list contains class names of the shapes which can be accepted as children of this shape. Note: Keyword 'All' behaves like any class name.

Parameters
typeClass name of accepted shape object
See also
IsChildAccepted

◆ AcceptConnection()

void wxSFShapeBase::AcceptConnection ( const wxString &  type)
inline

Add given connection type to an acceptance list. The acceptance list contains class names of the connection which can be accepted by this shape. Note: Keyword 'All' behaves like any class name.

Parameters
typeClass name of accepted connection object
See also
IsConnectionAccepted

◆ AcceptCurrentlyDraggedShapes()

bool wxSFShapeBase::AcceptCurrentlyDraggedShapes ( )

Function returns TRUE if all currently dragged shapes can be accepted as children of this shape.

See also
IsShapeAccepted

◆ AcceptSrcNeighbour()

void wxSFShapeBase::AcceptSrcNeighbour ( const wxString &  type)
inline

Add given shape type to an source neighbours' acceptance list. The acceptance list contains class names of the shape types which can be accepted by this shape as its source neighbour. Note: Keyword 'All' behaves like any class name.

Parameters
typeClass name of accepted connection object
See also
IsSrcNeighbourAccepted

◆ AcceptTrgNeighbour()

void wxSFShapeBase::AcceptTrgNeighbour ( const wxString &  type)
inline

Add given shape type to an target neighbours' acceptance list. The acceptance list contains class names of the shape types which can be accepted by this shape as its target neighbour. Note: Keyword 'All' behaves like any class name.

Parameters
typeClass name of accepted connection object
See also
IsTrgNeighbourAccepted

◆ Activate()

void wxSFShapeBase::Activate ( bool  active)
inline

Shape's activation/deactivation.

Deactivated shapes are visible, but don't receive (process) any events.

Parameters
activeTRUE for activation, FALSE for deactivation
Returns
Description
See also
Show

◆ AddConnectionPoint() [1/3]

wxSFConnectionPoint* wxSFShapeBase::AddConnectionPoint ( const wxRealPoint &  relpos,
long  id = -1,
bool  persistent = true 
)

Assign custom connection point to the shape.

Parameters
relposRelative position in percentages
idOptional connection point ID
persistentTRUE if the connection point should be serialized
Returns
Pointer to the new connection point

◆ AddConnectionPoint() [2/3]

void wxSFShapeBase::AddConnectionPoint ( wxSFConnectionPoint cp,
bool  persistent = true 
)

Assigned given connection point to the shape.

Parameters
cpPointer to connection point (shape will take the ownership)
persistentTRUE if the connection point should be serialized

◆ AddConnectionPoint() [3/3]

wxSFConnectionPoint* wxSFShapeBase::AddConnectionPoint ( wxSFConnectionPoint::CPTYPE  type,
bool  persistent = true 
)

Assign connection point of given type to the shape.

Parameters
typeConnection point type
persistentTRUE if the connection point should be serialized
Returns
Pointer to the new connection point
See also
wxSFConnectionPoint::CPTYPE

◆ AddHandle()

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

Add new handle to the shape.

The function creates new instance of shape handle (if it doesn't exist yet) and inserts it into handle list.

Parameters
typeHandle type
idHandle ID (usefull only for line control points)
See also
wxSFShapeHandle

◆ AddStyle()

void wxSFShapeBase::AddStyle ( STYLE  style)
inline

◆ ClearAcceptedChilds()

void wxSFShapeBase::ClearAcceptedChilds ( )
inline

Clear shape object acceptance list.

See also
AcceptChild

◆ ClearAcceptedConnections()

void wxSFShapeBase::ClearAcceptedConnections ( )
inline

Clear connection object acceptance list.

See also
AcceptConnection

◆ ClearAcceptedSrcNeighbours()

void wxSFShapeBase::ClearAcceptedSrcNeighbours ( )
inline

Clear source neighbour objects acceptance list.

See also
AcceptSrcNeighbour

◆ ClearAcceptedTrgNeighbours()

void wxSFShapeBase::ClearAcceptedTrgNeighbours ( )
inline

Clear target neighbour objects acceptance list.

See also
AcceptTrgNeighbour

◆ Contains()

virtual bool wxSFShapeBase::Contains ( const wxPoint &  pos)
virtual
\brief Test whether the given point is inside the shape. The function

can be overrided if neccessary.

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

Reimplemented in wxSFRoundRectShape, wxSFLineShape, wxSFEllipseShape, wxSFDiamondShape, and wxSFCircleShape.

◆ ContainsStyle()

bool wxSFShapeBase::ContainsStyle ( STYLE  style) const
inline

◆ CreateHandles()

virtual void wxSFShapeBase::CreateHandles ( )
virtual
\brief Function called by the framework responsible for creation of shape handles

at the creation time. Default implementation does nothing. The function can be overrided if neccesary.

Reimplemented in wxSFRectShape, and wxSFLineShape.

◆ Deserialize()

virtual void wxSFShapeBase::Deserialize ( wxXmlNode *  node)
protectedvirtual

Deserialize shape's properties from the given XML node. The routine is automatically called by the framework and should take care about deserialization of all specific (non-standard) shape's properties.

Note, that the shape serialization is used not only for saving canvas's content to a file but also during Undo/Redo and the clipboard operations so it is very important to implement this virtual function otherwise all mentioned operations wont be available for this shape.

Parameters
nodePointer to a source XML node containig the shape's property nodes
See also
xsSerializable::Deserialize

Reimplemented from xsSerializable.

Reimplemented in wxSFTextShape, wxSFPolygonShape, and wxSFBitmapShape.

◆ DoAlignment()

void wxSFShapeBase::DoAlignment ( )

Update the shape's position in order to its alignment.

◆ Draw()

virtual void wxSFShapeBase::Draw ( wxDC &  dc,
bool  children = sfWITHCHILDREN 
)
virtual

Draw shape. Default implementation tests basic shape visual states (normal/ready, mouse is over the shape, dragged shape can be accepted) and call appropriate virtual functions (DrawNormal, DrawHover, DrawHighlighted) for its visualisation. The function can be overrided if neccessary.

Parameters
dcReference to a device context where the shape will be drawn to
childrenTRUE if the shape's children should be drawn as well

◆ DrawHighlighted()

virtual void wxSFShapeBase::DrawHighlighted ( wxDC &  dc)
protectedvirtual

Draw the shape in the highlighted mode (another shape is dragged over this shape and this shape will accept the dragged one if it will be dropped on it). The function can be overrided if neccessary.

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

Reimplemented in wxSFTextShape, wxSFRoundRectShape, wxSFRectShape, wxSFPolygonShape, wxSFLineShape, wxSFEllipseShape, wxSFCircleShape, and wxSFBitmapShape.

◆ DrawHover()

virtual void wxSFShapeBase::DrawHover ( wxDC &  dc)
protectedvirtual

Draw the shape 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

Reimplemented in wxSFTextShape, wxSFRoundRectShape, wxSFRectShape, wxSFPolygonShape, wxSFLineShape, wxSFEllipseShape, wxSFCircleShape, and wxSFBitmapShape.

◆ DrawNormal()

virtual void wxSFShapeBase::DrawNormal ( wxDC &  dc)
protectedvirtual

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

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

Reimplemented in wxSFTextShape, wxSFRoundRectShape, wxSFRectShape, wxSFPolygonShape, wxSFLineShape, wxSFEllipseShape, wxSFCircleShape, and wxSFBitmapShape.

◆ DrawSelected()

virtual void wxSFShapeBase::DrawSelected ( wxDC &  dc)
protectedvirtual

Draw the shape in the selected way. The function can be overrided if neccessary.

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

◆ DrawShadow()

virtual void wxSFShapeBase::DrawShadow ( wxDC &  dc)
protectedvirtual

Draw shadow under the shape. The function can be overrided if neccessary.

Parameters
dcReference to device context where the shadow will be drawn to

Reimplemented in wxSFTextShape, wxSFRoundRectShape, wxSFRectShape, wxSFPolygonShape, wxSFEllipseShape, and wxSFCircleShape.

◆ FitToChildren()

virtual void wxSFShapeBase::FitToChildren ( )
virtual

Resize the shape to bound all child shapes. The function can be overrided if neccessary.

Reimplemented in wxSFRectShape, wxSFPolygonShape, wxSFGridShape, and wxSFControlShape.

◆ GetAbsolutePosition()

virtual wxRealPoint wxSFShapeBase::GetAbsolutePosition ( )
virtual

Get the shape's absolute position in the canvas (calculated as a sumation of all relative positions in the shapes' hierarchy. The function can be overrided if neccessary.

Returns
Shape's position

Reimplemented in wxSFLineShape.

◆ GetAcceptedChildren()

wxArrayString& wxSFShapeBase::GetAcceptedChildren ( )
inline

Get shape types acceptance list.

Returns
String array with class names of accepted shape types.
See also
IsChildAccepted

◆ GetAcceptedConnections()

wxArrayString& wxSFShapeBase::GetAcceptedConnections ( )
inline

Get connection types acceptance list.

Returns
String array with class names of accepted connection types.
See also
IsConnectionAccepted

◆ GetAcceptedSrcNeighbours()

wxArrayString& wxSFShapeBase::GetAcceptedSrcNeighbours ( )
inline

Get source neighbour types acceptance list.

Returns
String array with class names of accepted source neighbours types.
See also
IsSrcNeighbourAccepted

◆ GetAcceptedTrgNeighbours()

wxArrayString& wxSFShapeBase::GetAcceptedTrgNeighbours ( )
inline

Get target neighbour types acceptance list.

Returns
String array with class names of accepted target neighbours types.
See also
IsTrgNeighbourAccepted

◆ GetAssignedConnections()

void wxSFShapeBase::GetAssignedConnections ( wxClassInfo *  shapeInfo,
wxSFShapeBase::CONNECTMODE  mode,
ShapeList &  lines 
)

Get list of connections assigned to this shape.

Note: For proper functionality the shape must be managed by a diagram manager.

Parameters
shapeInfoLine object type
modeSearch mode
linesReference to shape list where pointers to all found connections will be stored
See also
wxSFShapeBase::CONNECTMODE

◆ GetBorderPoint()

virtual wxRealPoint wxSFShapeBase::GetBorderPoint ( const wxRealPoint &  start,
const wxRealPoint &  end 
)
virtual
\brief Get intersection point of the shape border and a line leading from
'start' point to 'end' point.  Default implementation does nothing. The function can be overrided if neccessary.
\param start Starting point of the virtual intersection line
Parameters
endEnding point of the virtual intersection line
Returns
Intersection point

Reimplemented in wxSFRectShape, wxSFPolygonShape, wxSFLineShape, wxSFEllipseShape, and wxSFCircleShape.

◆ GetBoundingBox()

virtual wxRect wxSFShapeBase::GetBoundingBox ( )
virtual
\brief Get shapes's bounding box. The function can be overrided if neccessary.
Returns
Bounding rectangle

Reimplemented in wxSFRectShape, wxSFLineShape, and wxSFCurveShape.

◆ GetCenter()

virtual wxRealPoint wxSFShapeBase::GetCenter ( )
virtual

Get shape's center. Default implementation does nothing. The function can be overrided if neccessary.

Returns
Center point

◆ GetChildShapes()

void wxSFShapeBase::GetChildShapes ( wxClassInfo *  type,
ShapeList &  children,
bool  recursive = false,
xsSerializable::SEARCHMODE  mode = xsSerializable::searchBFS 
)
\brief Get child shapes associated with this (parent) shape.
Parameters
typeType of searched child shapes (NULL for any type)
childrenList of child shapes
recursiveSet this flag TRUE if also children of children of ... should be found (also sfRECURSIVE a sfNORECURSIVE constants can be used).
modeSearch mode (has sense only for recursive search)
See also
xsSerializable::SEARCHMODE

◆ GetCompleteBoundingBox()

void wxSFShapeBase::GetCompleteBoundingBox ( wxRect &  rct,
int  mask = bbALL 
)

Get shape's bounding box which includes also associated child shapes and connections.

Parameters
rctReturned bounding rectangle
maskBit mask of object types which should be included into calculation
See also
BBMODE

◆ GetConnectionPoint()

wxSFConnectionPoint* wxSFShapeBase::GetConnectionPoint ( wxSFConnectionPoint::CPTYPE  type,
long  id = -1 
)

Get connection point of given type assigned to the shape.

Parameters
typeConnection point type
idOptional connection point ID
Returns
Pointer to connection point if exists, otherwise NULL
See also
wxSFConnectionPoint::CPTYPE

◆ GetConnectionPoints()

ConnectionPointList& wxSFShapeBase::GetConnectionPoints ( )
inline

Get reference to connection points list.

Returns
Constant reference to connection points list

◆ GetCustomDockPoint()

int wxSFShapeBase::GetCustomDockPoint ( )
inline

Get custom dock point used if the shape is child shape of a line shape.

Returns
Custom dock point

◆ GetGrandParentShape()

wxSFShapeBase* wxSFShapeBase::GetGrandParentShape ( )

Get pointer to the topmost parent shape.

◆ GetHAlign()

HALIGN wxSFShapeBase::GetHAlign ( ) const
inline

Get horizontal alignment of this shape inside its parent.

Returns
Alignment type
See also
VALIGN

◆ GetHandle()

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

Get shape handle.

Parameters
typeHandle type
idHandle ID (usefull only for line control points)
Returns
Pointer to the shape handle object
See also
wxSFShapeHandle

◆ GetHandles()

HandleList& wxSFShapeBase::GetHandles ( )
inline

Get list of currently assigned shape handles.

Returns
Reference to the handle list
See also
CHandleList

◆ GetHBorder()

double wxSFShapeBase::GetHBorder ( ) const
inline

Get horizontal border between this shape and its parent (is horizontal alignment is set).

Returns
Vertical border
See also
SetHAlign

◆ GetHoverColour()

wxColour wxSFShapeBase::GetHoverColour ( ) const
inline

Get shape's hover color.

Returns
Current hover color

◆ GetNearestConnectionPoint()

wxSFConnectionPoint* wxSFShapeBase::GetNearestConnectionPoint ( const wxRealPoint &  pos)

Get connection point closest to the diven position.

Parameters
posPosition
Returns
Pointer to closest connection point if exists, otherwise NULL

◆ GetNeighbours()

void wxSFShapeBase::GetNeighbours ( ShapeList &  neighbours,
wxClassInfo *  shapeInfo,
CONNECTMODE  condir,
bool  direct = true 
)

Get neighbour shapes connected to this shape.

Parameters
neighboursList of neighbour shapes
shapeInfoLine object type
condirConnection direction
directSet this flag to TRUE if only closest shapes should be found, otherwise also shapes connected by forked lines will be found (also constants sfDIRECT and sfINDIRECT can be used)
See also
CONNECTMODE

◆ GetParentAbsolutePosition()

wxRealPoint wxSFShapeBase::GetParentAbsolutePosition ( )
protected

Get absolute position of the shape parent.

Returns
Absolute position of the shape parent if exists, otherwise 0,0

◆ GetParentCanvas()

wxSFShapeCanvas* wxSFShapeBase::GetParentCanvas ( )

Get shape's parent canvas.

Returns
Pointer to shape canvas if assigned via diagram manager, otherwise NULL
See also
wxSFDiagramManager

◆ GetParentShape()

wxSFShapeBase* wxSFShapeBase::GetParentShape ( )

Get pointer to a parent shape.

◆ GetRelativePosition()

wxRealPoint wxSFShapeBase::GetRelativePosition ( ) const
inline
\brief Get shape's relative position.
Returns
Current relative position
See also
GetAbsolutePosition

◆ GetShapeManager()

wxSFDiagramManager* wxSFShapeBase::GetShapeManager ( )
inline

Get shape's parent diagram manager.

Returns
Pointer to diagram manager
See also
wxSFDiagramManager

◆ GetStyle()

long wxSFShapeBase::GetStyle ( ) const
inline

Get current shape style.

◆ GetUserData()

xsSerializable* wxSFShapeBase::GetUserData ( )
inline

Get associated user data.

Returns
Pointer to user data

◆ GetVAlign()

VALIGN wxSFShapeBase::GetVAlign ( ) const
inline

Get vertical alignment of this shape inside its parent.

Returns
Alignment type
See also
VALIGN

◆ GetVBorder()

double wxSFShapeBase::GetVBorder ( ) const
inline

Get vertical border between this shape and its parent (is vertical alignment is set).

Returns
Vertical border
See also
SetVAlign

◆ Intersects()

virtual bool wxSFShapeBase::Intersects ( const wxRect &  rct)
virtual

Test whether the given rectangle intersects the shape.

Parameters
rctExamined rectangle
Returns
TRUE if the examined rectangle intersects the shape, otherwise FALSE

◆ IsActive()

bool wxSFShapeBase::IsActive ( ) const
inline

Function returns value of a shape's activation flag.

Non-active shapes are visible, but don't receive (process) any events.

Returns
TRUE if the shape is active, othervise FALSE

◆ IsAncestor()

bool wxSFShapeBase::IsAncestor ( wxSFShapeBase child)

Determine whether this shape is ancestor of given child shape.

Parameters
childPointer to child shape.
Returns
TRUE if this shape is parent of given child shape, otherwise FALSE

◆ IsChildAccepted()

bool wxSFShapeBase::IsChildAccepted ( const wxString &  type)

Tells whether the given shape type is accepted by this shape (it means whether this shape can be its parent).

The function is typically used by the framework for determination whether a dropped shape can be assigned to an underlying shape as its child.

Parameters
typeClass name of examined shape object
Returns
TRUE if the shape type is accepted, otherwise FALSE.

◆ IsConnectionAccepted()

bool wxSFShapeBase::IsConnectionAccepted ( const wxString &  type)

Tells whether the given connection type is accepted by this shape (it means whether this shape can be connected to another one by a connection of given type).

The function is typically used by the framework during interactive connection creation.

Parameters
typeClass name of examined connection object
Returns
TRUE if the connection type is accepted, otherwise FALSE.

◆ IsDescendant()

bool wxSFShapeBase::IsDescendant ( wxSFShapeBase parent)

Determine whether this shape is descendant of given parent shape.

Parameters
parentPointer to parent shape
Returns
TRUE if this shape is a child of given parent shape, otherwise FALSE

◆ IsInside()

virtual bool wxSFShapeBase::IsInside ( const wxRect &  rct)
virtual
\brief Test whether the shape is completely inside given rectangle. The function

can be overrided if neccessary.

Parameters
rctExamined rectangle
Returns
TRUE if the shape is completely inside given rectangle, otherwise FALSE

◆ IsSelected()

bool wxSFShapeBase::IsSelected ( ) const
inline

Function returns TRUE if the shape is selected, otherwise returns FALSE.

◆ IsSrcNeighbourAccepted()

bool wxSFShapeBase::IsSrcNeighbourAccepted ( const wxString &  type)

Tells whether the given shape type is accepted by this shape as its source neighbour(it means whether this shape can be connected from another one of given type).

The function is typically used by the framework during interactive connection creation.

Parameters
typeClass name of examined connection object
Returns
TRUE if the shape type is accepted, otherwise FALSE.

◆ IsTrgNeighbourAccepted()

bool wxSFShapeBase::IsTrgNeighbourAccepted ( const wxString &  type)

Tells whether the given shape type is accepted by this shape as its target neighbour(it means whether this shape can be connected to another one of given type).

The function is typically used by the framework during interactive connection creation.

Parameters
typeClass name of examined connection object
Returns
TRUE if the shape type is accepted, otherwise FALSE.

◆ IsVisible()

bool wxSFShapeBase::IsVisible ( ) const
inline

Get the shape's visibility status.

Returns
TRUE if the shape is visible, otherwise FALSE

◆ MarkSerializableDataMembers()

void wxSFShapeBase::MarkSerializableDataMembers ( )
private

Initialize serializable properties.

◆ MoveBy() [1/2]

void wxSFShapeBase::MoveBy ( const wxRealPoint &  delta)

Move the shape by the given offset.

Parameters
deltaOffset

◆ MoveBy() [2/2]

virtual void wxSFShapeBase::MoveBy ( double  x,
double  y 
)
virtual

Move the shape by the given offset. The function can be overrided if neccessary.

Parameters
xX offset
yY offset

Reimplemented in wxSFLineShape, and wxSFControlShape.

◆ MoveTo() [1/2]

void wxSFShapeBase::MoveTo ( const wxRealPoint &  pos)

Move the shape to the given absolute position.

Parameters
posNew absolute position

◆ MoveTo() [2/2]

virtual void wxSFShapeBase::MoveTo ( double  x,
double  y 
)
virtual

Move the shape to the given absolute position. The function can be overrided if necessary.

Parameters
xX coordinate
yY coordinate

Reimplemented in wxSFLineShape, and wxSFControlShape.

◆ OnBeginDrag()

virtual void wxSFShapeBase::OnBeginDrag ( const wxPoint &  pos)
virtual

Event handler called at the begining of the shape dragging process. The function can be overrided if necessary.

The function is called by the framework (by the shape canvas). Default implementation emmits wxEVT_SF_SHAPE_DRAG_BEGIN event.

See also
wxSFShapeCanvas

Reimplemented in wxSFLineShape, and wxSFControlShape.

◆ OnBeginHandle()

virtual void wxSFShapeBase::OnBeginHandle ( wxSFShapeHandle handle)
virtual

Event handler called when the user started to drag the shape handle. The function can be overrided if necessary.

The function is called by the framework (by the shape canvas). Default implementation emmits wxEVT_SF_SHAPE_HANDLE_BEGIN event.

Parameters
handleReference to dragged handle

Reimplemented in wxSFRectShape, wxSFMultiSelRect, wxSFControlShape, and wxSFBitmapShape.

◆ OnChildDropped()

virtual void wxSFShapeBase::OnChildDropped ( const wxRealPoint &  pos,
wxSFShapeBase child 
)
virtual

Event handler called when any shape is dropped above this shape (and the dropped shape is accepted as a child of this shape). The function can be overrided if necessary.

The function is called by the framework (by the shape canvas). Default implementation emmits wxEVT_SF_SHAPE_CHILD_DROP event.

Parameters
posRelative position of dropped shape
childPointer to dropped shape

Reimplemented in wxSFGridShape.

◆ OnDragging()

virtual void wxSFShapeBase::OnDragging ( const wxPoint &  pos)
virtual

Event handler called during the shape dragging process. The function can be overrided if necessary.

The function is called by the framework (by the shape canvas). Default implementation emmits wxEVT_SF_SHAPE_DRAG event.

Parameters
posCurrent mouse position
See also
wxSFShapeCanvas

◆ OnEndDrag()

virtual void wxSFShapeBase::OnEndDrag ( const wxPoint &  pos)
virtual

Event handler called at the end of the shape dragging process. The function can be overrided if necessary.

The function is called by the framework (by the shape canvas). Default implementation emmits wxEVT_SF_SHAPE_DRAG_END event.

Parameters
posCurrent mouse position
See also
wxSFShapeCanvas

Reimplemented in wxSFControlShape.

◆ OnEndHandle()

virtual void wxSFShapeBase::OnEndHandle ( wxSFShapeHandle handle)
virtual

Event handler called when the user finished dragging of the shape handle. The function can be overrided if necessary.

The function is called by the framework (by the shape canvas). Default implementation emmits wxEVT_SF_SHAPE_HANDLE_END event.

Parameters
handleReference to dragged handle

Reimplemented in wxSFMultiSelRect, wxSFLineShape, wxSFControlShape, and wxSFBitmapShape.

◆ OnHandle()

virtual void wxSFShapeBase::OnHandle ( wxSFShapeHandle handle)
virtual

Event handler called during dragging of the shape handle. The function can be overrided if necessary.

The function is called by the framework (by the shape canvas). Default implementation emmits wxEVT_SF_SHAPE_HANDLE event.

Parameters
handleReference to dragged handle

Reimplemented in wxSFTextShape, wxSFRectShape, wxSFPolygonShape, wxSFMultiSelRect, wxSFLineShape, wxSFSquareShape, wxSFControlShape, and wxSFBitmapShape.

◆ OnKey()

virtual bool wxSFShapeBase::OnKey ( int  key)
virtual

Event handler called when any key is pressed (in the shape canvas). The function can be overrided if necessary.

The function is called by the framework (by the shape canvas). Default implementation emmits wxEVT_SF_SHAPE_KEYDOWN event.

Parameters
keyThe key code
Returns
The function must return TRUE if the default event routine should be called as well, otherwise FALSE
See also
wxSFShapeBase::_OnKey

Reimplemented in wxSFEditTextShape.

◆ OnLeftClick()

virtual void wxSFShapeBase::OnLeftClick ( const wxPoint &  pos)
virtual

Event handler called when the shape is clicked by the left mouse button. The function can be overrided if necessary.

The function is called by the framework (by the shape canvas). Default implementation emmits wxEVT_SF_SHAPE_LEFT_DOWN event.

Parameters
posCurrent mouse position
See also
wxSFShapeCanvas

◆ OnLeftDoubleClick()

virtual void wxSFShapeBase::OnLeftDoubleClick ( const wxPoint &  pos)
virtual

Event handler called when the shape is double-clicked by the left mouse button. The function can be overrided if necessary.

The function is called by the framework (by the shape canvas). Default implementation emmits wxEVT_SF_SHAPE_LEFT_DCLICK event.

Parameters
posCurrent mouse position
See also
wxSFShapeCanvas

Reimplemented in wxSFLineShape, and wxSFEditTextShape.

◆ OnMouseEnter()

virtual void wxSFShapeBase::OnMouseEnter ( const wxPoint &  pos)
virtual

Event handler called when a mouse pointer enters the shape area. The function can be overrided if necessary.

The function is called by the framework (by the shape canvas). Default implementation emmits wxEVT_SF_SHAPE_MOUSE_ENTER event.

Parameters
posCurrent mouse position

◆ OnMouseLeave()

virtual void wxSFShapeBase::OnMouseLeave ( const wxPoint &  pos)
virtual

Event handler called when a mouse pointer leaves the shape area. The function can be overrided if necessary.

The function is called by the framework (by the shape canvas). Default implementation emmits wxEVT_SF_SHAPE_MOUSE_LEAVE event.

Parameters
posCurrent mouse position

◆ OnMouseOver()

virtual void wxSFShapeBase::OnMouseOver ( const wxPoint &  pos)
virtual

Event handler called when a mouse pointer moves above the shape area. The function can be overrided if necessary.

The function is called by the framework (by the shape canvas). Default implementation emmits wxEVT_SF_SHAPE_MOUSE_OVER event.

Parameters
posCurrent mouse position

◆ OnRightClick()

virtual void wxSFShapeBase::OnRightClick ( const wxPoint &  pos)
virtual

Event handler called when the shape is clicked by the right mouse button. The function can be overrided if necessary.

The function is called by the framework (by the shape canvas). Default implementation emmits wxEVT_SF_SHAPE_RIGHT_DOWN event.

Parameters
posCurrent mouse position
See also
wxSFShapeCanvas

◆ OnRightDoubleClick()

virtual void wxSFShapeBase::OnRightDoubleClick ( const wxPoint &  pos)
virtual

Event handler called when the shape is double-clicked by the right mouse button. The function can be overrided if necessary.

The function is called by the framework (by the shape canvas). Default implementation emmits wxEVT_SF_SHAPE_RIGHT_DCLICK event.

Parameters
posCurrent mouse position
See also
wxSFShapeCanvas

◆ Refresh() [1/2]

void wxSFShapeBase::Refresh ( bool  delayed = false)

Refresh (redraw) the shape.

Parameters
delayedIf TRUE then the shape canvas will be rather invalidated than refreshed.
See also
wxSFShapeCanvas::InvalidateRect(), wxSFShapeCanvas::RefreshInvalidatedRect()

◆ Refresh() [2/2]

void wxSFShapeBase::Refresh ( const wxRect &  rct,
bool  delayed = false 
)
protected

Repaint the shape.

Parameters
rctCanvas portion that should be updated
delayedIf TRUE then the shape canvas will be rather invalidated than refreshed.
See also
wxSFShapeCanvas::InvalidateRect(), wxSFShapeCanvas::RefreshInvalidatedRect()

◆ RemoveConnectionPoint()

void wxSFShapeBase::RemoveConnectionPoint ( wxSFConnectionPoint::CPTYPE  type)

Remove connection point of given type from the shape (if pressent).

Parameters
typeConnection point type
See also
wxSFConnectionPoint::CPTYPE

◆ RemoveHandle()

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

Remove given shape handle (if exists).

Parameters
typeHandle type
idHandle ID (usefull only for line control points)
See also
wxSFShapeHandle

◆ RemoveStyle()

void wxSFShapeBase::RemoveStyle ( STYLE  style)
inline

◆ Scale() [1/2]

void wxSFShapeBase::Scale ( const wxRealPoint &  scale,
bool  children = sfWITHCHILDREN 
)
\brief Scale the shape size by in both directions.
Parameters
scaleScaling factor
childrenTRUE if the shape's children shoould be scaled as well, otherwise the shape will be updated after scaling via Update() function.

◆ Scale() [2/2]

virtual void wxSFShapeBase::Scale ( double  x,
double  y,
bool  children = sfWITHCHILDREN 
)
virtual
\brief Scale the shape size by in both directions. The function can be overrided if necessary

(new implementation should call default one ore scale shape's children manualy if neccesary).

Parameters
xHorizontal scale factor
yVertical scale factor
childrenTRUE if the shape's children shoould be scaled as well, otherwise the shape will be updated after scaling via Update() function.

Reimplemented in wxSFTextShape, wxSFRectShape, wxSFPolygonShape, wxSFLineShape, wxSFSquareShape, wxSFControlShape, and wxSFBitmapShape.

◆ ScaleChildren()

void wxSFShapeBase::ScaleChildren ( double  x,
double  y 
)

Scale shape's children.

Parameters
xHorizontal scale factor
yVertical scale factor
See also
Scale

◆ Select()

void wxSFShapeBase::Select ( bool  state)
inline

Set the shape as a selected/deselected one.

Parameters
stateSelection state (TRUE is selected, FALSE is deselected)

◆ Serialize()

virtual wxXmlNode* wxSFShapeBase::Serialize ( wxXmlNode *  node)
protectedvirtual

Serialize shape's properties to the given XML node. The serialization routine is automatically called by the framework and should take care about serialization of all specific (non-standard) shape's properties.

Note, that the shape serialization is used not only for saving canvas's content to a file but also during Undo/Redo and the clipboard operations so it is very important to implement this virtual function otherwise all mentioned operations wont be available for this shape.

Parameters
nodePointer to XML node where the shape's property nodes will be appended to
See also
xsSerializable::Serialize

Reimplemented from xsSerializable.

Reimplemented in wxSFTextShape, wxSFPolygonShape, and wxSFBitmapShape.

◆ SetCustomDockPoint()

void wxSFShapeBase::SetCustomDockPoint ( int  dp)
inline

Set custom dock point used if the shape is child shape of a line shape.

Parameters
dpCustom dock point

◆ SetHAlign()

void wxSFShapeBase::SetHAlign ( HALIGN  val)
inline

Set horizontal alignment of this shape inside its parent.

Parameters
valHorizontal type
See also
HALIGN

◆ SetHBorder()

void wxSFShapeBase::SetHBorder ( double  border)
inline

Set horizontal border between this shape and its parent (is horizontal alignment is set).

Parameters
borderHorizontal border
See also
SetVAlign

◆ SetHoverColour()

void wxSFShapeBase::SetHoverColour ( const wxColour &  col)
inline

Set shape's hover color.

Parameters
colHover color

◆ SetRelativePosition() [1/2]

void wxSFShapeBase::SetRelativePosition ( const wxRealPoint &  pos)
inline
\brief Set shape's relative position. Absolute shape's position is then calculated

as a sumation of the relative positions of this shape and all parent shapes in the shape's hierarchy.

Parameters
posNew relative position
See also
MoveTo

◆ SetRelativePosition() [2/2]

void wxSFShapeBase::SetRelativePosition ( double  x,
double  y 
)
inline
\brief Set shape's relative position. Absolute shape's position is then calculated

as a sumation of the relative positions of this shape and all parent shapes in the shape's hierarchy.

Parameters
xHorizontal coordinate of new relative position
yVertical coordinate of new relative position
See also
MoveTo

◆ SetStyle()

void wxSFShapeBase::SetStyle ( long  style)
inline

Set shape's style.

Default value is sfsPARENT_CHANGE | sfsPOSITION_CHANGE | sfsSIZE_CHANGE | sfsHOVERING | sfsHIGHLIGHTING | sfsSHOW_HANDLES | sfsALWAYS_INSIDE | sfsDELETE_USER_DATA
Parameters
styleCombination of the shape's styles
See also
STYLE

◆ SetUserData()

void wxSFShapeBase::SetUserData ( xsSerializable data)

Associate user data with the shape.

If the data object is properly set then its marked properties will be serialized together with the parent shape.

Parameters
dataPointer to user data

◆ SetVAlign()

void wxSFShapeBase::SetVAlign ( VALIGN  val)
inline

Set vertical alignment of this shape inside its parent.

Parameters
valAlignment type
See also
VALIGN

◆ SetVBorder()

void wxSFShapeBase::SetVBorder ( double  border)
inline

Set vertical border between this shape and its parent (is vertical alignment is set).

Parameters
borderVertical border
See also
SetVAlign

◆ Show()

void wxSFShapeBase::Show ( bool  show)
inline

Show/hide shape.

Parameters
showSet the parameter to TRUE if the shape should be visible, otherwise use FALSE

◆ ShowHandles()

void wxSFShapeBase::ShowHandles ( bool  show)

Show/hide shape handles. Hidden handles are inactive.

Parameters
showTRUE for showing, FALSE for hidding

◆ Update()

virtual void wxSFShapeBase::Update ( )
virtual

Upate shape (align all child shapes an resize it to fit them)

Reimplemented in wxSFTextShape, wxSFGridShape, and wxSFControlShape.

◆ XS_DECLARE_CLONABLE_CLASS()

wxSFShapeBase::XS_DECLARE_CLONABLE_CLASS ( wxSFShapeBase  )

Friends And Related Function Documentation

◆ wxSFDiagramManager

friend class wxSFDiagramManager
friend

◆ wxSFShapeCanvas

friend class wxSFShapeCanvas
friend

◆ wxSFShapeHandle

friend class wxSFShapeHandle
friend

Member Data Documentation

◆ m_arrAcceptedChildren

wxArrayString wxSFShapeBase::m_arrAcceptedChildren
protected

String list with class names of accepted child shapes.

◆ m_arrAcceptedConnections

wxArrayString wxSFShapeBase::m_arrAcceptedConnections
protected

String list with class names of accepted connections.

◆ m_arrAcceptedSrcNeighbours

wxArrayString wxSFShapeBase::m_arrAcceptedSrcNeighbours
protected

String list with class names of accepted source neighbour shapes.

◆ m_arrAcceptedTrgNeighbours

wxArrayString wxSFShapeBase::m_arrAcceptedTrgNeighbours
protected

String list with class names of accepted target neighbour shapes.

◆ m_fActive

bool wxSFShapeBase::m_fActive
protected

Activation flag.

◆ m_fFirstMove

bool wxSFShapeBase::m_fFirstMove
private

◆ m_fHighlighParent

bool wxSFShapeBase::m_fHighlighParent
private

◆ m_fMouseOver

bool wxSFShapeBase::m_fMouseOver
private

◆ m_fSelected

bool wxSFShapeBase::m_fSelected
protected

Selection flag.

◆ m_fVisible

bool wxSFShapeBase::m_fVisible
protected

Visibility flag.

◆ m_lstConnectionPts

ConnectionPointList wxSFShapeBase::m_lstConnectionPts
protected

◆ m_lstHandles

HandleList wxSFShapeBase::m_lstHandles
protected

Handle list.

◆ m_nCustomDockPoint

int wxSFShapeBase::m_nCustomDockPoint
protected

Custom line dock point.

◆ m_nHAlign

HALIGN wxSFShapeBase::m_nHAlign
protected

Horizontal alignment of child shapes.

◆ m_nHBorder

double wxSFShapeBase::m_nHBorder
protected

Value of horizontal border used by AlignH function.

◆ m_nHoverColor

wxColour wxSFShapeBase::m_nHoverColor
protected

◆ m_nMouseOffset

wxRealPoint wxSFShapeBase::m_nMouseOffset
private

◆ m_nRelativePosition

wxRealPoint wxSFShapeBase::m_nRelativePosition
protected

◆ m_nStyle

long wxSFShapeBase::m_nStyle
protected

Shape's style mask.

◆ m_nVAlign

VALIGN wxSFShapeBase::m_nVAlign
protected

Vertical alignment of child shapes.

◆ m_nVBorder

double wxSFShapeBase::m_nVBorder
protected

Value of vertical border used by AlignV function.

◆ m_pUserData

xsSerializable* wxSFShapeBase::m_pUserData
protected

Container for serializable user data associated with the shape.


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