Ignore:
Timestamp:
Oct 22, 2010, 9:22:55 AM (14 years ago)
Author:
george
Message:
  • Compiler producer for C language separated to GCC and Dynamic C dialect.
  • Enhanced: Parse record functions body.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Transpascal/Forms/UMainForm.pas

    r76 r77  
    88  SysUtils, Variants, Classes, Graphics, Controls, Forms,
    99  Dialogs, StdCtrls, UCompiler, UProducerAsm8051, Registry,
    10   UProducerC, ComCtrls, ExtCtrls, SynEdit, SynHighlighterPas, UProducerTreeView,
     10  UProducerDynamicC, ComCtrls, ExtCtrls, SynEdit, SynHighlighterPas, UProducerTreeView,
    1111  UProducerPascal, Contnrs, UProject, FileUtil, Menus, ActnList, UCoolDocking,
    1212  UCompiledForm, UCodeTreeForm, URegistry, ULastOpenedList, UApplicationInfo,
     
    8484
    8585procedure TMainForm.ButtonCompileClick(Sender: TObject);
    86 var
    87   I: Integer;
    88 begin
    89   if ComboBoxTargetSelection.ItemIndex = 0 then begin
    90     Compiler.Producer.Free;
    91     Compiler.Producer := TProducerPascal.Create;
    92   end else
    93   if ComboBoxTargetSelection.ItemIndex = 1 then begin
    94     Compiler.Producer.Free;
    95     Compiler.Producer := TProducerC.Create;
    96   end else
    97   if ComboBoxTargetSelection.ItemIndex = 2 then begin
    98     Compiler.Producer.Free;
    99     Compiler.Producer := TProducerAsm8051.Create;
    100   end else
    101   if ComboBoxTargetSelection.ItemIndex = 3 then begin
    102     Compiler.Producer.Free;
    103     Compiler.Producer := TProducerTreeView.Create;
    104   end;
    105 
     86begin
    10687  // Compile project file
     88  Compiler.ProducerType := TProducerType(ComboBoxTargetSelection.ItemIndex);
    10789  Compiler.Init;
    10890  Compiler.Parser.OnGetSource := GetSource;
     
    173155      OpenKey(RegistryKey, True);
    174156      ReopenLastOpenedFile := ReadBoolWithDefault('ReopenLastOpenedFile', True);
     157      ComboBoxTargetSelection.ItemIndex :=
     158        ReadIntegerWithDefault('ProducerType', 0);
    175159    finally
    176160      Free;
     
    186170      OpenKey(RegistryKey, True);
    187171      WriteBool('ReopenLastOpenedFile', ReopenLastOpenedFile);
     172      WriteInteger('ProducerType', ComboBoxTargetSelection.ItemIndex);
    188173    finally
    189174      Free;
     
    209194
    210195procedure TMainForm.FormCreate(Sender: TObject);
     196var
     197  ProducerType: TProducerType;
    211198begin
    212199  DebugLog.FileName := 'DebugLog.txt';
     
    218205  LastOpenedFiles.MenuItem := MenuItemOpenRecent;
    219206  LastOpenedFiles.ClickAction := OpenRecentClick;
     207
     208  ComboBoxTargetSelection.Clear;
     209  for ProducerType := Low(ProducerType) to High(ProducerType) do
     210    ComboBoxTargetSelection.AddItem(ProducerTypeName[ProducerType], nil);
    220211end;
    221212
Note: See TracChangeset for help on using the changeset viewer.