Quellcode durchsuchen

Bug 1686: Allow deleting history of edit boxes

https://winscp.net/tracker/1686

Source commit: 5fbd0491b4c43c565ad23f75e1928c847938df45
Martin Prikryl vor 7 Jahren
Ursprung
Commit
7964eae320
1 geänderte Dateien mit 8 neuen und 1 gelöschten Zeilen
  1. 8 1
      source/packages/my/HistoryComboBox.pas

+ 8 - 1
source/packages/my/HistoryComboBox.pas

@@ -88,7 +88,14 @@ procedure THistoryComboBox.KeyDown(var Key: Word; Shift: TShiftState);
 begin
   if ((Key = VK_DOWN) or (Key = VK_UP)) and
      (not (ssAlt in Shift)) and (soDropDown in SaveOn) then
-      if Items.IndexOf(Text) < 0 then SaveToHistory;
+  begin
+    if Items.IndexOf(Text) < 0 then SaveToHistory;
+  end;
+  if DroppedDown and (Key = VK_DELETE) and (ssCtrl in Shift) then
+  begin
+    Items.Clear;
+    Key := 0;
+  end;
   inherited;
 end;