Changeset 32 for trunk/Forms


Ignore:
Timestamp:
Nov 24, 2011, 10:31:04 AM (13 years ago)
Author:
chronos
Message:
  • Modified: Better form addition to tab list. Better tab titles.
Location:
trunk/Forms
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UItemList.pas

    r31 r32  
    6767  with ListView1 do begin
    6868    Visible := True;
    69     SelectedObject.Load(SelectedObject.Id);
     69    //SelectedObject.Load(SelectedObject.Id);
    7070    Report.Load(SelectedObject);
    7171
     
    8686    NewItemViewForm.SelectedObject.Assign(SelectedObject);
    8787    NewItemViewForm.SelectedItemId := Integer(ListView1.Selected.Data);
     88    NewItemViewForm.Caption := NewItemViewForm.Caption + ' ' + SelectedObject.Name;
    8889    MainForm.AddTabForm(NewItemViewForm);
    8990  end;
     
    118119    NewItemEditForm.SelectedObject.Assign(SelectedObject);
    119120    NewItemEditForm.SelectedItemId := Integer(ListView1.Selected.Data);
     121    NewItemEditForm.Caption := NewItemEditForm.Caption + ' ' + SelectedObject.Name;
    120122    MainForm.AddTabForm(NewItemEditForm);
    121123  end;
     
    129131  NewItemAddForm.SelectedObject.Assign(SelectedObject);
    130132  NewItemAddForm.SelectedItemId := Integer(ListView1.Selected.Data);
     133  NewItemAddForm.Caption := NewItemAddForm.Caption + ' ' + SelectedObject.Name;
    131134  MainForm.AddTabForm(NewItemAddForm);
    132135end;
  • trunk/Forms/UItemView.pas

    r31 r32  
    110110  NewItemEditForm.SelectedObject.Assign(SelectedObject);
    111111  NewItemEditForm.SelectedItemId := SelectedItemId;
     112  NewItemEditForm.Caption := NewItemEditForm.Caption + ' ' + SelectedObject.Name;
    112113  MainForm.AddTabForm(NewItemEditForm);
    113114end;
  • trunk/Forms/UMainForm.pas

    r31 r32  
    326326  if Assigned(TreeView1.Selected) then begin
    327327    NewItemListForm := TItemListForm.Create(Self);
    328     NewItemListForm.SelectedObject.Id := Integer(TreeView1.Selected.Data);
     328    NewItemListForm.SelectedObject.Load(Integer(TreeView1.Selected.Data));
     329    NewItemListForm.Caption := NewItemListForm.Caption + ' ' + NewItemListForm.SelectedObject.Name;
    329330    AddTabForm(NewItemListForm);
    330331  end;
     
    384385  NewTabSheet.UseDockManager := True;
    385386  NewTabSheet.Caption := Form.Caption;
     387  PageControl1.TabIndex := PageControl1.PageCount - 1;
    386388  Form.DragKind := dkDock;
    387389  Form.DragMode := dmAutomatic;
     390  Form.ManualDock(NewTabSheet);
    388391  Form.Show;
    389   Form.ManualDock(NewTabSheet);
    390   PageControl1.TabIndex := PageControl1.PageCount - 1;
     392
     393  // Workaround for not showing content of first tab after docking
     394  NewTabSheet.Visible := False;
     395  NewTabSheet.Visible := True;
    391396end;
    392397
Note: See TracChangeset for help on using the changeset viewer.