[commit] r2653 - trunk/GME/ObjectInspector

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Mon Oct 3 14:02:58 CDT 2016


Author: ksmyth
Date: Mon Oct  3 14:02:58 2016
New Revision: 2653

Log:
TreeBrowser: right click on unselected element selects only that element

Modified:
   trunk/GME/ObjectInspector/InspectorList.cpp

Modified: trunk/GME/ObjectInspector/InspectorList.cpp
==============================================================================
--- trunk/GME/ObjectInspector/InspectorList.cpp	Mon Oct  3 14:02:54 2016	(r2652)
+++ trunk/GME/ObjectInspector/InspectorList.cpp	Mon Oct  3 14:02:58 2016	(r2653)
@@ -1158,17 +1158,20 @@
 	CWnd* pParent = GetParent();
 	CInspectorDlg* pInspectorDlg = (CInspectorDlg*)pParent->GetParent();
 
-	int nSelCount = GetSelCount();
-	// if nothing selected, select item that was clicked
-	if (nSelCount == 0) {
-		BOOL outside;
-		auto clickedIndex = ItemFromPoint(point, outside);
-		if (!outside) {
+	// if clicked item is not selected, select only it
+	BOOL outside;
+	auto clickedIndex = ItemFromPoint(point, outside);
+	if (!outside) {
+		if (GetSel(clickedIndex) <= 0) {
+			for (int i = 0; i < GetCount(); i++)
+			{
+				SetSel(i, FALSE);
+			}
 			SetSel(clickedIndex);
-			nSelCount = GetSelCount();
 		}
 	}
 
+	int nSelCount = GetSelCount();
 	CArray<int, int> SelItemArr;
 	SelItemArr.SetSize(nSelCount);
 


More information about the gme-commit mailing list