Changeset 54 for trunk/IDE/Forms/UFormMain.pas
- Timestamp:
- Jun 26, 2012, 7:41:11 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IDE/Forms/UFormMain.pas
r53 r54 88 88 PageControlRight: TPageControl; 89 89 PageControlBottom: TPageControl; 90 PopupMenu1: TPopupMenu; 90 91 SaveDialog1: TSaveDialog; 91 92 Splitter1: TSplitter; … … 144 145 procedure DockInit; 145 146 procedure UpdateMenu; 146 procedure UpdateT oolbar;147 procedure UpdateTitle; 147 148 public 148 149 procedure LoadFromRegistry(Root: HKEY; Key: string); … … 290 291 291 292 procedure TFormMain.UpdateInterface; 292 var293 I: Integer;294 Title: string;295 293 begin 296 294 with Core do begin 297 Title := ApplicationInfo.Name; 298 if Project.FileName <> '' then Title := Project.FileName + ' - ' + Title; 299 if Project.Modified then Title := Title + ' *'; 300 Caption := Title; 301 AProjectClose.Enabled := Project.Active; 302 AProjectSave.Enabled := Project.Active and Project.Modified; 303 AProjectSaveAs.Enabled := Project.Active; 295 UpdateTitle; 296 AProjectClose.Enabled := Assigned(Project); 297 AProjectSave.Enabled := Assigned(Project) and Project.Modified; 298 AProjectSaveAs.Enabled := Assigned(Project); 304 299 (*AProgramRun.Enabled := Project.Active and (BrainFuckInterpreter.State = rsStopped); 305 300 AProgramPause.Enabled := Project.Active and (BrainFuckInterpreter.State = rsRunning); 306 301 AProgramStop.Enabled := Project.Active and (BrainFuckInterpreter.State <> rsStopped);*) 307 ABuild.Enabled := Project.Activeand Assigned(Compiler.Target) and302 ABuild.Enabled := Assigned(Project) and Assigned(Compiler.Target) and 308 303 Assigned(Compiler.Target.Producer); 309 APause.Enabled := Project.Activeand Assigned(Compiler.Target) and304 APause.Enabled := Assigned(Project) and Assigned(Compiler.Target) and 310 305 Assigned(Compiler.Target.Executor) and (Compiler.Target.Executor.State = rsRunning); 311 ARun.Enabled := Project.Activeand Assigned(Compiler.Target) and306 ARun.Enabled := Assigned(Project) and Assigned(Compiler.Target) and 312 307 Assigned(Compiler.Target.Executor) and ((Compiler.Target.Executor.State = rsStopped) or 313 308 (Compiler.Target.Executor.State = rsPaused)); 314 AStop.Enabled := Project.Activeand Assigned(Compiler.Target) and309 AStop.Enabled := Assigned(Project) and Assigned(Compiler.Target) and 315 310 Assigned(Compiler.Target.Executor) and ((Compiler.Target.Executor.State = rsRunning) or 316 311 (Compiler.Target.Executor.State = rsPaused)); 317 AStepIn.Enabled := Project.Activeand Assigned(Compiler.Target) and312 AStepIn.Enabled := Assigned(Project) and Assigned(Compiler.Target) and 318 313 Assigned(Compiler.Target.Executor) and ((Compiler.Target.Executor.State = rsRunning) or 319 314 (Compiler.Target.Executor.State = rsPaused)); … … 324 319 325 320 UpdateMenu; 326 UpdateToolbar;327 321 FormSourceCode.UpdateInterface; 328 322 FormTargetCode.UpdateInterface; … … 443 437 end; 444 438 445 procedure TFormMain.UpdateToolbar; 446 var 447 I: Integer; 448 begin 449 for I := 0 to ToolBar1.ButtonCount - 1 do 450 TToolButton(ToolBar1.Buttons[I]).Hint := TToolButton(ToolBar1.Buttons[I]).Caption; 439 procedure TFormMain.UpdateTitle; 440 var 441 Title: string; 442 begin 443 Title := ApplicationInfo.Name; 444 if Assigned(Core.Project) then begin 445 if Core.Project.FileName <> '' then Title := Core.Project.FileName + ' - ' + Title; 446 if Core.Project.Modified then Title := Title + ' *'; 447 end; 448 Caption := Title; 451 449 end; 452 450 … … 503 501 begin 504 502 //if Project.Modified then ; 505 Core.Project.Active := False;503 FreeAndNil(Core.Project); 506 504 UpdateInterface; 507 505 end; … … 532 530 begin 533 531 if FormProjectNew.ShowModal = mrOk then begin 534 if Assigned(FormProjectNew.ListView1.Selected) then 532 if Assigned(FormProjectNew.ListView1.Selected) then begin 533 Core.ProjectNew; 535 534 TProjectTemplate(FormProjectNew.ListView1.Selected.Data).InitProject(Core.Project); 535 end; 536 536 end; 537 537 UpdateInterface; … … 540 540 procedure TFormMain.AProjectSaveAsExecute(Sender: TObject); 541 541 begin 542 if Assigned(Core.Project) then 542 543 if SaveDialog1.Execute then begin 543 Core.Project.Active := True;544 544 Core.Project.SaveToFile(SaveDialog1.FileName); 545 545 FormSourceCode.Save;
Note:
See TracChangeset
for help on using the changeset viewer.