Changeset 31 for trunk/Forms


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.
Location:
trunk/Forms
Files:
3 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UItemAdd.pas

    r22 r31  
    2828    { private declarations }
    2929  public
     30    SelectedObject: TChronisObject;
     31    SelectedItemId: Integer;
    3032    Report: TReport;
    3133  end;
     
    5961    for I := 0 to Report.Columns.Count - 1 do
    6062    if not (TReportColumn(Report.Columns[I]).CustomType is TDataTypeRelationMany) then
    61     if TReportColumn(Report.Columns[I]).ColumnName <> MainForm.SelectedObject.PrimaryKey then begin
     63    if TReportColumn(Report.Columns[I]).ColumnName <> SelectedObject.PrimaryKey then begin
    6264      DataType := TReportColumn(Report.Columns[I]).CustomType;
    6365      Data.Add(TReportColumn(Report.Columns[I]).ColumnName,
    6466        DataType.GetControlValue(TWinControl(TReportColumn(Report.Columns[I]).Control)));
    6567    end;
    66     Database.Insert(MainForm.SelectedObject.Table, Data, MainForm.SelectedObject.Schema);
     68    Database.Insert(SelectedObject.Table, Data, SelectedObject.Schema);
    6769  finally
    6870    Data.Free;
    6971  end;
    70   MainForm.LoadItemList;
     72  //MainForm.LoadItemList;
    7173  Close;
    7274end;
     
    8284  Report := TReport.Create;
    8385  Report.Base := Core.System;
     86  SelectedObject := TChronisObject.Create;
     87  SelectedObject.Base := Core.System;
    8488end;
    8589
     
    8791begin
    8892  Report.Free;
     93  SelectedObject.Free;
    8994end;
    9095
     
    113118    Panel1.Controls[I].Free;
    114119
    115   Report.Load(MainForm.SelectedObject, MainForm.SelectedObject.PrimaryKey + ' = ' +
    116     IntToStr(MainForm.SelectedItem));
     120  Report.Load(SelectedObject, SelectedObject.PrimaryKey + ' = ' +
     121    IntToStr(SelectedItemId));
    117122
    118123  // Load column names
  • trunk/Forms/UItemEdit.lfm

    r30 r31  
    131131          Width = 67
    132132          Caption = 'Delete'
     133          Enabled = False
    133134          OnClick = ButtonDeleteClick
    134135          TabOrder = 1
     
    140141          Width = 64
    141142          Caption = 'View'
     143          Enabled = False
    142144          OnClick = ButtonViewClick
    143145          TabOrder = 2
     
    149151          Width = 62
    150152          Caption = 'Edit'
     153          Enabled = False
    151154          OnClick = ButtonEditClick
    152155          TabOrder = 3
  • trunk/Forms/UItemEdit.pas

    r30 r31  
    4646    procedure TabControl1Change(Sender: TObject);
    4747  private
    48     SelectedItem: Integer;
    4948    SubListObject: TChronisObject;
    5049    TabObjectList: TListInteger;
     
    5251    procedure LoadSubList;
    5352  public
     53    SelectedObject: TChronisObject;
     54    SelectedItemId: Integer;
    5455    Report: TReport;
    5556    procedure BuildControls;
     
    8889procedure TItemEditForm.ButtonAddClick(Sender: TObject);
    8990begin
    90   if Assigned(ListView1.Selected) then
    91     ItemAddForm.Show;
     91  ItemAddForm.Show;
    9292end;
    9393
     
    9999  with TReportLine(Report[Item.Index]) do begin
    100100    Item.Caption := Items[0];
     101    Item.Data := Pointer(Id);
    101102    for I := 1 to Items.Count - 1 do
    102103    if not TReportColumn(Report.Columns[I]).VirtualItem then
     
    127128    for I := 0 to Report.Columns.Count - 1 do
    128129    if not (TReportColumn(Report.Columns[I]).CustomType is TDataTypeRelationMany) then
    129     if TReportColumn(Report.Columns[I]).ColumnName <> MainForm.SelectedObject.PrimaryKey then begin
     130    if TReportColumn(Report.Columns[I]).ColumnName <> SelectedObject.PrimaryKey then begin
    130131      DataType := TReportColumn(Report.Columns[I]).CustomType;
    131132      Data.Add(TReportColumn(Report.Columns[I]).ColumnName,
    132133        DataType.GetControlValue(TWinControl(TReportColumn(Report.Columns[I]).Control)));
    133134    end;
    134     Database.Update(MainForm.SelectedObject.Table, Data,
    135       '`' + MainForm.SelectedObject.PrimaryKey + '` = ' + IntToStr(MainForm.SelectedItem), MainForm.SelectedObject.Schema);
     135    Database.Update(SelectedObject.Table, Data,
     136      '`' + SelectedObject.PrimaryKey + '` = ' + IntToStr(SelectedItemId), SelectedObject.Schema);
    136137  finally
    137138    Data.Free;
    138139  end;
    139   if (MainForm.SelectedObject.Table = ObjectGroupTable) or
    140   (MainForm.SelectedObject.Table = ObjectTable) then
     140  if (SelectedObject.Table = ObjectGroupTable) or
     141  (SelectedObject.Table = ObjectTable) then
    141142    MainForm.LoadTree;
    142   MainForm.LoadItemList;
     143  //MainForm.LoadItemList;
    143144  Close;
    144145end;
     
    166167  TabDataTypeList.OwnsObjects := False;
    167168  TabControl1.Tabs.Clear;
     169  SelectedObject := TChronisObject.Create;
     170  SelectedObject.Base := Core.System;
    168171end;
    169172
     
    174177  TabObjectList.Free;
    175178  TabDataTypeList.Free;
     179  SelectedObject.Free;
    176180end;
    177181
     
    197201  LastTop := 8;
    198202  Column := 0;
    199   Report.Load(MainForm.SelectedObject, MainForm.SelectedObject.PrimaryKey + ' = ' +
    200     IntToStr(MainForm.SelectedItem));
     203  Report.Load(SelectedObject, SelectedObject.PrimaryKey + ' = ' +
     204    IntToStr(SelectedItemId));
    201205
    202206  // Clear previous controls on panel
     
    215219        TabControl1.Tabs.Add(TReportColumn(Report.Columns[I]).Caption);
    216220        TabDataTypeList.Add(DataType);
    217         TabObjectList.Add(MainForm.SelectedItem);
     221        TabObjectList.Add(SelectedItemId);
    218222      end else begin
    219223        NewControl := TLabel.Create(Panel1);
     
    270274  Selected: Boolean);
    271275begin
    272   if Assigned(ListView1.Selected) then
    273     SelectedItem := TReportLine(Report[ListView1.Selected.Index]).Id
    274     else SelectedItem := 0;
    275 
    276276  ButtonDelete.Enabled := Assigned(ListView1.Selected);
    277277  ButtonView.Enabled := Assigned(ListView1.Selected);
  • 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);
  • trunk/Forms/UMainForm.lfm

    r30 r31  
    180180      TabOrder = 0
    181181      OnChange = TreeView1Change
     182      OnDblClick = TreeView1DblClick
    182183      Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
    183184    end
     
    193194    ClientWidth = 451
    194195    TabOrder = 1
    195     object Label2: TLabel
    196       Left = 2
    197       Height = 14
    198       Top = 4
    199       Width = 43
    200       Caption = 'Reports:'
    201       ParentColor = False
    202     end
    203     object ListView1: TListView
    204       Left = 2
    205       Height = 371
    206       Top = 19
    207       Width = 447
    208       Anchors = [akTop, akLeft, akRight, akBottom]
    209       Columns = <>
    210       OwnerData = True
    211       PopupMenu = PopupMenuItem
    212       ReadOnly = True
    213       RowSelect = True
     196    object PageControl1: TPageControl
     197      Left = 0
     198      Height = 427
     199      Top = 0
     200      Width = 451
     201      Align = alClient
    214202      TabOrder = 0
    215       ViewStyle = vsReport
    216       OnData = ListView1Data
    217       OnDblClick = ListView1DblClick
    218       OnKeyPress = ListView1KeyPress
    219       OnResize = ListView1Resize
    220       OnSelectItem = ListView1SelectItem
    221     end
    222     object ButtonAdd: TButton
    223       Left = 3
    224       Height = 25
    225       Top = 398
    226       Width = 75
    227       Action = AItemAdd
    228       Anchors = [akLeft, akBottom]
    229       TabOrder = 1
    230     end
    231     object ButtonDelete: TButton
    232       Left = 83
    233       Height = 25
    234       Top = 398
    235       Width = 75
    236       Action = AItemDelete
    237       Anchors = [akLeft, akBottom]
    238       TabOrder = 2
    239     end
    240     object ButtonView: TButton
    241       Left = 163
    242       Height = 25
    243       Top = 398
    244       Width = 75
    245       Action = AItemView
    246       Anchors = [akLeft, akBottom]
    247       TabOrder = 3
    248     end
    249     object ButtonEdit: TButton
    250       Left = 243
    251       Height = 25
    252       Top = 398
    253       Width = 75
    254       Action = AItemEdit
    255       Anchors = [akLeft, akBottom]
    256       TabOrder = 4
    257203    end
    258204  end
     
    267213    left = 360
    268214    top = 120
    269     object AItemDelete: TAction
    270       Category = 'Item'
    271       Caption = 'Delete'
    272       OnExecute = AItemDeleteExecute
    273       ShortCut = 16452
    274     end
    275     object AItemAdd: TAction
    276       Category = 'Item'
    277       Caption = 'Add'
    278       OnExecute = AItemAddExecute
    279       ShortCut = 16449
    280     end
    281     object AItemEdit: TAction
    282       Category = 'Item'
    283       Caption = 'Edit'
    284       OnExecute = AItemEditExecute
    285       ShortCut = 16453
    286     end
    287     object AItemView: TAction
    288       Category = 'Item'
    289       Caption = 'View'
    290       OnExecute = AItemViewExecute
    291       ShortCut = 16470
    292     end
    293215    object AObjectGroupDelete: TAction
    294216      Category = 'ObjectGroup'
     
    356278    top = 120
    357279    object MenuItem1: TMenuItem
    358       Action = AItemView
     280      Caption = 'View'
    359281      Default = True
    360       OnClick = AItemViewExecute
     282      ShortCut = 16470
    361283    end
    362284    object MenuItem4: TMenuItem
    363       Action = AItemEdit
    364       OnClick = AItemEditExecute
     285      Caption = 'Edit'
     286      ShortCut = 16453
    365287    end
    366288    object MenuItem3: TMenuItem
    367       Action = AItemDelete
     289      Caption = 'Delete'
     290      ShortCut = 16452
    368291    end
    369292    object MenuItem2: TMenuItem
    370       Action = AItemAdd
    371       OnClick = AItemAddExecute
     293      Caption = 'Add'
     294      ShortCut = 16449
    372295    end
    373296  end
  • trunk/Forms/UMainForm.lrt

    r30 r31  
    11TMAINFORM.CAPTION=ChronIS
    22TMAINFORM.LABEL1.CAPTION=Groups:
    3 TMAINFORM.LABEL2.CAPTION=Reports:
    4 TMAINFORM.AITEMDELETE.CAPTION=Delete
    5 TMAINFORM.AITEMADD.CAPTION=Add
    6 TMAINFORM.AITEMEDIT.CAPTION=Edit
    7 TMAINFORM.AITEMVIEW.CAPTION=View
    83TMAINFORM.AOBJECTGROUPDELETE.CAPTION=Delete
    94TMAINFORM.AOBJECTGROUPADDGROUP.CAPTION=Add group
     
    2116TMAINFORM.AABOUT.CAPTION=About
    2217TMAINFORM.ADISCONNECT.CAPTION=Disconnect
     18TMAINFORM.MENUITEM1.CAPTION=View
     19TMAINFORM.MENUITEM4.CAPTION=Edit
     20TMAINFORM.MENUITEM3.CAPTION=Delete
     21TMAINFORM.MENUITEM2.CAPTION=Add
    2322TMAINFORM.MENUITEM13.CAPTION=Server
    2423TMAINFORM.MENUITEM11.CAPTION=View
  • trunk/Forms/UMainForm.pas

    r30 r31  
    2929    AObjectGroupAddGroup: TAction;
    3030    AObjectGroupDelete: TAction;
    31     AItemView: TAction;
    32     AItemEdit: TAction;
    33     AItemAdd: TAction;
    34     AItemDelete: TAction;
    3531    ActionListItem: TActionList;
    36     ButtonEdit: TButton;
    37     ButtonView: TButton;
    38     ButtonAdd: TButton;
    39     ButtonDelete: TButton;
    4032    ImageListActions: TImageList;
    4133    Label1: TLabel;
    42     Label2: TLabel;
    43     ListView1: TListView;
    4434    MainMenu1: TMainMenu;
    4535    MenuItem1: TMenuItem;
     
    6454    MenuItem8: TMenuItem;
    6555    MenuItem9: TMenuItem;
     56    PageControl1: TPageControl;
    6657    Panel1: TPanel;
    6758    Panel2: TPanel;
     
    7667    procedure AExitExecute(Sender: TObject);
    7768    procedure AImportStructureExecute(Sender: TObject);
    78     procedure AItemAddExecute(Sender: TObject);
    79     procedure AItemDeleteExecute(Sender: TObject);
    80     procedure AItemEditExecute(Sender: TObject);
    81     procedure AItemViewExecute(Sender: TObject);
    8269    procedure AObjectEditExecute(Sender: TObject);
    8370    procedure AObjectGroupAddGroupExecute(Sender: TObject);
     
    8572    procedure ASettingsExecute(Sender: TObject);
    8673    procedure AToggleFullscreenExecute(Sender: TObject);
    87     procedure ButtonAddClick(Sender: TObject);
    8874    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    8975    procedure FormCreate(Sender: TObject);
    9076    procedure FormDestroy(Sender: TObject);
    9177    procedure FormShow(Sender: TObject);
    92     procedure ListView1Data(Sender: TObject; Item: TListItem);
    93     procedure ListView1DblClick(Sender: TObject);
    94     procedure ListView1KeyPress(Sender: TObject; var Key: char);
    95     procedure ListView1Resize(Sender: TObject);
    96     procedure ListView1SelectItem(Sender: TObject; Item: TListItem;
    97       Selected: Boolean);
    9878    procedure MenuItem17Click(Sender: TObject);
    9979    procedure MenuItem19Click(Sender: TObject);
    10080    procedure TreeView1Change(Sender: TObject; Node: TTreeNode);
     81    procedure TreeView1DblClick(Sender: TObject);
    10182  private
    10283    OriginalBounds: TRect;
     
    10687    procedure SaveToRegistry;
    10788  public
    108     SelectedObjectId: Integer;
    109     SelectedObject: TChronisObject;
    110     SelectedItem: Integer;
    11189    PersistentForm: TPersistentForm;
    11290    TreeState: TTreeState;
    11391    Report: TReport;
     92    TabForms: TListObject; // TListObject<TForm>
    11493    procedure UpdateInterface;
    11594    procedure LoadTree;
    116     procedure LoadItemList;
    117   end; 
     95    procedure AddTabForm(Form: TForm);
     96  end;
    11897
    11998var
     
    132111uses
    133112  UItemView, UItemEdit, UItemAdd, ULoginForm, USettingForm, UApplicationInfo,
    134   UCore, UImportStructureForm, UAboutForm, ULoginProfileForm, UChronisClientDirect;
     113  UCore, UImportStructureForm, UAboutForm, ULoginProfileForm, UChronisClientDirect,
     114  UItemList;
    135115
    136116{$R *.lfm}
     
    175155procedure TMainForm.FormCreate(Sender: TObject);
    176156begin
     157  TabForms := TListObject.Create;
     158  TabForms.OwnsObjects := False;
    177159  TreeState := TTreeState.Create;
    178160  Report := TReport.Create;
    179161  Report.Base := Core.System;
    180   SelectedObject := TChronisObject.Create;
    181   SelectedObject.Base := Core.System;
    182162  PersistentForm := TPersistentForm.Create;
    183163  PersistentForm.RegistryKey := Core.RegistryKey;
     
    189169  TreeState.Free;
    190170  PersistentForm.Free;
     171  TabForms.Free;
    191172end;
    192173
    193174procedure TMainForm.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    194175begin
     176  ADisconnect.Execute;
    195177  PersistentForm.Save(Self);
    196178  SaveToRegistry;
    197179end;
    198180
    199 procedure TMainForm.ButtonAddClick(Sender: TObject);
    200 begin
    201 
    202 end;
    203 
    204 procedure TMainForm.AItemViewExecute(Sender: TObject);
    205 begin
    206   if Assigned(ListView1.Selected) then
    207     ItemViewForm.Show;
    208 end;
    209 
    210181procedure TMainForm.AObjectEditExecute(Sender: TObject);
    211182begin
    212   if Assigned(TreeView1.Selected) then begin
     183(*  if Assigned(TreeView1.Selected) then begin
    213184    SelectedObjectId := 9;
    214185    SelectedItem := Integer(TreeView1.Selected.Data);
    215186    ItemEditForm.Show;
    216   end;
     187  end;*)
    217188end;
    218189
     
    224195procedure TMainForm.AObjectGroupEditExecute(Sender: TObject);
    225196begin
    226   if Assigned(TreeView1.Selected) then begin
     197(*  if Assigned(TreeView1.Selected) then begin
    227198    SelectedObjectId := 8;
    228199    SelectedItem := Integer(TreeView1.Selected.Data);
    229200    ItemEditForm.Show;
    230   end;
     201  end;*)
    231202end;
    232203
     
    263234end;
    264235
    265 procedure TMainForm.AItemEditExecute(Sender: TObject);
    266 begin
    267   ItemEditForm.Show;
    268 end;
    269 
    270236procedure TMainForm.AExitExecute(Sender: TObject);
    271237begin
     
    276242begin
    277243  ImportStructureForm.ShowModal;
    278 end;
    279 
    280 procedure TMainForm.AItemAddExecute(Sender: TObject);
    281 begin
    282   ItemAddForm.ShowModal;
    283 end;
    284 
    285 procedure TMainForm.AItemDeleteExecute(Sender: TObject);
    286 begin
    287   if MessageDlg(SItemDeletion, SReallyWantToDelete, mtConfirmation, [mbYes, mbNo], 0) = mrYes then begin
    288 
    289   end;
    290244end;
    291245
     
    315269procedure TMainForm.ADisconnectExecute(Sender: TObject);
    316270begin
    317   Core.System.Database.Disconnect;
    318   TreeView1.Items.Clear;
    319   ListView1.Items.Clear;
    320   Core.System.Types.Clear;
    321   FreeAndNil(Core.Client);
     271  if Core.System.Database.Connected then begin
     272    Core.System.Database.Disconnect;
     273    TreeView1.Items.Clear;
     274    Core.System.Types.Clear;
     275    FreeAndNil(Core.Client);
     276  end;
    322277end;
    323278
    324279procedure TMainForm.AAboutExecute(Sender: TObject);
    325280begin
    326   AboutForm.ShowModal;
     281  try
     282    AboutForm := TAboutForm.Create(nil);
     283    AboutForm.ShowModal;
     284  finally
     285    FreeAndNil(AboutForm);
     286  end;
    327287end;
    328288
     
    332292  LoadFromRegistry;
    333293  AConnect.Execute;
    334 end;
    335 
    336 procedure TMainForm.ListView1Data(Sender: TObject; Item: TListItem);
    337 var
    338   I: Integer;
    339 begin
    340   if Item.Index < Report.Count then
    341   with TReportLine(Report[Item.Index]) do begin
    342     Item.Caption := Items[0];
    343     for I := 1 to Report.Columns.Count - 1 do
    344     if not TReportColumn(Report.Columns[I]).VirtualItem then begin
    345       Item.SubItems.Add(Items[I]);
    346     end;
    347   end;
    348 end;
    349 
    350 procedure TMainForm.ListView1DblClick(Sender: TObject);
    351 begin
    352   AItemViewExecute(Self);
    353 end;
    354 
    355 procedure TMainForm.ListView1KeyPress(Sender: TObject; var Key: char);
    356 begin
    357   if Key = #13 then AItemViewExecute(Self);
    358 end;
    359 
    360 procedure TMainForm.ListView1Resize(Sender: TObject);
    361 var
    362   I: Integer;
    363 begin
    364   for I := 0 to ListView1.Columns.Count - 1 do
    365     ListView1.Columns[I].Width := ListView1.Width div ListView1.Columns.Count;
    366 end;
    367 
    368 procedure TMainForm.ListView1SelectItem(Sender: TObject; Item: TListItem;
    369   Selected: Boolean);
    370 begin
    371   if Assigned(ListView1.Selected) then
    372     SelectedItem := TReportLine(Report[ListView1.Selected.Index]).Id
    373     else SelectedItem := 0;
    374 
    375   ButtonDelete.Enabled := Assigned(ListView1.Selected);
    376   ButtonView.Enabled := Assigned(ListView1.Selected);
    377   ButtonEdit.Enabled := Assigned(ListView1.Selected);
    378294end;
    379295
     
    395311    if TreeView1.Selected.ImageIndex = 0 then begin
    396312      TreeView1.PopupMenu := PopupMenuObjectGroup;
    397       ListView1.Visible := False;
     313      PageControl1.Visible := False;
    398314    end;
    399315    if TreeView1.Selected.ImageIndex = 1 then begin
    400316      TreeView1.PopupMenu := PopupMenuObject;
    401       LoadItemList;
    402     end;
     317      //LoadItemList;
     318    end;
     319  end;
     320end;
     321
     322procedure TMainForm.TreeView1DblClick(Sender: TObject);
     323var
     324  NewItemListForm: TItemListForm;
     325begin
     326  if Assigned(TreeView1.Selected) then begin
     327    NewItemListForm := TItemListForm.Create(Self);
     328    NewItemListForm.SelectedObject.Id := Integer(TreeView1.Selected.Data);
     329    AddTabForm(NewItemListForm);
    403330  end;
    404331end;
     
    448375end;
    449376
    450 procedure TMainForm.LoadItemList;
     377procedure TMainForm.AddTabForm(Form: TForm);
    451378var
    452   NewColumn: TListColumn;
    453   I: Integer;
    454 begin
    455   SelectedObjectId := 0;
    456   if Assigned(TreeView1.Selected) then
    457   with ListView1 do begin
    458     Visible := True;
    459     SelectedObject.Load(Integer(TreeView1.Selected.Data));
    460     Report.Load(SelectedObject);
    461 
    462     Report.FillListColumns(Columns);
    463     Items.Count := Report.Count;
    464     Refresh;
    465   end;
    466   ListView1Resize(Self);
    467   ListView1SelectItem(Self, nil, False);
     379  NewTabSheet: TTabSheet;
     380begin
     381  TabForms.Add(Form);
     382  NewTabSheet := PageControl1.AddTabSheet;
     383  NewTabSheet.DockSite := True;
     384  NewTabSheet.UseDockManager := True;
     385  NewTabSheet.Caption := Form.Caption;
     386  Form.DragKind := dkDock;
     387  Form.DragMode := dmAutomatic;
     388  Form.Show;
     389  Form.ManualDock(NewTabSheet);
     390  PageControl1.TabIndex := PageControl1.PageCount - 1;
    468391end;
    469392
Note: See TracChangeset for help on using the changeset viewer.