Changeset 37 for trunk/IDE/Forms/UMainForm.pas
- Timestamp:
- Feb 14, 2012, 7:33:51 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IDE/Forms/UMainForm.pas
r36 r37 17 17 18 18 type 19 20 { TCustomCompiler } 21 22 TCustomCompiler = class(TCompiler) 23 procedure LoadFromRegistry(Root: HKEY; Key: string); 24 procedure SaveToRegistry(Root: HKEY; Key: string); 25 end; 26 19 27 { TMainForm } 20 28 21 29 TMainForm = class(TForm) 22 30 ABuild: TAction; 31 AViewProducers: TAction; 23 32 AViewCompiledSoruce: TAction; 24 33 AViewCodeTree: TAction; … … 58 67 MenuItem22: TMenuItem; 59 68 MenuItem23: TMenuItem; 69 MenuItem24: TMenuItem; 60 70 MenuItemAnalyzer: TMenuItem; 61 71 MenuItemProducer: TMenuItem; … … 102 112 procedure AViewMessagesExecute(Sender: TObject); 103 113 procedure AViewOptionsExecute(Sender: TObject); 114 procedure AViewProducersExecute(Sender: TObject); 104 115 procedure AViewProjectExecute(Sender: TObject); 105 116 procedure AViewSourceEditorExecute(Sender: TObject); … … 127 138 LogParsing: Boolean; 128 139 Project: TProject; 129 Compiler: TC ompiler;140 Compiler: TCustomCompiler; 130 141 function GetSource(Name: string; var SourceCode: string): Boolean; 131 142 procedure UpdateInterface; … … 141 152 142 153 uses 143 UMessagesForm, UCodeForm, UProjectManager, UCommon, UAboutForm, UFormOptions; 154 UMessagesForm, UCodeForm, UProjectManager, UCommon, UAboutForm, UFormOptions, 155 UCompilersForm; 144 156 145 157 resourcestring 146 158 SNewProject = 'New project'; 159 160 { TCustomCompiler } 161 162 procedure TCustomCompiler.LoadFromRegistry(Root: HKEY; Key: string); 163 var 164 I: Integer; 165 begin 166 with TRegistryEx.Create do 167 try 168 RootKey := Root; 169 for I := 0 to Producers.Count - 1 do 170 with TProducer(Producers[I]) do begin 171 OpenKey(Key + '\Producers\' + Name, True); 172 CompilerPAth := ReadStringWithDefault('CompilerPath', CompilerPath); 173 end; 174 finally 175 Free; 176 end; 177 end; 178 179 procedure TCustomCompiler.SaveToRegistry(Root: HKEY; Key: string); 180 var 181 I: Integer; 182 begin 183 with TRegistryEx.Create do 184 try 185 RootKey := Root; 186 for I := 0 to Producers.Count - 1 do 187 with TProducer(Producers[I]) do begin 188 OpenKey(Key + '\Producers\' + Name, True); 189 WriteString('CompilerPath', CompilerPath); 190 end; 191 finally 192 Free; 193 end; 194 end; 147 195 148 196 { TMainForm } … … 189 237 begin 190 238 FormOptions.ShowModal; 239 end; 240 241 procedure TMainForm.AViewProducersExecute(Sender: TObject); 242 begin 243 FormProducers.Show; 191 244 end; 192 245 … … 234 287 AProgramPause.Enabled := Project.Active and (BrainFuckInterpreter.State = rsRunning); 235 288 AProgramStop.Enabled := Project.Active and (BrainFuckInterpreter.State <> rsStopped);*) 289 ABuild.Enabled := Project.Active; 236 290 UpdateMenu; 237 291 CodeForm.UpdateInterface; … … 259 313 CompiledForm.Align := alClient; 260 314 CompiledForm.Show; 315 PageControlRight.TabIndex := 0; 316 PageControlBottom.TabIndex := 0; 261 317 262 318 (*ProjectManager.ManualDock(DockPanel, nil, alLeft); … … 311 367 Free; 312 368 end; 313 LastOpenedFiles.LoadFromRegistry(RegistryRootKey, Key); 369 LastOpenedFiles.LoadFromRegistry(RegistryRootKey, Key + '\LastOpenedFiles'); 370 Compiler.LoadFromRegistry(RegistryRootKey, Key + '\Compiler'); 314 371 end; 315 372 … … 330 387 Free; 331 388 end; 332 LastOpenedFiles.SaveToRegistry(RegistryRootKey, Key );389 LastOpenedFiles.SaveToRegistry(RegistryRootKey, Key + '\LastOpenedFiles'); 333 390 LastOpenedFiles.ReloadMenu; 391 Compiler.SaveToRegistry(RegistryRootKey, Key + '\Compiler'); 334 392 end; 335 393 336 394 procedure TMainForm.ProjectOpen(FileName: string); 337 395 begin 396 Project.Active := True; 338 397 Project.LoadFromFile(FileName); 339 398 LastOpenedFiles.AddItem(FileName); 340 399 LastOpenedFiles.ReloadMenu; 341 ProjectManager.UpdateProjectTree;342 400 UpdateInterface; 343 401 end; … … 393 451 begin 394 452 DeleteFile(DebugLog1.FileName); 395 Compiler := TC ompiler.Create;453 Compiler := TCustomCompiler.Create; 396 454 Project := TProject.Create; 397 455 LastOpenedFiles := TLastOpenedList.Create;
Note:
See TracChangeset
for help on using the changeset viewer.