Changeset 60 for branches/Transpascal/Forms/UMainForm.pas
- Timestamp:
- Oct 14, 2010, 1:50:39 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Transpascal/Forms/UMainForm.pas
r59 r60 9 9 Dialogs, StdCtrls, USourceCode, UCompiler, UProducerAsm8051, 10 10 UProducerC, ComCtrls, ExtCtrls, SynEdit, SynHighlighterPas, UProducerTreeView, 11 UProducerPascal, Contnrs, UProject ;11 UProducerPascal, Contnrs, UProject, FileUtil, Menus, ActnList; 12 12 13 13 const … … 18 18 19 19 TMainForm = class(TForm) 20 AProjectNew: TAction; 21 AProjectOpen: TAction; 22 AProjectSave: TAction; 23 AProjectSaveAs: TAction; 24 AProjectClose: TAction; 25 ActionList1: TActionList; 20 26 ButtonCompile: TButton; 21 27 ComboBox1: TComboBox; 22 28 ListBoxMessages: TListBox; 29 MainMenu1: TMainMenu; 30 MenuItem1: TMenuItem; 31 MenuItem2: TMenuItem; 32 MenuItem3: TMenuItem; 33 MenuItem4: TMenuItem; 34 MenuItem5: TMenuItem; 35 MenuItem6: TMenuItem; 23 36 Panel1: TPanel; 37 Panel2: TPanel; 38 Panel3: TPanel; 39 Splitter1: TSplitter; 40 Splitter2: TSplitter; 41 Splitter3: TSplitter; 24 42 SynEditSource: TSynEdit; 25 43 SynPasSyn1: TSynPasSyn; … … 32 50 procedure FormDestroy(Sender: TObject); 33 51 procedure ListBoxMessagesClick(Sender: TObject); 52 procedure Panel2Click(Sender: TObject); 53 procedure Splitter2CanResize(Sender: TObject; var NewSize: Integer; 54 var Accept: Boolean); 34 55 procedure TreeViewProjectChange(Sender: TObject; Node: TTreeNode); 35 56 private … … 76 97 ProducerControl.Parent := Panel1; 77 98 ProducerControl.Align := alClient; 78 TProducerTreeView(Compiler.Producer).TreeView := TTreeView(ProducerControl);79 end; 80 81 // Compile all project files99 // TProducerTreeView(Compiler.Producer).TreeView := TTreeView(ProducerControl); 100 end; 101 102 // Compile project file 82 103 Compiler.Init; 83 104 Compiler.Parser.OnGetSource := GetSource; 84 105 with TProjectFile(Project.Items[0]) do begin 85 Compiler.Compile(Parent.GetDir + Name, Source , ProducedCode);106 Compiler.Compile(Parent.GetDir + Name, Source); 86 107 end; 87 108 … … 127 148 end; 128 149 150 procedure TMainForm.Panel2Click(Sender: TObject); 151 begin 152 153 end; 154 155 procedure TMainForm.Splitter2CanResize(Sender: TObject; var NewSize: Integer; 156 var Accept: Boolean); 157 begin 158 159 end; 160 129 161 procedure TMainForm.LoadErrorMessages; 130 162 var … … 139 171 140 172 procedure TMainForm.TreeViewProjectChange(Sender: TObject; Node: TTreeNode); 173 var 174 FileName: string; 141 175 begin 142 176 if Assigned(Node) then begin 143 177 if TProjectNode(Node.Data) is TProjectFile then begin 144 178 SynEditSource.Lines.Assign(TProjectFile(Node.Data).Source); 179 FileName := Compiler.CompiledFolder + DirectorySeparator + 180 Compiler.Producer.ClassName + DirectorySeparator + ExtractFileNameOnly(TProjectFile(Node.Data).Name) + Compiler.Producer.FileExtension; 145 181 if ProducerControl is TMemo then 146 TMemo(ProducerControl).Lines.Assign(TProjectFile(Node.Data).ProducedCode); 182 if FileExists(FileName) then 183 TMemo(ProducerControl).Lines.LoadFromFile(FileName) else 184 TMemo(ProducerControl).Lines.Clear; 185 //if ProducerControl is TTreeView then 186 // TTreeView(ProducerControl).Assign(TProjectFile(Node.Data).ProducedCode); 147 187 end; 148 188 end;
Note:
See TracChangeset
for help on using the changeset viewer.