瀏覽代碼

1. 导出单标段文件时,提示同名文件名
2. 复制整块,选择粘贴位置,未提交的新增单元

MaiXinRong 10 年之前
父節點
當前提交
48c4d2e810
共有 3 個文件被更改,包括 150 次插入1 次删除
  1. 78 0
      Forms/BillsPasteSelectFrm.dfm
  2. 70 0
      Forms/BillsPasteSelectFrm.pas
  3. 2 1
      Units/ProjectCommands.pas

+ 78 - 0
Forms/BillsPasteSelectFrm.dfm

@@ -0,0 +1,78 @@
+object BillsPasteSelectForm: TBillsPasteSelectForm
+  Left = 596
+  Top = 356
+  Width = 251
+  Height = 124
+  Caption = #20301#32622#36873#25321
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'MS Sans Serif'
+  Font.Style = []
+  OldCreateOrder = False
+  PixelsPerInch = 96
+  TextHeight = 13
+  object Label1: TLabel
+    Left = 6
+    Top = 5
+    Width = 132
+    Height = 13
+    Caption = #35831#36873#25321#25554#20837#33410#28857#30340#31867#22411#65306
+  end
+  object btnOk: TButton
+    Left = 114
+    Top = 63
+    Width = 55
+    Height = 21
+    Caption = #30830#23450
+    TabOrder = 0
+    OnClick = btnOkClick
+  end
+  object btnCancel: TButton
+    Left = 178
+    Top = 63
+    Width = 55
+    Height = 21
+    Caption = #21462#28040
+    ModalResult = 2
+    TabOrder = 1
+  end
+  object pnlPos: TPanel
+    Left = 18
+    Top = 24
+    Width = 207
+    Height = 33
+    BevelInner = bvRaised
+    BevelOuter = bvLowered
+    TabOrder = 2
+    object rbNext: TRadioButton
+      Tag = 1
+      Left = 71
+      Top = 9
+      Width = 49
+      Height = 17
+      Caption = #21518#39033
+      Checked = True
+      TabOrder = 0
+      TabStop = True
+    end
+    object rbPre: TRadioButton
+      Tag = 2
+      Left = 137
+      Top = 9
+      Width = 49
+      Height = 17
+      Caption = #21069#39033
+      TabOrder = 1
+    end
+    object rbChild: TRadioButton
+      Left = 8
+      Top = 9
+      Width = 49
+      Height = 17
+      Caption = #23376#39033
+      TabOrder = 2
+    end
+  end
+end

+ 70 - 0
Forms/BillsPasteSelectFrm.pas

@@ -0,0 +1,70 @@
+unit BillsPasteSelectFrm;
+
+interface
+
+uses
+  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+  Dialogs, ExtCtrls, StdCtrls;
+
+type
+  TBillsPasteSelectForm = class(TForm)
+    btnOk: TButton;
+    btnCancel: TButton;
+    pnlPos: TPanel;
+    rbNext: TRadioButton;
+    rbPre: TRadioButton;
+    rbChild: TRadioButton;
+    Label1: TLabel;
+    procedure btnOkClick(Sender: TObject);
+  private
+    function GetPos: Integer;
+  public
+    property Pos: Integer read GetPos;
+  end;
+
+  function SelectBillsPasteType(var APos: Integer): Boolean;
+
+implementation
+
+uses
+  UtilMethods;
+
+{$R *.dfm}
+
+function SelectBillsPasteType(var APos: Integer): Boolean;
+var
+  SelectForm: TBillsPasteSelectForm;
+begin
+  SelectForm := TBillsPasteSelectForm.Create(nil);
+  try
+    Result := SelectForm.ShowModal = mrOk;
+    if Result then
+      APos := SelectForm.Pos;
+  finally
+    SelectForm.Free;
+  end;
+end;
+
+{ TBillsPasteSelectForm }
+
+function TBillsPasteSelectForm.GetPos: Integer;
+begin
+  if rbChild.Checked then
+    Result := 0
+  else if rbNext.Checked then
+    Result := 1
+  else if rbPre.Checked then
+    Result := 2
+  else
+    Result := -1;
+end;
+
+procedure TBillsPasteSelectForm.btnOkClick(Sender: TObject);
+begin
+  if (Pos = -1) then
+    WarningMessage('粘贴层次结构模式下,须选择插入节点的类型!')
+  else
+    ModalResult := mrOk;
+end;
+
+end.

+ 2 - 1
Units/ProjectCommands.pas

@@ -641,7 +641,8 @@ begin
     if AExportAttachment then
       CopyFolder(FAttachmentPath, FTempFolder + '\' + sFileName + '[附件包]');
 
-  if FIngore or (not FileExists(FResultFile) or QuestMessage('存在同名文件,是否替换?')) then
+  if FIngore or (not FileExists(FResultFile) or
+      QuestMessage(Format('存在同名文件“%s”,是否替换?', [ExtractFileName(FResultFile)]))) then
     ZipFolder(FTempFolder, FResultFile);
 end;