Changeset 54 for trunk/IDE/Forms
- Timestamp:
- Jun 26, 2012, 7:41:11 AM (12 years ago)
- Location:
- trunk/IDE/Forms
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IDE/Forms/UFormMain.lfm
r53 r54 43 43 Top = 2 44 44 Action = AProjectOpen 45 DropdownMenu = PopupMenu1 46 Style = tbsDropDown 45 47 end 46 48 object ToolButton3: TToolButton 47 Left = 4749 Left = 59 48 50 Top = 2 49 51 Action = AProjectSave 50 52 end 51 53 object ToolButton4: TToolButton 52 Left = 7054 Left = 82 53 55 Top = 2 54 56 Action = AProjectClose 55 57 end 56 58 object ToolButton5: TToolButton 57 Left = 9359 Left = 105 58 60 Top = 2 59 61 Width = 10 … … 61 63 end 62 64 object ToolButton6: TToolButton 63 Left = 1 0365 Left = 115 64 66 Top = 2 65 67 Action = AViewOptions 66 68 end 67 69 object ToolButton7: TToolButton 68 Left = 1 2670 Left = 138 69 71 Top = 2 70 72 Action = ABuild 71 73 end 72 74 object ToolButton8: TToolButton 73 Left = 1 4975 Left = 161 74 76 Top = 2 75 77 Action = ARun 76 78 end 77 79 object ToolButton9: TToolButton 78 Left = 1 7280 Left = 184 79 81 Top = 2 80 82 Action = APause 81 83 end 82 84 object ToolButton10: TToolButton 83 Left = 19585 Left = 207 84 86 Top = 2 85 87 Action = AStop … … 869 871 end 870 872 object ImageList1: TImageList 871 left = 344872 top = 184873 left = 112 874 top = 272 873 875 Bitmap = { 874 876 4C690E0000001000000010000000000000000000000000000000000000000000 … … 1323 1325 } 1324 1326 end 1327 object PopupMenu1: TPopupMenu 1328 left = 196 1329 top = 54 1330 end 1325 1331 end -
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; -
trunk/IDE/Forms/UFormProject.pas
r53 r54 74 74 BeginUpdate; 75 75 Clear; 76 if Project.Activethen begin76 if Assigned(Project) then begin 77 77 NewNode := AddChild(nil, ExtractFileNameOnly(Project.FileName)); 78 78 UpdateProjectFiles(NewNode, Project.Files); -
trunk/IDE/Forms/UFormSourceCode.pas
r53 r54 40 40 procedure TFormSourceCode.SynEditSourceChange(Sender: TObject); 41 41 begin 42 if Core.Project.Activethen42 if Assigned(Core.Project) then 43 43 ProjectFile.Modified := True; 44 44 end; … … 61 61 procedure TFormSourceCode.UpdateInterface; 62 62 begin 63 SynEditSource.Enabled := Core.Project.Active;64 if not Core.Project.Activethen SynEditSource.ClearAll;63 SynEditSource.Enabled := Assigned(Core.Project); 64 if not Assigned(Core.Project) then SynEditSource.ClearAll; 65 65 end; 66 66 -
trunk/IDE/Forms/UFormTargetCode.pas
r53 r54 48 48 procedure TFormTargetCode.UpdateInterface; 49 49 begin 50 SynEdit1.Enabled := Core.Project.Active;51 if not Core.Project.Activethen SynEdit1.ClearAll;50 SynEdit1.Enabled := Assigned(Core.Project); 51 if not Assigned(Core.Project) then SynEdit1.ClearAll; 52 52 end; 53 53 -
trunk/IDE/Forms/UFormTargetProject.pas
r53 r54 41 41 BeginUpdate; 42 42 Clear; 43 if Project.Activethen begin43 if Assigned(Project) then begin 44 44 NewNode := AddChild(nil, ExtractFileNameOnly(TargetProject.FileName)); 45 45 UpdateProjectFiles(NewNode, TargetProject.Files);
Note:
See TracChangeset
for help on using the changeset viewer.