Changeset 15 for trunk/Forms/UItemEdit.pas
- Timestamp:
- Jun 13, 2011, 8:25:31 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 4 4 heaptrclog.trc 5 5 chronis.exe 6 DebugLog.txt
-
- Property svn:ignore
-
trunk/Forms/UItemEdit.pas
r14 r15 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, 9 StdCtrls, Spin, EditBtn, USqlDatabase, MaskEdit, USystem; 9 StdCtrls, Spin, EditBtn, USqlDatabase, MaskEdit, USystem, 10 SpecializedList, SpecializedDictionary; 10 11 11 12 type … … 27 28 public 28 29 Report: TReport; 30 ControlList: TListObject; 29 31 procedure BuildControls; 30 32 end; … … 48 50 49 51 procedure TItemEditForm.ButtonSaveClick(Sender: TObject); 52 var 53 Data: TDictionaryStringString; 54 I: Integer; 55 DataType: TDataType; 50 56 begin 51 57 with Core.System do 58 try 59 Data := TDictionaryStringString.Create; 60 for I := 0 to Report.Columns.Count - 1 do 61 if TReportColumn(Report.Columns[I]).ColumnName <> 'Id' then begin 62 DataType := TReportColumn(Report.Columns[I]).CustomType; 63 Data.Add(TReportColumn(Report.Columns[I]).ColumnName, DataType.GetControlValue(TWinControl(ControlList[I]))); 64 end; 65 Database.Update(MainForm.SelectedObject.Table, Data, 66 '`Id` = ' + IntToStr(MainForm.SelectedItem), MainForm.SelectedObject.Schema); 67 finally 68 Data.Free; 69 end; 70 if (MainForm.SelectedObject.Table = ObjectGroupTable) or 71 (MainForm.SelectedObject.Table = ObjectTable) then 72 MainForm.LoadTree; 52 73 MainForm.LoadItemList; 53 74 Close; … … 64 85 Report := TReport.Create; 65 86 Report.Base := Core.System; 87 ControlList := TListObject.Create; 88 ControlList.OwnsObjects := False; 66 89 end; 67 90 68 91 procedure TItemEditForm.FormDestroy(Sender: TObject); 69 92 begin 93 ControlList.Free; 70 94 Report.Free; 71 95 end; … … 115 139 NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2; 116 140 NewControl.Width := (Width div ColumnCount) div 2 - 20; 141 ControlList.Add(NewControl); 117 142 118 143 Column := (Column + 1) mod 2; 119 144 if Column = 0 then LastTop := LastTop + NewControl.Height + 4; 120 end ;145 end else ControlList.Add(nil); 121 146 end; 122 147
Note:
See TracChangeset
for help on using the changeset viewer.