Changeset 49 for branches/DelphiToC/UMainForm.pas
- Timestamp:
- Aug 9, 2010, 2:24:24 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DelphiToC/UMainForm.pas
r46 r49 9 9 Dialogs, StdCtrls, UPascalSource, UPascalCompiler, UAssemblerSource, 10 10 UProducerC, ComCtrls, SynEdit, SynHighlighterPas, USourceTree, 11 UProducerPascal ;11 UProducerPascal, Contnrs; 12 12 13 13 const … … 15 15 16 16 type 17 18 17 { TMainForm } 19 18 … … 21 20 Button1: TButton; 22 21 ComboBox1: TComboBox; 22 ListBox1: TListBox; 23 23 Memo2: TMemo; 24 Memo3: TMemo;25 24 SynEdit1: TSynEdit; 26 25 SynPasSyn1: TSynPasSyn; … … 32 31 procedure FormCreate(Sender: TObject); 33 32 procedure FormDestroy(Sender: TObject); 34 procedure ErrorMessage(Text: string); 33 procedure ListBox1Click(Sender: TObject); 34 procedure LoadErrorMessages; 35 35 private 36 36 public … … 52 52 I: Integer; 53 53 begin 54 MainForm. Memo3.Clear;54 MainForm.ListBox1.Clear; 55 55 Compiler.SourceCode.Assign(SynEdit1.Lines); 56 56 … … 81 81 Memo2.Lines.Add(TAssemblerLine(AssemblyCode[I]).AsString); 82 82 end; 83 LoadErrorMessages; 83 84 84 85 SourceTree.TreeView := TreeView1; … … 87 88 end; 88 89 89 procedure TMainForm. ErrorMessage(Text: string);90 procedure TMainForm.ListBox1Click(Sender: TObject); 90 91 begin 91 MainForm.Memo3.Lines.Add(Text); 92 if ListBox1.ItemIndex <> - 1 then begin 93 SynEdit1.CaretXY := TErrorMessage(Compiler.ErrorMessages[ListBox1.ItemIndex]).Position; 94 SynEdit1.SetFocus; 95 end; 96 end; 97 98 procedure TMainForm.LoadErrorMessages; 99 var 100 I: Integer; 101 begin 102 ListBox1.Clear; 103 for I := 0 to Compiler.ErrorMessages.Count - 1 do 104 with TErrorMessage(Compiler.ErrorMessages[I]) do 105 MainForm.ListBox1.Items.Add('(' + IntToStr(Position.X) + 106 ',' + IntToStr(Position.Y) + ') ' + Text); 92 107 end; 93 108 … … 100 115 begin 101 116 Compiler := TCompiler.Create; 102 Compiler.OnErrorMessage := ErrorMessage;103 117 SourceTree := TSourceTree.Create; 104 118 end;
Note:
See TracChangeset
for help on using the changeset viewer.