Ignore:
Timestamp:
Mar 8, 2012, 7:51:16 AM (13 years ago)
Author:
chronos
Message:
  • Removed: Main tabbed view of opened lists.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        55chronis.exe
        66DebugLog.txt
         7chronis.lps
  • trunk/Forms/UMainForm.pas

    r35 r36  
    99  StdCtrls, ActnList, Menus, ExtCtrls, USqlDatabase, DOM, XMLRead, XMLWrite,
    1010  UPersistentForm, UTreeState, SpecializedList, SpecializedDictionary,
    11   URegistry, USystem;
     11  URegistry, USystem, UItemList;
    1212
    1313type
     
    5454    MenuItem8: TMenuItem;
    5555    MenuItem9: TMenuItem;
    56     PageControl1: TPageControl;
    57     Panel1: TPanel;
    58     Panel2: TPanel;
     56    PanelMenu: TPanel;
     57    PanelData: TPanel;
    5958    PopupMenuObjectGroup: TPopupMenu;
    6059    PopupMenuObject: TPopupMenu;
    6160    PopupMenuItem: TPopupMenu;
    6261    Splitter1: TSplitter;
     62    StatusBar1: TStatusBar;
    6363    TreeView1: TTreeView;
    6464    procedure AAboutExecute(Sender: TObject);
     
    8787    procedure SaveToRegistry;
    8888  public
     89    MainPanelForm: TForm;
    8990    PersistentForm: TPersistentForm;
    9091    TreeState: TTreeState;
    9192    Report: TReport;
    92     TabForms: TListObject; // TListObject<TForm>
    9393    procedure UpdateInterface;
    9494    procedure LoadTree;
    95     procedure AddTabForm(Form: TForm);
     95    procedure SetMainPanelForm(Form: TForm);
    9696  end;
    9797
     
    112112  UItemView, UItemEdit, UItemAdd, ULoginForm, USettingForm, UApplicationInfo,
    113113  UCore, UImportStructureForm, UAboutForm, ULoginProfileForm, UChronisClientDirect,
    114   UItemList, UChronisClient;
     114  UChronisClient;
    115115
    116116{$R *.lfm}
     
    124124    RootKey := Core.RegistryRootKey;
    125125    OpenKey(Core.RegistryKey, True);
    126     Panel1.Width := ReadIntegerWithDefault('GroupTreeWidth', 200);
     126    PanelMenu.Width := ReadIntegerWithDefault('GroupTreeWidth', 200);
    127127    with Core.CoolTranslator1 do
    128128      Language := Languages.SearchByCode(ReadStringWithDefault('LanguageCode', ''));
     
    138138    RootKey := Core.RegistryRootKey;
    139139    OpenKey(Core.RegistryKey, True);
    140     WriteInteger('GroupTreeWidth', Panel1.Width);
     140    WriteInteger('GroupTreeWidth', PanelMenu.Width);
    141141    with Core.CoolTranslator1 do
    142142      WriteString('LanguageCode', Language.Code);
     
    151151  AConnect.Enabled := not Core.System.Database.Connected;
    152152  AImportStructure.Enabled := Core.System.Database.Connected;
     153  if Assigned(MainPanelForm) then
     154    Caption := MainPanelForm.Caption + ' - ' + ApplicationInfo.Name
     155    else Caption :=  ApplicationInfo.Name;
     156  if Assigned(Core.System.Client) then
     157  with Core.System.Client do
     158    StatusBar1.Panels[0].Text := User + '@' + Host + ':' + IntToStr(Port) + '/' + Schema;
    153159end;
    154160
    155161procedure TMainForm.FormCreate(Sender: TObject);
    156162begin
    157   TabForms := TListObject.Create;
    158   TabForms.OwnsObjects := False;
    159163  TreeState := TTreeState.Create;
    160164  Report := TReport.Create;
     
    169173  TreeState.Free;
    170174  PersistentForm.Free;
    171   TabForms.Free;
    172175end;
    173176
     
    204207procedure TMainForm.ASettingsExecute(Sender: TObject);
    205208begin
    206   SettingForm.ShowModal;
     209  try
     210    SettingForm := TSettingForm.Create(nil);
     211    SettingForm.ShowModal;
     212  finally
     213    SettingForm.Free;
     214  end;
    207215end;
    208216
     
    311319    if TreeView1.Selected.ImageIndex = 0 then begin
    312320      TreeView1.PopupMenu := PopupMenuObjectGroup;
    313       PageControl1.Visible := False;
     321      PanelData.Visible := False;
    314322    end;
    315323    if TreeView1.Selected.ImageIndex = 1 then begin
     
    327335    NewItemListForm := TItemListForm.Create(Self);
    328336    NewItemListForm.SelectedObject.Load(Integer(TreeView1.Selected.Data));
    329     NewItemListForm.Caption := NewItemListForm.Caption + ' ' + NewItemListForm.SelectedObject.Name;
    330     AddTabForm(NewItemListForm);
     337    NewItemListForm.Caption := NewItemListForm.SelectedObject.Name;
     338    SetMainPanelForm(NewItemListForm);
    331339  end;
    332340end;
     
    387395end;
    388396
    389 procedure TMainForm.AddTabForm(Form: TForm);
    390 var
    391   NewTabSheet: TTabSheet;
    392 begin
    393   TabForms.Add(Form);
    394   NewTabSheet := PageControl1.AddTabSheet;
    395   NewTabSheet.DockSite := True;
    396   NewTabSheet.UseDockManager := True;
    397   NewTabSheet.Caption := Form.Caption;
    398   PageControl1.TabIndex := PageControl1.PageCount - 1;
    399   Form.DragKind := dkDock;
    400   Form.DragMode := dmAutomatic;
    401   Form.ManualDock(NewTabSheet);
    402   Form.Show;
    403 
    404   // Workaround for not showing content of first tab after docking
    405   NewTabSheet.Visible := False;
    406   NewTabSheet.Visible := True;
     397procedure TMainForm.SetMainPanelForm(Form: TForm);
     398begin
     399  MainPanelForm.Free;
     400  MainPanelForm := Form;
     401  MainPanelForm.ManualDock(PanelData, nil, alClient);
     402  MainPanelForm.Align := alClient;
     403  MainPanelForm.Show;
     404  UpdateInterface;
    407405end;
    408406
Note: See TracChangeset for help on using the changeset viewer.