Changeset 62
- Timestamp:
- Dec 4, 2014, 11:46:40 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r61 r62 154 154 procedure LastOpenedListChange(Sender: TObject); 155 155 public 156 LastFileName: string;157 156 procedure LoadFromRegistry(Root: HKEY; Key: string); 158 157 procedure SaveToRegistry(Root: HKEY; Key: string); … … 182 181 SCompileStart = 'Compiling...'; 183 182 SDone = 'Done'; 183 SChanged = 'Changed'; 184 184 185 185 { TMainForm } … … 264 264 Core.LastOpenedList.AddItem(FileName); 265 265 Core.Project.FileName := FileName; 266 Core.Project. Modified := False;266 Core.Project.Openned := True; 267 267 CurrentTarget.Compiled := False; 268 268 UpdateInterface; … … 319 319 OpenKey(Key, True); 320 320 TargetName := ReadStringWithDefault('TargetName', 'Interpretter'); 321 LastFileName := ReadStringWithDefault('LastFileName',322 ExtractFileDir(Application.ExeName) + DirectorySeparator + 'Examples');323 321 CurrentTarget := Core.Targets.FindByName(TargetName); 324 322 if not Assigned(CurrentTarget) then CurrentTarget := TTarget(Core.Targets[0]); … … 335 333 OpenKey(Key, True); 336 334 WriteString('TargetName', CurrentTarget.Name); 337 WriteString('LastFileName', LastFileName);338 335 finally 339 336 Free; … … 345 342 Title: string; 346 343 begin 344 Title := ''; 345 if Core.Project.FileName <> '' then Title := Core.Project.FileName; 346 if Core.Project.Modified then Title := Title + ' (' + SChanged + ')'; 347 Title:= Title + ' - ' + Core.ApplicationInfo.AppName; 348 Caption := Title; 347 349 AProjectSave.Enabled := Core.Project.Modified; 348 Title := Core.ApplicationInfo.AppName; 349 if Core.Project.FileName <> '' then Title := Core.Project.FileName + ' - ' + Title; 350 if Core.Project.Modified then Title := Title + ' *'; 351 Caption := Title; 352 FormSourceCode.MemoSource.Enabled := Core.Project.FileName <> ''; 353 AProjectClose.Enabled := Core.Project.FileName <> ''; 350 FormSourceCode.MemoSource.Enabled := Core.Project.Openned; 351 AProjectClose.Enabled := Core.Project.Openned; 352 AProjectSaveAs.Enabled := Core.Project.Openned; 354 353 AProgramRun.Enabled := (tcRun in CurrentTarget.Capabilities) and 355 (Core.Project.FileName <> '')and (CurrentTarget.State = rsStopped) or (CurrentTarget.State = rsPaused);354 Core.Project.Openned and (CurrentTarget.State = rsStopped) or (CurrentTarget.State = rsPaused); 356 355 AProgramPause.Enabled := (tcPause in CurrentTarget.Capabilities) and 357 (Core.Project.FileName <> '')and (CurrentTarget.State = rsRunning);356 Core.Project.Openned and (CurrentTarget.State = rsRunning); 358 357 AProgramStop.Enabled := (tcStop in CurrentTarget.Capabilities) and 359 (Core.Project.FileName <> '')and (CurrentTarget.State <> rsStopped);358 Core.Project.Openned and (CurrentTarget.State <> rsStopped); 360 359 AProgramCompile.Enabled := (tcCompile in CurrentTarget.Capabilities) and 361 (Core.Project.FileName <> '');360 Core.Project.Openned; 362 361 AProgramStepInto.Enabled := (tcStepInto in CurrentTarget.Capabilities) and 363 (Core.Project.FileName <> '')and ((CurrentTarget.State = rsPaused) or (CurrentTarget.State = rsStopped));362 Core.Project.Openned and ((CurrentTarget.State = rsPaused) or (CurrentTarget.State = rsStopped)); 364 363 AProgramStepOut.Enabled := (tcStepOut in CurrentTarget.Capabilities) and 365 (Core.Project.FileName <> '')and (CurrentTarget.State = rsPaused);364 Core.Project.Openned and (CurrentTarget.State = rsPaused); 366 365 AProgramRunToCursor.Enabled := (tcRunToCursor in CurrentTarget.Capabilities) and 367 (Core.Project.FileName <> '')and ((CurrentTarget.State = rsPaused) or (CurrentTarget.State = rsStopped));366 Core.Project.Openned and ((CurrentTarget.State = rsPaused) or (CurrentTarget.State = rsStopped)); 368 367 AProgramStepOver.Enabled := (tcStepOver in CurrentTarget.Capabilities) and 369 (Core.Project.FileName <> '')and ((CurrentTarget.State = rsPaused) or (CurrentTarget.State = rsStopped));368 Core.Project.Openned and ((CurrentTarget.State = rsPaused) or (CurrentTarget.State = rsStopped)); 370 369 AProgramShowExecutionPoint.Enabled := (tcPause in CurrentTarget.Capabilities) and 371 (Core.Project.FileName <> '')and (CurrentTarget.State = rsPaused);370 Core.Project.Openned and (CurrentTarget.State = rsPaused); 372 371 AShowSourcePosition.Enabled := CurrentTarget.Compiled; 373 372 AShowTargetPosition.Enabled := CurrentTarget.Compiled; … … 568 567 if Core.Project.Modified then AProjectSaveAs.Execute; 569 568 AProgramStop.Execute; 570 Core.Project. FileName := '';569 Core.Project.Openned := False; 571 570 FormSourceCode.MemoSource.Clear; 572 Core.Project.Modified := False;573 571 UpdateInterface; 574 572 end; … … 579 577 Core.Project.FileName := 'Examples' + DirectorySeparator + SNewProject + '.b'; 580 578 FormSourceCode.MemoSource.Clear; 581 Core.Project. Modified := False;579 Core.Project.Openned := True; 582 580 CurrentTarget.Compiled := False; 583 581 UpdateInterface; … … 592 590 begin 593 591 AProjectClose.Execute; 594 OpenDialog1.FileName := LastFileName; 595 OpenDialog1.InitialDir := ExtractFileDir(LastFileName); 592 if Core.LastOpenedList.Items.Count > 0 then 593 OpenDialog1.FileName := Core.LastOpenedList.Items[0] 594 else OpenDialog1.FileName := ExtractFileDir(Application.ExeName) + DirectorySeparator + 'Examples'; 595 OpenDialog1.InitialDir := ExtractFileDir(OpenDialog1.FileName); 596 596 if OpenDialog1.Execute then begin 597 LastFileName := OpenDialog1.FileName;598 597 ProjectOpen(OpenDialog1.FileName); 599 598 end; … … 614 613 procedure TMainForm.AProjectSaveExecute(Sender: TObject); 615 614 begin 616 if Core.Project.Modified then AProjectSaveAs.Execute; 615 if Core.Project.Modified and FileExistsUTF8(Core.Project.FileName) then begin 616 FormSourceCode.MemoSource.Lines.SaveToFile(UTF8Decode(Core.Project.FileName)); 617 Core.Project.Modified := False; 618 UpdateInterface; 619 end else AProjectSaveAs.Execute; 617 620 end; 618 621 -
trunk/Languages/LazFuckIDE.cs.po
r60 r62 104 104 msgctxt "tformlog.caption" 105 105 msgid "Log" 106 msgstr " "106 msgstr "Záznam" 107 107 108 108 #: tformmemory.caption … … 436 436 msgctxt "tmainform.aviewlog.caption" 437 437 msgid "Log" 438 msgstr " "438 msgstr "Záznam" 439 439 440 440 #: tmainform.caption … … 612 612 msgstr " kroků/s" 613 613 614 #: uformmain.schanged 615 msgid "Changed" 616 msgstr "ZmÄnÄno" 617 614 618 #: uformmain.scompilestart 615 619 msgid "Compiling..." … … 739 743 msgid "Read input error" 740 744 msgstr "Chyba Ätenà vstupu" 741 -
trunk/Languages/LazFuckIDE.po
r60 r62 599 599 msgstr "" 600 600 601 #: uformmain.schanged 602 msgid "Changed" 603 msgstr "" 604 601 605 #: uformmain.scompilestart 602 606 msgid "Compiling..." -
trunk/UProject.pas
r61 r62 9 9 10 10 type 11 12 { TProject } 13 11 14 TProject = class 15 private 16 FOpenned: Boolean; 17 procedure SetOpenned(AValue: Boolean); 18 public 12 19 Modified: Boolean; 13 20 FileName: string; 21 property Openned: Boolean read FOpenned write SetOpenned; 14 22 end; 15 23 16 24 implementation 17 25 26 { TProject } 27 28 29 procedure TProject.SetOpenned(AValue: Boolean); 30 begin 31 if FOpenned = AValue then Exit; 32 FOpenned := AValue; 33 if AValue then begin 34 Modified := False; 35 end else begin 36 FileName := ''; 37 end; 38 end; 39 18 40 end. 19 41
Note:
See TracChangeset
for help on using the changeset viewer.