Browse Source

变更令,delete删除问题

MaiXinRong 5 years ago
parent
commit
0b95962b39
1 changed files with 27 additions and 26 deletions
  1. 27 26
      Frames/BillsMeasureFme.pas

+ 27 - 26
Frames/BillsMeasureFme.pas

@@ -152,8 +152,6 @@ begin
   zgBillsMeasure.OnExpandMouseDown := ExpandMouseDown;
 
   FColVisibleManager := TBM_ColVisibleManager.Create(stdBillsMeasure);
-  if not _IsDebugView then
-    zgBillsMeasure.OnKeyDown := nil;
   stdBillsMeasure.OnGridBeforeDelete := OnGridBeforeDelete;
   
   FNeedRefreshColorRow := -1;
@@ -446,33 +444,36 @@ procedure TBillsMeasureFrame.zgBillsMeasureKeyDown(Sender: TObject;
   var Key: Word; Shift: TShiftState);
 begin
   // For Inner Test
-  if (ssCtrl in Shift) and (ssShift in Shift) and (ssAlt in Shift)
-      and (Key in [65, 97]) // 'a', 'A'
-      and (zgBillsMeasure.CurCol = 4) then
-    SetAddFieldVisible(not FShowAddField);
-
-  if (ssCtrl in Shift) and (ssShift in Shift) and (ssAlt in Shift)
-      and (Key in [80, 112]) // 'p', 'P' - Parent
-      and (zgBillsMeasure.CurCol = 5) then
+  if _IsDebugView then
   begin
-    FBillsMeasureData.ShowParentData := not FBillsMeasureData.ShowParentData;
-    zgBillsMeasure.Invalidate;
-  end;
+    if (ssCtrl in Shift) and (ssShift in Shift) and (ssAlt in Shift)
+        and (Key in [65, 97]) // 'a', 'A'
+        and (zgBillsMeasure.CurCol = 4) then
+      SetAddFieldVisible(not FShowAddField);
+
+    if (ssCtrl in Shift) and (ssShift in Shift) and (ssAlt in Shift)
+        and (Key in [80, 112]) // 'p', 'P' - Parent
+        and (zgBillsMeasure.CurCol = 5) then
+    begin
+      FBillsMeasureData.ShowParentData := not FBillsMeasureData.ShowParentData;
+      zgBillsMeasure.Invalidate;
+    end;
 
-  if (ssCtrl in Shift) and (ssShift in Shift) and (ssAlt in Shift)
-      and (Key in [77, 109]) // 'm', 'M' - PriceMargin
-      and (zgBillsMeasure.CurCol = 5) then
-  begin
-    SetPMFieldVisible(not FShowPMField);
-  end;
+    if (ssCtrl in Shift) and (ssShift in Shift) and (ssAlt in Shift)
+        and (Key in [77, 109]) // 'm', 'M' - PriceMargin
+        and (zgBillsMeasure.CurCol = 5) then
+    begin
+      SetPMFieldVisible(not FShowPMField);
+    end;
 
-  if (ssCtrl in Shift) and (ssShift in Shift) and (ssAlt in Shift)
-      and (Key in [67, 99]) then // 'c', 'C'
-  begin
-    if _IsDebugView then
-      TProjectData(FBillsMeasureData.ProjectData).CalculateAll
-    else
-      actnCalculateAll.Execute;
+    if (ssCtrl in Shift) and (ssShift in Shift) and (ssAlt in Shift)
+        and (Key in [67, 99]) then // 'c', 'C'
+    begin
+      if _IsDebugView then
+        TProjectData(FBillsMeasureData.ProjectData).CalculateAll
+      else
+        actnCalculateAll.Execute;
+    end;
   end;
 
   if (ssCtrl in Shift) and (ssShift in Shift) and (ssAlt in Shift)