Browse Source

批量插入子后项,用户可调整窗口大小

MaiXinRong 7 years ago
parent
commit
ddc2d48ceb
3 changed files with 67 additions and 30 deletions
  1. 31 27
      Forms/BatchInsertBillsFrm.dfm
  2. 14 3
      Forms/BatchInsertBillsFrm.pas
  3. 22 0
      Units/ConfigDoc.pas

+ 31 - 27
Forms/BatchInsertBillsFrm.dfm

@@ -1,11 +1,10 @@
 object BatchInsertBillsForm: TBatchInsertBillsForm
   Left = 384
   Top = 229
+  Width = 795
+  Height = 420
   BorderIcons = [biSystemMenu]
-  BorderStyle = bsSingle
   Caption = #25209#37327#25554#20837#21518#39033
-  ClientHeight = 382
-  ClientWidth = 779
   Color = clBtnFace
   Font.Charset = ANSI_CHARSET
   Font.Color = clWindowText
@@ -18,12 +17,15 @@ object BatchInsertBillsForm: TBatchInsertBillsForm
   TextHeight = 12
   object pnlButton: TPanel
     Left = 0
-    Top = 354
-    Width = 779
+    Top = 361
+    Width = 787
     Height = 28
     Align = alBottom
     BevelOuter = bvNone
     TabOrder = 0
+    DesignSize = (
+      787
+      28)
     object lblHint: TLabel
       Left = 6
       Top = 8
@@ -43,6 +45,7 @@ object BatchInsertBillsForm: TBatchInsertBillsForm
       Top = 1
       Width = 72
       Height = 23
+      Anchors = [akTop, akRight]
       Caption = #30830'  '#23450
       TabOrder = 0
       OnClick = btnOKClick
@@ -52,6 +55,7 @@ object BatchInsertBillsForm: TBatchInsertBillsForm
       Top = 1
       Width = 72
       Height = 23
+      Anchors = [akTop, akRight]
       Caption = #21462'  '#28040
       ModalResult = 2
       TabOrder = 1
@@ -60,30 +64,30 @@ object BatchInsertBillsForm: TBatchInsertBillsForm
   object pnlAllGrid: TPanel
     Left = 0
     Top = 0
-    Width = 779
-    Height = 354
+    Width = 787
+    Height = 361
     Align = alClient
     BevelOuter = bvNone
     TabOrder = 1
     object pnlPositon_Bills: TPanel
       Left = 0
       Top = 0
-      Width = 480
-      Height = 354
+      Width = 488
+      Height = 361
       Align = alClient
       BevelOuter = bvNone
       TabOrder = 0
       object pnlPosition: TPanel
         Left = 0
         Top = 0
-        Width = 480
-        Height = 194
+        Width = 488
+        Height = 201
         Align = alClient
         BevelOuter = bvNone
         TabOrder = 0
         DesignSize = (
-          480
-          194)
+          488
+          201)
         object lblPostion: TLabel
           Left = 8
           Top = 8
@@ -98,7 +102,7 @@ object BatchInsertBillsForm: TBatchInsertBillsForm
           ParentFont = False
         end
         object zgPosition: TZJGrid
-          Left = 3
+          Left = 8
           Top = 27
           Width = 474
           Height = 166
@@ -129,18 +133,18 @@ object BatchInsertBillsForm: TBatchInsertBillsForm
       end
       object pnlBills: TPanel
         Left = 0
-        Top = 194
-        Width = 480
+        Top = 201
+        Width = 488
         Height = 135
         Align = alBottom
         BevelOuter = bvNone
         TabOrder = 1
         DesignSize = (
-          480
+          488
           135)
         object lblBills: TLabel
           Left = 8
-          Top = 8
+          Top = 1
           Width = 48
           Height = 12
           Caption = #28165#21333#32534#21495
@@ -152,8 +156,8 @@ object BatchInsertBillsForm: TBatchInsertBillsForm
           ParentFont = False
         end
         object zgBills: TZJGrid
-          Left = 2
-          Top = 27
+          Left = 7
+          Top = 22
           Width = 475
           Height = 105
           OptionsEx = []
@@ -172,7 +176,7 @@ object BatchInsertBillsForm: TBatchInsertBillsForm
         end
         object pnlBillsSpr: TPanel
           Left = 62
-          Top = 14
+          Top = 7
           Width = 414
           Height = 2
           Anchors = [akLeft, akTop, akRight]
@@ -183,8 +187,8 @@ object BatchInsertBillsForm: TBatchInsertBillsForm
       end
       object pnlOther: TPanel
         Left = 0
-        Top = 329
-        Width = 480
+        Top = 336
+        Width = 488
         Height = 25
         Align = alBottom
         BevelOuter = bvNone
@@ -240,16 +244,16 @@ object BatchInsertBillsForm: TBatchInsertBillsForm
       end
     end
     object pnlDealBills: TPanel
-      Left = 480
+      Left = 488
       Top = 0
       Width = 299
-      Height = 354
+      Height = 361
       Align = alRight
       BevelOuter = bvNone
       TabOrder = 1
       DesignSize = (
         299
-        354)
+        361)
       object lblDealBills: TLabel
         Left = 5
         Top = 8
@@ -267,7 +271,7 @@ object BatchInsertBillsForm: TBatchInsertBillsForm
         Left = 0
         Top = 27
         Width = 295
-        Height = 322
+        Height = 328
         Options = [goRangeSelect, goRowSizing, goColSizing, goCellNotMaintainData, goFixedRowShowNo, goFixedColShowNo, goAlwaysShowSelection]
         OptionsEx = []
         RowCount = 7

+ 14 - 3
Forms/BatchInsertBillsFrm.pas

@@ -56,6 +56,7 @@ type
     procedure zgBillsMouseDown(Sender: TObject; Button: TMouseButton;
       Shift: TShiftState; X, Y: Integer);
     procedure actnInsertColUpdate(Sender: TObject);
+    procedure FormResize(Sender: TObject);
   private
     FInsertType: TInsertType;
     FBillsCompileData: TBillsCompileData;
@@ -83,7 +84,7 @@ procedure AddLeafBills(ABillsCompileData: TBillsCompileData; AInsertType: TInser
 implementation
 
 uses
-  sdDB, UtilMethods, ProjectData, MainFrm;
+  sdDB, UtilMethods, ProjectData, MainFrm, Globals;
 
 {$R *.dfm}
 
@@ -161,8 +162,11 @@ end;
 procedure TBatchInsertBillsForm.Init(ABillsCompileData: TBillsCompileData;
   AInsertType: TInsertType);
 begin
-  ClientHeight := 382;
-  ClientWidth := 779;
+  ClientHeight := SupportManager.ConfigInfo.BatchInsertFrmHeight;
+  ClientWidth := SupportManager.ConfigInfo.BatchInsertFrmWidth;
+  pnlBills.Height := Trunc((pnlPositon_Bills.Height - pnlOther.Height)/22*9);
+
+  OnResize := FormResize;
 
   FBillsCompileData := ABillsCompileData;
   sgdDealBills.DataView := TProjectData(ABillsCompileData.ProjectData).DealBillsData.sdvDealBills;
@@ -477,4 +481,11 @@ begin
     TAction(Sender).Caption := '²åÈëÒ»ÐÐ';
 end;
 
+procedure TBatchInsertBillsForm.FormResize(Sender: TObject);
+begin
+  SupportManager.ConfigInfo.BatchInsertFrmHeight := ClientHeight;
+  SupportManager.ConfigInfo.BatchInsertFrmWidth := ClientWidth;
+  pnlBills.Height := Trunc((pnlPositon_Bills.Height - pnlOther.Height)/22*9);
+end;
+
 end.

+ 22 - 0
Units/ConfigDoc.pas

@@ -23,7 +23,10 @@ type
     FOverRangeType: Integer;
     FExcelWithMis: Boolean;
     FIsLog: Boolean;
+    FBatchInsertFrmHeight: Integer;
+    FBatchInsertFrmWidth: Integer;
 
+    procedure LoadSectionOfCustomize;
     procedure LoadSectionOfUnitList;
     procedure LoadSectionOfStdFile;
     procedure LoadSectionOfPath;
@@ -33,6 +36,7 @@ type
     procedure SaveIniFile;
     procedure SaveSectionOfStdFile;
     procedure SaveSectionOfOptions;
+    procedure SaveSectionOfCustomize;
 
     function GetStandardGclLib: string;
     function GetStandardXmLib: string;
@@ -61,6 +65,10 @@ type
     property AutoSaveInterval: Integer read FAutoSaveInterval write FAutoSaveInterval;
     property OverRangeType: Integer read FOverRangeType write FOverRangeType;
     property ExcelWithMis: Boolean read FExcelWithMis write FExcelWithMis;
+
+    // Customize
+    property BatchInsertFrmHeight: Integer read FBatchInsertFrmHeight write FBatchInsertFrmHeight;
+    property BatchInsertFrmWidth: Integer read FBatchInsertFrmWidth write FBatchInsertFrmWidth;
   end;
 
 implementation
@@ -108,10 +116,17 @@ begin
   LoadSectionOfStdFile;
   LoadSectionOfPath;
   LoadSectionOfOptions;
+  LoadSectionOfCustomize;
 
   FIsLog := FIniFile.ReadBool('Other', 'IsLog', True);
 end;
 
+procedure TConfigInfo.LoadSectionOfCustomize;
+begin
+  FBatchInsertFrmHeight := FIniFile.ReadInteger('Customize', 'BatchInsertFrmHeight', 382);
+  FBatchInsertFrmWidth := FIniFile.ReadInteger('Customize', 'BatchInsertFrmWidth', 779);
+end;
+
 procedure TConfigInfo.LoadSectionOfOptions;
 begin
   FCompanyName := FIniFile.ReadString('Options', 'CompanyName', '');
@@ -149,6 +164,13 @@ procedure TConfigInfo.SaveIniFile;
 begin
   SaveSectionOfStdFile;
   SaveSectionOfOptions;
+  SaveSectionOfCustomize;
+end;
+
+procedure TConfigInfo.SaveSectionOfCustomize;
+begin
+  FIniFile.WriteInteger('Customize', 'BatchInsertFrmHeight', FBatchInsertFrmHeight);
+  FIniFile.WriteInteger('Customize', 'BatchInsertFrmWidth', FBatchInsertFrmWidth);
 end;
 
 procedure TConfigInfo.SaveSectionOfOptions;