Changeset 36 for trunk/Forms


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:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

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

    r32 r36  
    8787    NewItemViewForm.SelectedItemId := Integer(ListView1.Selected.Data);
    8888    NewItemViewForm.Caption := NewItemViewForm.Caption + ' ' + SelectedObject.Name;
    89     MainForm.AddTabForm(NewItemViewForm);
     89    MainForm.SetMainPanelForm(NewItemViewForm);
    9090  end;
    9191end;
     
    120120    NewItemEditForm.SelectedItemId := Integer(ListView1.Selected.Data);
    121121    NewItemEditForm.Caption := NewItemEditForm.Caption + ' ' + SelectedObject.Name;
    122     MainForm.AddTabForm(NewItemEditForm);
     122    MainForm.SetMainPanelForm(NewItemEditForm);
    123123  end;
    124124end;
     
    132132  NewItemAddForm.SelectedItemId := Integer(ListView1.Selected.Data);
    133133  NewItemAddForm.Caption := NewItemAddForm.Caption + ' ' + SelectedObject.Name;
    134   MainForm.AddTabForm(NewItemAddForm);
     134  MainForm.SetMainPanelForm(NewItemAddForm);
    135135end;
    136136
  • trunk/Forms/UItemView.pas

    r32 r36  
    111111  NewItemEditForm.SelectedItemId := SelectedItemId;
    112112  NewItemEditForm.Caption := NewItemEditForm.Caption + ' ' + SelectedObject.Name;
    113   MainForm.AddTabForm(NewItemEditForm);
     113  MainForm.SetMainPanelForm(NewItemEditForm);
    114114end;
    115115
  • trunk/Forms/UMainForm.lfm

    r31 r36  
    44  Top = 126
    55  Width = 640
    6   ActiveControl = Panel1
     6  ActiveControl = PanelMenu
    77  Caption = 'ChronIS'
    88  ClientHeight = 427
     
    151151  OnShow = FormShow
    152152  LCLVersion = '0.9.31'
    153   object Panel1: TPanel
     153  object PanelMenu: TPanel
    154154    Left = 0
    155     Height = 427
     155    Height = 407
    156156    Top = 0
    157157    Width = 184
    158158    Align = alLeft
    159159    BevelOuter = bvNone
    160     ClientHeight = 427
     160    ClientHeight = 407
    161161    ClientWidth = 184
    162162    TabOrder = 0
     
    171171    object TreeView1: TTreeView
    172172      Left = 4
    173       Height = 403
     173      Height = 383
    174174      Top = 19
    175175      Width = 180
     
    184184    end
    185185  end
    186   object Panel2: TPanel
     186  object PanelData: TPanel
    187187    Left = 189
    188     Height = 427
     188    Height = 407
    189189    Top = 0
    190190    Width = 451
    191191    Align = alClient
    192192    BevelOuter = bvNone
    193     ClientHeight = 427
    194     ClientWidth = 451
    195193    TabOrder = 1
    196     object PageControl1: TPageControl
    197       Left = 0
    198       Height = 427
    199       Top = 0
    200       Width = 451
    201       Align = alClient
    202       TabOrder = 0
    203     end
    204194  end
    205195  object Splitter1: TSplitter
    206196    Left = 184
    207     Height = 427
     197    Height = 407
    208198    Top = 0
    209199    Width = 5
     200  end
     201  object StatusBar1: TStatusBar
     202    Left = 0
     203    Height = 20
     204    Top = 407
     205    Width = 640
     206    Panels = <   
     207      item
     208        Width = 150
     209      end   
     210      item
     211        Width = 150
     212      end   
     213      item
     214        Width = 150
     215      end>
     216    SimplePanel = False
    210217  end
    211218  object ActionListItem: TActionList
  • 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.