Browse Source

批量插入后/子项,右键菜单名称调整

MaiXinRong 7 years ago
parent
commit
d98f537197
3 changed files with 27 additions and 2 deletions
  1. 2 1
      Forms/BatchInsertBillsFrm.dfm
  2. 24 0
      Forms/BatchInsertBillsFrm.pas
  3. 1 1
      Units/UtilMethods.pas

+ 2 - 1
Forms/BatchInsertBillsFrm.dfm

@@ -159,7 +159,7 @@ object BatchInsertBillsForm: TBatchInsertBillsForm
           FrozenCol = 0
           FrozenRow = 0
           OnCellTextChanged = zgBillsCellTextChanged
-          OnMouseDown = zgPositionMouseDown
+          OnMouseDown = zgBillsMouseDown
         end
         object pnlBillsSpr: TPanel
           Left = 62
@@ -390,6 +390,7 @@ object BatchInsertBillsForm: TBatchInsertBillsForm
     object actnInsertCol: TAction
       Caption = #25554#20837#19968#21015
       OnExecute = actnInsertColExecute
+      OnUpdate = actnInsertColUpdate
     end
   end
 end

+ 24 - 0
Forms/BatchInsertBillsFrm.pas

@@ -53,6 +53,9 @@ type
       Row: Integer);
     procedure dxpmInsertBillsPopup(Sender: TObject);
     procedure actnInsertColExecute(Sender: TObject);
+    procedure zgBillsMouseDown(Sender: TObject; Button: TMouseButton;
+      Shift: TShiftState; X, Y: Integer);
+    procedure actnInsertColUpdate(Sender: TObject);
   private
     FInsertType: TInsertType;
     FBillsCompileData: TBillsCompileData;
@@ -341,7 +344,10 @@ procedure TBatchInsertBillsForm.zgPositionMouseDown(Sender: TObject;
   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
 begin
   if Button = mbRight then
+  begin
+    dxpmInsertBills.Tag := 0;
     dxpmInsertBills.PopupFromCursorPos;
+  end;
 end;
 
 procedure TBatchInsertBillsForm.zgBillsCellTextChanged(Sender: TObject;
@@ -453,4 +459,22 @@ begin
   zgBills.Cells[0, zgBills.RowCount-1].Text := 'Çåµ¥' + IntToStr(zgBills.RowCount-1);
 end;
 
+procedure TBatchInsertBillsForm.zgBillsMouseDown(Sender: TObject;
+  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+begin
+  if Button = mbRight then
+  begin
+    dxpmInsertBills.Tag := 1;
+    dxpmInsertBills.PopupFromCursorPos;
+  end;
+end;
+
+procedure TBatchInsertBillsForm.actnInsertColUpdate(Sender: TObject);
+begin
+  if dxpmInsertBills.Tag = 0 then
+    TAction(Sender).Caption := '²åÈëÒ»ÁÐ'
+  else
+    TAction(Sender).Caption := '²åÈëÒ»ÐÐ';
+end;
+
 end.

+ 1 - 1
Units/UtilMethods.pas

@@ -377,7 +377,7 @@ end;
 function GetAppTempPath: string;
 begin
   Result := GetAppFilePath + 'Temp\';
-  if DirectoryExists(Result) then
+  if not DirectoryExists(Result) then
     CreateDirectoryInDeep(Result);
 end;