Explorar o código

Task #1450 台账分解、计量台账,表达式,可读写备注列内容

MaiXinRong %!s(int64=8) %!d(string=hai) anos
pai
achega
bdbc56f014
Modificáronse 2 ficheiros con 26 adicións e 8 borrados
  1. 14 5
      Frames/BillsCompileFme.pas
  2. 12 3
      Frames/BillsMeasureFme.pas

+ 14 - 5
Frames/BillsCompileFme.pas

@@ -91,6 +91,8 @@ type
     procedure ResetAllowInsert(AAllow: Boolean);
 
     function CheckExprsColumn: Boolean;
+    function CheckMemoStrColumn: Boolean;
+
     procedure SetShowDesignQuantity(const Value: Boolean);
     procedure SetShowAlias(const Value: Boolean);
   public
@@ -232,7 +234,6 @@ end;
 
 destructor TBillsCompileFrame.Destroy;
 begin
-
   inherited;
 end;
 
@@ -243,7 +244,7 @@ begin
     dxpmBillsCompile.PopupFromCursorPos
   else
   begin
-    if CheckExprsColumn then
+    if CheckExprsColumn or CheckMemoStrColumn then
       laEdtExprs.Text := zgBillsCompile.CurCell.EditText
     else
       laEdtExprs.Text := '';
@@ -292,7 +293,7 @@ end;
 procedure TBillsCompileFrame.laEdtExprsExit(Sender: TObject);
 begin
   if not TLabeledEdit(Sender).ReadOnly then
-    if CheckExprsColumn then
+    if CheckExprsColumn or CheckMemoStrColumn then
       zgBillsCompile.CurCell.Text := laEdtExprs.Text;
 end;
 
@@ -313,7 +314,7 @@ begin
   begin
     zgBillsCompile.SetFocus;
     if not TLabeledEdit(Sender).ReadOnly then
-      if CheckExprsColumn then
+      if CheckExprsColumn or CheckMemoStrColumn then
         zgBillsCompile.CurCell.Text := laEdtExprs.Text;
   end;
 end;
@@ -681,7 +682,7 @@ end;
 procedure TBillsCompileFrame.zgBillsCompileCellTextChanged(Sender: TObject;
   Col, Row: Integer);
 begin
-  if CheckExprsColumn then
+  if CheckExprsColumn or CheckMemoStrColumn then
     laEdtExprs.Text := zgBillsCompile.CurCell.EditText
   else
     laEdtExprs.Text := '';
@@ -690,4 +691,12 @@ begin
       laEdtExprs.ReadOnly := Current.ValueByName('LockedInfo').AsBoolean;
 end;
 
+function TBillsCompileFrame.CheckMemoStrColumn: Boolean;
+var
+  iCol: Integer;
+begin
+  iCol := zgBillsCompile.CurCol - zgBillsCompile.FixedColCount;
+  Result := (iCol = stdBillsCompile.VisibleCol('MemoStr'));
+end;
+
 end.

+ 12 - 3
Frames/BillsMeasureFme.pas

@@ -75,6 +75,7 @@ type
     procedure ShowGridCols(AShow: Boolean; ALeft, ARight: Integer);
 
     function CheckExprsColumn: Boolean;
+    function CheckMemoStrColumn: Boolean;
 
     procedure SetColumnVisible(const AColumn: string; AVisible: Boolean);
     procedure SetAddFieldVisible(AValue: Boolean);
@@ -161,7 +162,7 @@ begin
   end
   else
   begin
-    if CheckExprsColumn then
+    if CheckExprsColumn or CheckMemoStrColumn then
       laEdtExprs.Text := zgBillsMeasure.CurCell.EditText
     else
       laEdtExprs.Text := '';
@@ -183,7 +184,7 @@ begin
   begin
     zgBillsMeasure.SetFocus;
     if not TLabeledEdit(Sender).ReadOnly then
-      if CheckExprsColumn then
+      if CheckExprsColumn or CheckMemoStrColumn then
         zgBillsMeasure.CurCell.Text := laEdtExprs.Text;
   end;
 end;
@@ -191,7 +192,7 @@ end;
 procedure TBillsMeasureFrame.laEdtExprsExit(Sender: TObject);
 begin
   if not TLabeledEdit(Sender).ReadOnly then
-    if CheckExprsColumn then
+    if CheckExprsColumn or CheckMemoStrColumn then
       zgBillsMeasure.CurCell.Text := laEdtExprs.Text;
 end;
 
@@ -739,4 +740,12 @@ begin
   FColVisibleManager.ShowGridCol(AShow, iBegin, iEnd);
 end;
 
+function TBillsMeasureFrame.CheckMemoStrColumn: Boolean;
+var
+  iCol: Integer;
+begin
+  iCol := zgBillsMeasure.CurCol - zgBillsMeasure.FixedColCount;
+  Result := (iCol = stdBillsMeasure.VisibleCol('MemoStr'));
+end;
+
 end.