Changeset 52 for branches/DelphiToC/Forms/UMainForm.pas
- Timestamp:
- Aug 10, 2010, 7:57:46 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DelphiToC/Forms/UMainForm.pas
r51 r52 7 7 uses 8 8 SysUtils, Variants, Classes, Graphics, Controls, Forms, 9 Dialogs, StdCtrls, USourceCode, UCompiler, U AssemblerSource,10 UProducerC, ComCtrls, SynEdit, SynHighlighterPas, USourceTree,9 Dialogs, StdCtrls, USourceCode, UCompiler, UProducerAsm8051, 10 UProducerC, ComCtrls, ExtCtrls, SynEdit, SynHighlighterPas, UProducerTreeView, 11 11 UProducerPascal, Contnrs; 12 12 … … 21 21 ComboBox1: TComboBox; 22 22 ListBox1: TListBox; 23 Memo2: TMemo;23 Panel1: TPanel; 24 24 SynEdit1: TSynEdit; 25 25 SynPasSyn1: TSynPasSyn; 26 TreeView1: TTreeView;27 26 procedure ComboBox1Change(Sender: TObject); 28 27 procedure FormShow(Sender: TObject); … … 35 34 private 36 35 public 36 ProducerControl: TControl; 37 37 Compiler: TCompiler; 38 SourceTree: T SourceTree;38 SourceTree: TProducerTreeView; 39 39 end; 40 40 … … 55 55 Compiler.SourceCode.Assign(SynEdit1.Lines); 56 56 57 Memo2.Clear;57 ProducerControl.Free; 58 58 if ComboBox1.ItemIndex = 0 then begin 59 59 Compiler.Producer.Free; … … 61 61 Compiler.Producer.ProgramCode := Compiler.ProgramCode; 62 62 Compiler.Compile; 63 ProducerControl := TMemo.Create(Self); 64 ProducerControl.Parent := Panel1; 65 ProducerControl.Align := alClient; 63 66 with TProducerPascal(Compiler.Producer) do 64 Memo2.Lines.Assign(TextSource);67 TMemo(ProducerControl).Lines.Assign(TextSource); 65 68 end else 66 69 if ComboBox1.ItemIndex = 1 then begin 67 70 Compiler.Producer.Free; 68 Compiler.Producer := T CProducer.Create;71 Compiler.Producer := TProducerC.Create; 69 72 Compiler.Producer.ProgramCode := Compiler.ProgramCode; 70 73 Compiler.Compile; 71 with TCProducer(Compiler.Producer) do 72 Memo2.Lines.Assign(TextSource); 74 ProducerControl := TMemo.Create(Self); 75 ProducerControl.Parent := Panel1; 76 ProducerControl.Align := alClient; 77 with TProducerC(Compiler.Producer) do 78 TMemo(ProducerControl).Lines.Assign(TextSource); 73 79 end else 74 80 if ComboBox1.ItemIndex = 2 then begin 75 81 Compiler.Producer.Free; 76 Compiler.Producer := T AssemblerProducer.Create;82 Compiler.Producer := TProducerAsm8051.Create; 77 83 Compiler.Producer.ProgramCode := Compiler.ProgramCode; 78 84 Compiler.Compile; 79 with TAssemblerProducer(Compiler.Producer) do 85 ProducerControl := TMemo.Create(Self); 86 ProducerControl.Parent := Panel1; 87 ProducerControl.Align := alClient; 88 with TProducerAsm8051(Compiler.Producer) do 80 89 for I := 0 to AssemblyCode.Count - 1 do 81 Memo2.Lines.Add(TAssemblerLine(AssemblyCode[I]).AsString); 90 TMemo(ProducerControl).Lines.Add(TAssemblerLine(AssemblyCode[I]).AsString); 91 end; 92 if ComboBox1.ItemIndex = 3 then begin 93 Compiler.Producer.Free; 94 Compiler.Producer := TProducerTreeView.Create; 95 Compiler.Producer.ProgramCode := Compiler.ProgramCode; 96 ProducerControl := TTreeView.Create(Self); 97 ProducerControl.Parent := Panel1; 98 ProducerControl.Align := alClient; 99 TProducerTreeView(Compiler.Producer).TreeView := TTreeView(ProducerControl); 100 Compiler.Compile; 82 101 end; 83 102 LoadErrorMessages; 84 85 SourceTree.TreeView := TreeView1;86 SourceTree.Code := Compiler.ProgramCode;87 SourceTree.Fill;88 103 end; 89 104 … … 115 130 begin 116 131 Compiler := TCompiler.Create; 117 SourceTree := T SourceTree.Create;132 SourceTree := TProducerTreeView.Create; 118 133 end; 119 134
Note:
See TracChangeset
for help on using the changeset viewer.