Ignore:
Timestamp:
Nov 24, 2011, 10:03:48 AM (13 years ago)
Author:
chronos
Message:
  • Modified: Item list is separated from MainForm as ItemListForm.
  • Modified: Now it is possible to open multiple forms for same operation as View, Edit, Add, List. Open forms are listed in main windows tab list.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UItemView.pas

    r30 r31  
    4040    { private declarations }
    4141  public
     42    SelectedObject: TChronisObject;
     43    SelectedItemId: Integer;
    4244    Report: TReport;
    4345    procedure BuildControls;
     
    7274  TabDataTypeList.OwnsObjects := False;
    7375  TabControl1.Tabs.Clear;
     76  SelectedObject := TChronisObject.Create;
     77  SelectedObject.Base := Core.System;
    7478end;
    7579
     
    8084  TabObjectList.Free;
    8185  TabDataTypeList.Free;
     86  SelectedObject.Free;
    8287end;
    8388
     
    98103
    99104procedure TItemViewForm.ButtonEditClick(Sender: TObject);
     105var
     106  NewItemEditForm: TItemEditForm;
    100107begin
    101108  Close;
    102   ItemEditForm.Show;
     109  NewItemEditForm := TItemEditForm.Create(nil);
     110  NewItemEditForm.SelectedObject.Assign(SelectedObject);
     111  NewItemEditForm.SelectedItemId := SelectedItemId;
     112  MainForm.AddTabForm(NewItemEditForm);
    103113end;
    104114
     
    135145  LastTop := 8;
    136146  Column := 0;
    137   Report.Load(MainForm.SelectedObject, MainForm.SelectedObject.PrimaryKey + ' = ' +
    138     IntToStr(MainForm.SelectedItem));
     147  Report.Load(SelectedObject, SelectedObject.PrimaryKey + ' = ' +
     148    IntToStr(SelectedItemId));
    139149  for I := PanelControls.ControlCount - 1 downto 0 do
    140150    PanelControls.Controls[I].Free;
     
    152162      TabControl1.Tabs.Add(TReportColumn(Report.Columns[I]).Caption);
    153163      TabDataTypeList.Add(DataType);
    154       TabObjectList.Add(MainForm.SelectedItem);
     164      TabObjectList.Add(SelectedItemId);
    155165    end else begin
    156166      NewControl := TLabel.Create(PanelControls);
Note: See TracChangeset for help on using the changeset viewer.