Ignore:
Timestamp:
Feb 28, 2012, 8:34:31 PM (13 years ago)
Author:
chronos
Message:
  • Modified: Instead of TProducer class will be used TTarget as real target definition.
  • Added: For execution of compiled code TExecutor class is introduced.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IDE/Forms/UMainForm.pas

    r39 r41  
    1111  UCDConjoinForm, UCDWindowList, UCDLayout, UCDCustomize, UCoolTranslator,
    1212  UCompiledForm, UCodeTreeForm, URegistry, ULastOpenedList, UApplicationInfo,
    13   UDebugLog, UAnalyzer, UProducer;
     13  UDebugLog;
    1414
    1515const
     
    6868    MenuItem23: TMenuItem;
    6969    MenuItem24: TMenuItem;
    70     MenuItemAnalyzer: TMenuItem;
    7170    MenuItemProducer: TMenuItem;
    7271    MenuItem3: TMenuItem;
     
    157156uses
    158157  UMessagesForm, UCodeForm, UProjectManager, UCommon, UAboutForm, UFormOptions,
    159   UCompilersForm;
     158  UCompilersForm, UTarget, UAnalyzer, UProducer;
    160159
    161160resourcestring
     
    171170    try
    172171      RootKey := Root;
    173       for I := 0 to Producers.Count - 1 do
    174       with TProducer(Producers[I]) do begin
    175         OpenKey(Key + '\Producers\' + Name, True);
     172      for I := 0 to Targets.Count - 1 do
     173      with TTarget(Targets[I]) do begin
     174        OpenKey(Key + '\Targets\' + Name, True);
    176175        if ValueExists('CompilerPath') then
    177           CompilerPath := ReadStringWithDefault('CompilerPath', CompilerPath);
     176          Producer.CompilerPath := ReadStringWithDefault('CompilerPath', Producer.CompilerPath);
    178177      end;
     178      if ValueExists('SelectedTarget') then
     179      Target := Targets.SearchBySysName(ReadString('SelectedTarget'))
     180        else Target := nil;
    179181    finally
    180182      Free;
     
    189191    try
    190192      RootKey := Root;
    191       for I := 0 to Producers.Count - 1 do
    192       with TProducer(Producers[I]) do begin
    193         OpenKey(Key + '\Producers\' + Name, True);
    194         if CompilerPath <> '' then WriteString('CompilerPath', CompilerPath)
    195           else DeleteValue('CompilerPath');
     193      for I := 0 to Targets.Count - 1 do
     194      with TTarget(Targets[I]) do begin
     195        OpenKey(Key + '\Targets\' + Name, True);
     196        if Assigned(Producer) then begin
     197          if Producer.CompilerPath <> '' then WriteString('CompilerPath', Producer.CompilerPath)
     198            else DeleteValue('CompilerPath');
     199        end;
    196200      end;
     201      if Assigned(Target) then WriteString('SelectedTarget', Target.SysName)
     202        else DeleteValue('SelectedTarget');
    197203    finally
    198204      Free;
     
    207213
    208214  // Compile project file
    209     Compiler.Producer := TProducer(Compiler.Producers[SelectedProducerIndex]);
    210     Compiler.Analyzer := TAnalyzer(Compiler.Analyzers[SelectedAnalyzerIndex]);
    211215    Compiler.Init;
    212216
     
    434438  NewMenuItem: TMenuItem;
    435439begin
    436   MenuItemAnalyzer.Clear;
    437   for I := 0 to Compiler.Analyzers.Count - 1 do begin
    438     NewMenuItem := TMenuItem.Create(MenuItemAnalyzer);
    439     NewMenuItem.Caption := TAnalyzer(Compiler.Analyzers[I]).Name;
    440     NewMenuItem.OnClick := MenuItemAnalyzerClick;
    441     if I = SelectedAnalyzerIndex then NewMenuItem.Checked := True;
    442     MenuItemAnalyzer.Add(NewMenuItem);
    443   end;
    444440  MenuItemProducer.Clear;
    445   for I := 0 to Compiler.Producers.Count - 1 do begin
     441  for I := 0 to Compiler.Targets.Count - 1 do begin
    446442    NewMenuItem := TMenuItem.Create(MenuItemProducer);
    447     NewMenuItem.Caption := TProducer(Compiler.Producers[I]).Name;
     443    NewMenuItem.Caption := TTarget(Compiler.Targets[I]).Name;
    448444    NewMenuItem.OnClick := MenuItemProducerClick;
    449445    if I = SelectedProducerIndex then NewMenuItem.Checked := True;
Note: See TracChangeset for help on using the changeset viewer.