Ignore:
Timestamp:
Aug 3, 2012, 4:03:59 PM (12 years ago)
Author:
chronos
Message:
  • Modified: Implementing base tabbed opened file list.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/StudioPackage/Forms/UFormMain.pas

    r11 r13  
    105105    procedure AExitExecute(Sender: TObject);
    106106    procedure AFileCloseExecute(Sender: TObject);
     107    procedure AFileNewExecute(Sender: TObject);
    107108    procedure AFileOpenExecute(Sender: TObject);
    108109    procedure AViewModulesExecute(Sender: TObject);
     
    115116    procedure DockInit;
    116117  public
    117     procedure OpenFileExecute(OpenedFile: TOpenedFile);
     118    procedure OpenedFileChange(Sender: TObject);
    118119  end;
    119120
     
    137138procedure TFormMain.AFileCloseExecute(Sender: TObject);
    138139begin
    139 //  DataModule1.OpenedFiles.Close(DataModule1.OpenedFiles.Selected);
     140  DataModule1.OpenedFiles.CloseFile(DataModule1.OpenedFiles.Selected.FileName);
     141end;
     142
     143procedure TFormMain.AFileNewExecute(Sender: TObject);
     144begin
     145  DataModule1.OpenedFiles.NewFile;
    140146end;
    141147
     
    185191}end;
    186192
    187 procedure TFormMain.OpenFileExecute(OpenedFile: TOpenedFile);
     193procedure TFormMain.OpenedFileChange(Sender: TObject);
    188194var
    189195  NewTabSheet: TTabSheet;
    190 begin
    191   NewTabSheet := PageControlCenter.AddTabSheet;
    192   OpenedFile.Form.ManualDock(NewTabSheet, nil, alClient);
    193   OpenedFile.Form.Align := alClient;
    194   OpenedFile.Form.Show;
     196  I: Integer;
     197begin
     198  with DataModule1.OpenedFiles do begin
     199    for I := 0 to Count - 1 do
     200    with TOpenedFile(Items[I]) do begin
     201      if not Assigned(Form.Parent) then begin
     202        NewTabSheet := PageControlCenter.AddTabSheet;
     203        NewTabSheet.Caption := ExtractFileName(FileName);
     204        //NewTabSheet.PopupMenu := ;
     205        Form.ManualDock(NewTabSheet, nil, alClient);
     206        Form.Align := alClient;
     207        Form.Show;
     208      end;
     209    end;
     210  end;
    195211end;
    196212
Note: See TracChangeset for help on using the changeset viewer.