Changeset 8


Ignore:
Timestamp:
Aug 3, 2012, 12:14:25 PM (12 years ago)
Author:
chronos
Message:
Location:
trunk
Files:
3 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Studio/LibreDevelopStudio.lpi

    r7 r8  
    3333      </local>
    3434    </RunParams>
    35     <RequiredPackages Count="4">
     35    <RequiredPackages Count="5">
    3636      <Item1>
    37         <PackageName Value="LDModuleBrainfuck"/>
     37        <PackageName Value="LDModulePascal"/>
    3838      </Item1>
    3939      <Item2>
    40         <PackageName Value="LDModuleDebug"/>
     40        <PackageName Value="LDModuleBrainfuck"/>
    4141      </Item2>
    4242      <Item3>
    43         <PackageName Value="LibreDevelopStudio"/>
     43        <PackageName Value="LDModuleDebug"/>
    4444      </Item3>
    4545      <Item4>
     46        <PackageName Value="LibreDevelopStudio"/>
     47      </Item4>
     48      <Item5>
    4649        <PackageName Value="LCL"/>
    47       </Item4>
     50      </Item5>
    4851    </RequiredPackages>
    4952    <Units Count="2">
     
    7982    </Parsing>
    8083    <Linking>
     84      <Debugging>
     85        <UseHeaptrc Value="True"/>
     86      </Debugging>
    8187      <Options>
    8288        <Win32>
  • trunk/Studio/LibreDevelopStudio.lpr

    r5 r8  
    1616  Application.Initialize;
    1717  Application.CreateForm(TCore, Core);
    18   Application.CreateForm(TDataModule1, DataModule1);
    1918  Core.Init;
    2019  Application.Run;
  • trunk/Studio/UCore.pas

    r7 r8  
    3131
    3232uses
    33   ULDModuleDebug, UFormMain, ULDModuleBrainfuck, UDataModule;
     33  ULDModuleDebug, UFormMain, ULDModuleBrainfuck, UDataModule, ULDModulePascal;
    3434
    3535{ TCore }
     
    3737procedure TCore.DataModuleCreate(Sender: TObject);
    3838begin
     39  DataModule1 := TDataModule1.Create(nil);
    3940  API := TLDStudioAPI.Create;
    4041  ModuleManager := TModuleManager.Create(nil);
     
    4647  FreeAndNil(ModuleManager);
    4748  FreeAndNil(API);
     49  FreeAndNil(DataModule1);
    4850end;
    4951
     
    5254  ModuleManager.RegisterModule(TLDModuleDebug.Create, True);
    5355  ModuleManager.RegisterModule(TLDModuleBrainfuck.Create, True);
     56  ModuleManager.RegisterModule(TLDModulePascal.Create, True);
    5457  ModuleManager.InstallMarked;
    5558end;
  • trunk/StudioCommon/USource.pas

    r7 r8  
    5959  end;
    6060
     61
    6162implementation
    6263
  • trunk/StudioModules/LDModulePascal

    • Property svn:ignore set to
      lib
  • trunk/StudioPackage/Forms/UFormMain.lfm

    r7 r8  
    88  ClientWidth = 747
    99  Menu = MainMenu
     10  OnCreate = FormCreate
    1011  OnShow = FormShow
    1112  LCLVersion = '1.1'
     
    4647    end
    4748  end
    48   object PageControl1: TPageControl
     49  object PageControlRight: TPageControl
    4950    Left = 547
    5051    Height = 350
     
    6061    end
    6162  end
    62   object PageControl2: TPageControl
     63  object PageControlLeft: TPageControl
    6364    Left = 0
    6465    Height = 350
     
    7475    end
    7576  end
    76   object PageControl3: TPageControl
     77  object PageControlBottom: TPageControl
    7778    Left = 0
    7879    Height = 105
     
    101102    ResizeAnchor = akRight
    102103  end
    103   object PageControl4: TPageControl
     104  object PageControlCenter: TPageControl
    104105    Left = 205
    105106    Height = 350
     
    14311432  end
    14321433  object OpenDialogFile: TOpenDialog
    1433     Filter = 'kkk|.kk|jj|.jj'
    14341434    left = 82
    14351435    top = 210
  • trunk/StudioPackage/Forms/UFormMain.pas

    r7 r8  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
    9   ActnList, ComCtrls, ExtCtrls;
     9  ActnList, ComCtrls, ExtCtrls, UDataModule;
    1010
    1111type
     
    7575    MenuItem9: TMenuItem;
    7676    OpenDialogFile: TOpenDialog;
    77     PageControl1: TPageControl;
    78     PageControl2: TPageControl;
    79     PageControl3: TPageControl;
    80     PageControl4: TPageControl;
     77    PageControlRight: TPageControl;
     78    PageControlLeft: TPageControl;
     79    PageControlBottom: TPageControl;
     80    PageControlCenter: TPageControl;
    8181    SaveDialogFile: TSaveDialog;
    8282    Splitter1: TSplitter;
     
    9696    procedure AViewProjectManagerExecute(Sender: TObject);
    9797    procedure AViewSettingsExecute(Sender: TObject);
     98    procedure FormCreate(Sender: TObject);
    9899    procedure FormShow(Sender: TObject);
    99100  private
    100101    procedure DockInit;
    101102  public
    102     { public declarations }
     103    procedure OpenFileExecute(OpenedFile: TOpenedFile);
    103104  end;
    104105
     
    111112
    112113uses
    113   UFormProject, UFormSourceCode, UFormSettings, UDataModule;
     114  UFormProject, UFormSourceCode, UFormSettings;
    114115
    115116{ TFormMain }
     
    123124begin
    124125  OpenDialogFile.Filter := DataModule1.FileTypes.GetDialogFilter;
    125   if OpenDialogFile.Execute then ;
     126  if OpenDialogFile.Execute then begin
     127    DataModule1.OpenedFiles.OpenFile(OpenDialogFile.FileName);
     128  end;
    126129end;
    127130
     
    134137begin
    135138  FormSettings.ShowModal;
     139end;
     140
     141procedure TFormMain.FormCreate(Sender: TObject);
     142begin
    136143end;
    137144
     
    151158end;
    152159
     160procedure TFormMain.OpenFileExecute(OpenedFile: TOpenedFile);
     161var
     162  NewTabSheet: TTabSheet;
     163begin
     164  NewTabSheet := PageControlCenter.AddTabSheet;
     165  OpenedFile.Form.ManualDock(NewTabSheet, nil, alClient);
     166  OpenedFile.Form.Align := alClient;
     167  OpenedFile.Form.Show;
     168end;
     169
    153170end.
    154171
  • trunk/StudioPackage/UDataModule.pas

    r7 r8  
    99
    1010type
     11
     12  { TOpenedFile }
     13
     14  TOpenedFile = class
     15  private
     16    FFileName: string;
     17    procedure SetFileName(AValue: string);
     18  public
     19    Modified: Boolean;
     20    Form: TForm;
     21    property FileName: string read FFileName write SetFileName;
     22  end;
     23
     24  TOpenFileEvent = procedure (OpenedFile: TOpenedFile) of object;
     25
     26  { TOpenedFiles }
     27
     28  TOpenedFiles = class(TListObject)
     29  private
     30    FOnOpenFile: TOpenFileEvent;
     31  public
     32    procedure OpenFile(FileName: string);
     33    procedure NewFile;
     34    property OnOpenFile: TOpenFileEvent read FOnOpenFile write FOnOpenFile;
     35  end;
     36
    1137  { TDataModule1 }
    1238
     
    1945    Project: TProject;
    2046    FileTypes: TFileTypes;
     47    OpenedFiles: TOpenedFiles;
    2148  end;
    2249
     
    3259  UFormSourceCode, UFormMain, UFormProject, UFormSettings;
    3360
     61procedure TOpenedFile.SetFileName(AValue: string);
     62begin
     63  if FFileName = AValue then Exit;
     64  FFileName := AValue;
     65  if Assigned(Form) then
     66    Form.Caption := ExtractFileName(FFileName);
     67end;
     68
     69{ TOpenedFiles }
     70
     71procedure TOpenedFiles.OpenFile(FileName: string);
     72var
     73  NewFile: TOpenedFile;
     74begin
     75  NewFile := TOpenedFile(AddNew(TOpenedFile.Create));
     76  NewFile.FileName := FileName;
     77  NewFile.Form := TFormSourceCode.Create(nil);
     78  NewFile.Form.Caption := ExtractFileName(NewFile.FileName);
     79  NewFile.Form.Visible := True;
     80  if Assigned(FOnOpenFile) then
     81    FOnOpenFile(NewFile);
     82end;
     83
     84procedure TOpenedFiles.NewFile;
     85begin
     86
     87end;
     88
    3489{ TDataModule1 }
    3590
    3691procedure TDataModule1.DataModuleCreate(Sender: TObject);
    3792begin
     93  FileTypes := TFileTypes.Create;
     94  FileTypes.OwnsObjects := False;
     95  OpenedFiles := TOpenedFiles.Create;
     96
    3897  Application.CreateForm(TFormMain, FormMain);
     98  OpenedFiles.OnOpenFile := FormMain.OpenFileExecute;
    3999  Application.CreateForm(TFormProject, FormProject);
    40100  Application.CreateForm(TFormSourceCode, FormSourceCode);
    41101  Application.CreateForm(TFormSettings, FormSettings);
    42   FileTypes := TFileTypes.Create;
    43102end;
    44103
    45104procedure TDataModule1.DataModuleDestroy(Sender: TObject);
    46105begin
     106  FreeAndNil(OpenedFiles);
    47107  FreeAndNil(FileTypes);
    48108end;
Note: See TracChangeset for help on using the changeset viewer.