View Issue Details

IDProjectCategoryView StatusLast Update
0001769Double CommanderGraphical user interfacepublic2020-11-30 07:43
Reportercordylus Assigned ToAlexx2000  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
ProjectionnoneETAnone 
Target Version0.8.0Fixed in Version0.8.0 
Summary0001769: Escape to cancel editing of fields in Custom columns settings
DescriptionСейчас Escape воспринимается как попытка выхода из настроек вообще. Интуитивно ожидается отмена редактирования ячейки и внесённых изменений.
TagsNo tags attached.
Attached Files
bug1769.patch (1,954 bytes)   
Index: src/frames/foptionscustomcolumns.pas
===================================================================
--- src/frames/foptionscustomcolumns.pas	(revision 7615)
+++ src/frames/foptionscustomcolumns.pas	(working copy)
@@ -233,6 +233,7 @@
     FUpdating: boolean;
     ColumnClassOwnership: boolean;
     IndexRaw: integer;
+    FCellValue: string;
 
   protected
     procedure Load; override;
@@ -691,6 +692,8 @@
     begin
       Editor.Tag := aRow;
       Editor.Hint := IntToStr(aCol);
+      if not stgColumns.EditorMode then
+        FCellValue := stgColumns.Cells[aCol, aRow];
     end;
     FUpdating := False;
   end;
@@ -699,9 +702,19 @@
 { TfrmOptionsCustomColumns.stgColumnsKeyDown }
 procedure TfrmOptionsCustomColumns.stgColumnsKeyDown(Sender: TObject; var Key: word; Shift: TShiftState);
 begin
-  if (Key = vk_Down) and (stgColumns.Row = stgColumns.RowCount - 1) then
-  begin
-    AddNewField;
+  case Key of
+    VK_DOWN:
+      if (stgColumns.Row = stgColumns.RowCount - 1) then
+      begin
+        AddNewField;
+      end;
+    VK_ESCAPE:
+      if (stgColumns.EditorMode) then
+      begin
+        stgColumns.Cells[stgColumns.Col, stgColumns.Row] := FCellValue;
+        stgColumns.EditorMode := False;
+        Key := 0;
+      end;
   end;
 end;
 
@@ -813,11 +826,20 @@
 { TfrmOptionsCustomColumns.EditorKeyDown }
 procedure TfrmOptionsCustomColumns.EditorKeyDown(Sender: TObject; var Key: word; Shift: TShiftState);
 begin
-  if Key = VK_RETURN then
-  begin
-    EditorSaveResult(Sender);
-    stgColumns.EditorMode := False;
-    Key := 0;
+  case Key of
+    VK_RETURN:
+      begin
+        EditorSaveResult(Sender);
+        stgColumns.EditorMode := False;
+        Key := 0;
+       end;
+    VK_ESCAPE:
+      begin
+        stgColumns.EditorMode := False;
+        stgColumns.Cells[stgColumns.Col, stgColumns.Row] := FCellValue;
+        UpdateColumnClass;
+        Key := 0;
+      end;
   end;
 end;
 
bug1769.patch (1,954 bytes)   
Fixed in Revision7619
Operating system
Widgetset
Architecture

Activities

Issue History

Date Modified Username Field Change
2017-03-16 19:27 cordylus New Issue
2017-06-05 06:51 cordylus File Added: bug1769.patch
2017-06-12 10:46 Alexx2000 Assigned To => Alexx2000
2017-06-12 10:46 Alexx2000 Status new => assigned
2017-06-12 10:46 Alexx2000 Target Version => 0.8.0
2017-06-12 10:48 Alexx2000 Fixed in Revision => 7619
2017-06-12 10:48 Alexx2000 Status assigned => resolved
2017-06-12 10:48 Alexx2000 Fixed in Version => 0.8.0
2017-06-12 10:48 Alexx2000 Resolution open => fixed
2020-11-30 07:43 Alexx2000 Status resolved => closed