Changeset 31 for trunk/Forms/UItemView.pas
- Timestamp:
- Nov 24, 2011, 10:03:48 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UItemView.pas
r30 r31 40 40 { private declarations } 41 41 public 42 SelectedObject: TChronisObject; 43 SelectedItemId: Integer; 42 44 Report: TReport; 43 45 procedure BuildControls; … … 72 74 TabDataTypeList.OwnsObjects := False; 73 75 TabControl1.Tabs.Clear; 76 SelectedObject := TChronisObject.Create; 77 SelectedObject.Base := Core.System; 74 78 end; 75 79 … … 80 84 TabObjectList.Free; 81 85 TabDataTypeList.Free; 86 SelectedObject.Free; 82 87 end; 83 88 … … 98 103 99 104 procedure TItemViewForm.ButtonEditClick(Sender: TObject); 105 var 106 NewItemEditForm: TItemEditForm; 100 107 begin 101 108 Close; 102 ItemEditForm.Show; 109 NewItemEditForm := TItemEditForm.Create(nil); 110 NewItemEditForm.SelectedObject.Assign(SelectedObject); 111 NewItemEditForm.SelectedItemId := SelectedItemId; 112 MainForm.AddTabForm(NewItemEditForm); 103 113 end; 104 114 … … 135 145 LastTop := 8; 136 146 Column := 0; 137 Report.Load( MainForm.SelectedObject, MainForm.SelectedObject.PrimaryKey + ' = ' +138 IntToStr( MainForm.SelectedItem));147 Report.Load(SelectedObject, SelectedObject.PrimaryKey + ' = ' + 148 IntToStr(SelectedItemId)); 139 149 for I := PanelControls.ControlCount - 1 downto 0 do 140 150 PanelControls.Controls[I].Free; … … 152 162 TabControl1.Tabs.Add(TReportColumn(Report.Columns[I]).Caption); 153 163 TabDataTypeList.Add(DataType); 154 TabObjectList.Add( MainForm.SelectedItem);164 TabObjectList.Add(SelectedItemId); 155 165 end else begin 156 166 NewControl := TLabel.Create(PanelControls);
Note:
See TracChangeset
for help on using the changeset viewer.