ide;debugger; (#1014) fixed confusion with the expression and value fields in the...
authorRejean Loyer <redj@ecere.com>
Sat, 5 Oct 2013 13:19:11 +0000 (09:19 -0400)
committerRejean Loyer <redj@ecere.com>
Tue, 8 Oct 2013 21:02:23 +0000 (17:02 -0400)
ecere/src/gui/controls/ListBox.ec
ide/src/panels/WatchesView.ec

index 0434b18..f88a210 100644 (file)
@@ -3719,8 +3719,7 @@ private:
          }
          else
          {
-            result = NotifySelect(master, this, 
-               currentRow ? currentRow : null, mods);
+            DataField f = null;
             if(result && style.alwaysEdit && currentRow)
             {
                if(newCurrentRow)
@@ -3746,13 +3745,19 @@ private:
                      if(!field.prev) width -= indent;
                      if(x >= sx && x < sx + width)
                      {
-                        currentField = field;
+                        f = currentField = field;
                         break;
                      }
                      sx += width;
                   }
                }
-               currentRow.Edit(currentField);
+            }
+            // Moved NotifySelect after setting currentField for the NotifySelect implementation to be aware of which field is now selected (e.g. WatchesView)
+            result = NotifySelect(master, this, currentRow, mods);
+            if(result && style.alwaysEdit && currentRow)
+            {
+               // In case the user specifically clicked on a field (f is set), override any change to currentField that NotifySelect could have done
+               currentRow.Edit(f ? f : currentField);
 
                // If the user clicked exactly on the edited field,
                // activate it
index f0c1639..4f23d56 100644 (file)
@@ -72,6 +72,13 @@ class WatchesView : Window
          }
          return true;
       }
+
+      bool NotifySelect(ListBox listBox, DataRow row, Modifiers mods)
+      {
+         if(listBox.currentField != expressionField)
+            listBox.currentField = expressionField;
+         return true;
+      }
    };
    DataField expressionField { "char *", true, width = 130, header = $"Expression" };
    DataField typeField { "Type", false, width = 180, header = $"Type" };