Changeset 55 for branches/DelphiToC/Forms
- Timestamp:
- Aug 10, 2010, 1:48:38 PM (15 years ago)
- Location:
- branches/DelphiToC/Forms
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DelphiToC/Forms/UMainForm.lfm
r54 r55 3 3 Height = 494 4 4 Top = 103 5 Width = 8 845 Width = 861 6 6 Caption = 'Transpascal ' 7 7 ClientHeight = 494 8 ClientWidth = 8 848 ClientWidth = 861 9 9 Font.Height = -11 10 10 Font.Name = 'Tahoma' … … 16 16 LCLVersion = '0.9.29' 17 17 object ButtonCompile: TButton 18 Left = 7 3618 Left = 713 19 19 Height = 22 20 20 Top = 397 … … 28 28 TabOrder = 0 29 29 end 30 inline SynEdit 1: TSynEdit30 inline SynEditSource: TSynEdit 31 31 Left = 248 32 32 Height = 384 … … 611 611 end> 612 612 Lines.Strings = ( 613 'SynEdit 1'613 'SynEditSource' 614 614 ) 615 615 BracketHighlightStyle = sbhsBoth … … 723 723 end 724 724 object ComboBox1: TComboBox 725 Left = 7 35725 Left = 712 726 726 Height = 21 727 727 Top = 424 728 728 Width = 144 729 Anchors = [ak Left, akRight, akBottom]729 Anchors = [akRight, akBottom] 730 730 ItemHeight = 13 731 731 ItemIndex = 0 … … 741 741 Text = 'Pascal' 742 742 end 743 object ListBox 1: TListBox743 object ListBoxMessages: TListBox 744 744 Left = 8 745 745 Height = 91 746 746 Top = 398 747 Width = 720747 Width = 697 748 748 Anchors = [akLeft, akRight, akBottom] 749 749 ItemHeight = 0 750 OnClick = ListBox 1Click750 OnClick = ListBoxMessagesClick 751 751 TabOrder = 3 752 752 end … … 755 755 Height = 382 756 756 Top = 8 757 Width = 2 31757 Width = 208 758 758 Anchors = [akTop, akLeft, akRight, akBottom] 759 759 BevelOuter = bvNone -
branches/DelphiToC/Forms/UMainForm.pas
r54 r55 20 20 ButtonCompile: TButton; 21 21 ComboBox1: TComboBox; 22 ListBox 1: TListBox;22 ListBoxMessages: TListBox; 23 23 Panel1: TPanel; 24 SynEdit 1: TSynEdit;24 SynEditSource: TSynEdit; 25 25 SynPasSyn1: TSynPasSyn; 26 26 TreeViewProject: TTreeView; … … 31 31 procedure FormCreate(Sender: TObject); 32 32 procedure FormDestroy(Sender: TObject); 33 procedure ListBox 1Click(Sender: TObject);33 procedure ListBoxMessagesClick(Sender: TObject); 34 34 procedure TreeViewProjectChange(Sender: TObject; Node: TTreeNode); 35 35 private … … 79 79 80 80 // Compile all project files 81 Compiler.Init; 81 82 for I := 0 to Project.Items.Count - 1 do begin 82 if TProjectNode(Project.Items[I]) is TProjectFile then begin83 Compiler.Compile(TProjectFile(Project.Items[I]).Source,84 TProjectFile(Project.Items[I]).ProducedCode);83 if TProjectNode(Project.Items[I]) is TProjectFile then 84 with TProjectFile(Project.Items[I]) do begin 85 Compiler.Compile(Parent.GetDir + Name, Source, ProducedCode); 85 86 end; 86 87 end; … … 113 114 end; 114 115 115 procedure TMainForm.ListBox1Click(Sender: TObject); 116 begin 117 if ListBox1.ItemIndex <> - 1 then begin 118 SynEdit1.CaretXY := TErrorMessage(Compiler.ErrorMessages[ListBox1.ItemIndex]).Position; 119 SynEdit1.SetFocus; 116 procedure TMainForm.ListBoxMessagesClick(Sender: TObject); 117 var 118 ProjectFile: TProjectFile; 119 begin 120 if ListBoxMessages.ItemIndex <> -1 then 121 with TErrorMessage(Compiler.ErrorMessages[ListBoxMessages.ItemIndex]) do begin 122 ProjectFile := Project.SearchFile(fileName); 123 if Assigned(ProjectFile) then 124 SynEditSource.Lines.Assign(ProjectFile.Source); 125 SynEditSource.CaretXY := Position; 126 SynEditSource.SetFocus; 120 127 end; 121 128 end; … … 125 132 I: Integer; 126 133 begin 127 ListBox 1.Clear;134 ListBoxMessages.Clear; 128 135 for I := 0 to Compiler.ErrorMessages.Count - 1 do 129 136 with TErrorMessage(Compiler.ErrorMessages[I]) do 130 MainForm.ListBox 1.Items.Add('(' + IntToStr(Position.X) +137 MainForm.ListBoxMessages.Items.Add(FileName + '(' + IntToStr(Position.X) + 131 138 ',' + IntToStr(Position.Y) + ') ' + Text); 132 139 end; … … 136 143 if Assigned(Node) then begin 137 144 if TProjectNode(Node.Data) is TProjectFile then begin 138 SynEdit 1.Lines.Assign(TProjectFile(Node.Data).Source);145 SynEditSource.Lines.Assign(TProjectFile(Node.Data).Source); 139 146 if ProducerControl is TMemo then 140 147 TMemo(ProducerControl).Lines.Assign(TProjectFile(Node.Data).ProducedCode); … … 193 200 NewProjectFile: TProjectFile; 194 201 begin 202 Project.RootDir := '../../Project/'; 195 203 Project.Name := 'Project'; 204 196 205 NewProjectFile := TProjectFile.Create; 206 NewProjectFile.Parent := Project; 197 207 NewProjectFile.Name := 'Project.pas'; 198 NewProjectFile.FileName := ProjectDir + 'Project.pas';199 208 Project.Items.Add(NewProjectFile); 209 200 210 NewProjectFile := TProjectFile.Create; 211 NewProjectFile.Parent := Project; 201 212 NewProjectFile.Name := 'System.pas'; 202 NewProjectFile.FileName := ProjectDir + 'System.pas';203 213 Project.Items.Add(NewProjectFile); 214 215 NewProjectFile := TProjectFile.Create; 216 NewProjectFile.Parent := Project; 217 NewProjectFile.Name := 'Console.pas'; 218 Project.Items.Add(NewProjectFile); 219 204 220 Project.Load; 205 221 UpdateProjectTree;
Note:
See TracChangeset
for help on using the changeset viewer.