Changeset 61 for trunk/Forms/UFormMain.pas
- Timestamp:
- Dec 4, 2014, 11:26:54 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r60 r61 263 263 FormSourceCode.MemoSource.Lines.LoadFromFile(UTF8Decode(FileName)); 264 264 Core.LastOpenedList.AddItem(FileName); 265 Core.Project FileName := FileName;266 Core. Modified := False;265 Core.Project.FileName := FileName; 266 Core.Project.Modified := False; 267 267 CurrentTarget.Compiled := False; 268 268 UpdateInterface; … … 300 300 FormMessages.Align := alClient; 301 301 FormMessages.Show; 302 PageControlRight.Width := MainForm.Width div 2;302 PageControlRight.Width := MainForm.Width div 3; 303 303 PageControlBottom.Height := MainForm.Height div 5; 304 304 end; … … 345 345 Title: string; 346 346 begin 347 AProjectSave.Enabled := Core. Modified;347 AProjectSave.Enabled := Core.Project.Modified; 348 348 Title := Core.ApplicationInfo.AppName; 349 if Core.Project FileName <> '' then Title := Core.ProjectFileName + ' - ' + Title;350 if Core. Modified then Title := Title + ' *';349 if Core.Project.FileName <> '' then Title := Core.Project.FileName + ' - ' + Title; 350 if Core.Project.Modified then Title := Title + ' *'; 351 351 Caption := Title; 352 FormSourceCode.MemoSource.Enabled := Core.Project FileName <> '';353 AProjectClose.Enabled := Core.Project FileName <> '';352 FormSourceCode.MemoSource.Enabled := Core.Project.FileName <> ''; 353 AProjectClose.Enabled := Core.Project.FileName <> ''; 354 354 AProgramRun.Enabled := (tcRun in CurrentTarget.Capabilities) and 355 (Core.Project FileName <> '') and (CurrentTarget.State = rsStopped) or (CurrentTarget.State = rsPaused);355 (Core.Project.FileName <> '') and (CurrentTarget.State = rsStopped) or (CurrentTarget.State = rsPaused); 356 356 AProgramPause.Enabled := (tcPause in CurrentTarget.Capabilities) and 357 (Core.Project FileName <> '') and (CurrentTarget.State = rsRunning);357 (Core.Project.FileName <> '') and (CurrentTarget.State = rsRunning); 358 358 AProgramStop.Enabled := (tcStop in CurrentTarget.Capabilities) and 359 (Core.Project FileName <> '') and (CurrentTarget.State <> rsStopped);359 (Core.Project.FileName <> '') and (CurrentTarget.State <> rsStopped); 360 360 AProgramCompile.Enabled := (tcCompile in CurrentTarget.Capabilities) and 361 (Core.Project FileName <> '');361 (Core.Project.FileName <> ''); 362 362 AProgramStepInto.Enabled := (tcStepInto in CurrentTarget.Capabilities) and 363 (Core.Project FileName <> '') and ((CurrentTarget.State = rsPaused) or (CurrentTarget.State = rsStopped));363 (Core.Project.FileName <> '') and ((CurrentTarget.State = rsPaused) or (CurrentTarget.State = rsStopped)); 364 364 AProgramStepOut.Enabled := (tcStepOut in CurrentTarget.Capabilities) and 365 (Core.Project FileName <> '') and (CurrentTarget.State = rsPaused);365 (Core.Project.FileName <> '') and (CurrentTarget.State = rsPaused); 366 366 AProgramRunToCursor.Enabled := (tcRunToCursor in CurrentTarget.Capabilities) and 367 (Core.Project FileName <> '') and ((CurrentTarget.State = rsPaused) or (CurrentTarget.State = rsStopped));367 (Core.Project.FileName <> '') and ((CurrentTarget.State = rsPaused) or (CurrentTarget.State = rsStopped)); 368 368 AProgramStepOver.Enabled := (tcStepOver in CurrentTarget.Capabilities) and 369 (Core.Project FileName <> '') and ((CurrentTarget.State = rsPaused) or (CurrentTarget.State = rsStopped));369 (Core.Project.FileName <> '') and ((CurrentTarget.State = rsPaused) or (CurrentTarget.State = rsStopped)); 370 370 AProgramShowExecutionPoint.Enabled := (tcPause in CurrentTarget.Capabilities) and 371 (Core.Project FileName <> '') and (CurrentTarget.State = rsPaused);371 (Core.Project.FileName <> '') and (CurrentTarget.State = rsPaused); 372 372 AShowSourcePosition.Enabled := CurrentTarget.Compiled; 373 373 AShowTargetPosition.Enabled := CurrentTarget.Compiled; … … 457 457 procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: boolean); 458 458 begin 459 if Core. Modified then AProjectSaveAs.Execute;459 if Core.Project.Modified then AProjectSaveAs.Execute; 460 460 end; 461 461 … … 481 481 Optimization := coNormal; 482 482 SourceCode := FormSourceCode.MemoSource.Text; 483 ProjectFileName := Core.Project FileName;484 ProgramName := ExtractFileNameOnly(Core.Project FileName);483 ProjectFileName := Core.Project.FileName; 484 ProgramName := ExtractFileNameOnly(Core.Project.FileName); 485 485 CurrentTarget.Messages.AddMessage(SCompileStart); 486 486 Compile; … … 566 566 procedure TMainForm.AProjectCloseExecute(Sender: TObject); 567 567 begin 568 if Core. Modified then AProjectSaveAs.Execute;568 if Core.Project.Modified then AProjectSaveAs.Execute; 569 569 AProgramStop.Execute; 570 Core.Project FileName := '';570 Core.Project.FileName := ''; 571 571 FormSourceCode.MemoSource.Clear; 572 Core. Modified := False;572 Core.Project.Modified := False; 573 573 UpdateInterface; 574 574 end; … … 577 577 begin 578 578 AProjectClose.Execute; 579 Core.Project FileName := 'Examples' + DirectorySeparator + SNewProject + '.b';579 Core.Project.FileName := 'Examples' + DirectorySeparator + SNewProject + '.b'; 580 580 FormSourceCode.MemoSource.Clear; 581 Core. Modified := False;581 Core.Project.Modified := False; 582 582 CurrentTarget.Compiled := False; 583 583 UpdateInterface; … … 602 602 procedure TMainForm.AProjectSaveAsExecute(Sender: TObject); 603 603 begin 604 SaveDialog1.FileName := Core.Project FileName;604 SaveDialog1.FileName := Core.Project.FileName; 605 605 if SaveDialog1.Execute then begin 606 606 FormSourceCode.MemoSource.Lines.SaveToFile(UTF8Decode(SaveDialog1.FileName)); 607 Core.Project FileName := SaveDialog1.FileName;607 Core.Project.FileName := SaveDialog1.FileName; 608 608 Core.LastOpenedList.AddItem(SaveDialog1.FileName); 609 Core. Modified := False;609 Core.Project.Modified := False; 610 610 UpdateInterface; 611 611 end; … … 614 614 procedure TMainForm.AProjectSaveExecute(Sender: TObject); 615 615 begin 616 if Core. Modified then AProjectSaveAs.Execute;616 if Core.Project.Modified then AProjectSaveAs.Execute; 617 617 end; 618 618
Note:
See TracChangeset
for help on using the changeset viewer.