|
@@ -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.
|