[commit] r2796 - trunk/GME/Gme

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Mon Apr 5 11:25:57 CDT 2021


Author: ksmyth
Date: Mon Apr  5 11:25:57 2021
New Revision: 2796

Log:
Model editor: disable drag-n-drop for library models

Modified:
   trunk/GME/Gme/GMEView.cpp
   trunk/GME/Gme/GMEView.h

Modified: trunk/GME/Gme/GMEView.cpp
==============================================================================
--- trunk/GME/Gme/GMEView.cpp	Mon Apr  5 11:25:54 2021	(r2795)
+++ trunk/GME/Gme/GMEView.cpp	Mon Apr  5 11:25:57 2021	(r2796)
@@ -1109,6 +1109,10 @@
 
 		COMTHROW(currentModel->Open(OPEN_READ));
 		COMTHROW(currentModel->get_Name(PutOut(name)));
+		VARIANT_BOOL isLibObject = VARIANT_FALSE;
+		COMTHROW(currentModel->get_IsLibObject(&isLibObject));
+		this->isLibObject = isLibObject != VARIANT_FALSE;
+
 		CComPtr<IMgaMetaFCO> meta;
 		COMTHROW(currentModel->get_Meta(&meta));
 		COMTHROW(meta->get_Name(PutOut(kindName)));
@@ -5361,11 +5365,13 @@
 
 					validGuiObjects = true;
 					dragSource = (selected.GetCount() > 0) ? selected.GetHead() : NULL;
-					DROPEFFECT dropEffect = CGMEDoc::DoDragDrop(&selected, &selectedAnnotations, &desc,
-						DROPEFFECT_MOVE | DROPEFFECT_COPY | DROPEFFECT_LINK, &rectAwake,this);
-
+					DROPEFFECT dropEffect = DROPEFFECT_NONE;
+					if (!isLibObject) {
+						dropEffect = CGMEDoc::DoDragDrop(&selected, &selectedAnnotations, &desc,
+							DROPEFFECT_MOVE | DROPEFFECT_COPY | DROPEFFECT_LINK, &rectAwake, this);
+					}
 					if (validGuiObjects && dropEffect == DROPEFFECT_NONE) {
-						if (inDrag && alreadySelected != NULL && (selection || annotation)) {
+						if (!isLibObject && inDrag && alreadySelected != NULL && (selection || annotation)) {
 							OnLButtonUp(nFlags, ppoint);
 						}
 						if (nFlags & MK_CONTROL) {
@@ -5413,7 +5419,7 @@
 						}
 						doNotDeselectAfterInPlaceEdit = false;
 					}
-					else {
+					else if (!isLibObject) {
 						ChangeAttrPrefObjs(selected);
 					}
 					Invalidate();
@@ -5925,7 +5931,7 @@
 	CPoint ppoint = point;
 	CoordinateTransfer(point);
 
-	if(!tmpConnectMode) {
+	if(!tmpConnectMode && !isLibObject) {
 		CGMEDoc *doc = GetDocument();
 		if(doc->GetEditMode() == GME_EDIT_MODE)
 		{

Modified: trunk/GME/Gme/GMEView.h
==============================================================================
--- trunk/GME/Gme/GMEView.h	Mon Apr  5 11:25:54 2021	(r2795)
+++ trunk/GME/Gme/GMEView.h	Mon Apr  5 11:25:57 2021	(r2796)
@@ -199,6 +199,7 @@
 
 	bool					isType;
 	bool					isSubType;
+	bool					isLibObject;
 	CString					name;
 	CString					kindName;
 	CString					kindDisplayedName;


More information about the gme-commit mailing list