瀏覽代碼

批量插入子/后项,部位,新增右键菜单功能,“插入一列”

MaiXinRong 9 年之前
父節點
當前提交
970aff99f4
共有 4 個文件被更改,包括 60 次插入19 次删除
  1. 13 0
      Forms/BatchInsertBillsFrm.dfm
  2. 21 2
      Forms/BatchInsertBillsFrm.pas
  3. 22 16
      Forms/MainFrm.dfm
  4. 4 1
      Forms/MainFrm.pas

+ 13 - 0
Forms/BatchInsertBillsFrm.dfm

@@ -292,8 +292,13 @@ object BatchInsertBillsForm: TBatchInsertBillsForm
       item
         Item = MainForm.dxbtnPaste
         Visible = True
+      end
+      item
+        Item = MainForm.dxbtnInsertCol
+        Visible = True
       end>
     UseOwnFont = False
+    OnPopup = dxpmInsertBillsPopup
     Left = 139
     Top = 99
   end
@@ -377,4 +382,12 @@ object BatchInsertBillsForm: TBatchInsertBillsForm
     Left = 568
     Top = 139
   end
+  object alBatchInsertBills: TActionList
+    Left = 203
+    Top = 99
+    object actnInsertCol: TAction
+      Caption = #25554#20837#19968#21015
+      OnExecute = actnInsertColExecute
+    end
+  end
 end

+ 21 - 2
Forms/BatchInsertBillsFrm.pas

@@ -5,7 +5,8 @@ interface
 uses
   BillsCompileDm,
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
-  Dialogs, StdCtrls, ExtCtrls, ZJGrid, sdIDTree, dxBar, sdGridDBA, ComCtrls;
+  Dialogs, StdCtrls, ExtCtrls, ZJGrid, sdIDTree, dxBar, sdGridDBA, ComCtrls,
+  ActnList;
 
 type
   TInsertType = (itChild, itNextSibling);
@@ -35,6 +36,8 @@ type
     lblHint: TLabel;
     sgdDealBills: TsdGridDBA;
     udBeginCode: TUpDown;
+    alBatchInsertBills: TActionList;
+    actnInsertCol: TAction;
     procedure zgPositionCustomPaste(Sender: TObject; ABounds: TRect;
       ASourSheet: TZjSheet);
     procedure zgBillsCustomPaste(Sender: TObject; ABounds: TRect;
@@ -48,6 +51,8 @@ type
     procedure leBeginCodeKeyPress(Sender: TObject; var Key: Char);
     procedure zgPositionCellTextChanged(Sender: TObject; Col,
       Row: Integer);
+    procedure dxpmInsertBillsPopup(Sender: TObject);
+    procedure actnInsertColExecute(Sender: TObject);
   private
     FInsertType: TInsertType;
     FBillsCompileData: TBillsCompileData;
@@ -75,7 +80,7 @@ procedure AddLeafBills(ABillsCompileData: TBillsCompileData; AInsertType: TInser
 implementation
 
 uses
-  sdDB, UtilMethods, ProjectData;
+  sdDB, UtilMethods, ProjectData, MainFrm;
 
 {$R *.dfm}
 
@@ -397,4 +402,18 @@ begin
   end;
 end;
 
+procedure TBatchInsertBillsForm.dxpmInsertBillsPopup(Sender: TObject);
+begin
+  SetDxBtnAction(actnInsertCol, MainForm.dxbtnInsertCol);
+end;
+
+procedure TBatchInsertBillsForm.actnInsertColExecute(Sender: TObject);
+begin
+  zgPosition.ColCount := zgPosition.ColCount + 1;
+  zgPosition.Cells[zgPosition.ColCount-1, 0].Text := 'Çåµ¥' + IntToStr(zgPosition.ColCount -1 - 1);
+  zgPosition.ColWidths[zgPosition.ColCount-1] := 50;
+  zgBills.RowCount := zgPosition.ColCount - 1;
+  zgBills.Cells[0, zgBills.RowCount-1].Text := 'Çåµ¥' + IntToStr(zgBills.RowCount-1);
+end;
+
 end.

+ 22 - 16
Forms/MainFrm.dfm

@@ -20,8 +20,8 @@ object MainForm: TMainForm
   TextHeight = 12
   object jtsProjects: TJimTabSet
     Left = 0
-    Top = 49
-    Width = 734
+    Top = 48
+    Width = 742
     Height = 21
     Align = alTop
     BackgroundColor = clGradientInactiveCaption
@@ -45,8 +45,8 @@ object MainForm: TMainForm
   end
   object dxStatusBar: TdxStatusBar
     Left = 0
-    Top = 480
-    Width = 734
+    Top = 484
+    Width = 742
     Height = 20
     Panels = <
       item
@@ -78,12 +78,12 @@ object MainForm: TMainForm
     object dxStatusBarContainer2: TdxStatusBarContainerControl
       Left = 604
       Top = 2
-      Width = 128
+      Width = 136
       Height = 16
       object ProgressBar: TProgressBar
         Left = 0
         Top = 0
-        Width = 128
+        Width = 136
         Height = 16
         Align = alClient
         Max = 200
@@ -93,9 +93,9 @@ object MainForm: TMainForm
   end
   object jpsMain: TJimPages
     Left = 0
-    Top = 70
-    Width = 734
-    Height = 410
+    Top = 69
+    Width = 742
+    Height = 415
     ActivePage = jpsMainProjectsManager
     ActivePageIndex = 0
     Align = alClient
@@ -103,8 +103,8 @@ object MainForm: TMainForm
     object jpsMainProjectsManager: TJimPage
       Left = 0
       Top = 0
-      Width = 734
-      Height = 410
+      Width = 742
+      Height = 415
       TabName = 'ProjectsManager'
       Caption = 'ProjsMgr'
       object pnlUser: TPanel
@@ -201,8 +201,8 @@ object MainForm: TMainForm
     object jpsMainProjects: TJimPage
       Left = 0
       Top = 0
-      Width = 734
-      Height = 410
+      Width = 742
+      Height = 415
       TabName = 'Projects'
       Caption = 'Projects'
       object jpsProjects: TJimPages
@@ -220,7 +220,7 @@ object MainForm: TMainForm
     Font.Charset = DEFAULT_CHARSET
     Font.Color = clWindowText
     Font.Height = -12
-    Font.Name = #24494#36719#38597#40657
+    Font.Name = #23435#20307
     Font.Style = []
     Bars = <
       item
@@ -266,7 +266,7 @@ object MainForm: TMainForm
         Caption = #24037#20855#26639
         DockedDockingStyle = dsTop
         DockedLeft = 0
-        DockedTop = 27
+        DockedTop = 26
         DockingStyle = dsTop
         FloatLeft = 484
         FloatTop = 279
@@ -375,7 +375,7 @@ object MainForm: TMainForm
     DockControlHeights = (
       0
       0
-      49
+      48
       0)
     object dxsiFile: TdxBarSubItem
       Caption = #25991#20214'(&F)'
@@ -988,6 +988,12 @@ object MainForm: TMainForm
       Visible = ivAlways
       ImageIndex = 15
     end
+    object dxbtnInsertCol: TdxBarButton
+      Caption = #26032#22686#19968#21015
+      Category = 0
+      Hint = #26032#22686#19968#21015
+      Visible = ivAlways
+    end
   end
   object Images: TImageList
     DrawingStyle = dsTransparent

+ 4 - 1
Forms/MainFrm.pas

@@ -147,6 +147,7 @@ type
     dxbtnCopyDetailGls: TdxBarButton;
     dxbtnApplyToSameBills: TdxBarButton;
     dxbtnCalculatePriceMargin: TdxBarButton;
+    dxbtnInsertCol: TdxBarButton;
     procedure FormCreate(Sender: TObject);
     procedure FormDestroy(Sender: TObject);
     procedure jtsProjectsChange(Sender: TObject; NewTab: Integer;
@@ -265,7 +266,9 @@ procedure TMainForm.FormCreate(Sender: TObject);
       Result := Result + '¹ã¶«';
     if _ModuleType = mtAll then
     begin
-      if G_IsCloud then
+      if G_IsTest then
+        Result := '²âÊÔ'
+      else if G_IsCloud then
         Result := Result + 'ÔÆ'
       else if _IsEncrypt then
         Result := Result + 'רҵ'