GME  13
GMEView.h
Go to the documentation of this file.
00001 // GMEView.h : interface of the CGMEView class
00002 //
00004 
00005 
00006 #if !defined(AFX_GMEVIEW_H__BD235B55_BD3F_11D3_91E2_00104B98EAD9__INCLUDED_)
00007 #define AFX_GMEVIEW_H__BD235B55_BD3F_11D3_91E2_00104B98EAD9__INCLUDED_
00008 
00009 #if _MSC_VER > 1000
00010 #pragma once
00011 #endif // _MSC_VER > 1000
00012 
00013 #include "GMEStd.h"
00014 #include "GMEOLEData.h"
00015 #include "GuiObject.h"
00016 #include "AspectSyncDlg.h"
00017 #include "ScrollZoomView.h"
00018 #include "GMEViewOverlay.h"
00019 #include <list>
00020 
00021 class CViewDriver;
00022 class CChildFrame;
00023 class CGMEDoc;
00024 
00025 
00026 class CGMEView :        public CScrollZoomView
00027 {
00028         friend class CGMEOLEModel;
00029         friend class CGMEOLEIt;
00030         friend class GMEViewOverlay;
00031         std::unique_ptr<GMEViewOverlay> m_overlay;
00032         void HighlightConnection(CGuiConnection* connection);
00033 public:
00034         virtual BOOL OnScrollBy(CSize sizeScroll, BOOL bDoScroll = TRUE) {
00035                 m_overlay = nullptr;
00036                 return __super::OnScrollBy(sizeScroll, bDoScroll);
00037         }
00038 
00039 protected: // create from serialization only
00040         CGMEView();
00041         DECLARE_DYNCREATE(CGMEView)
00042 
00043 private:
00044         bool                    m_preview;
00045         CGuiMetaAspect* m_prevcurrasp;
00046         int                             m_scalePrnPages;
00047         int                             m_currPrnNumAsp;
00048         int                             m_fullPrnAspNum;
00049         POSITION                m_prnpos;
00050         unsigned int    m_lastPrnPage;
00051         unsigned long   m_findNextAlreadyAchieved;
00052         bool                    m_supressConnectionCheckAlert;
00053 
00054         void                    SetZoomPoint(int curzoom, CPoint point);
00055         bool                    GetNamePositionVal(CComPtr<IMgaFCO>& ccpMgaFCO, int *valRet);
00056         void                    SetNamePositionVal(CComPtr<IMgaFCO>& ccpMgaFCO, int val);
00057         void                    ChangeNamePosition(int w);
00058         void                    UpdateNamePositionMenuItem(CCmdUI* pCmdUI, int this_val);
00059         bool                    AskUserAndDetachIfNeeded(CComPtr<IMgaFCO>& mgafco);
00060         CGuiObject*             HelpMeFindNextObject(bool p_secondFind);
00061         bool IsLegalConnectionEnd(CGuiObject *connEnd, CGuiPort *port = NULL);
00062 
00063 public:
00064         bool m_isActive;
00065         void DoPannWinRefresh();
00066 
00067 public:
00068         void PrepareAspectPrn(CPrintInfo* pInfo);
00069         bool ChangePrnAspect(CString aspect);
00070         void SaveCurrAsp() { m_prevcurrasp = currentAspect; }
00071         CGuiMetaAspect* GetSavedAsp() { CGuiMetaAspect *ret = m_prevcurrasp; m_prevcurrasp = NULL; return ret; }
00072         bool IsPreview() { return m_preview; }
00073         void SetPreview(bool set) { m_preview = set; }
00074 
00075 // Attributes
00076 public:
00077         static int                              inTransaction;
00078         static bool                             inRWTransaction;
00079         static bool                             inEventHandler;
00080         static int                              instanceCount;
00081         static int                              offScreenCreated;
00082         static CDC*                             offScreen;
00083         static CBitmap*                 ofsbmp;
00084         static HCURSOR                  autoconnectCursor;
00085         static HCURSOR                  autoconnect2Cursor;
00086         static HCURSOR                  disconnectCursor;
00087         static HCURSOR                  disconnect2Cursor;
00088         static HCURSOR                  setCursor;
00089         static HCURSOR                  set2Cursor;
00090         static HCURSOR                  zoomCursor;
00091         static HCURSOR                  visualCursor;
00092         static HCURSOR                  editCursor;
00093         static bool                             derivedDrop;
00094         static bool                             instanceDrop;
00095         static bool                             showConnectedPortsOnly;
00096 
00097         // === Start of decorator operation specific variables ===
00098 private:
00099         CRect                                   originalRect;
00100         CGuiObject*                             objectInDecoratorOperation;
00101         CGuiAnnotator*                  annotatorInDecoratorOperation;
00102         bool                                    isCursorChangedByDecorator;
00103         bool                                    inElementDecoratorOperation;
00104         bool                                    inOpenedDecoratorTransaction;
00105         bool                                    isContextInitiatedOperation;
00106         bool                                    shouldCommitOperation;
00107         bool                                    decoratorOrAnnotator;
00108         bool m_dropRightClick;
00109 public:
00110         bool m_bEnablePannWindowRefresh;
00111         struct ContextClickState {
00112                 UINT            nFlags;
00113                 CPoint          lpoint;
00114                 CPoint          dpoint;
00115         };
00116         ContextClickState               ctxClkSt;
00117         CGuiObject*                             selectedObjectOfContext;
00118         CGuiAnnotator*                  selectedAnnotationOfContext;
00119         CGuiConnection*                 selectedConnection;
00120         bool                                    isConnectionJustSelected;
00121         bool                                    isLeftMouseButtonDown;
00122         bool                                    doNotDeselectAfterInPlaceEdit;  // disable deselection code, if in-place edit took place (up was handled)
00123         // for connection customize operation
00124         bool                                    isInConnectionCustomizeOperation;
00125         PathCustomizationType   customizeConnectionType;
00126         int                                             customizeConnectionEdgeIndex;
00127         ConnectionPartMoveType  customizeConnectionPartMoveMethod;
00128         bool                                    customizeHorizontalOrVerticalEdge;
00129         CPoint                                  customizeConnectionEdgeStartPoint;
00130         CPoint                                  customizeConnectionEdgeEndPoint;
00131         CPoint                                  customizeConnectionEdgeThirdPoint;
00132         long                                            customizeConnectionEdgeXMinLimit;
00133         long                                            customizeConnectionEdgeXMaxLimit;
00134         long                                            customizeConnectionEdgeYMinLimit;
00135         long                                            customizeConnectionEdgeYMaxLimit;
00136         CPoint                                  customizeConnectionOrigCursor;
00137         CPoint                                  customizeConnectionCurrCursor;
00138         bool                                    isCursorChangedByEdgeCustomize;
00139         HCURSOR                                 customizeConnectionCursorBackup;
00140         // for connection context menu
00141         CGuiConnection*                 selectedContextConnection;
00142         PathCustomizationType   contextConnectionCustomizationType;
00143         int                                             contextConnectionEdgeIndex;
00144         int                                             contextConnectionEdge2Index;
00145         ConnectionPartMoveType  contextConnectionPartMoveMethod;
00146         // === End of decorator operation specific variables ===
00147         COleDropTarget                  dropTarget;
00148         bool                                    inDrag;
00149         CGMEDataDescriptor              dragDesc;
00150         DROPEFFECT                              prevDropEffect;
00151         CRect                                   dragRect;
00152         CPoint                                  dragPoint;
00153         CPoint                                  dragOffset;
00154         CPoint                                  contextMenuLocation;
00155         std::set<CString> uncreatableDecorators;
00156 
00157         CComPtr<IMgaTerritory>  terry;
00158         CComPtr<IMgaModel>              currentModel;
00159         CComBSTR                                currentModId;
00160         CComPtr<IMgaFCO>                baseType;                       // currentModel's baseType (or type in case of an instance)
00161         CComPtr<IMgaModel>              parent;
00162         CComPtr<CViewDriver>    driver;
00163         CGuiMetaModel*                  guiMeta;
00164         CGuiMetaAspect*                 currentAspect;
00165         CGuiFco*                                contextSelection;
00166         CGuiAnnotator*                  contextAnnotation;
00167         CGuiConnection *last_Connection;
00168         CGuiSet*                                currentSet;
00169         CGuiPort*                               contextPort;
00170         CString                                 currentSetID;
00171 
00172         bool                                    tmpConnectMode;
00173         CGuiObject*                             connSrc;
00174         CGuiPort*                               connSrcPort;
00175         int                                             connSrcHotSide;
00176         CGuiObject*                             connTmp;
00177         CGuiPort*                               connTmpPort;
00178         int                                             connTmpHotSide;
00179 
00180         CGuiObject*                             lastObject;
00181         CGuiPort*                               lastPort;
00182         CGuiObject*                             dragSource;
00183 
00184         bool                                    isType;
00185         bool                                    isSubType;
00186         CString                                 name;
00187         CString                                 kindName;
00188         CString                                 kindDisplayedName;
00189         CString                                 path;
00190 
00191 //      int                                             zoomIdx;
00192         int                                             m_zoomVal;
00193 
00194         bool                                    drawGrid;
00195         bool                                    alive;
00196 
00197         unsigned long                   animRefCnt;
00198         UINT_PTR                                timerID;
00199 
00200 
00201         CAutoRouter                             router;
00202         CGuiFcoList                             children;
00203         CGuiConnectionList              connections;
00204         CGuiAnnotatorList               annotators;
00205         CGuiObjectList                  selected;
00206         CGuiAnnotatorList               selectedAnnotations;
00207         bool                                    validGuiObjects;
00208         CStringList                             newObjectIDs;                   // after paste(drop) keep track of new objects for selection after reset
00209 
00210         bool                                    needsReset;
00211         bool                                    needsConnConversion;
00212         bool                                    initDone;
00213         bool                                    isModelAutoRouted;
00214         COLORREF                                bgColor;
00215         CChildFrame*                    frame;
00216 
00217         CPendingRequestList             pendingRequests;
00218         bool                                    executingPendingRequests;
00219         CDC*                                    onScreen;
00220 
00221         static bool                                                     m_bUseStretchBlt;               // Supposed workaround for Vista black view problem: use StretchBlt instead of BitBlt
00222         static Gdiplus::SmoothingMode           m_eEdgeAntiAlias;               // Edge smoothing mode
00223         static Gdiplus::TextRenderingHint       m_eFontAntiAlias;               // Text renndering hint mode
00224 
00225         CGMEDoc*                                GetDocument();
00226 
00227 // Operations
00228 public:
00229         CComPtr<IMgaModel>&             GetCurrentModel() { return currentModel; }
00230         CGuiFco*                                CreateGuiObject(CComPtr<IMgaFCO>& fco, CGuiFcoList* objList = NULL, CGuiConnectionList* connList = NULL);
00231         void                                    CreateGuiObjects(CComPtr<IMgaFCOs>& fcos, CGuiFcoList& objList, CGuiConnectionList& connList);
00232         bool                                    CreateGuiObjects();
00233         void                                    CreateAnnotators(CComPtr<IMgaRegNodes>& regNodes, CGuiAnnotatorList& annList);
00234         void                                    CreateAnnotators();
00235         bool                                    SendOpenModelEvent();
00236         bool                                    SendCloseModelEvent();
00237         bool                                    SendSelecEvent4Object(CGuiObject* selection);
00238         bool                                    SendUnselEvent4Object(CGuiObject* selection);
00239         bool                                    SendSelecEvent4List(CGuiObjectList* pSelectedList);
00240         bool                                    SendUnselEvent4List(CGuiObjectList* pSelectedList);
00241         bool                                    SendMouseOver4Object(CGuiObject* object);
00242         bool                                    SendNow(bool onlyDecoratorNotification = false);
00243         void                                    AddAnnotationToSelectionHead(CGuiAnnotator* ann);
00244         void                                    AddAnnotationToSelectionTail(CGuiAnnotator* ann);
00245         void                                    AddAnnotationToSelection(CGuiAnnotator* ann, bool headOrTail);
00246         void                                    RemoveAllAnnotationFromSelection(void);
00247         void                                    RemoveAnnotationFromSelectionHead(void);
00248         void                                    RemoveAnnotationFromSelection(POSITION annPos);
00249         void                                    ClearConnectionSelection(void);
00250         void                                    UpdateConnectionSelection(int aspect);
00251         bool                                    FollowLine(CGuiConnection* guiConn, bool reverse, bool tryPort);
00252         bool                                    FollowLine(CGuiObject* guiObj, bool reverse, bool tryPort);
00253         bool                                    FollowLine(CGuiPort* guiPort, bool reverse, bool tryPort);
00254         bool jumpToSelectedEnd( CGuiConnectionList& p_collOfConns, bool p_reverse, bool p_tryPort);
00255         std::list<CGuiObject*>  m_lstSelect;
00256         std::list<CGuiObject*>  m_lstUnselect;
00257         void                                    Reset(bool doInvalidate = false);
00258         void                                    ResetPartBrowser();
00259         void                                    ResetParent(bool doInvalidate = false);
00260         void                                    InitSets();
00261         void                                    CreateOffScreen(CDC* dc);
00262         void                                    Invalidate(bool thorough = false);
00263         void                                    SetProperties();
00264         void                                    SetTypeNameProperty();
00265         void                                    SetNameProperty();
00266         void                                    SetTitles(void);
00267         void                                    GetNameProperty(CString& txt);
00268         void                                    SetKindNameProperty();
00269         int                                             GetAspectProperty();
00270         void                                    SetAspectProperty(int ind);
00271         void                                    SetTypeProperty(bool type);
00272         void                                    ModeChange();
00273         void                                    IncrementalAutoRoute();
00274         void                                    AutoRoute();
00275         void                                    DrawConnections(HDC pDC, Gdiplus::Graphics* gdip);
00276         void                                    DrawTracker(CDC* pDC, const CRect& trackerRect, CRectTracker::StyleFlags styleFlags);
00277         void                                    DrawConnectionCustomizationTracker(CDC* pDC, Gdiplus::Graphics* gdip);
00278         void                                    InsertCustomEdge(CGuiConnection* selectedConn, PathCustomizationType custType,
00279                                                                                          int newPosX, int newPosY, int edgeIndex, bool horizontalOrVerticalEdge);
00280         void                                    UpdateCustomEdges(CGuiConnection* selectedConn, PathCustomizationType custType,
00281                                                                                           int newPosX, int newPosY, int edgeIndex, bool horizontalOrVerticalEdge);
00282         void                                    DeleteCustomEdges(CGuiConnection* selectedConn, PathCustomizationType custType,
00283                                                                                           int edgeIndex, bool horizontalOrVerticalEdge = false);
00284         void                                    ConvertPathToCustom(CComPtr<IUnknown>& pMgaObject);
00285         void                                    PrintHeader(CDC* pDC, CPrintInfo* pInfo);
00286         void                                    PrintHeaderRect(CDC* pDC, CRect& rectDraw);
00287         void                                    PrintMultiLineText(Gdiplus::Graphics* gdip, CDC* pDC, CString txt, int x, int& y, int ry, int xwidth);
00288 
00289         void                                    CoordinateTransfer(CPoint& point) const;
00290         CGuiObject*                             FindFirstObject();
00291         CGuiObject*                             FindNextObject();
00292         CGuiObject*                             FindObject(CPoint& pt, bool lookNearToo = false, bool lookForLabel = false);
00293         CGuiAnnotator*                  FindAnnotation(CPoint& pt);
00294         bool                                    FindObjects(CRect& rect, CGuiObjectList& objectList);
00295         bool                                    FindAnnotations(CRect& rect, CGuiAnnotatorList& annotatorList);
00296         bool                                    DeleteObjects(CGuiObjectList& objectList);
00297         void                                    DeleteAnnotations(CGuiAnnotatorList& annotatorList);
00298         bool                                    DeleteConnection(CGuiConnection* guiConn,bool checkAspect = true);
00299         bool                                    DisconnectAll(CGuiObject* end, CGuiPort* endPort, bool onlyVisible = true);
00300         void                                    FindConnections(CGuiObject* end, CGuiPort* endPort, CGuiConnectionList& guiConn);
00301         void                                    FindConnections(CGuiObject* end1, CGuiPort* end1Port, CGuiObject* end2, CGuiPort* end2Port,
00302                                                                                         CGuiConnectionList& guiConn);
00303         void                                    GrayOutNonInternalConnections();
00304         void                                    FillModelGrid();
00305         void                                    SetObjectLocation(CComPtr<IMgaFCO>& child, CComPtr<IMgaMetaRole>& mmRole, CPoint pt);
00306         void                                    SetScroll();
00307         void                                    SetCenterObject(CComPtr<IMgaFCO> obj);
00308         void                                    InsertNewPart(const CString& roleName, const CPoint& pt);
00309         void                                    GetRefereeChain(IMgaFCOs* refChain, IMgaFCO* fco);
00310         bool                                    Connect(CGuiObject* src, CGuiPort* srcPort, int srcHotSide, CGuiObject* dst, CGuiPort* dstPort,
00311                                                                         int dstHotSide, bool nosticky);
00312         void                                    ResolveConnections();
00313         bool                                    IsConnectionConversionNeeded(void);
00314         void                                    ConvertNeededConnections(void);
00315         void                                    BeginTransaction(transactiontype_enum mode = TRANSACTION_GENERAL);
00316         void                                    CommitTransaction(); // throws hresult_exception
00317         void                                    __CommitTransaction(); // throws _com_error
00318         void                                    AbortTransaction(HRESULT hr);
00319         void                                    PasteAnnotations(CComPtr<IMgaModel>& targetModel, CComPtr<IMgaRegNodes>& regNodes,
00320                                                                                          CComPtr<IMgaRegNodes>& newRegNodes, bool isMove);
00321         void                                    CopyRegTree(CComPtr<IMgaRegNode>& regNode, CComPtr<IMgaRegNode>& newNode);
00322         bool                                    DoPasteItem(COleDataObject* pDataObject, bool drag = false, bool move = false, bool reference = false,
00323                                                                                 bool derive = false, bool instance = false, bool closure = false, bool merge = false,
00324                                                                                 CGuiObject* ref = 0, CPoint pt = CPoint(0, 0));
00325         bool                                    DoPasteNative(COleDataObject* pDataObject, bool drag, bool move, bool reference, bool derive,
00326                                                                                   bool instance, CGuiObject* ref, CPoint pt);
00327         void                                    MakeSureGUIDIsUniqueForSmartCopy(CComPtr<IMgaFCO>& fco);
00328         void                                    ChangeAspect(CString aspName, bool p_eraseStack = true);
00329         void                                    ChangeAspect(int ind);
00330         CString&                                GetAspectName(int ind);
00331         CString&                                GetCurrentAspectName(void);
00332         void                                    SetName();
00333         void                                    RetrievePath();
00334         void                                    SetBgColor();
00335         void                                    ShowHelp(CComPtr<IMgaFCO> fco);
00336         void                                    ShowModel(CComPtr<IMgaModel> model, const CString& aspect = CString(""));
00337         void                                    GetModelInContext(CComPtr<IMgaModel>& model);
00338         void                                    FindDerivedFrom(CComPtr<IMgaModel> model, CComPtr<IMgaModel>& type);
00339         void                                    ChangeAttrPrefObjs(CGuiObjectList& objlist);
00340         void                                    ChangeAttrPrefFco(CGuiFco* guiFco);
00341         void                                    ChangeAttrPrefFco();
00342         void                                    ShowProperties(CGuiFco* guiFco);
00343         void                                    ShowProperties();
00344         void                                    ShowAttributes(CGuiFco* guiFco);
00345         void                                    ShowAttributes();
00346         void                                    ShowPreferences(CGuiFco* guiFco);
00347         void                                    ShowPreferences();
00348         void                                    FillAttributeDescs(CComPtr<IMgaFCO> fco, CGuiMetaAttributeList& guiMetaAttrs, CGuiDepCtrlDescList& list);
00349         bool                                    CheckBeforeDeleteObjects(CGuiObjectList& objectList, CString& txt);
00350         void                                    ZoomOut(CPoint point);
00351         void                                    ZoomIn(CPoint point);
00352         void                                    ZoomRect(CRect srect);
00353         void                                    ZoomToFCOs(CRect rect);
00354         void                                    ShowRegistryBrowser(CComPtr<IMgaFCO> fco);
00355         bool                                    ShowAnnotationBrowser(CComPtr<IMgaFCO> fco, CComPtr<IMgaRegNode> focus);
00356         void                                    SyncAspects(CGuiMetaAspect* srcAspect, CGuiMetaAspectList& dstAspects, CGuiObjectList& movingObjects,
00357                                                                                 CGuiObjectList& sedentaryObjects, bool priorityForSrcVisible, bool priorityForSelected);
00358         void                                    SyncOnGrid(CGuiObject *obj, int aspectIndexFrom, int aspectIndexTo);
00359         void                                    ClearConnSpecs();
00360         void                                    RunComponent(CString compname);
00361         void                                    SetEditCursor(void);
00362         void                                    StartDecoratorOperation(void);
00363         void                                    EndDecoratorOperation(void);
00364         void                                    CancelDecoratorOperation(bool notify = true);
00365 
00366         bool                                    IsCursorChangedByDecorator(void) const;
00367         void                                    SetIsCursorChangedByDecorator(bool isCurChanged);
00368         CRect                                   GetOriginalRect(void) const;
00369         void                                    SetOriginalRect(const CRect& rect);
00370         void                                    SetOriginalRectEmpty(void);
00371         bool                                    IsInElementDecoratorOperation(void) const;
00372         void                                    SetInElementDecoratorOperation(bool isIn);
00373         bool                                    IsInOpenedDecoratorTransaction(void) const;
00374         void                                    SetInOpenedDecoratorTransaction(bool inOpenedTr);
00375         bool                                    IsContextInitiatedOperation(void) const;
00376         void                                    SetIsContextInitiatedOperation(bool isCtxInit);
00377         bool                                    ShouldCommitOperation(void) const;
00378         void                                    SetShouldCommitOperation(bool shouldCommitOp);
00379         bool                                    IsDecoratorOrAnnotator(void) const;
00380         void                                    SetDecoratorOrAnnotator(bool decorOrAnnot);
00381         CGuiObject*                             GetObjectInDecoratorOperation(void) const;
00382         void                                    SetObjectInDecoratorOperation(CGuiObject* obj);
00383         CGuiAnnotator*                  GetAnnotatorInDecoratorOperation(void) const;
00384         void                                    SetAnnotatorInDecoratorOperation(CGuiAnnotator* ann);
00385 
00386         bool                                    ShouldSupressConnectionCheckAlert(void) const { return m_supressConnectionCheckAlert; };
00387         void                                    ClearSupressConnectionCheckAlert(void) { m_supressConnectionCheckAlert = false; };
00388         void                                    SupressConnectionCheckAlert(void) { m_supressConnectionCheckAlert = true; };
00389         HRESULT                                 DumpModelGeometryXML(LPCTSTR filePath);
00390         void                                    SetConnectionCustomizeCursor(const CPoint& point);
00391         bool                                    IsInstance(void) const;
00392         void                                    TryToExecutePendingRequests(void);
00393 
00394         virtual INT_PTR                 OnToolHitTest(CPoint point, TOOLINFO* pTI) const;
00395 
00396         static bool                             IsHugeModel()   { return false; } // HACK
00397         static CGMEView*                GetActiveView();
00398 
00399 // Overrides
00400         // ClassWizard generated virtual function overrides
00401         //{{AFX_VIRTUAL(CGMEView)
00402         public:
00403         virtual void OnDraw(CDC* pDC);  // overridden to draw this view
00404         virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00405         virtual DROPEFFECT OnDragEnter(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point);
00406         virtual void OnDragLeave();
00407         virtual DROPEFFECT OnDragOver(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point);
00408         virtual BOOL OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point);
00409         virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
00410         virtual BOOL PreTranslateMessage(MSG* pMsg);
00411         virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL);
00412         protected:
00413         virtual void OnInitialUpdate(); // called first time after construct
00414         virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
00415         virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
00416         virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
00417         virtual void OnActivateFrame( UINT nState, CFrameWnd* pFrameWnd );
00418         //}}AFX_VIRTUAL
00419         afx_msg void OnKillFocus(CWnd* pNewWnd);
00420 
00421 // Implementation
00422 public:
00423         virtual ~CGMEView();
00424 #ifdef _DEBUG
00425         virtual void AssertValid() const;
00426         virtual void Dump(CDumpContext& dc) const;
00427 #endif
00428 
00429 protected:
00430         void SwapAutoRouterPref(const CString& strPref);
00431         void SetAllAutoRouterPref(bool bSrc, bool bClear);
00432 
00433 // Generated message map functions
00434 public:
00435         void ShowGrid(bool show);
00436         void AttributepanelPage(long page);
00437         void ZoomPercent(long percent);
00438         void CycleAspect() { this->OnCycleAspect(); }
00439         void CycleAllAspects() { this->OnCycleAllAspects(); }
00440 protected:
00441         //{{AFX_MSG(CGMEView)
00442         afx_msg void OnDestroy();
00443         afx_msg void OnSize(UINT nType, int cx, int cy);
00444         afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00445         afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
00446         afx_msg void OnDropFiles(HDROP p_hDropInfo);
00447         afx_msg void OnKillfocusNameProp();
00448         afx_msg void OnSelChangeAspectProp();
00449         afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00450         afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00451         afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
00452         afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00453         afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
00454         afx_msg BOOL OnMouseWheel(UINT fFlags, short zDelta, CPoint point);
00455         afx_msg void OnAppCommand(CWnd* pWnd, UINT nCmd, UINT nDevice, UINT nKey);
00456         afx_msg void OnViewParent();
00457         afx_msg void OnUpdateViewParent(CCmdUI* pCmdUI);
00458         afx_msg void OnViewGrid();
00459         afx_msg void OnUpdateViewGrid(CCmdUI* pCmdUI);
00460         afx_msg void OnEditNudgedown();
00461         afx_msg void OnEditNudgeleft();
00462         afx_msg void OnEditNudgeright();
00463         afx_msg void OnEditNudgeup();
00464         afx_msg void OnEditDelete();
00465         afx_msg void OnUpdateEditDelete(CCmdUI* pCmdUI);
00466         afx_msg void OnContextProperties();
00467         afx_msg void OnCntxAttributes();
00468         afx_msg void OnEditUndo();
00469         afx_msg void OnEditRedo();
00470         afx_msg void OnEditCopy();
00471         afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
00472         afx_msg void OnEditCopyClosure();
00473         afx_msg void OnEditCopySmart();
00474         afx_msg void OnUpdateEditCopyClosure(CCmdUI* pCmdUI);
00475         afx_msg void OnUpdateEditCopySmart(CCmdUI* pCmdUI);
00476         afx_msg void OnEditCut();
00477         afx_msg void OnUpdateEditCut(CCmdUI* pCmdUI);
00478         afx_msg void OnEditPaste();
00479         afx_msg void OnUpdateEditPaste(CCmdUI* pCmdUI);
00480         afx_msg void OnCntxCopy();
00481         afx_msg void OnCntxCopyClosure();
00482         afx_msg void OnCntxCopySmart();
00483         afx_msg void OnCntxCut();
00484         afx_msg void OnCntxDelete();
00485         afx_msg void OnSelfcntxCopy();
00486         afx_msg void OnUpdateSelfcntxCopy(CCmdUI* pCmdUI);
00487         afx_msg void OnSelfcntxCopyClosure();
00488         afx_msg void OnSelfcntxCopySmart();
00489         afx_msg void OnUpdateSelfcntxCopyClosure(CCmdUI* pCmdUI);
00490         afx_msg void OnUpdateSelfcntxCopySmart(CCmdUI* pCmdUI);
00491         afx_msg void OnSelfcntxCut();
00492         afx_msg void OnUpdateSelfcntxCut(CCmdUI* pCmdUI);
00493         afx_msg void OnSelfcntxDelete();
00494         afx_msg void OnUpdateSelfcntxDelete(CCmdUI* pCmdUI);
00495         afx_msg void OnSelfcntxPaste();
00496         afx_msg void OnUpdateSelfcntxPaste(CCmdUI* pCmdUI);
00497         afx_msg void OnUpdateCntxAttributes(CCmdUI* pCmdUI);
00498         afx_msg void OnEditCancel();
00499         afx_msg void OnUpdateEditCancel(CCmdUI* pCmdUI);
00500         afx_msg void OnCntxDisconnectall();
00501         afx_msg void OnUpdateCntxDisconnectall(CCmdUI* pCmdUI);
00502         afx_msg void OnFileClose();
00503         afx_msg void OnConncntxProperties();
00504         afx_msg void OnConncntxDelete();
00505         afx_msg void OnConncntxReverse();
00506         afx_msg void OnUpdateConncntxReverse(CCmdUI* pCmdUI);
00507         afx_msg void OnConnCntxFollow();
00508         afx_msg void OnConnCntxRevfollow();
00509         afx_msg void OnCntxClear();
00510         afx_msg void OnUpdateCntxClear(CCmdUI* pCmdUI);
00511         afx_msg void OnCntxReset();
00512         afx_msg void OnUpdateCntxReset(CCmdUI* pCmdUI);
00513         afx_msg void OnUpdateCntxDelete(CCmdUI* pCmdUI);
00514         afx_msg void OnUpdateConncntxDelete(CCmdUI* pCmdUI);
00515         afx_msg void OnUpdateCntxCut(CCmdUI* pCmdUI);
00516         afx_msg void OnCntxPreferences();
00517         afx_msg void OnEditPreferences();
00518         afx_msg void OnHelpHelp();
00519         afx_msg void OnCntxHelp();
00520         afx_msg void OnEditShowtype();
00521         afx_msg void OnUpdateEditShowtype(CCmdUI* pCmdUI);
00522         afx_msg void OnEditShowbasetype();
00523         afx_msg void OnUpdateEditShowbasetype(CCmdUI* pCmdUI);
00524         afx_msg void OnCntxShowtype();
00525         afx_msg void OnUpdateCntxShowtype(CCmdUI* pCmdUI);
00526         afx_msg void OnCntxShowbasetype();
00527         afx_msg void OnUpdateCntxShowbasetype(CCmdUI* pCmdUI);
00528         afx_msg void OnFileInterpret();
00529         afx_msg void OnFileCheck();
00530         afx_msg void OnFileCheckSelected();
00531         afx_msg void OnCntxInterpret();
00532         afx_msg void OnCntxCheck();
00533         afx_msg void OnCntxLocate();
00534         afx_msg void OnUpdateCntxInterpret(CCmdUI* pCmdUI);
00535         afx_msg void OnUpdateCntxCheck(CCmdUI* pCmdUI);
00536         afx_msg void OnUpdateCntxLocate(CCmdUI* pCmdUI);
00537         afx_msg void OnCntxRegistry();
00538         afx_msg void OnEditRegistry();
00539         afx_msg void OnEditSync();
00540         afx_msg void OnUpdateEditSync(CCmdUI* pCmdUI);
00541         afx_msg void OnEditSelectall();
00542         afx_msg void OnUpdateFileCheck(CCmdUI* pCmdUI);
00543         afx_msg void OnUpdateFileCheckSelected(CCmdUI* pCmdUI);
00544         afx_msg void OnUpdateFileSettings(CCmdUI* pCmdUI);
00545         afx_msg void OnEditPastespecialAsinstance();
00546         afx_msg void OnEditPastespecialAsreference();
00547         afx_msg void OnEditPastespecialAssubtype();
00548         afx_msg void OnEditPastespecialAsclosure();
00549         afx_msg void OnEditPastespecialAdditive();
00550         afx_msg void OnEditPastespecialMerge();
00551         afx_msg void OnUpdateEditPastespecialAsinstance(CCmdUI* pCmdUI);
00552         afx_msg void OnUpdateEditPastespecialAsreference(CCmdUI* pCmdUI);
00553         afx_msg void OnUpdateEditPastespecialAssubtype(CCmdUI* pCmdUI);
00554         afx_msg void OnUpdateEditPastespecialAsclosure(CCmdUI* pCmdUI);
00555         afx_msg void OnUpdateEditPastespecialAdditive(CCmdUI* pCmdUI);
00556         afx_msg void OnUpdateEditPastespecialMerge(CCmdUI* pCmdUI);
00557         afx_msg void OnCntxPastespecialAsinstance();
00558         afx_msg void OnUpdateCntxPastespecialAsinstance(CCmdUI* pCmdUI);
00559         afx_msg void OnCntxPastespecialAsreference();
00560         afx_msg void OnUpdateCntxPastespecialAsreference(CCmdUI* pCmdUI);
00561         afx_msg void OnCntxPastespecialAssubtype();
00562         afx_msg void OnUpdateCntxPastespecialAssubtype(CCmdUI* pCmdUI);
00563         afx_msg void OnCntxPastespecialAsclosure();
00564         afx_msg void OnUpdateCntxPastespecialAsclosure(CCmdUI* pCmdUI);
00565         afx_msg void OnCntxPastespecialAdditive();
00566         afx_msg void OnUpdateCntxPastespecialAdditive(CCmdUI* pCmdUI);
00567         afx_msg void OnCntxPastespecialMerge();
00568         afx_msg void OnUpdateCntxPastespecialMerge(CCmdUI* pCmdUI);
00569         afx_msg void OnCntxRedirectionpaste();
00570         afx_msg void OnUpdateCntxRedirectionpaste(CCmdUI* pCmdUI);
00571         afx_msg void OnCntxConnect();
00572         afx_msg void OnUpdateCntxConnect(CCmdUI* pCmdUI);
00573         afx_msg void OnResetSticky();
00574         afx_msg void OnNcMouseMove(UINT nHitTest, CPoint point);
00575         afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00576         afx_msg void OnTimer(UINT_PTR nIDEvent);
00577         afx_msg void OnUpdateCntxInsertannotation(CCmdUI* pCmdUI);
00578         afx_msg void OnCntxInsertannotation();
00579         afx_msg void OnCntxAnnotations();
00580         afx_msg void OnEditAnnotations();
00581         afx_msg void OnUpdateCntxAutoRouters( CCmdUI* pCmdUI );
00582         afx_msg void OnCntxSrcarSouth();
00583         afx_msg void OnCntxSrcarNorth();
00584         afx_msg void OnCntxSrcarEast();
00585         afx_msg void OnCntxSrcarWest();
00586         afx_msg void OnCntxDstarEast();
00587         afx_msg void OnCntxDstarNorth();
00588         afx_msg void OnCntxDstarSouth();
00589         afx_msg void OnCntxDstarWest();
00590         afx_msg void OnCntxSrcarClear();
00591         afx_msg void OnCntxDstarClear();
00592         afx_msg void OnCntxSrcarSet();
00593         afx_msg void OnCntxDstarSet();
00594         afx_msg void OnPortCntxFollowConnection();
00595         afx_msg void OnPortCntxRevfollowConnection();
00596         afx_msg void OnCntxPortDelete();
00597         afx_msg void OnCntxFollowConnection();
00598         afx_msg void OnCntxRevfollowConnection();
00599         afx_msg void OnCntxPortShowInParent();
00600         afx_msg void OnCntxPortLocateInBrw();
00601         afx_msg void OnJumpAlongConnection();
00602         afx_msg void OnBackAlongConnection();
00603         afx_msg void OnJumpToFirstObject();
00604         afx_msg void OnJumpToNextObject();
00605         afx_msg void OnTryToSnapHorzVertPath();
00606         afx_msg void OnDeleteConnEdgeCustomData();
00607         afx_msg void OnDeleteConnPointCustomData();
00608         afx_msg void OnDeleteConnRouteCustomDataThisAspect();
00609         afx_msg void OnDeleteConnRouteCustomDataAllAspects();
00610         afx_msg void OnShowContextMenu();
00611         afx_msg void OnPrintMetafile();
00612         afx_msg void OnZoomIn();
00613         afx_msg void OnZoomOut();
00614         afx_msg LRESULT OnZoom(WPARAM wParam, LPARAM lParam);
00615         afx_msg LRESULT OnPannScroll(WPARAM wParam, LPARAM lParam);
00616         afx_msg LRESULT OnPannRefresh(WPARAM wParam, LPARAM lParam);
00617         afx_msg LRESULT OnDecoratorViewRefreshRequest(WPARAM wParam, LPARAM lParam);
00618         afx_msg LRESULT OnExecutePendingRequests(WPARAM wParam, LPARAM lParam);
00619         afx_msg void OnCntxNamePositionSouth();
00620         afx_msg void OnCntxNamePositionNorth();
00621         afx_msg void OnCntxNamePositionEast();
00622         afx_msg void OnCntxNamePositionWest();
00623         afx_msg void OnUpdateCntxNamePositionSouth( CCmdUI* pCmdUI );
00624         afx_msg void OnUpdateCntxNamePositionNorth( CCmdUI* pCmdUI );
00625         afx_msg void OnUpdateCntxNamePositionEast( CCmdUI* pCmdUI );
00626         afx_msg void OnUpdateCntxNamePositionWest( CCmdUI* pCmdUI );
00627         afx_msg void OnUpdatePortCntxFollowConnection( CCmdUI* pCmdUI );
00628         afx_msg void OnUpdatePortCntxRevfollowConnection( CCmdUI* pCmdUI );
00629         afx_msg void OnUpdateCntxFollowConnection( CCmdUI* pCmdUI );
00630         afx_msg void OnUpdateCntxRevfollowConnection( CCmdUI* pCmdUI );
00631         afx_msg void OnUpdateJumpAlongConnection( CCmdUI* pCmdUI );
00632         afx_msg void OnUpdateBackAlongConnection( CCmdUI* pCmdUI );
00633         afx_msg void OnUpdateTryToSnapHorzVertPath( CCmdUI* pCmdUI );
00634         afx_msg void OnUpdateDeleteConnEdgeCustomData( CCmdUI* pCmdUI );
00635         afx_msg void OnUpdateDeleteConnPointCustomData( CCmdUI* pCmdUI );
00636         afx_msg void OnUpdateDeleteConnRouteCustomDataThisAspect( CCmdUI* pCmdUI );
00637         afx_msg void OnUpdateDeleteConnRouteCustomDataAllAspects( CCmdUI* pCmdUI );
00638 #if defined(ADDCRASHTESTMENU)
00639         afx_msg void OnCrashTestIllegalWrite();
00640         afx_msg void OnCrashTestIllegalRead();
00641         afx_msg void OnCrashTestIllegalReadInCRuntime();
00642         afx_msg void OnCrashTestIllegalCodeRead();
00643         afx_msg void OnCrashTestDivideByZero();
00644         afx_msg void OnCrashTestAbort();
00645         afx_msg void OnCrashTestTerminate();
00646         afx_msg void OnUpdateCrashTestMenu(CCmdUI* pCmdUI);
00647         afx_msg void OnUpdateCrashTestIllegalWrite(CCmdUI* pCmdUI);
00648         afx_msg void OnUpdateCrashTestIllegalRead(CCmdUI* pCmdUI);
00649         afx_msg void OnUpdateCrashTestIllegalReadInCRuntime(CCmdUI* pCmdUI);
00650         afx_msg void OnUpdateCrashTestIllegalCodeRead(CCmdUI* pCmdUI);
00651         afx_msg void OnUpdateCrashTestDivideByZero(CCmdUI* pCmdUI);
00652         afx_msg void OnUpdateCrashTestAbort(CCmdUI* pCmdUI);
00653         afx_msg void OnUpdateCrashTestTerminate(CCmdUI* pCmdUI);
00654 #endif
00655         afx_msg void OnShowSelectedModel();
00656         afx_msg void OnFocusBrowser();
00657         afx_msg void OnRename();
00658         afx_msg void OnFocusInspector();
00659         afx_msg void OnCycleAspect();
00660         afx_msg void OnCycleAspectBackwards();
00661         afx_msg void OnCycleAllAspects();
00662         afx_msg void OnHistoryBack();
00663         afx_msg void OnHistoryForw();
00664         afx_msg void OnKeyConnect();
00665         afx_msg void OnKeyCycleObjInspectorFrwd();
00666         afx_msg void OnKeyCycleObjInspectorBkwd();
00667         afx_msg void OnViewMultiUserShowObjectOwner();
00668         afx_msg void OnUpdateViewMultiUserShowObjectOwner( CCmdUI* pCmdUI);
00669         //}}AFX_MSG
00670         DECLARE_MESSAGE_MAP()
00671 public:
00672         afx_msg void OnViewShowconnectedportsonly();
00673         afx_msg void OnUpdateViewShowconnectedportsonly(CCmdUI *pCmdUI);
00674 };
00675 
00676 class ATL_NO_VTABLE CViewDriver :
00677                 public CComObjectRootEx<CComSingleThreadModel>,
00678                 public IDispatchImpl<IMgaEventSink, &__uuidof(IMgaEventSink), &__uuidof(__MGALib)>
00679 {
00680 public:
00681         CViewDriver() { }
00682         virtual ~CViewDriver() {}
00683 public:
00684         CGMEView *view;
00685         static bool attrNeedsRefresh;
00686 
00687 BEGIN_COM_MAP(CViewDriver)
00688         COM_INTERFACE_ENTRY(IMgaEventSink)
00689 //      COM_INTERFACE_ENTRY(IDispatch)
00690 END_COM_MAP()
00691 
00692 // ------- COM methods
00693 public:
00694         STDMETHODIMP GlobalEvent(globalevent_enum event);
00695         STDMETHODIMP ObjectEvent(IMgaObject * obj, unsigned long eventmask,VARIANT v);
00696 
00697 
00698 
00699 };
00700 
00701 
00702 #ifndef _DEBUG  // debug version in GMEView.cpp
00703 inline CGMEDoc* CGMEView::GetDocument()
00704    { return (CGMEDoc*)m_pDocument; }
00705 #endif
00706 
00708 
00709 //{{AFX_INSERT_LOCATION}}
00710 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00711 
00712 #endif // !defined(AFX_GMEVIEW_H__BD235B55_BD3F_11D3_91E2_00104B98EAD9__INCLUDED_)