Changeset 31 for trunk/Forms


Ignore:
Timestamp:
Feb 18, 2012, 8:02:50 PM (13 years ago)
Author:
chronos
Message:
  • Modified: Renamed classes from Compiler to Target. Interpretter registred as possible and default target.
Location:
trunk/Forms
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UCompilersForm.pas

    r25 r31  
    3131
    3232uses
    33   UMainForm, UCompiler;
     33  UMainForm, UTarget;
    3434
    3535resourcestring
     
    4646procedure TFormCompilers.ListView1Data(Sender: TObject; Item: TListItem);
    4747begin
    48   if (Item.Index >= 0) and (Item.Index < MainForm.Compilers.Count) then
    49   with TBrainFuckCompiler(MainForm.Compilers[Item.Index]) do begin
     48  if (Item.Index >= 0) and (Item.Index < MainForm.Targets.Count) then
     49  with TTarget(MainForm.Targets[Item.Index]) do begin
    5050    Item.Caption := Name;
    51     Item.Data := MainForm.Compilers[Item.Index];
     51    Item.Data := MainForm.Targets[Item.Index];
    5252    Item.SubItems.Add(CompilerPath);
    5353  end;
     
    5656procedure TFormCompilers.ListView1DblClick(Sender: TObject);
    5757begin
    58   with TBrainFuckCompiler(ListView1.Selected.Data) do
     58  with TTarget(ListView1.Selected.Data) do
    5959    CompilerPath := InputBox(SCompilerOptions, SCompilerPath,
    6060      CompilerPath);
     
    6464procedure TFormCompilers.ReloadList;
    6565begin
    66   ListView1.Items.Count := MainForm.Compilers.Count;
     66  ListView1.Items.Count := MainForm.Targets.Count;
    6767  ListView1.Refresh;
    6868end;
  • trunk/Forms/UMainForm.pas

    r30 r31  
    77uses
    88  Classes, SysUtils, FileUtil, SynEdit, Forms, Controls, Graphics, Dialogs,
    9   Menus, ActnList, StdCtrls, ComCtrls, UBrainFuck, UCoolTranslator, StrUtils,
    10   SpecializedList, UCompiler, Registry, URegistry, ULastOpenedList, Process;
     9  Menus, ActnList, StdCtrls, ComCtrls, UTargetInterpretter, UCoolTranslator, StrUtils,
     10  SpecializedList, UTarget, Registry, URegistry, ULastOpenedList, Process;
    1111
    1212const
     
    146146    CompilerIndex: Integer;
    147147    ProjectFileName: string;
    148     BrainFuckCompiler: TBrainFuckCompiler;
    149     BrainFuckInterpreter: TBrainFuckInterpretter;
     148    BrainFuckCompiler: TTarget;
     149    BrainFuckInterpreter: TTargetInterpretter;
    150150    BreakPoints: TListInteger;
    151     Compilers: TCompilerList;
     151    Targets: TTargetList;
    152152    LastOpenedList: TLastOpenedList;
    153153    OpenProjectOnStart: Boolean;
     
    168168uses
    169169  UInterpretterForm, UApplicationInfo, UCompiledForm, UOptionsForm,
    170   UCompilerDelphi, UCompilerPHP, UCompilerC, UCompilersForm;
     170  UTargetDelphi, UTargetPHP, UTargetC, UCompilersForm;
    171171
    172172resourcestring
     
    255255  end;
    256256  LastOpenedList.LoadFromRegistry(Root, Key);
    257   Compilers.LoadFromRegistry(Root, Key);
     257  Targets.LoadFromRegistry(Root, Key);
    258258end;
    259259
    260260procedure TMainForm.SaveToRegistry(Root: HKEY; Key: string);
    261261begin
    262   Compilers.SaveToRegistry(Root, Key);
     262  Targets.SaveToRegistry(Root, Key);
    263263  LastOpenedList.SaveToRegistry(Root, Key);
    264264  with TRegistryEx.Create do
     
    308308begin
    309309  MenuItemTarget.Clear;
    310   for I := 0 to Compilers.Count - 1 do begin
     310  for I := 0 to Targets.Count - 1 do begin
    311311    NewMenuItem := TMenuItem.Create(MenuItemTarget);
    312     NewMenuItem.Caption := TBrainFuckCompiler(Compilers[I]).Name;
     312    NewMenuItem.Caption := TTarget(Targets[I]).Name;
    313313    NewMenuItem.OnClick := MenuItemTargetClick;
    314314    if I = CompilerIndex then NewMenuItem.Checked := True;
     
    320320begin
    321321  BreakPoints := TListInteger.Create;
    322   BrainFuckInterpreter := TBrainFuckInterpretter.Create;
     322  BrainFuckInterpreter := TTargetInterpretter.Create;
    323323  BrainFuckInterpreter.OnChangeState := BrainFuckInterpreterChangeState;
    324   BrainFuckCompiler := TBrainFuckCompiler.Create;
    325   Compilers := TCompilerList.Create;
    326   Compilers.Add(TBrainFuckCompilerDelphi.Create);
    327   Compilers.Add(TBrainFuckCompilerPHP.Create);
    328   Compilers.Add(TBrainFuckCompilerC.Create);
     324  BrainFuckCompiler := TTarget.Create;
     325  Targets := TTargetList.Create;
     326  Targets.Add(TTargetInterpretter.Create);
     327  Targets.Add(TTargetDelphi.Create);
     328  Targets.Add(TTargetPHP.Create);
     329  Targets.Add(TTargetC.Create);
    329330  UpdateTargetList;
    330331  LastOpenedList := TLastOpenedList.Create;
     
    338339  SaveToRegistry(RegistryRoot, ApplicationInfo.RegistryKey);
    339340  LastOpenedList.Free;
    340   Compilers.Free;
     341  Targets.Free;
    341342  BrainFuckCompiler.Free;
    342343  BrainFuckInterpreter.Free;
     
    449450procedure TMainForm.ACompileExecute(Sender: TObject);
    450451begin
    451   with TBrainFuckCompiler(Compilers[CompilerIndex]) do begin
     452  with TTarget(Targets[CompilerIndex]) do begin
    452453    Optimization := coNormal;
    453454    Source := MemoSource.Text;
     
    466467procedure TMainForm.ACompileAndRunExecute(Sender: TObject);
    467468begin
    468   with TBrainFuckCompiler(Compilers[CompilerIndex]) do begin
     469  with TTarget(Targets[CompilerIndex]) do begin
    469470    Optimization := coNormal;
    470471    Source := MemoSource.Text;
  • trunk/Forms/UOptionsForm.pas

    r25 r31  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   Spin, ComCtrls, UBrainFuck;
     9  Spin, ComCtrls, UTargetInterpretter;
    1010
    1111type
     
    2828    { private declarations }
    2929  public
    30     procedure LoadFromInterpretter(Interpretter: TBrainFuckInterpretter);
    31     procedure SaveToInterpretter(Interpretter: TBrainFuckInterpretter);
     30    procedure LoadFromInterpretter(Interpretter: TTargetInterpretter);
     31    procedure SaveToInterpretter(Interpretter: TTargetInterpretter);
    3232  end;
    3333
     
    5959end;
    6060
    61 procedure TOptionsForm.LoadFromInterpretter(Interpretter: TBrainFuckInterpretter
     61procedure TOptionsForm.LoadFromInterpretter(Interpretter: TTargetInterpretter
    6262  );
    6363begin
     
    6666end;
    6767
    68 procedure TOptionsForm.SaveToInterpretter(Interpretter: TBrainFuckInterpretter);
     68procedure TOptionsForm.SaveToInterpretter(Interpretter: TTargetInterpretter);
    6969begin
    7070  Interpretter.CellSize := SpinEditCellSize.Value;
Note: See TracChangeset for help on using the changeset viewer.