Changeset 22 for trunk/Forms/UItemEdit.pas
- Timestamp:
- Jun 16, 2011, 12:18:21 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UItemEdit.pas
r21 r22 28 28 public 29 29 Report: TReport; 30 ControlList: TListObject;31 30 procedure BuildControls; 32 31 end; … … 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.Update(MainForm.SelectedObject.Table, Data, 66 '` Id` = ' + IntToStr(MainForm.SelectedItem), MainForm.SelectedObject.Schema);67 '`' + MainForm.SelectedObject.PrimaryKey + '` = ' + IntToStr(MainForm.SelectedItem), MainForm.SelectedObject.Schema); 67 68 finally 68 69 Data.Free; … … 85 86 Report := TReport.Create; 86 87 Report.Base := Core.System; 87 ControlList := TListObject.Create;88 ControlList.OwnsObjects := False;89 88 end; 90 89 91 90 procedure TItemEditForm.FormDestroy(Sender: TObject); 92 91 begin 93 ControlList.Free;94 92 Report.Free; 95 93 end; … … 141 139 NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2; 142 140 NewControl.Width := (Width div ColumnCount) div 2 - 20; 143 ControlList.Add(NewControl);141 TReportColumn(Report.Columns[I]).Control := NewControl; 144 142 145 143 Column := (Column + 1) mod 2; 146 144 if Column = 0 then LastTop := LastTop + NewControl.Height + 4; 147 145 end; 148 end else ControlList.Add(nil);146 end; 149 147 end; 150 148
Note:
See TracChangeset
for help on using the changeset viewer.