Ignore:
Timestamp:
May 6, 2015, 11:19:49 AM (10 years ago)
Author:
chronos
Message:
  • Added: Now opened projects are remembered between application restarts.
  • Added: Show basic list of files in selected project.
  • Added: Packages Common and TemplateGenerics.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.pas

    r5 r6  
    2323    MenuItem15: TMenuItem;
    2424    MenuItem16: TMenuItem;
     25    MenuItemOpenRecent: TMenuItem;
    2526    MenuItem2: TMenuItem;
    2627    MenuItem3: TMenuItem;
     
    3536    StatusBar1: TStatusBar;
    3637    ToolBarMain: TToolBar;
     38    procedure FormActivate(Sender: TObject);
     39    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     40    procedure FormShow(Sender: TObject);
    3741  private
    38     { private declarations }
     42    Initialized: Boolean;
    3943  public
     44    procedure OpenRecentExecute(Sender: TObject);
    4045    procedure UpdateInterface;
     46    procedure DockInit;
    4147  end;
    4248
     
    4955
    5056uses
    51   UCore;
     57  UCore, UFormBrowse;
    5258
    5359{ TFormMain }
     60
     61procedure TFormMain.FormShow(Sender: TObject);
     62begin
     63  DockInit;
     64end;
     65
     66procedure TFormMain.OpenRecentExecute(Sender: TObject);
     67begin
     68  Core.ProjectOpen(Core.LastOpenedList1.Items[TMenuItem(Sender).MenuIndex]);
     69end;
     70
     71procedure TFormMain.FormActivate(Sender: TObject);
     72begin
     73  if not Initialized then begin
     74    Initialized := True;
     75    Core.Init;
     76  end;
     77end;
     78
     79procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);
     80begin
     81  Core.Done;
     82end;
    5483
    5584procedure TFormMain.UpdateInterface;
     
    5988  if Assigned(Core.Project) then
    6089    Caption := Core.Project.Directory + ' - ' + AppName
    61     else Caption := AppName
     90    else Caption := AppName;
     91end;
     92
     93procedure TFormMain.DockInit;
     94begin
     95  FormBrowse.ManualDock(Self, nil, alClient);
     96  FormBrowse.Align := alClient;
     97  FormBrowse.Show;
    6298end;
    6399
Note: See TracChangeset for help on using the changeset viewer.