Changeset 22 for trunk/Forms/UItemAdd.pas
- Timestamp:
- Jun 16, 2011, 12:18:21 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UItemAdd.pas
r21 r22 29 29 public 30 30 Report: TReport; 31 ControlList: TListObject; 32 end; 31 end; 33 32 34 33 var … … 59 58 Data := TDictionaryStringString.Create; 60 59 for I := 0 to Report.Columns.Count - 1 do 61 if TReportColumn(Report.Columns[I]).ColumnName <> 'Id' then begin 60 if not (TReportColumn(Report.Columns[I]).CustomType is TDataTypeRelationMany) then 61 if TReportColumn(Report.Columns[I]).ColumnName <> MainForm.SelectedObject.PrimaryKey then begin 62 62 DataType := TReportColumn(Report.Columns[I]).CustomType; 63 Data.Add(TReportColumn(Report.Columns[I]).ColumnName, DataType.GetControlValue(TWinControl(ControlList[I]))); 63 Data.Add(TReportColumn(Report.Columns[I]).ColumnName, 64 DataType.GetControlValue(TWinControl(TReportColumn(Report.Columns[I]).Control))); 64 65 end; 65 66 Database.Insert(MainForm.SelectedObject.Table, Data, MainForm.SelectedObject.Schema); … … 81 82 Report := TReport.Create; 82 83 Report.Base := Core.System; 83 ControlList := TListObject.Create;84 ControlList.OwnsObjects := False;85 84 end; 86 85 … … 88 87 begin 89 88 Report.Free; 90 ControlList.Free;91 89 end; 92 90 … … 119 117 120 118 // Load column names 121 ControlList.Clear;122 119 for I := 0 to Report.Columns.Count - 1 do 123 120 if TReportColumn(Report.Columns[I]).ColumnName <> 'Id' then begin … … 138 135 NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2; 139 136 NewControl.Width := (Width div ColumnCount) div 2 - 20; 140 ControlList.Add(NewControl);137 TReportColumn(Report.Columns[I]).Control := NewControl; 141 138 142 139 Column := (Column + 1) mod 2; 143 140 if Column = 0 then LastTop := LastTop + NewControl.Height + 4; 144 141 end; 145 end else ControlList.Add(nil);142 end; 146 143 end; 147 144
Note:
See TracChangeset
for help on using the changeset viewer.