CODController Class
class CODController: public MvcController
The controller handles user interaction and keeps track of UI state information. Messages are forwarded to the controller from the viewport. The controller inherits message map processing from CWnd, but it does not actually have its own window handle. Instead, the controller is plugged into the window that contains the viewport so that it can process messages for the viewport.The controller changes state and updates the viewport as it receives events. When a user interaction task is complete, the controller typically generates a command object and passes it to the model. A set of virtual Execute methods take care of command creation and execution.
The controller keeps track of the currently selected set of components. Many of the tasks that are performed by the controller act upon the current selection. The OnSelectionChange is called whenever the current selection changes.
The controller contains a CODDropTarget object that is used to implement OLE drag and drop. The CreateDropTarget method creates the drop target object and registers the viewport with it.
Defined in: OdController.h
Class Members
Constructor/Destructor
CODController(CODViewport* pViewport = NULL)
Constructor.
virtual ~CODController()
Destructor.
virtual BOOL Create(CWnd* pWnd, sfl::MvcVisualComponent* pComp)
Create the controller on the specified visual component.
General Attributes
int m_state
The current state of the controller.
BOOL m_bEditVertices
TRUE if in edit vertices mode.
CODViewport* m_pViewport
The viewport associated with this controller.
int GetState() const
Gets the current state of the controller
void SetState(const int nState)
Sets the current state of the controller
CODModel* GetCanvasModel() const
Gets the model being controlled.
CODViewport* GetCanvasVp() const
Gets the viewport on the model.
void SetCanvasVp(CODViewport* pVp)
Sets the viewport on the model.
CODViewport* GetVp() const
Gets the viewport on the model.
void SetVp(CODViewport* pVp)
Sets the viewport on the model.
General Operations
virtual void EqualOffset(LPPOINT lpDev)
Causes an operation to have an equal offest in the horizontal and vertical directions.
virtual void Manhattan(LPPOINT lpReference, LPPOINT lpTarget)
Causes lines to form 90 degree angles.
virtual void AlignWithGrid(CODComponent* pComp, OD_CONTROL_POINT nAlignPoint = OD_TOP_LEFT)
Aligns a component with the grid.
virtual void SetWithinBoundaries(CODComponent* pComp)
Adjusts component so it falls within diagram boundaries.
virtual void SetComponentDefaults(CODComponent* pComp)
Sets the current viewport defaults to a component.
virtual void CancelAction(UINT nFlags, CPoint ptDev)
Cancels common actions.
void UseComponentDefaults(BOOL bUseCompDefaults=TRUE)
Set to TRUE if the component should be initialized using default properties contained in the viewport.
BOOL IsUsingComponentDefaults() const
TRUE indicates the component is being initialized using default properties contained in the viewport.
virtual void AddCustomPages(CPropertySheet* pSheet)
Add Customized Pages to the property sheet
BOOL m_bUseCompDefaults
TRUE indicates components should be intialized using properties contained in the viewport.
Viewport coordinate conversions
void VpDPtoLP(LPPOINT lpPoints, int nCount = 1)
Converts points from device coordinates to logical coordinates using the viewport's device context.
void VpDPtoLP(CODPointArray* pPointArray)
Converts points from device coordinates to logical coordinates using the viewport's device context.
void VpLPtoDP(LPPOINT lpPoints, int nCount = 1)
Converts points from logical coordinates to device coordinates using the viewport's device context.
void VpLPtoDP(CODPointArray* pPointArray)
Converts points from logical coordinates to device coordinates using the viewport's device context.
Context Menus
CMenu* m_pContextMenu
A pointer to a menu from which the context menu can be
virtual CMenu* CreateContextMenu()
Creates and initializes the pop up context menu.
virtual void AddVerbsToMenu(HMENU hmenu, CODComponent* pSelection)
Adds control verbs to the context menu
Hit Testing
CPoint m_ptOrigDev
The original point clicked in device coordinates.
CPoint m_ptOrigLog
The original point clicked in logical coordinates.
CPoint m_ptLastMouseMove
The last point sent to the OnMouseMove handler.
CODComponent* m_pCompHit
A pointer to the component hit by a mouse click.
virtual void Rollover(UINT nFlags, CPoint ptDev)
Checks if the mouse has rolled over a part of a component.
virtual BOOL RolloverHandles(UINT nFlags, CPoint ptLog)
Checks if the mouse has rolled over a handle of a component.
virtual BOOL RolloverEdges(UINT nFlags, CPoint ptLog)
Checks if the mouse has rolled over an edge of component.
virtual BOOL RolloverComponents(UINT nFlags, CPoint ptLog)
Checks if the mouse has rolled over a component.
virtual void Hit(UINT nFlags, CPoint ptDev, int nButton = VK_LBUTTON)
Checks if a part of a component has been clicked.
virtual BOOL HitHandle(UINT nFlags, CPoint ptLog, int nButton = VK_LBUTTON)
Checks if a handle of a component has been clicked.
virtual BOOL HitEdge(UINT nFlags, CPoint ptLog, int nButton = VK_LBUTTON)
Checks if an edge of a component has been clicked.
virtual BOOL HitComponent(UINT nFlags, CPoint ptLog, int nButton = VK_LBUTTON)
Checks if a component has been clicked.
virtual void DblHit(UINT nFlags, CPoint ptDev, int nButton = VK_LBUTTON)
Checks if component has been double-clicked.
Selection
CODComponentSet m_setSelection
The currently selected components.
BOOL m_bResetSelection
Non-zero if the selection needs to be reset.
BOOL m_bNoStretchScaling
Non-zero if a no-stretch scaling operation is being performed.
void GetRotateComponents(const CODComponentSet& setComponents, CODComponentSet& setRotate)
Finds the components which allow rotation in a set.
void GetMoveComponents(const CODComponentSet& setComponents, CODComponentSet& setMove)
Finds the components which allow moves in a set.
void GetScaleComponents(const CODComponentSet& setComponents, CODComponentSet& setScale)
Finds the components which allow scaling in a set.
CODComponentSet* GetSelection()
Returns a pointer to the set of selected components.
void ClearSelection()
Clear selection list.
CODComponent* GetAnchor()
Gets the anchor component in the selection.
virtual void OnSelectionChange(CODComponentSet* pChangedSet)
Called whenever the selection changes.
virtual void OnSelectionDo(CODCommand* pCmd)
Used to update the set of selected components when the given command is executed.
virtual void OnSelectionUndo(CODCommand* pCmd)
Used to update the set of selected components when the given command is reversed.
void SelectAll()
Used to select all components in the diagram. This method can be called from a menu message handler. It is not part of the default edit menu.
int Deselect(CODComponentSet* pCompSet)
Removes the given components from the selection set.
BOOL SelectComponent(CODComponent *pCompSel, BOOL bSelect = TRUE, BOOL bDeselectOthers = FALSE)
Used to select and deselect a single component in the diagram based on a boolean parameter.
This method also has the option of deselecting all other components in the diagram or adding a new component to the existing selection.
This method can be called from a menu message handler. It is not part of the default edit menu.
Cursors
HCURSOR m_hCursor
The current cursor being used.
void SetCustomCursor(UINT nCursor = 0)
Sets a cursor from the resources as current.
void SetStandardCursor(LPCTSTR lpszCursor)
Sets one of the standard Windows cursors as current.
Movement
int m_nLastMoveX
The last horizontal movement offset of the component.
int m_nLastMoveY
The last vertical movement offset of the component.
virtual void StartMoving(UINT nFlags, CPoint ptDev)
Called when components begin to move.
virtual void Moving(UINT nFlags, CPoint ptDev)
Called while the components are moving.
virtual void EndMoving(UINT nFlags, CPoint ptDev)
Called when the components stop moving.
OLE Drag and Drop
CLIPFORMAT NEAR m_cfCanvas
The clipboard format of the diagram.
CODDropTarget* m_pDropTarget
The drop target used for OLE drag and drop.
BOOL m_bClipboardText
Indicates if text is supported for clipboard operations.
BOOL m_bClipboardEnhMetafile
Indicates if enhanced metafile format is supported for clipboard operations.
CLIPFORMAT GetClipFormat() const
Returns the clipboard format used in this controller.
BOOL ClipboardTextEnabled() const
Indicates if text is supported for clipboard operations.
void EnableClipboardText(const BOOL bFlag)
Sets a flag that indicates if text is accepted from the clipboard.
BOOL ClipboardEnhMetafileEnabled() const
Indicates if enhanced metafile format is supported for clipboard operations.
void EnableClipboardEnhMetafiles(const BOOL bFlag)
Determines if enhanced metafile format is supported for clipboard operations.
virtual BOOL IsOleInitialized()
Returns TRUE if the OLE libraries have been initialized.
virtual void CopyToClipboard(CODComponentSet* pCompSet)
Copies a set of components to the clipboard.
virtual void CopyFromClipboard(CODComponentSet* pCompSet)
Copies a set of component from the clipboard.
void LoadComponents(CArchive& ar, CODComponentSet& setPrimary, CODComponentSet& setDependents)
Retrieve a set of components and their dependents from an archive.
void StoreComponents(CArchive& ar, const CODComponentSet& setComponents)
Store a set of components and their dependents to an archive.
virtual void DoOleDragAndDrop()
Performs the OLE version of drag and drop.
virtual void CreateDropTarget()
Creates a drop target.
virtual CODDropSource* CreateDropSource()
Creates a drop source.
void SnapToGridWithoutLabels(BOOL bSnapToGridWithoutLabels)
Sets snap after dragging a symbol to grid without counting labels regions.
Rotation
int m_nOrigAngle
The original angle the component was at, in tenths of a degree.
int m_nLastAngle
The last angle the component was at, in tenths of a degree.
CPoint m_ptCenterLog
Center point of a component in logical coordinates.
virtual void StartRotating(UINT nFlags, CPoint ptDev)
Called when components begin to rotate.
virtual void Rotating(UINT nFlags, CPoint ptDev)
Called while components are rotating.
virtual void EndRotating(UINT nFlags, CPoint ptDev)
Called when the components stop rotating.
Scaling
int m_nHandleHit
The index of the control handle hit.
int m_nOrigWidth
The height of the component being scaled.
int m_nOrigHeight
The width of the component being scaled.
float m_fLastScaleX
The last horizontal scaling factor.
float m_fLastScaleY
The last vertical scaling factor.
int m_nHandleIndex
Index of the handle being manipulated.
OD_CONTROL_POINT m_nLastCenter
The last control point used for the origin of an operation
virtual void StartScaling(UINT nFlags, CPoint ptDev)
Called when components being scaling.
virtual void Scaling(UINT nFlags, CPoint ptDev)
Called while the components are scaling.
virtual void EndScaling(UINT nFlags, CPoint ptDev)
Called when the components finish scaling.
Vertex editing
virtual BOOL IsEditingVertices()
Returns TRUE if in edit vertex mode.
virtual BOOL CanEditVertices(CODComponent* pComp)
Returns TRUE if the vertices of the component can be edited.
virtual BOOL CanAlwaysEditVertices(CODComponent* pComp)
Returns TRUE if the vertices of the component can always be edited.
virtual BOOL IsVertexEditAllowed(CODComponent* pComp)
Returns TRUE if a vertex editing operation is currently allowed on the component.
virtual void StartMovingVertex(UINT nFlags, CPoint ptDev)
Called when a vertex of a component begins to move.
virtual void MovingVertex(UINT nFlags, CPoint ptDev)
Called while a vertex of a component is moving.
virtual void EndMovingVertex(UINT nFlags, CPoint ptDev)
Called when a vertex of a component stop moving.
virtual void StartMovingPort(UINT nFlags, CPoint ptDev)
Called when a port begins to move.
virtual void MovingPort(UINT nFlags, CPoint ptDev)
Called while a port is moving.
virtual void EndMovingPort(UINT nFlags, CPoint ptDev)
Called when a port stops moving.
virtual void CancelMovingPort(UINT nFlags, CPoint ptDev)
Called to cancel the moving of a port.
CODPortComponent* m_pMovingPort
Pointer to port that is moving.
CODConnection* m_pMovingConnection
Pointer to connection that affected by moving port.
Text editing
CODTextComponent* m_pTextEdit
Pointer to text component being edited.
virtual BOOL StartTextEdit(UINT nFlags, CPoint ptDev)
Begin editing the text component at the given point.
virtual void EndTextEdit(UINT nFlags, CPoint ptDev)
Finish text component editing.
virtual void UpdateTextEdit()
Synchronize active text component.
Line creation
void TrackLine(CPoint ptTrackDev)
Tracks a line on the screen.
virtual void LineReady(UINT nFlags, CPoint ptDev)
Called when the user is ready to draw a line.
virtual void StartLine(UINT nFlags, CPoint ptDev)
Called when the line starts to be drawn.
virtual void DrawingLine(UINT nFlags, CPoint ptDev)
Called while the line is being drawn.
virtual void EndLine(UINT nFlags, CPoint ptDev)
Called when the line has beem completed.
virtual void CancelLine(UINT nFlags, CPoint ptDev)
Called to cancel the drawing of the line.
Polyline creation
void TrackPolyline(CPoint ptTrackDev)
Tracks a multi-segmented line.
virtual void PolylineReady(UINT nFlags, CPoint ptDev)
Called when the user is ready to draw a multi-segmented line.
virtual void StartPolyline(UINT nFlags, CPoint ptDev)
Called when the polyline is started.
virtual void GrowPolyline(UINT nFlags, CPoint ptDev)
Called when a new segment is added to the line.
virtual void DrawingPolyline(UINT nFlags, CPoint ptDev)
Called while the multi-segmented line is being drawn.
virtual void EndPolyline(UINT nFlags, CPoint ptDev)
Called when the multi-segmented line is complete.
virtual void CancelPolyline(UINT nFlags, CPoint ptDev)
Called to cancel the drawing of the multi-segmented line.
Polygon creation
void TrackPolygon(CPoint ptTrackDev)
Tracks a polygon.
virtual void PolygonReady(UINT nFlags, CPoint ptDev)
Called when the user is ready to draw a polygon.
virtual void StartPolygon(UINT nFlags, CPoint ptDev)
Called when a polygon is started.
virtual void GrowPolygon(UINT nFlags, CPoint ptDev)
Called when a segment is added to the polygon.
virtual void DrawingPolygon(UINT nFlags, CPoint ptDev)
Called as the polygon is being drawn.
virtual void EndPolygon(UINT nFlags, CPoint ptDev)
Called when the polygon is complete.
virtual void CancelPolygon(UINT nFlags, CPoint ptDev)
Called to cancel the drawing of the polygon.
Curve creation
void TrackPolyCurve(CPoint ptTrackDev)
Tracks the creation of a polycurve shape on the screen.
virtual void PolyCurveReady(UINT nFlags, CPoint ptDev)
Called when the user is ready to start drawing an polycurve.
virtual void StartPolyCurve(UINT nFlags, CPoint ptDev)
Called when the curve starts to be drawn.
virtual void GrowPolyCurve(UINT nFlags, CPoint ptDev)
Called when a new segment is added to the current spline.
virtual void DrawingPolyCurve(UINT nFlags, CPoint ptDev)
Called while the curve is being drawn.
virtual void EndPolyCurve(UINT nFlags, CPoint ptDev)
Called when the curve is complete.
virtual void CancelPolyCurve(UINT nFlags, CPoint ptDev)
Called to cancel the drawing of the curve.
Closed Curve creation
void TrackClosedCurve(CPoint ptTrackDev)
Tracks the creation of a curve shape on the screen.
virtual void ClosedCurveReady(UINT nFlags, CPoint ptDev)
Called when the user is ready to start drawing an curve.
virtual void StartClosedCurve(UINT nFlags, CPoint ptDev)
Called when the curve starts to be drawn.
virtual void GrowClosedCurve(UINT nFlags, CPoint ptDev)
Called when a new segment is added to the current spline.
virtual void DrawingClosedCurve(UINT nFlags, CPoint ptDev)
Called while the curve is being drawn.
virtual void EndClosedCurve(UINT nFlags, CPoint ptDev)
Called when the curve is complete.
virtual void CancelClosedCurve(UINT nFlags, CPoint ptDev)
Called to cancel the drawing of the curve.
Rectangle creation
void TrackRect(CPoint ptTrackDev)
Tracks a rectangle on the screen.
virtual void RectReady(UINT nFlags, CPoint ptDev)
Called when the user is ready to start drawing a rectangle.
virtual void StartRect(UINT nFlags, CPoint ptDev)
Called when the rectangle starts to be drawn.
virtual void DrawingRect(UINT nFlags, CPoint ptDev)
Called while the rectangle is being drawn.
virtual void EndRect(UINT nFlags, CPoint ptDev)
Called when the rectangle is complete.
virtual void CancelRect(UINT nFlags, CPoint ptDev)
Called to cancel the drawing of the rectangle.
Ellipse creation
void TrackEllipse(CPoint ptTrackDev)
Tracks an ellipse shape on the screen.
virtual void EllipseReady(UINT nFlags, CPoint ptDev)
Called when the user is ready to start drawing an ellipse.
virtual void StartEllipse(UINT nFlags, CPoint ptDev)
Called when the ellipse starts to be drawn.
virtual void DrawingEllipse(UINT nFlags, CPoint ptDev)
Called while the ellipse is being drawn.
virtual void EndEllipse(UINT nFlags, CPoint ptDev)
Called when the ellipse is complete.
virtual CODComponent* CreateEllipse(const CRect& rcCreate)
Called by the framework to create an ellipse component.
virtual void CancelEllipse(UINT nFlags, CPoint ptDev)
Called to cancel the drawing of the ellipse.
Image insertion
virtual void InsertImage(UINT nFlags, CPoint ptDev)
Called when the user is ready to insert an image.
virtual void CancelImage(UINT nFlags, CPoint ptDev)
Called to cancel the image insertion.
Text creation
virtual void InsertText(UINT nFlags, CPoint ptDev)
Called when the user is ready to insert text.
virtual void CancelText(UINT nFlags, CPoint ptDev)
Called to cancel the text insertion.
Port creation
virtual void InsertPort(UINT nFlags, CPoint ptDev)
Called when the user is ready to insert a port.
virtual void CancelPort(UINT nFlags, CPoint ptDev)
Called to cancel the port insertion.
Symbol insertion
CODComponent* m_pInsert
The component being inserted into the diagram.
CODPointArray m_arPointsLog
A list of gathered points, in logical coordinates.
virtual void OnInsertSymbol(CODComponent* pSymbolInsert)
Called when the user is ready to insert a symbol.
virtual void OnDrawSymbol(CODComponent* pSymbolInsert)
Called when the user is ready to draw a symbol.
virtual void SymbolReady(UINT nFlags, CPoint ptDev)
Called when a left mouse button down event is received to begin drawing the tracking rectangle for a new symbol.
virtual void StartSymbol(UINT nFlags, CPoint ptDev)
Called when the user begins to draw the new symbol.
virtual void DrawingSymbol(UINT nFlags, CPoint ptDev)
Called when the user is in the process of drawing the new symbol.
virtual void EndSymbol(UINT nFlags, CPoint ptDev)
Called when the user finishes drawing the new symbol.
virtual void InsertSymbol(UINT nFlags, CPoint ptDev)
Called to insert a symbol.
virtual void CancelSymbol(UINT nFlags, CPoint ptDev)
Called to cancel the symbol insertion.
Tracking
CPoint m_ptTrackDev
Tracking point, in device coordinates.
CODComponentSetTracker m_compSetTracker
The components which are being tracked.
CODComponentSet m_setTracking
The set of components begin tracked.
CODComponentSet m_setCmdTracking
The set of editable components to which tracking changes will be applied.
CODComponentSet m_setTrackingDep
The set of components which are dependant on the components being tracked.
virtual void SetCapture()
Sets mouse capture, handling associated MVC implementation details.
virtual void ReleaseCapture()
Releases mouse capture, handling associated MVC implementation details.
virtual void BeginTracking(const CODComponentSet& setTracking)
Begins tracking the manipluation of components.
virtual void EraseTracking()
Erases tracking in viewport.
virtual void DrawTracking()
Draws tracking in viewport.
virtual void EndTracking()
Ends the tracking of components.
Linking
CODPortComponent* m_pSourcePort
The source port of a link operation.
CODPortComponent* m_pTargetPort
The target port of a link operation.
int m_nPortHitTestSlop
Size of slop value in device units for port hit testing.
virtual void OnInsertLink(CODLinkComponent* pLinkInsert)
Called when the user is ready to insert a link.
virtual void LinkReady(UINT nFlags, CPoint ptDev)
Called when the user is ready to create a link.
virtual void GrowLink(UINT nFlags, CPoint ptDev)
Called when a segment is added to the link.
virtual void DrawingLink(UINT nFlags, CPoint ptDev)
Called while the link is being drawn.
virtual void EndLink(UINT nFlags, CPoint ptDev)
Called when the link is complete.
virtual void CancelLink(UINT nFlags, CPoint ptDev)
Called to cancel the link.
void SetPortHitTestSlop(const int nPortHitTestSlop)
Sets the slop value for port hit testing.
Zooming
virtual void ZoomIn(UINT nFlags, CPoint ptDev)
Zooms in on the diagram.
virtual void ZoomOut(UINT nFlags, CPoint ptDev)
Zooms out from the diagram.
virtual void ZoomReady(UINT nFlags, CPoint ptDev)
Called when the controller is ready to start a zoom operation.
virtual void StartZoomRect(UINT nFlags, CPoint ptDev)
Called when the controller starts tracking a zoom rectangle.
virtual void ZoomRect(UINT nFlags, CPoint ptDev)
Called while the zoom rectangle is being drawn.
virtual void EndZoomRect(UINT nFlags, CPoint ptDev)
Called when the zoom rectangle is complete.
Panning
virtual void PanReady(UINT nFlags, CPoint ptDev)
Called when the controller is ready to start panning.
virtual void Panning(UINT nFlags, CPoint ptDev)
Called as the controller is panning the viewport.
virtual void EndPanning(UINT nFlags, CPoint ptDev)
Called when panning is complete.
virtual void StartSelecting(UINT nFlags, CPoint ptDev)
Called when the selection rectangle is started.
virtual void Selecting(UINT nFlags, CPoint ptDev)
Called while the selection rectangle is being drawn.
virtual void EndSelecting(UINT nFlags, CPoint ptDev)
Called when the selection rectangle has been completed.
Drag Scrolling
int m_nDragScrollMargin
Margin for drag scrolling in device units.
int m_nDragScrollIncrement
Number of logical to units to scroll when drag scrolling.
SEC_UINT m_nDragScrollTimerID
Event ID for drag scroll timer.
UINT m_nDragScrollTimerElapse
Time-out value for drag scroll timer.
void SetDragScrolling(const int nMargin, const int nIncrement = 10, const UINT nTimerElapse = 100, const UINT nTimerID = 1001)
Enables or disables drag scrolling and initializes drag scroll parameters.
BOOL StartDragScroll()
Sets the timer for drag scrolling.
BOOL StopDragScroll()
Kills the timer for drag scrolling.
BOOL DragScrollHitTest(const CPoint& ptDrag)
Determine if the given point falls within the drag scroll margin.
virtual BOOL DoDragScroll(const CPoint& ptDrag, CSize& szScroll)
Scrolls the viewport if the point is within the drag scroll margin.
virtual void OnDragScroll()
Called by the framework when the drag scroll timer fires.
Grouping
virtual CODComponent* CreateGroupComponent(const CODComponentSet& setGroup)
Factory method for creating component for group operation.
Input focus
virtual CODComponent* SetFocusNext()
Change input focus to next component in tab order.
virtual CODComponent* SetFocusPrev()
Change input focus to previous component in tab order.
File Export
virtual BOOL FileExportPrompt(CString& strFileName, DWORD* pFilterIdx = NULL, UINT nTitleID = IDS_OD_EXPORT_TITLE, UINT nFilterID = IDS_OD_EXPORT_FILTER)
Prompts the user for a filename and format to export diagram into.
virtual BOOL SaveDib(LPCTSTR lpszFileName)
Saves contents of the viewport to a Windows bitmap.
virtual BOOL SaveMetafile(LPCTSTR lpszFileName)
Saves the contents of the viewport to an enhanced metafile.
CSize m_szMag
The current magnification of the viewport.
Command Creation
virtual CODInsertCommand* ExecuteInsertCommand(CODComponent* pComp, const BOOL bAllowDuplicates = TRUE)
Creates and executes an insert command for a single component.
virtual CODInsertCommand* ExecuteInsertCommand(CODComponentSet* pCompSet, const BOOL bAllowDuplicates = TRUE)
Creates and executes an insert command for a set of components.
virtual CODDeleteCommand* ExecuteDeleteCommand(CODComponentSet* pCompSet)
Creates and executes a delete command.
virtual void RemoveImage(CODComponentSet* pCompSet)
Removes deleted image component
virtual CODGroupCommand* ExecuteGroupCommand(CODComponentSet* pCompSet)
Creates and executes a group command.
virtual CODUngroupCommand* ExecuteUngroupCommand(CODComponentSet* pCompSet)
Creates and executes an ungroup command.
virtual CODLinkCommand* ExecuteLinkCommand(const CODPointArray& pointArray, CODPortComponent* pSourcePort, CODPortComponent* pTargetPort, CODEndpoint* pSourceEndpoint = NULL, CODEndpoint* pTargetEndpoint = NULL)
Creates and executes a link command.
virtual CODLinkCommand* ExecuteLinkCommand(CODLinkComponent* pLinkComp, const CODPointArray& pointArray, CODPortComponent* pSourcePort, CODPortComponent* pTargetPort)
Creates and executes a link command.
virtual CODLinkCommand* ExecuteLinkCommand(CODLinkComponent* pLinkComp, CODPortComponent* pSourcePort, CODPortComponent* pTargetPort)
Creates and executes a link command.
virtual CODOrderCommand* ExecuteOrderCommand(CODComponentSet* pCompSet, OD_ORDER nOrderType)
Creates and executes an order command.
virtual CODMoveCommand* ExecuteMoveCommand(CODComponentSet* pCompSet, int nOffsetX, int nOffsetY)
Creates and executes a move command.
virtual CODRotateCommand* ExecuteRotateCommand(CODComponentSet* pCompSet, int nAngle)
Creates and executes a rotate command.
virtual CODScaleCommand* ExecuteScaleCommand(CODComponentSet* pCompSet, float fScaleX, float fScaleY, OD_CONTROL_POINT nControlPoint)
Creates and executes a scale command.
virtual CODInsertVertexCommand* ExecuteInsertVertexCommand(CODComponent* pComp, int nVertexIndex, CPoint ptVertex)
Creates and executes an insert vertex command.
virtual CODDeleteVertexCommand* ExecuteDeleteVertexCommand(CODComponent* pComp, int nVertexIndex)
Creates and executes a delete vertex command.
virtual CODMoveVertexCommand* ExecuteMoveVertexCommand(CODComponent* pComp, int nVertexIndex, int nOffsetX, int nOffsetY)
Creates and executes a move vertex command.
virtual CODMovePortCommand* ExecuteMovePortCommand(CODPortComponent* pPort, int nOffsetX, int nOffsetY, CODPortComponent* pPortConnect = NULL)
Creates and executes a move port command.
virtual CODTextCommand* ExecuteTextCommand(CODComponentSet* pCompSet, const LPCTSTR lpszText)
Creates and executes a text command.
virtual CODAlignCommand* ExecuteAlignCommand(CODComponentSet* pCompSet, OD_ALIGNMENT nAlignment)
Creates and executes an align command.
virtual CODSpacingCommand* ExecuteSpaceAcrossCommand(CODComponentSet* pCompSet)
Creates and executes a spacing command to evenly space components across the canvas.
virtual CODSpacingCommand* ExecuteSpaceDownCommand(CODComponentSet* pCompSet)
Creates and executes a spacing command to evenly space components down the canvas.
virtual CODSizeCommand* ExecuteSetWidthCommand(CODComponentSet* pCompSet, const int nWidth)
Creates and executes a size command to set the width of the components.
virtual CODSizeCommand* ExecuteSetHeightCommand(CODComponentSet* pCompSet, const int nHeight)
Creates and executes a size command to set the height of the components.
virtual CODSizeCommand* ExecuteSetSizeCommand(CODComponentSet* pCompSet, const CSize& szBounds)
Creates and executes a size command to set the size of the components.
Generated message map functions
afx_msg void OnEditCut()
Called to move the components currently selected to the clipboard.
afx_msg void OnEditCopy()
Called to copy the components currently selected to the clipboard.
afx_msg void OnEditPaste()
Called to paste the components currently on the clipboard to the diagram.
afx_msg void OnUpdateEditPaste(CCmdUI* pCmdUI)
Updates a user interface object associated with pasting.
afx_msg void OnEditUndo()
Called to undo the last action.
afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI)
Updates a user interface object associated with undo.
afx_msg void OnEditRedo()
Called to redo the last action undone.
afx_msg void OnUpdateEditRedo(CCmdUI* pCmdUI)
Updates a user interface object associated with redo.
afx_msg void OnEditClear()
Called to delete the components currently selected.
afx_msg void OnVerb( UINT nID )
Called to invoke a verb from the context menu.
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
Called when a nonsystem key is pressed.
afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
Called when a nonsystem key is released.
afx_msg void OnLButtonDown(UINT nFlags, CPoint point)
Called when the left mouse button is pressed.
afx_msg void OnLButtonUp(UINT nFlags, CPoint point)
Called when the left mouse button is released.
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point)
Called when the left mouse button is double-clicked.
afx_msg void OnRButtonDown(UINT nFlags, CPoint point)
Called when the right mouse button is pressed.
afx_msg void OnRButtonUp(UINT nFlags, CPoint point)
Called when the right mouse button is released.
afx_msg void OnMouseMove(UINT nFlags, CPoint point)
Called when the mouse cursor is moved.
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
Called to set the current cursor.
afx_msg void OnViewComponents()
Called when the user wants to view a list of components currently in the diagram.
afx_msg void OnViewGrid()
Toggles the visibility of the background grid.
afx_msg void OnUpdateViewGrid(CCmdUI* pCmdUI)
Updates a user interface object associated with grid visibility.
afx_msg void OnViewPageBounds()
Toggles the visibility of the page bounds.
afx_msg void OnUpdateViewPageBounds(CCmdUI* pCmdUI)
Updates a user interface object associated with page bounds visibility.
afx_msg void OnSnapToGrid()
Toggles the snap to grid setting.
afx_msg void OnUpdateSnapToGrid(CCmdUI* pCmdUI)
Updates a user interface object associated with snap to grid.
afx_msg void OnAngleSnap()
Toggles the angle snap setting.
afx_msg void OnUpdateAngleSnap(CCmdUI* pCmdUI)
Updates a user interface object associated with angle snap.
afx_msg void OnPageSetup()
Called when the user wants to view or edit the page settings.
afx_msg void OnProperties()
Called when the user wishes to view or edit the properties associated with the components in the current selection.
afx_msg void OnGridProperties()
Called when the user wants to view or edit the grid properties.
afx_msg void OnDefaultProperties()
Called when the user wants to view or edit the default properites for all new components.
afx_msg void OnGroup()
Called to group the currently selected components into one composite component.
afx_msg void OnUngroup()
Called to split up the currently selected components into their individual subcomponents, if possible.
afx_msg void OnUpdateUngroup(CCmdUI* pCmdUI)
Updates a user interface object associated with ungrouping.
afx_msg void OnDrawSelect()
Called when the controller is put into selection mode.
afx_msg void OnUpdateDrawSelect(CCmdUI* pCmdUI)
Updates a user interface object associated with selection.
afx_msg void OnRotate()
Called when the controller is put into rotation mode.
afx_msg void OnUpdateRotate(CCmdUI* pCmdUI)
Updates a user interface object associated with rotation.
afx_msg void OnRotateLeft()
Called to rotate the currently selected components 90 degrees counter clockwise.
afx_msg void OnRotateRight()
Called to rotate the currently selected components 90 degrees clockwise.
afx_msg void OnDrawRect()
Called to start the creation process of a new rectangle component.
afx_msg void OnUpdateDrawRect(CCmdUI* pCmdUI)
Updates a user interface object associated with drawing a rectangle.
afx_msg void OnDrawPolyCurve()
Called to start the creation process of a new polycurve component.
afx_msg void OnUpdateDrawPolyCurve(CCmdUI* pCmdUI)
Updates a user interface object associated with drawing a polycurve.
afx_msg void OnDrawClosedCurve()
Called to start the creation process of a new closed curve component.
afx_msg void OnUpdateDrawClosedCurve(CCmdUI* pCmdUI)
Updates a user interface object associated with drawing a closed curve.
afx_msg void OnDrawEllipse()
Called to start the creation process of a new ellipse component.
afx_msg void OnUpdateDrawEllipse(CCmdUI* pCmdUI)
Updates a user interface object associated with drawing an ellipse.
afx_msg void OnDrawLine()
Called to start the creation process of a new line component.
afx_msg void OnUpdateDrawLine(CCmdUI* pCmdUI)
Updates a user interface object associated with drawing a line.
afx_msg void OnDrawPolyline()
Called to start the creation process of a new polyline component.
afx_msg void OnUpdateDrawPolyline(CCmdUI* pCmdUI)
Updates a user interface object associated with drawing a polyline.
afx_msg void OnDrawPolygon()
Called to start the creation process of a new polygon component.
afx_msg void OnUpdateDrawPolygon(CCmdUI* pCmdUI)
Updates a user interface object associated with drawing a polygon.
afx_msg void OnDrawText()
Called to start the creation process of a new text component.
afx_msg void OnUpdateDrawText(CCmdUI* pCmdUI)
Updates a user interface object associated with creating a text component.
afx_msg void OnDrawImage()
Called to start the creation process of a new image component.
afx_msg void OnUpdateDrawImage(CCmdUI* pCmdUI)
Updates the user interface object associated with creating an image component.
afx_msg void OnDrawPort()
Called to start the creation process of a new port component.
afx_msg void OnUpdateDrawPort(CCmdUI* pCmdUI)
Updates a user interface object associated with creating a port component.
afx_msg void OnLinkSymbols()
Called to start the creation process of a new link component.
afx_msg void OnUpdateLinkSymbols(CCmdUI* pCmdUI)
Updates a user interface object associated with creating a link.
afx_msg void OnFlipHorizontal()
Called to flip the currently selected components about the y axis.
afx_msg void OnFlipVertical()
Called to flip the currently selected components about the x axis.
afx_msg void OnNudgeUp()
Called to move the currently selected components up slightly.
afx_msg void OnNudgeDown()
Called to move the currently selected components down slightly.
afx_msg void OnNudgeLeft()
Called to move the currently selected components to the left slightly.
afx_msg void OnNudgeRight()
Called to move the currently selected components to the right slightly.
afx_msg void OnSetFocusNext()
Set focus to next component in tab order.
afx_msg void OnSetFocusPrev()
Set focus to previous component in tab order.
afx_msg void OnAlignMiddle()
Called to align the vertical centers of the currently selected components.
afx_msg void OnAlignBottom()
Called to align the bottoms of the currently selected components.
afx_msg void OnAlignLeft()
Called to align the left sides of the currently selected components.
afx_msg void OnAlignCenter()
Called to align the horizontal centers of the currently selected components.
afx_msg void OnAlignRight()
Called to align the right sides of the currently selected components.
afx_msg void OnSpaceAcross()
Called to space components evenly across the canvas.
afx_msg void OnSpaceDown()
Called to space components evenly down the canvas.
afx_msg void OnSameWidth()
Called to make selected components the same width.
afx_msg void OnSameHeight()
Called to make selected components the same height.
afx_msg void OnSameSize()
Called to make selected components the same size.
afx_msg void OnFront()
Called to move the currently selected components to the front.
afx_msg void OnBack()
Called to move the currently selected components to the back.
afx_msg void OnForward()
Called to move the currently selected components forward one.
afx_msg void OnBackward()
Called to move the currently selected components backward one.
afx_msg void OnEditVertices()
Called to turn edit vertices mode on or off.
afx_msg void OnUpdateEditVertices(CCmdUI* pCmdUI)
Updates a user interface object associated with setting the edit vertices mode.
afx_msg void OnUpdateSelected(CCmdUI* pCmdUI)
Updates a user interface object that depends on at least one component being selected.
afx_msg void OnUpdateMultipleSelected(CCmdUI* pCmdUI)
Updates a user interface object that depends on more than one component being selected.
afx_msg void OnUpdateMoveSelected(CCmdUI* pCmdUI)
Updates the user interface object associated with edit components and depends on at least one movable component being selected.
afx_msg void OnUpdateMoveMultipleSelected(CCmdUI* pCmdUI)
Updates the user interface object associated with edit components and depends on at least two components (one moveable) being selected.
afx_msg void OnUpdateRotateSelected(CCmdUI* pCmdUI)
Updates the user interface object associated with edit components and depends on at least one rotatable component being selected.
afx_msg void OnUpdateScaleSelected(CCmdUI* pCmdUI)
Updates the user interface object associated with edit components and depends on at least one scalable component being selected.
afx_msg void OnUpdatePropEditSelected(CCmdUI* pCmdUI)
Updates the user interface object associated with edit components and depends on at least one component with editable properties being selected.
afx_msg void OnUpdateEditSelected(CCmdUI* pCmdUI)
Updates the user interface object associated with edit components and depends on one or more components being selected.
afx_msg void OnUpdateEditMultipleSelected(CCmdUI* pCmdUI)
Updates the user interface object associated with edit components and depends on more than one component being selected.
afx_msg void OnMeasurements()
Opens a dialog for changing the canvas size and units of measure.
afx_msg void OnZoom()
Called when the user indicates they want to begin a zoom operation.
afx_msg void OnUpdateZoom(CCmdUI* pCmdUI)
Updates a user interface object associated with zooming.
afx_msg void OnZoomNormal()
Sets the diagram back to its original zoom factor of 100%.
afx_msg void OnUpdateZoomNormal(CCmdUI* pCmdUI)
Updates a user interface object associated with zooming to normal size.
afx_msg void OnZoomCustom()
Zooms to a custom percentage.
afx_msg void OnUpdateZoomCustom(CCmdUI* pCmdUI)
Updates a user interface object associated with custom zoom.
afx_msg void OnZoomFit()
Zooms so all of the components in the model are shown in the viewport.
afx_msg void OnUpdateZoomFit(CCmdUI* pCmdUI)
Updates a user interface object associated with zoom to fit.
afx_msg void OnZoomSelection()
Zooms so all of the currently selected components are show in the viewport.
afx_msg void OnZoom50Pct()
Zooms so the diagram is 50% of its original size.
afx_msg void OnUpdateZoom50Pct(CCmdUI* pCmdUI)
Updates a user interface object associated with 50% zoom.
afx_msg void OnZoom75Pct()
Zooms so the diagram is 75% of its original size.
afx_msg void OnUpdateZoom75Pct(CCmdUI* pCmdUI)
Updates a user interface object associated with 75% zoom.
afx_msg void OnZoom100Pct()
Zooms so the diagram is 100% of its original size.
afx_msg void OnUpdateZoom100Pct(CCmdUI* pCmdUI)
Updates a user interface object associated with 100% zoom.
afx_msg void OnZoom200Pct()
Zooms so the diagram is 200% of its original size.
afx_msg void OnUpdateZoom200Pct(CCmdUI* pCmdUI)
Updates a user interface object associated with 200% zoom.
afx_msg void OnPan()
Called when the user indicates they want to begin a panning operation.
afx_msg void OnUpdatePan(CCmdUI* pCmdUI)
Updates a user interface object associated with panning.
afx_msg void OnChangeTextEdit()
Called as the user is typing new characters for a text component.
afx_msg void OnReturnNotifyTextEdit(NMHDR* pNMHDR, LRESULT* pResult)
Called when the user presses the enter key in the text component (edit-mode).
afx_msg void OnDebugDraw()
Toggles debug drawing mode.
afx_msg void OnContextMenu(CWnd* pWnd, CPoint point)
Pops up a context menu in response to the menu key.
afx_msg void OnFileExport()
Exports the viewport to a selected file format.
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
Called when a control needs a brush for painting itself.
afx_msg void OnTimer(SEC_UINT nIDEvent)
Called when a timer event is fired.
Alignment settings
virtual void SetAlignCenterPort(const BOOL bAlignCenterPort = TRUE)
Sets the alignment by central port location.
virtual void SetAlignNoLabel(const BOOL bAlignNoLabel = TRUE)
Sets the alignment by base region without a label.