Changeset 145 for trunk/Forms
- Timestamp:
- Jun 5, 2023, 6:44:57 PM (19 months ago)
- Location:
- trunk/Forms
- Files:
-
- 39 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormCPU.lfm
r144 r145 8 8 ClientWidth = 621 9 9 DesignTimePPI = 144 10 LCLVersion = '2.0.0.4' 10 OnCreate = FormCreate 11 LCLVersion = '2.2.6.0' 11 12 object Label4: TLabel 12 13 Left = 12 13 Height = 2 514 Height = 26 14 15 Top = 72 15 Width = 1 0416 Width = 112 16 17 Caption = 'Step counter:' 17 18 ParentColor = False … … 20 21 object Label7: TLabel 21 22 Left = 12 22 Height = 2 523 Height = 26 23 24 Top = 108 24 Width = 5 425 Width = 57 25 26 Caption = 'Speed:' 26 27 ParentColor = False … … 29 30 object LabelStepSpeed: TLabel 30 31 Left = 288 31 Height = 2 532 Height = 26 32 33 Top = 108 33 34 Width = 15 … … 38 39 object LabelStepCounter: TLabel 39 40 Left = 288 40 Height = 2 541 Height = 26 41 42 Top = 72 42 43 Width = 15 … … 47 48 object LabelMemoryPointer: TLabel 48 49 Left = 288 49 Height = 2 550 Height = 26 50 51 Top = 36 51 52 Width = 15 … … 56 57 object LabelProgramPointer: TLabel 57 58 Left = 288 58 Height = 2 559 Height = 26 59 60 Top = 0 60 61 Width = 15 … … 65 66 object Label3: TLabel 66 67 Left = 12 67 Height = 2 568 Height = 26 68 69 Top = 0 69 Width = 1 3570 Width = 145 70 71 Caption = 'Program pointer:' 71 72 ParentColor = False … … 74 75 object Label5: TLabel 75 76 Left = 12 76 Height = 2 577 Height = 26 77 78 Top = 36 78 Width = 1 3379 Width = 141 79 80 Caption = 'Memory pointer:' 80 81 ParentColor = False -
trunk/Forms/FormCPU.pas
r144 r145 1 unit UFormCPU;1 unit FormCPU; 2 2 3 3 interface … … 20 20 LabelStepCounter: TLabel; 21 21 LabelStepSpeed: TLabel; 22 private22 procedure FormCreate(Sender: TObject); 23 23 public 24 24 LastStepCounter: Integer; … … 29 29 FormCPU: TFormCPU; 30 30 31 31 32 implementation 32 33 33 34 uses 34 UCore, UTargetInterpretter;35 Core, TargetInterpretter; 35 36 36 37 {$R *.lfm} … … 41 42 { TFormCPU } 42 43 44 procedure TFormCPU.FormCreate(Sender: TObject); 45 begin 46 Core.Core.Translator.TranslateComponentRecursive(Self); 47 Core.Core.ThemeManager.UseTheme(Self); 48 end; 49 43 50 procedure TFormCPU.Reload; 44 51 begin 45 if Core.C urrentTarget is TTargetInterpretter then46 with TTargetInterpretter(Core.C urrentTarget) do begin52 if Core.Core.CurrentTarget is TTargetInterpretter then 53 with TTargetInterpretter(Core.Core.CurrentTarget) do begin 47 54 LabelProgramPointer.Caption := IntToStr(ProgramIndex); 48 55 LabelMemoryPointer.Caption := IntToStr(MemoryPosition); -
trunk/Forms/FormCompileMultiple.pas
r144 r145 1 unit UFormCompileMultiple;1 unit FormCompileMultiple; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls, 7 UTarget, fgl;7 Target, fgl; 8 8 9 9 type … … 20 20 procedure FormDestroy(Sender: TObject); 21 21 procedure FormShow(Sender: TObject); 22 procedure ListViewTargetsSelectItem(Sender: TObject; Item: TListItem;23 Selected: Boolean);24 22 private 25 23 FTargets: TTargets; … … 29 27 end; 30 28 31 var32 FormCompileMultiple: TFormCompileMultiple;33 34 29 35 30 implementation … … 38 33 39 34 uses 40 UCore;35 Core; 41 36 42 37 procedure TFormCompileMultiple.FormCreate(Sender: TObject); 43 38 begin 44 Core. Translator.TranslateComponentRecursive(Self);45 Core. ThemeManager.UseTheme(Self);39 Core.Core.Translator.TranslateComponentRecursive(Self); 40 Core.Core.ThemeManager.UseTheme(Self); 46 41 end; 47 42 … … 49 44 var CloseAction: TCloseAction); 50 45 begin 51 Core. PersistentForm1.Save(Self);46 Core.Core.PersistentForm1.Save(Self); 52 47 end; 53 48 … … 67 62 procedure TFormCompileMultiple.FormShow(Sender: TObject); 68 63 begin 69 Core. PersistentForm1.Load(Self);64 Core.Core.PersistentForm1.Load(Self); 70 65 ReloadList; 71 end;72 73 procedure TFormCompileMultiple.ListViewTargetsSelectItem(Sender: TObject;74 Item: TListItem; Selected: Boolean);75 begin76 77 66 end; 78 67 -
trunk/Forms/FormInput.pas
r144 r145 1 unit UFormInput;1 unit FormInput; 2 2 3 3 interface … … 14 14 MemoInput: TMemo; 15 15 procedure MemoInputKeyPress(Sender: TObject; var Key: char); 16 private17 { private declarations }18 public19 { public declarations }20 16 end; 21 22 var23 FormInput: TFormInput;24 17 25 18 … … 29 22 30 23 uses 31 UCore, UTargetInterpretter;24 Core, TargetInterpretter; 32 25 33 26 procedure TFormInput.MemoInputKeyPress(Sender: TObject; var Key: char); 34 27 begin 35 if Core.C urrentTarget is TTargetInterpretter then36 with TTargetInterpretter(Core.C urrentTarget) do28 if Core.Core.CurrentTarget is TTargetInterpretter then 29 with TTargetInterpretter(Core.Core.CurrentTarget) do 37 30 Input := Input + Key; 38 31 end; -
trunk/Forms/FormLog.pas
r144 r145 1 unit UFormLog;1 unit FormLog; 2 2 3 3 interface … … 13 13 Memo1: TMemo; 14 14 procedure FormCreate(Sender: TObject); 15 private16 { private declarations }17 public18 { public declarations }19 15 end; 20 16 21 var22 FormLog: TFormLog;23 17 24 18 implementation … … 27 21 28 22 uses 29 UCore;23 Core; 30 24 31 25 { TFormLog } … … 33 27 procedure TFormLog.FormCreate(Sender: TObject); 34 28 begin 35 Core. Translator.TranslateComponentRecursive(Self);36 Core. ThemeManager.UseTheme(Self);29 Core.Core.Translator.TranslateComponentRecursive(Self); 30 Core.Core.ThemeManager.UseTheme(Self); 37 31 end; 38 32 -
trunk/Forms/FormMain.pas
r144 r145 1 unit UFormMain;1 unit FormMain; 2 2 3 3 interface 4 4 5 5 uses 6 Classes, SysUtils, FileUtil, Forms, Controls, 7 Graphics, Dialogs, Menus, ActnList, ComCtrls, ExtCtrls, UTarget, Registry, 8 URegistry, LazFileUtils; 6 Classes, SysUtils, FileUtil, Forms, Controls, FormCPU, FormInput, 7 Graphics, Dialogs, Menus, ActnList, ComCtrls, ExtCtrls, Target, Registry, 8 LazFileUtils, FormOptions, FormMessages, FormTargets, 9 FormOutput, FormMemory, FormSourceCode, FormTargetCode, FormLog, 10 FormCompileMultiple; 9 11 10 12 type … … 144 146 procedure TimerRefreshTimer(Sender: TObject); 145 147 private 148 FormCPU: TFormCPU; 149 FormInput: TFormInput; 150 FormLog: TFormLog; 151 FormMemory: TFormMemory; 152 FormMessages: TFormMessages; 153 FormOutput: TFormOutput; 154 FormSourceCode: TFormSourceCode; 155 FormTargetCode: TFormTargetCode; 146 156 procedure AProjectOpenRecentExecute(Sender: TObject); 147 157 procedure MenuItemTargetClick(Sender: TObject); … … 151 161 procedure DockInit; 152 162 procedure LastOpenedListChange(Sender: TObject); 163 procedure CurrentTargetChangeExecute(Sender: TObject); 153 164 public 154 165 procedure MessagesChanged(Sender: TObject); 155 166 procedure TargetLogExecute(Lines: TStrings); 156 167 procedure TargetStateChanged(Sender: TObject); 157 procedure LoadFromRegistry(Context: TRegistryContext);158 procedure SaveToRegistry(Context: TRegistryContext);159 168 procedure UpdateInterface; 160 169 procedure UpdateStatusBar; … … 162 171 end; 163 172 164 var165 FormMain: TFormMain;166 167 173 168 174 implementation … … 171 177 172 178 uses 173 UCore, UFormCPU, UFormOptions, UFormMessages, UFormTargets, UFormOutput, UFormInput, 174 UFormMemory, UFormSourceCode, UFormTargetCode, UTargetInterpretter, UFormLog, 175 UBFTarget, UCommon, UFormCompileMultiple; 179 Core, TargetInterpretter, BFTarget, Common; 176 180 177 181 resourcestring … … 195 199 procedure TFormMain.FormShow(Sender: TObject); 196 200 begin 197 Core.Init; 198 LoadFromRegistry(Core.ApplicationInfo.GetRegistryContext); 201 Core.Core.Init; 199 202 PageControlMain.TabIndex := 0; 200 203 try 201 if Core. OpenProjectOnStart and (Core.LastOpenedList.Items.Count > 0) and202 FileExists(Core. LastOpenedList.Items[0]) then203 ProjectOpen(Core. LastOpenedList.Items[0])204 if Core.Core.OpenProjectOnStart and (Core.Core.LastOpenedList.Items.Count > 0) and 205 FileExists(Core.Core.LastOpenedList.Items[0]) then 206 ProjectOpen(Core.Core.LastOpenedList.Items[0]) 204 207 else AProjectNew.Execute; 205 208 finally … … 209 212 UpdateTargetList; 210 213 DockInit; 211 Core. PersistentForm1.Load(Self, True);212 Core. ThemeManager.UseTheme(Self);214 Core.Core.PersistentForm1.Load(Self, True); 215 Core.Core.ThemeManager.UseTheme(Self); 213 216 FormSourceCode.UpdateTheme; 214 217 end; 215 Core. Messages.OnChange := FormMain.MessagesChanged;218 Core.Core.Messages.OnChange := MessagesChanged; 216 219 end; 217 220 … … 232 235 begin 233 236 UpdateInterface; 234 if Core.C urrentTarget.State = rsPaused then237 if Core.Core.CurrentTarget.State = rsPaused then 235 238 AProgramShowExecutionPoint.Execute; 236 if Core.C urrentTarget.State = rsStopped then237 Core. Messages.AddMessage(SProgramStopped);239 if Core.Core.CurrentTarget.State = rsStopped then 240 Core.Core.Messages.AddMessage(SProgramStopped); 238 241 end; 239 242 … … 249 252 if Sender is TMenuItem then 250 253 with TMenuItem(Sender) do begin 251 Core.C urrentTarget := TTarget(Core.Targets[MenuIndex]);254 Core.Core.CurrentTarget := Core.Core.Targets[MenuIndex]; 252 255 Checked := True; 253 256 for I := 0 to Parent.Count - 1 do … … 258 261 procedure TFormMain.ProjectOpen(FileName: string); 259 262 begin 260 if Core.Project.Openned then 261 raise Exception.Create(SCloseProjectFirst); 262 FormSourceCode.SynEditSource.Lines.LoadFromFile(FileName); 263 Core.AddItemToLastOpenedList(FileName); 264 Core.Project.FileName := FileName; 265 Core.Project.Openned := True; 266 Core.CurrentTarget.Compiled := False; 263 with Core.Core do begin 264 if Project.Openned then 265 raise Exception.Create(SCloseProjectFirst); 266 FormSourceCode.SynEditSource.Lines.LoadFromFile(FileName); 267 AddItemToLastOpenedList(FileName); 268 Project.FileName := FileName; 269 Project.Openned := True; 270 CurrentTarget.Compiled := False; 271 end; 267 272 UpdateInterface; 268 273 end; … … 292 297 DockForm(FormMemory, PanelMemory); 293 298 DockForm(FormMessages, TabSheetMessages); 294 PageControlRight.Width := FormMain.Width div 3;295 PageControlBottom.Height := FormMain.Height div 5;299 PageControlRight.Width := Width div 3; 300 PageControlBottom.Height := Height div 5; 296 301 end; 297 302 298 303 procedure TFormMain.LastOpenedListChange(Sender: TObject); 299 304 begin 300 Core.LastOpenedList.LoadToMenuItem(MenuItemOpenRecent, AProjectOpenRecentExecute); 301 Core.LastOpenedList.LoadToMenuItem(PopupMenuRecentFiles.Items, AProjectOpenRecentExecute); 302 end; 303 304 procedure TFormMain.LoadFromRegistry(Context: TRegistryContext); 305 var 306 TargetName: string; 307 begin 308 with TRegistryEx.Create do 309 try 310 CurrentContext := Context; 311 TargetName := ReadStringWithDefault('TargetName', 'Interpretter'); 312 Core.CurrentTarget := Core.Targets.FindByName(TargetName); 313 if not Assigned(Core.CurrentTarget) then 314 Core.CurrentTarget := TTarget(Core.Targets[0]); 315 Core.Optimizations.AddSub := ReadBoolWithDefault('OptimizationAddSubEnabled', True); 316 Core.Optimizations.SetZero := ReadBoolWithDefault('OptimizationSetZeroEnabled', True); 317 Core.Optimizations.Merge := ReadBoolWithDefault('OptimizationMerge', True); 318 Core.Optimizations.CopyMultiply := ReadBoolWithDefault('OptimizationCopyMultiplyEnabled', True); 319 Core.Optimizations.RelativeIndexes := ReadBoolWithDefault('OptimizationRelativeIndexesEnabled', True); 320 finally 321 Free; 322 end; 323 end; 324 325 procedure TFormMain.SaveToRegistry(Context: TRegistryContext); 326 begin 327 with TRegistryEx.Create do 328 try 329 CurrentContext := Context; 330 WriteString('TargetName', Core.CurrentTarget.Name); 331 WriteBool('OptimizationAddSubEnabled', Core.Optimizations.AddSub); 332 WriteBool('OptimizationSetZeroEnabled', Core.Optimizations.SetZero); 333 WriteBool('OptimizationMerge', Core.Optimizations.Merge); 334 WriteBool('OptimizationCopyMultiplyEnabled', Core.Optimizations.CopyMultiply); 335 WriteBool('OptimizationRelativeIndexesEnabled', Core.Optimizations.RelativeIndexes); 336 finally 337 Free; 338 end; 305 Core.Core.LastOpenedList.LoadToMenuItem(MenuItemOpenRecent, AProjectOpenRecentExecute); 306 Core.Core.LastOpenedList.LoadToMenuItem(PopupMenuRecentFiles.Items, AProjectOpenRecentExecute); 307 end; 308 309 procedure TFormMain.CurrentTargetChangeExecute(Sender: TObject); 310 begin 311 UpdateTargetList; 312 UpdateInterface; 339 313 end; 340 314 … … 345 319 begin 346 320 Title := ''; 347 if Core.Project.FileName <> '' then Title := Core.Project.FileName; 348 if Core.Project.Modified then Title := Title + ' (' + SChanged + ')'; 349 Title:= Title + ' - ' + Core.ApplicationInfo.AppName; 350 Caption := Title; 351 AProjectSave.Enabled := Core.Project.Modified; 352 FormSourceCode.SynEditSource.Enabled := Core.Project.Openned; 353 AProjectClose.Enabled := Core.Project.Openned; 354 AProjectSaveAs.Enabled := Core.Project.Openned; 355 AProgramRun.Enabled := (tcRun in Core.CurrentTarget.Capabilities) and 356 Core.Project.Openned and (Core.CurrentTarget.State = rsStopped) or (Core.CurrentTarget.State = rsPaused); 357 AProgramPause.Enabled := (tcPause in Core.CurrentTarget.Capabilities) and 358 Core.Project.Openned and (Core.CurrentTarget.State = rsRunning); 359 AProgramStop.Enabled := (tcStop in Core.CurrentTarget.Capabilities) and 360 Core.Project.Openned and (Core.CurrentTarget.State <> rsStopped); 361 AProgramCompile.Enabled := (tcCompile in Core.CurrentTarget.Capabilities) and 362 Core.Project.Openned; 363 CanDebug := Core.DebugEnabled and Core.Project.Openned and 364 ((Core.CurrentTarget.State = rsPaused) or (Core.CurrentTarget.State = rsStopped)); 365 AProgramStepInto.Enabled := CanDebug and (tcStepInto in Core.CurrentTarget.Capabilities); 366 AProgramStepOut.Enabled := CanDebug and (tcStepOut in Core.CurrentTarget.Capabilities); 367 AProgramRunToCursor.Enabled := CanDebug and (tcRunToCursor in Core.CurrentTarget.Capabilities); 368 AProgramStepOver.Enabled := CanDebug and (tcStepOver in Core.CurrentTarget.Capabilities); 369 AProgramShowExecutionPoint.Enabled := CanDebug and (tcPause in Core.CurrentTarget.Capabilities); 370 AShowSourcePosition.Enabled := Core.CurrentTarget.Compiled; 371 AShowTargetPosition.Enabled := Core.CurrentTarget.Compiled; 321 with Core.Core do begin 322 if Project.FileName <> '' then Title := Project.FileName; 323 if Project.Modified then Title := Title + ' (' + SChanged + ')'; 324 Title:= Title + ' - ' + ApplicationInfo.AppName; 325 Caption := Title; 326 AProjectSave.Enabled := Project.Modified; 327 FormSourceCode.SynEditSource.Enabled := Project.Openned; 328 AProjectClose.Enabled := Project.Openned; 329 AProjectSaveAs.Enabled := Project.Openned; 330 AProgramRun.Enabled := (tcRun in CurrentTarget.Capabilities) and 331 Project.Openned and (CurrentTarget.State = rsStopped) or (CurrentTarget.State = rsPaused); 332 AProgramPause.Enabled := (tcPause in CurrentTarget.Capabilities) and 333 Project.Openned and (CurrentTarget.State = rsRunning); 334 AProgramStop.Enabled := (tcStop in CurrentTarget.Capabilities) and 335 Project.Openned and (CurrentTarget.State <> rsStopped); 336 AProgramCompile.Enabled := (tcCompile in CurrentTarget.Capabilities) and 337 Project.Openned; 338 CanDebug := DebugEnabled and Project.Openned and 339 ((CurrentTarget.State = rsPaused) or (CurrentTarget.State = rsStopped)); 340 AProgramStepInto.Enabled := CanDebug and (tcStepInto in CurrentTarget.Capabilities); 341 AProgramStepOut.Enabled := CanDebug and (tcStepOut in CurrentTarget.Capabilities); 342 AProgramRunToCursor.Enabled := CanDebug and (tcRunToCursor in CurrentTarget.Capabilities); 343 AProgramStepOver.Enabled := CanDebug and (tcStepOver in CurrentTarget.Capabilities); 344 AProgramShowExecutionPoint.Enabled := CanDebug and (tcPause in CurrentTarget.Capabilities); 345 AShowSourcePosition.Enabled := CurrentTarget.Compiled; 346 AShowTargetPosition.Enabled := CurrentTarget.Compiled; 347 end; 372 348 UpdateStatusBar; 373 349 end; … … 383 359 I: Integer; 384 360 begin 385 Core. Targets.LoadToMenuItem(MenuItemTarget, MenuItemTargetClick,Core.CurrentTarget);386 Core. Targets.LoadToMenuItem(PopupMenuTargets.Items, MenuItemTargetClick,Core.CurrentTarget);361 Core.Core.Targets.LoadToMenuItem(MenuItemTarget, MenuItemTargetClick, Core.Core.CurrentTarget); 362 Core.Core.Targets.LoadToMenuItem(PopupMenuTargets.Items, MenuItemTargetClick, Core.Core.CurrentTarget); 387 363 388 364 // Update toolbutton 389 I := Core. Targets.IndexOf(Core.CurrentTarget);365 I := Core.Core.Targets.IndexOf(Core.Core.CurrentTarget); 390 366 if I <> -1 then 391 with TTarget(Core. Targets[I]) do begin367 with TTarget(Core.Core.Targets[I]) do begin 392 368 ToolButtonTarget.ImageIndex := ImageIndex; 393 369 ToolButtonTarget.Caption := Name; … … 398 374 procedure TFormMain.FormCreate(Sender: TObject); 399 375 begin 376 Core.Core.Translator.TranslateComponentRecursive(Self); 377 Core.Core.ThemeManager.UseTheme(Self); 378 379 FormSourceCode := TFormSourceCode.Create(nil); 380 FormCPU := TFormCPU.Create(nil); 381 FormInput := TFormInput.Create(nil); 382 FormLog := TFormLog.Create(nil); 383 FormMemory := TFormMemory.Create(nil); 384 FormMessages := TFormMessages.Create(nil); 385 FormOutput := TFormOutput.Create(nil); 386 FormTargetCode := TFormTargetCode.Create(nil); 387 400 388 UpdateTargetList; 401 Core.LastOpenedList.OnChange := LastOpenedListChange; 389 with Core.Core do begin 390 LastOpenedList.OnChange := LastOpenedListChange; 391 OnCurrentTargetChange := CurrentTargetChangeExecute; 392 OnTargetChangeState := TargetStateChanged; 393 OnTargetLog := TargetLogExecute; 394 end; 402 395 end; 403 396 404 397 procedure TFormMain.FormDestroy(Sender: TObject); 405 398 begin 406 SaveToRegistry(Core.ApplicationInfo.GetRegistryContext); 399 FreeAndNil(FormSourceCode); 400 FreeAndNil(FormCPU); 401 FreeAndNil(FormInput); 402 FreeAndNil(FormLog); 403 FreeAndNil(FormMemory); 404 FreeAndNil(FormMessages); 405 FreeAndNil(FormOutput); 406 FreeAndNil(FormTargetCode); 407 407 end; 408 408 409 409 procedure TFormMain.AProgramRunExecute(Sender: TObject); 410 410 begin 411 if Core.C urrentTarget is TTargetInterpretter then412 TTargetInterpretter(Core.C urrentTarget).Input := FormInput.MemoInput.Lines.Text;413 if not Core.C urrentTarget.Compiled then AProgramCompile.Execute;414 Core.C urrentTarget.Run;415 Core. Messages.AddMessage(SProgramStarted);411 if Core.Core.CurrentTarget is TTargetInterpretter then 412 TTargetInterpretter(Core.Core.CurrentTarget).Input := FormInput.MemoInput.Lines.Text; 413 if not Core.Core.CurrentTarget.Compiled then AProgramCompile.Execute; 414 Core.Core.CurrentTarget.Run; 415 Core.Core.Messages.AddMessage(SProgramStarted); 416 416 end; 417 417 … … 420 420 DebugStep: TDebugStep; 421 421 begin 422 DebugStep := Core.C urrentTarget.DebugSteps.SearchByTargetPos(FormTargetCode.SynEditTarget.SelStart - 1);422 DebugStep := Core.Core.CurrentTarget.DebugSteps.SearchByTargetPos(FormTargetCode.SynEditTarget.SelStart - 1); 423 423 if Assigned(DebugStep) then begin 424 424 FormSourceCode.SynEditSource.SelStart := DebugStep.SourcePosition + 1; … … 431 431 DebugStep: TDebugStep; 432 432 begin 433 DebugStep := Core.C urrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEditSource.SelStart - 1);433 DebugStep := Core.Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEditSource.SelStart - 1); 434 434 if Assigned(DebugStep) then begin 435 435 FormTargetCode.SynEditTarget.SelStart := DebugStep.TargetPosition + 1; … … 461 461 procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction); 462 462 begin 463 Core.PersistentForm1.Save(Self); 463 Core.Core.PersistentForm1.Save(Self); 464 Application.Terminate; 464 465 end; 465 466 466 467 procedure TFormMain.FormCloseQuery(Sender: TObject; var CanClose: boolean); 467 468 begin 468 if Core. Project.Modified then begin469 if Core.Core.Project.Modified then begin 469 470 AProjectClose.Execute; 470 if Core. Project.Openned then CanClose := False;471 if Core.Core.Project.Openned then CanClose := False; 471 472 end; 472 473 end; … … 478 479 479 480 procedure TFormMain.AOptionsExecute(Sender: TObject); 481 var 482 FormOptions: TFormOptions; 480 483 begin 481 484 FormOptions := TFormOptions.Create(nil); … … 484 487 if FormOptions.ShowModal = mrOK then begin 485 488 FormOptions.Save; 486 if Assigned(Core.C urrentTarget) then begin487 Core.C urrentTarget.OptimizationLevel :=Core.OptimizationLevel;488 if Core.C urrentTarget is TBFTarget then begin489 TBFTarget(Core.C urrentTarget).CellSize :=Core.CellSize;490 TBFTarget(Core.C urrentTarget).MemorySize :=Core.MemorySize;489 if Assigned(Core.Core.CurrentTarget) then begin 490 Core.Core.CurrentTarget.OptimizationLevel := Core.Core.OptimizationLevel; 491 if Core.Core.CurrentTarget is TBFTarget then begin 492 TBFTarget(Core.Core.CurrentTarget).CellSize := Core.Core.CellSize; 493 TBFTarget(Core.Core.CurrentTarget).MemorySize := Core.Core.MemorySize; 491 494 end; 492 495 end; 493 Core. ThemeManager.UseTheme(Self);496 Core.Core.ThemeManager.UseTheme(Self); 494 497 FormSourceCode.UpdateTheme; 495 Core.SaveToRegistry(Core.ApplicationInfo.GetRegistryContext); 496 SaveToRegistry(Core.ApplicationInfo.GetRegistryContext); 498 Core.Core.SaveToRegistry(Core.Core.ApplicationInfo.GetRegistryContext); 497 499 end; 498 500 finally … … 503 505 procedure TFormMain.AProgramCompileExecute(Sender: TObject); 504 506 begin 505 with Core.C urrentTarget do507 with Core.Core, CurrentTarget do 506 508 try 507 Core.Messages.Clear;509 Messages.Clear; 508 510 AProgramStop.Execute; 509 511 SourceCode := FormSourceCode.SynEditSource.Text; 510 ProjectFileName := Core.Project.FileName;511 ProgramName := ExtractFileNameOnly( Core.Project.FileName);512 if C ore.CurrentTarget is TBFTarget then513 TBFTarget(C ore.CurrentTarget).Optimizations := Core.Optimizations;514 DebugEnabled := Core.DebugEnabled;515 Core.Messages.AddMessage(SCompileStart);512 ProjectFileName := Project.FileName; 513 ProgramName := ExtractFileNameOnly(Project.FileName); 514 if CurrentTarget is TBFTarget then 515 TBFTarget(CurrentTarget).Optimizations := Optimizations; 516 DebugEnabled := DebugEnabled; 517 Messages.AddMessage(SCompileStart); 516 518 Application.ProcessMessages; 517 519 Compile; 518 Core.Messages.AppendMessage(SDone);520 Messages.AppendMessage(SDone); 519 521 FormTargetCode.SynEditTarget.Text := TargetCode; 520 FormTargetCode.SetHighlighter(C ore.CurrentTarget.SourceExtension);522 FormTargetCode.SetHighlighter(CurrentTarget.SourceExtension); 521 523 UpdateInterface; 522 524 except … … 533 535 with TFormCompileMultiple.Create(nil) do 534 536 try 535 Targets := Core. Targets;537 Targets := Core.Core.Targets; 536 538 if ShowModal = mrOk then begin 537 Core. Messages.Clear;539 Core.Core.Messages.Clear; 538 540 for I := 0 to Targets.Count - 1 do 539 541 with Targets[I] do … … 542 544 AProgramStop.Execute; 543 545 SourceCode := FormSourceCode.SynEditSource.Text; 544 ProjectFileName := Core. Project.FileName;545 ProgramName := ExtractFileNameOnly(Core. Project.FileName);546 ProjectFileName := Core.Core.Project.FileName; 547 ProgramName := ExtractFileNameOnly(Core.Core.Project.FileName); 546 548 if Targets[I] is TBFTarget then 547 TBFTarget(Targets[I]).Optimizations := Core. Optimizations;548 DebugEnabled := Core. DebugEnabled;549 Core. Messages.AddMessage(Name + ' ' + SCompileStart);549 TBFTarget(Targets[I]).Optimizations := Core.Core.Optimizations; 550 DebugEnabled := Core.Core.DebugEnabled; 551 Core.Core.Messages.AddMessage(Name + ' ' + SCompileStart); 550 552 Application.ProcessMessages; 551 553 Compile; 552 Core. Messages.AppendMessage(SDone);554 Core.Core.Messages.AppendMessage(SDone); 553 555 FormTargetCode.SynEditTarget.Text := TargetCode; 554 FormTargetCode.SetHighlighter(Core.C urrentTarget.SourceExtension);556 FormTargetCode.SetHighlighter(Core.Core.CurrentTarget.SourceExtension); 555 557 UpdateInterface; 556 558 except … … 569 571 BreakPoint: TBreakPoint; 570 572 begin 571 DebugStep := Core.C urrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEditSource.SelStart - 1);573 DebugStep := Core.Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEditSource.SelStart - 1); 572 574 if Assigned(DebugStep) then begin 573 BreakPoint := Core.C urrentTarget.BreakPoints.SearchByTargetPos(DebugStep.ProgramPosition);575 BreakPoint := Core.Core.CurrentTarget.BreakPoints.SearchByTargetPos(DebugStep.ProgramPosition); 574 576 if Assigned(BreakPoint) then 575 Core.C urrentTarget.BreakPoints.Delete(Core.CurrentTarget.BreakPoints.IndexOf(BreakPoint))576 else Core.C urrentTarget.BreakPoints.AddItem(DebugStep.ProgramPosition);577 Core.Core.CurrentTarget.BreakPoints.Delete(Core.Core.CurrentTarget.BreakPoints.IndexOf(BreakPoint)) 578 else Core.Core.CurrentTarget.BreakPoints.AddItem(DebugStep.ProgramPosition); 577 579 end; 578 580 end; … … 580 582 procedure TFormMain.AAboutExecute(Sender: TObject); 581 583 begin 582 Core. AboutDialog.Show;584 Core.Core.AboutDialog.Show; 583 585 end; 584 586 585 587 procedure TFormMain.AProgramPauseExecute(Sender: TObject); 586 588 begin 587 Core.C urrentTarget.Pause;589 Core.Core.CurrentTarget.Pause; 588 590 end; 589 591 … … 592 594 DebugStep: TDebugStep; 593 595 begin 594 if Core.C urrentTarget.State = rsStopped then begin595 if not Core.C urrentTarget.Compiled then AProgramCompile.Execute;596 DebugStep := Core.C urrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEditSource.SelStart - 1);597 Core.C urrentTarget.BreakPoints.SetSystem(DebugStep.ProgramPosition);596 if Core.Core.CurrentTarget.State = rsStopped then begin 597 if not Core.Core.CurrentTarget.Compiled then AProgramCompile.Execute; 598 DebugStep := Core.Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEditSource.SelStart - 1); 599 Core.Core.CurrentTarget.BreakPoints.SetSystem(DebugStep.ProgramPosition); 598 600 AProgramRun.Execute; 599 601 end else begin 600 DebugStep := Core.C urrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEditSource.SelStart - 1);601 Core.C urrentTarget.RunToCursor(DebugStep.ProgramPosition);602 DebugStep := Core.Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEditSource.SelStart - 1); 603 Core.Core.CurrentTarget.RunToCursor(DebugStep.ProgramPosition); 602 604 end; 603 605 end; … … 607 609 DebugStep: TDebugStep; 608 610 begin 609 DebugStep := Core.CurrentTarget.DebugSteps.SearchByProgramPos(Core.CurrentTarget.ExecutionPosition); 611 DebugStep := Core.Core.CurrentTarget.DebugSteps.SearchByProgramPos( 612 Core.Core.CurrentTarget.ExecutionPosition); 610 613 FormSourceCode.SynEditSource.SelStart := DebugStep.SourcePosition + 1; 611 614 FormTargetCode.SynEditTarget.SelStart := DebugStep.TargetPosition + 1; … … 616 619 procedure TFormMain.AProgramStepIntoExecute(Sender: TObject); 617 620 begin 618 if Core.CurrentTarget.State = rsStopped then begin 619 if not Core.CurrentTarget.Compiled then AProgramCompile.Execute; 620 Core.CurrentTarget.BreakPoints.SetSystem(Core.CurrentTarget.DebugSteps.First.ProgramPosition); 621 if Core.Core.CurrentTarget.State = rsStopped then begin 622 if not Core.Core.CurrentTarget.Compiled then AProgramCompile.Execute; 623 Core.Core.CurrentTarget.BreakPoints.SetSystem( 624 Core.Core.CurrentTarget.DebugSteps.First.ProgramPosition); 621 625 AProgramRun.Execute; 622 end else Core.C urrentTarget.StepInto;626 end else Core.Core.CurrentTarget.StepInto; 623 627 end; 624 628 625 629 procedure TFormMain.AProgramStepOutExecute(Sender: TObject); 626 630 begin 627 Core.C urrentTarget.StepOut;631 Core.Core.CurrentTarget.StepOut; 628 632 end; 629 633 630 634 procedure TFormMain.AProgramStepOverExecute(Sender: TObject); 631 635 begin 632 if Core.CurrentTarget.State = rsStopped then begin 633 if not Core.CurrentTarget.Compiled then AProgramCompile.Execute; 634 Core.CurrentTarget.BreakPoints.SetSystem(TDebugStep(Core.CurrentTarget.DebugSteps.First).ProgramPosition); 636 if Core.Core.CurrentTarget.State = rsStopped then begin 637 if not Core.Core.CurrentTarget.Compiled then AProgramCompile.Execute; 638 Core.Core.CurrentTarget.BreakPoints.SetSystem( 639 TDebugStep(Core.Core.CurrentTarget.DebugSteps.First).ProgramPosition); 635 640 AProgramRun.Execute; 636 end else Core.C urrentTarget.StepOver;641 end else Core.Core.CurrentTarget.StepOver; 637 642 end; 638 643 639 644 procedure TFormMain.AProgramStopExecute(Sender: TObject); 640 645 begin 641 Core.C urrentTarget.Stop;646 Core.Core.CurrentTarget.Stop; 642 647 end; 643 648 … … 647 652 begin 648 653 DialogResult := mrNo; 649 if Core. Project.Modified then begin654 if Core.Core.Project.Modified then begin 650 655 DialogResult := MessageDlg(SUnsavedChanges, SDoYouWantToSaveProject, mtConfirmation, [mbYes, mbNo, mbCancel], 0); 651 656 if DialogResult = mrYes then begin … … 655 660 if (DialogResult = mrNo) or (DialogResult = mrYes) then begin 656 661 AProgramStop.Execute; 657 Core. Project.Openned := False;662 Core.Core.Project.Openned := False; 658 663 FormSourceCode.SynEditSource.Clear; 659 664 UpdateInterface; … … 664 669 begin 665 670 AProjectClose.Execute; 666 if Core. Project.Openned then Exit;667 Core. Project.FileName := CombinePaths(Core.DataDir, ExamplesDir + DirectorySeparator + SNewProject + '.b');671 if Core.Core.Project.Openned then Exit; 672 Core.Core.Project.FileName := CombinePaths(Core.Core.DataDir, ExamplesDir + DirectorySeparator + SNewProject + '.b'); 668 673 FormSourceCode.SynEditSource.Clear; 669 Core. Project.Openned := True;670 Core.C urrentTarget.Compiled := False;674 Core.Core.Project.Openned := True; 675 Core.Core.CurrentTarget.Compiled := False; 671 676 UpdateInterface; 672 677 end; … … 676 681 FileName: string; 677 682 begin 678 FileName := Core. LastOpenedList.Items[TMenuItem(Sender).MenuIndex];683 FileName := Core.Core.LastOpenedList.Items[TMenuItem(Sender).MenuIndex]; 679 684 if FileExists(FileName) then begin 680 685 AProjectClose.Execute; 681 if Core. Project.Openned then Exit;686 if Core.Core.Project.Openned then Exit; 682 687 ProjectOpen(FileName); 683 688 end else ShowMessage(Format(SFileNotFound, [FileName])); … … 688 693 FileName: string; 689 694 begin 690 if Core. LastOpenedList.Items.Count > 0 then691 FileName := Core. LastOpenedList.Items[0]692 else FileName := CombinePaths(Core. DataDir, ExamplesDir);695 if Core.Core.LastOpenedList.Items.Count > 0 then 696 FileName := Core.Core.LastOpenedList.Items[0] 697 else FileName := CombinePaths(Core.Core.DataDir, ExamplesDir); 693 698 OpenDialog1.InitialDir := ExtractFileDir(FileName); 694 699 OpenDialog1.FileName := ExtractFileName(FileName); 695 700 if OpenDialog1.Execute then begin 696 701 AProjectClose.Execute; 697 if Core. Project.Openned then Exit;702 if Core.Core.Project.Openned then Exit; 698 703 ProjectOpen(OpenDialog1.FileName); 699 704 end; … … 702 707 procedure TFormMain.AProjectSaveAsExecute(Sender: TObject); 703 708 begin 704 SaveDialog1.InitialDir := ExtractFileDir(Core. Project.FileName);705 SaveDialog1.FileName := ExtractFileName(Core. Project.FileName);709 SaveDialog1.InitialDir := ExtractFileDir(Core.Core.Project.FileName); 710 SaveDialog1.FileName := ExtractFileName(Core.Core.Project.FileName); 706 711 if SaveDialog1.Execute then begin 707 712 FormSourceCode.SynEditSource.Lines.SaveToFile(SaveDialog1.FileName); 708 Core. Project.FileName := SaveDialog1.FileName;709 Core. AddItemToLastOpenedList(SaveDialog1.FileName);710 Core. Project.Modified := False;713 Core.Core.Project.FileName := SaveDialog1.FileName; 714 Core.Core.AddItemToLastOpenedList(SaveDialog1.FileName); 715 Core.Core.Project.Modified := False; 711 716 UpdateInterface; 712 717 end; … … 715 720 procedure TFormMain.AProjectSaveExecute(Sender: TObject); 716 721 begin 717 if Core. Project.Modified and FileExists(Core.Project.FileName) then begin718 FormSourceCode.SynEditSource.Lines.SaveToFile(Core. Project.FileName);719 Core. AddItemToLastOpenedList(Core.Project.FileName);720 Core. Project.Modified := False;722 if Core.Core.Project.Modified and FileExists(Core.Core.Project.FileName) then begin 723 FormSourceCode.SynEditSource.Lines.SaveToFile(Core.Core.Project.FileName); 724 Core.Core.AddItemToLastOpenedList(Core.Core.Project.FileName); 725 Core.Core.Project.Modified := False; 721 726 UpdateInterface; 722 727 end else AProjectSaveAs.Execute; -
trunk/Forms/FormMemory.lfm
r144 r145 8 8 ClientWidth = 1039 9 9 DesignTimePPI = 144 10 OnCreate = FormCreate 10 11 LCLVersion = '2.2.6.0' 11 12 object Label6: TLabel -
trunk/Forms/FormMemory.pas
r144 r145 1 unit UFormMemory;1 unit FormMemory; 2 2 3 3 interface … … 17 17 Label6: TLabel; 18 18 ListViewMemory: TListView; 19 procedure FormCreate(Sender: TObject); 19 20 procedure ListViewMemoryData(Sender: TObject; Item: TListItem); 20 21 private … … 24 25 end; 25 26 26 var27 FormMemory: TFormMemory;28 27 29 28 implementation … … 32 31 33 32 uses 34 UCore, UTargetInterpretter;33 Core, TargetInterpretter; 35 34 36 35 { TFormMemory } … … 38 37 procedure TFormMemory.Reload; 39 38 begin 40 if Core.C urrentTarget is TTargetInterpretter then41 with TTargetInterpretter(Core.C urrentTarget) do begin39 if Core.Core.CurrentTarget is TTargetInterpretter then 40 with TTargetInterpretter(Core.Core.CurrentTarget) do begin 42 41 if MemoryChanged then begin 43 42 MemoryChanged := False; … … 55 54 Address: Integer; 56 55 begin 57 if Core.C urrentTarget is TTargetInterpretter then58 with TTargetInterpretter(Core.C urrentTarget) do56 if Core.Core.CurrentTarget is TTargetInterpretter then 57 with TTargetInterpretter(Core.Core.CurrentTarget) do 59 58 if (Item.Index >= 0) and (Item.Index <= Trunc((MemoryMaxUsedAddr + 1) / RowSize)) then begin 60 59 Item.Caption := IntToHex(Item.Index * RowSize, 8); … … 75 74 end; 76 75 76 procedure TFormMemory.FormCreate(Sender: TObject); 77 begin 78 Core.Core.Translator.TranslateComponentRecursive(Self); 79 Core.Core.ThemeManager.UseTheme(Self); 80 end; 81 77 82 end. 78 83 -
trunk/Forms/FormMessages.lfm
r144 r145 9 9 DesignTimePPI = 144 10 10 OnCreate = FormCreate 11 LCLVersion = '2. 0.0.4'11 LCLVersion = '2.2.6.0' 12 12 object ListView1: TListView 13 13 Left = 0 … … 18 18 Columns = < 19 19 item 20 Width = 7 1020 Width = 723 21 21 end> 22 22 OwnerData = True -
trunk/Forms/FormMessages.pas
r144 r145 1 unit UFormMessages;1 unit FormMessages; 2 2 3 3 interface … … 15 15 procedure FormCreate(Sender: TObject); 16 16 procedure ListView1Data(Sender: TObject; Item: TListItem); 17 private18 { private declarations }19 17 public 20 18 procedure Reload; 21 19 end; 22 20 23 var24 FormMessages: TFormMessages;25 21 26 22 implementation … … 29 25 30 26 uses 31 UCore, UTarget;27 Core, Target; 32 28 33 29 { TFormMessages } … … 35 31 procedure TFormMessages.ListView1Data(Sender: TObject; Item: TListItem); 36 32 begin 37 with Core do33 with Core.Core do 38 34 if (Item.Index >= 0) and (Item.Index < Messages.Count) then 39 35 with Messages[Item.Index] do begin … … 45 41 procedure TFormMessages.FormCreate(Sender: TObject); 46 42 begin 43 Core.Core.Translator.TranslateComponentRecursive(Self); 44 Core.Core.ThemeManager.UseTheme(Self); 47 45 end; 48 46 49 47 procedure TFormMessages.Reload; 50 48 begin 51 ListView1.Items.Count := Core. Messages.Count;49 ListView1.Items.Count := Core.Core.Messages.Count; 52 50 ListView1.Refresh; 53 51 end; -
trunk/Forms/FormOptions.pas
r144 r145 1 unit UFormOptions;1 unit FormOptions; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 7 Spin, ComCtrls, ExtCtrls, UTarget, UTheme;7 Spin, ComCtrls, ExtCtrls, Target, Theme; 8 8 9 9 type … … 47 47 procedure FormCreate(Sender: TObject); 48 48 procedure FormShow(Sender: TObject); 49 private50 { private declarations }51 49 public 52 50 procedure UpdateInterface; … … 55 53 end; 56 54 57 var58 FormOptions: TFormOptions;59 55 60 56 implementation … … 63 59 64 60 uses 65 UCore, ULanguages;61 Core, Languages; 66 62 67 63 { TFormOptions } … … 69 65 procedure TFormOptions.FormShow(Sender: TObject); 70 66 begin 71 Core. PersistentForm1.Load(Self);67 Core.Core.PersistentForm1.Load(Self); 72 68 end; 73 69 … … 91 87 procedure TFormOptions.Load; 92 88 begin 93 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.Translator.Language); 94 if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0; 95 ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(Core.ThemeManager.Theme); 96 if ComboBoxTheme.ItemIndex = -1 then ComboBoxTheme.ItemIndex := 0; 97 CheckBoxReopenLastFile.Checked := Core.OpenProjectOnStart; 98 CheckBoxOptimizeAddSub.Checked := Core.Optimizations.AddSub; 99 CheckBoxOptimizeSetZero.Checked := Core.Optimizations.SetZero; 100 CheckBoxOptimizeMerge.Checked := Core.Optimizations.Merge; 101 CheckBoxOptimizeRelativeIndexes.Checked := Core.Optimizations.RelativeIndexes; 102 CheckBoxOptimizeCopyMultiply.Checked := Core.Optimizations.CopyMultiply; 103 SpinEditDPIX.Value := Core.ScaleDPI1.DPI.X; 104 SpinEditDPIY.Value := Core.ScaleDPI1.DPI.Y; 105 CheckBoxDPIAuto.Checked := Core.ScaleDPI1.AutoDetect; 106 ComboBoxOptimization.ItemIndex := Integer(Core.OptimizationLevel); 107 SpinEditCellSize.Value := Core.CellSize; 108 SpinEditMemorySize.Value := Core.MemorySize; 109 CheckBoxDebugEnabled.Checked := Core.DebugEnabled; 110 if Core.OptionsFormTabIndex < PageControl1.PageCount then 111 PageControl1.TabIndex := Core.OptionsFormTabIndex 112 else PageControl1.TabIndex := 0; 89 with Core.Core do begin 90 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Translator.Language); 91 if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0; 92 ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(ThemeManager.Theme); 93 if ComboBoxTheme.ItemIndex = -1 then ComboBoxTheme.ItemIndex := 0; 94 CheckBoxReopenLastFile.Checked := OpenProjectOnStart; 95 CheckBoxOptimizeAddSub.Checked := Optimizations.AddSub; 96 CheckBoxOptimizeSetZero.Checked := Optimizations.SetZero; 97 CheckBoxOptimizeMerge.Checked := Optimizations.Merge; 98 CheckBoxOptimizeRelativeIndexes.Checked := Optimizations.RelativeIndexes; 99 CheckBoxOptimizeCopyMultiply.Checked := Optimizations.CopyMultiply; 100 SpinEditDPIX.Value := ScaleDPI1.DPI.X; 101 SpinEditDPIY.Value := ScaleDPI1.DPI.Y; 102 CheckBoxDPIAuto.Checked := ScaleDPI1.AutoDetect; 103 ComboBoxOptimization.ItemIndex := Integer(OptimizationLevel); 104 SpinEditCellSize.Value := CellSize; 105 SpinEditMemorySize.Value := MemorySize; 106 CheckBoxDebugEnabled.Checked := DebugEnabled; 107 if OptionsFormTabIndex < PageControl1.PageCount then 108 PageControl1.TabIndex := OptionsFormTabIndex 109 else PageControl1.TabIndex := 0; 110 end; 113 111 UpdateInterface; 114 112 end; … … 116 114 procedure TFormOptions.Save; 117 115 begin 116 with Core.Core do begin 118 117 if ComboBoxLanguage.ItemIndex <> -1 then 119 Core.Translator.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);118 Translator.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]); 120 119 if ComboBoxTheme.ItemIndex <> -1 then 121 Core.ThemeManager.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]); 122 Core.OpenProjectOnStart := CheckBoxReopenLastFile.Checked; 123 Core.ScaleDPI1.DPI := Point(SpinEditDPIX.Value, SpinEditDPIY.Value); 124 Core.ScaleDPI1.AutoDetect := CheckBoxDPIAuto.Checked; 125 Core.OptimizationLevel := TCompilerOptimization(ComboBoxOptimization.ItemIndex); 126 Core.CellSize := SpinEditCellSize.Value; 127 Core.MemorySize := SpinEditMemorySize.Value; 128 Core.Optimizations.AddSub := CheckBoxOptimizeAddSub.Checked; 129 Core.Optimizations.SetZero := CheckBoxOptimizeSetZero.Checked; 130 Core.Optimizations.Merge := CheckBoxOptimizeMerge.Checked; 131 Core.Optimizations.RelativeIndexes := CheckBoxOptimizeRelativeIndexes.Checked; 132 Core.Optimizations.CopyMultiply := CheckBoxOptimizeCopyMultiply.Checked; 133 Core.DebugEnabled := CheckBoxDebugEnabled.Checked; 134 Core.OptionsFormTabIndex := PageControl1.TabIndex; 120 ThemeManager.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]); 121 OpenProjectOnStart := CheckBoxReopenLastFile.Checked; 122 ScaleDPI1.DPI := Point(SpinEditDPIX.Value, SpinEditDPIY.Value); 123 ScaleDPI1.AutoDetect := CheckBoxDPIAuto.Checked; 124 OptimizationLevel := TCompilerOptimization(ComboBoxOptimization.ItemIndex); 125 CellSize := SpinEditCellSize.Value; 126 MemorySize := SpinEditMemorySize.Value; 127 Optimizations.AddSub := CheckBoxOptimizeAddSub.Checked; 128 Optimizations.SetZero := CheckBoxOptimizeSetZero.Checked; 129 Optimizations.Merge := CheckBoxOptimizeMerge.Checked; 130 Optimizations.RelativeIndexes := CheckBoxOptimizeRelativeIndexes.Checked; 131 Optimizations.CopyMultiply := CheckBoxOptimizeCopyMultiply.Checked; 132 DebugEnabled := CheckBoxDebugEnabled.Checked; 133 OptionsFormTabIndex := PageControl1.TabIndex; 134 end; 135 135 end; 136 136 … … 157 157 ); 158 158 begin 159 Core. PersistentForm1.Save(Self);159 Core.Core.PersistentForm1.Save(Self); 160 160 end; 161 161 162 162 procedure TFormOptions.FormCreate(Sender: TObject); 163 163 begin 164 Core.Translator.TranslateComponentRecursive(Self); 165 Core.ThemeManager.UseTheme(Self); 166 Core.ThemeManager.Themes.LoadToStrings(ComboBoxTheme.Items); 167 Core.Translator.LanguageListToStrings(ComboBoxLanguage.Items); 164 with Core.Core do begin 165 Translator.TranslateComponentRecursive(Self); 166 ThemeManager.UseTheme(Self); 167 ThemeManager.Themes.LoadToStrings(ComboBoxTheme.Items); 168 Translator.LanguageListToStrings(ComboBoxLanguage.Items); 169 end; 168 170 ComboBoxOptimization.Items.Clear; 169 171 ComboBoxOptimization.Items.Add(CompilerOptimizationText[coNone]); -
trunk/Forms/FormOutput.lfm
r144 r145 8 8 ClientWidth = 640 9 9 DesignTimePPI = 144 10 OnCreate = FormCreate 10 11 LCLVersion = '2.2.6.0' 11 12 object Label2: TLabel -
trunk/Forms/FormOutput.pas
r144 r145 1 unit UFormOutput;1 unit FormOutput; 2 2 3 3 interface … … 13 13 Label2: TLabel; 14 14 MemoOutput: TMemo; 15 private 16 { private declarations } 15 procedure FormCreate(Sender: TObject); 17 16 public 18 17 procedure Reload; 19 18 end; 20 21 var22 FormOutput: TFormOutput;23 19 24 20 … … 28 24 29 25 uses 30 UCore, UTargetInterpretter;26 Core, TargetInterpretter; 31 27 32 28 { TFormOutput } 33 29 30 procedure TFormOutput.FormCreate(Sender: TObject); 31 begin 32 Core.Core.Translator.TranslateComponentRecursive(Self); 33 Core.Core.ThemeManager.UseTheme(Self); 34 end; 35 34 36 procedure TFormOutput.Reload; 35 37 begin 36 if Core.C urrentTarget is TTargetInterpretter then37 with TTargetInterpretter(Core.C urrentTarget) do begin38 if Core.Core.CurrentTarget is TTargetInterpretter then 39 with TTargetInterpretter(Core.Core.CurrentTarget) do begin 38 40 if OutputChanged then begin 39 41 OutputChanged := False; -
trunk/Forms/FormSourceCode.pas
r144 r145 1 unit UFormSourceCode;1 unit FormSourceCode; 2 2 3 3 interface … … 6 6 Classes, SysUtils, FileUtil, SynEdit, SynHighlighterIni, Forms, Controls, 7 7 Graphics, Dialogs, Menus, ActnList, 8 SynEditHighlighter, SynHighlighterAny, SynHighlighterJava, UBFHighlighter;8 SynEditHighlighter, SynHighlighterAny, SynHighlighterJava, BFHighlighter; 9 9 10 10 type … … 60 60 private 61 61 BFHighlighter: TSynBrainFuckHl; 62 FOnUpdateInterface: TNotifyEvent; 63 FOnUpdateStatusBar: TNotifyEvent; 62 64 public 63 65 procedure UpdateInterface; 64 66 procedure UpdateTheme; 67 property OnUpdateStatusBar: TNotifyEvent read FOnUpdateStatusBar 68 write FOnUpdateStatusBar; 69 property OnUpdateInterface: TNotifyEvent read FOnUpdateInterface 70 write FOnUpdateInterface; 65 71 end; 66 72 67 var68 FormSourceCode: TFormSourceCode;69 70 73 71 74 implementation … … 74 77 75 78 uses 76 UCore, UFormMain, UBFCodeTools;79 Core, BFCodeTools; 77 80 78 81 resourcestring … … 142 145 procedure TFormSourceCode.FormCreate(Sender: TObject); 143 146 begin 147 Core.Core.Translator.TranslateComponentRecursive(Self); 148 Core.Core.ThemeManager.UseTheme(Self); 149 144 150 BFHighlighter := TSynBrainFuckHl.Create(nil); 145 151 SynEditSource.Highlighter := BFHighlighter; … … 162 168 clLightRed = TColor($8080FF); 163 169 begin 164 if Core. ThemeManager.Theme.Name = 'Dark' then begin170 if Core.Core.ThemeManager.Theme.Name = 'Dark' then begin 165 171 BFHighlighter.IoAttri.Foreground := clWhite; 166 172 BFHighlighter.LoopAttri.Foreground := clLightRed; … … 177 183 procedure TFormSourceCode.MemoSourceChange(Sender: TObject); 178 184 begin 179 Core.Project.Modified := True; 180 Core.CurrentTarget.Compiled := False; 181 FormMain.UpdateInterface; 185 Core.Core.Project.Modified := True; 186 Core.Core.CurrentTarget.Compiled := False; 187 if Assigned(FOnUpdateInterface) then 188 OnUpdateInterface(Self); 182 189 end; 183 190 … … 194 201 Shift: TShiftState); 195 202 begin 196 FormMain.UpdateStatusBar; 203 if Assigned(FOnUpdateStatusBar) then 204 FOnUpdateStatusBar(Self); 197 205 end; 198 206 … … 200 208 Shift: TShiftState; X, Y: Integer); 201 209 begin 202 FormMain.UpdateStatusBar; 210 if Assigned(FOnUpdateStatusBar) then 211 FOnUpdateStatusBar(Self); 203 212 end; 204 213 -
trunk/Forms/FormTargetCode.lfm
r144 r145 1 1 object FormTargetCode: TFormTargetCode 2 2 Left = 555 3 Height = 4353 Height = 522 4 4 Top = 379 5 Width = 6125 Width = 734 6 6 Caption = 'Target code' 7 ClientHeight = 435 8 ClientWidth = 612 9 DesignTimePPI = 120 10 LCLVersion = '2.0.2.0' 7 ClientHeight = 522 8 ClientWidth = 734 9 DesignTimePPI = 144 10 OnCreate = FormCreate 11 LCLVersion = '2.2.6.0' 11 12 inline SynEditTarget: TSynEdit 12 13 Left = 0 13 Height = 43514 Height = 522 14 15 Top = 0 15 Width = 61216 Width = 734 16 17 Align = alClient 17 Font.Height = -1 318 Font.Height = -16 18 19 Font.Name = 'Courier New' 19 20 Font.Pitch = fpFixed … … 23 24 PopupMenu = PopupMenuTarget 24 25 TabOrder = 0 25 Gutter.Width = 6826 Gutter.Width = 81 26 27 Gutter.MouseActions = <> 27 28 RightGutter.Width = 0 … … 472 473 inline SynLeftGutterPartList1: TSynGutterPartList 473 474 object SynGutterMarks1: TSynGutterMarks 474 Width = 3 0475 Width = 36 475 476 MouseActions = <> 476 477 end 477 478 object SynGutterLineNumber1: TSynGutterLineNumber 478 Width = 17479 Width = 21 479 480 MouseActions = <> 480 481 MarkupInfo.Background = clBtnFace … … 486 487 end 487 488 object SynGutterChanges1: TSynGutterChanges 488 Width = 5489 Width = 6 489 490 MouseActions = <> 490 491 ModifiedColor = 59900 … … 498 499 end 499 500 object SynGutterCodeFolding1: TSynGutterCodeFolding 500 Width = 1 3501 Width = 15 501 502 MouseActions = <> 502 503 MarkupInfo.Background = clNone … … 509 510 object PopupMenuTarget: TPopupMenu 510 511 Images = Core.ImageListMain 511 left = 84512 top = 100512 Left = 101 513 Top = 120 513 514 object MenuItem20: TMenuItem 514 515 Action = AFormatCode … … 520 521 object ActionList1: TActionList 521 522 Images = Core.ImageListMain 522 left = 199523 top = 39523 Left = 239 524 Top = 47 524 525 object AFormatCode: TAction 525 526 Caption = 'Format code' -
trunk/Forms/FormTargetCode.pas
r144 r145 1 unit UFormTargetCode;1 unit FormTargetCode; 2 2 3 3 interface … … 23 23 procedure AFormatCodeExecute(Sender: TObject); 24 24 procedure AShrinkCodeExecute(Sender: TObject); 25 private 26 { private declarations } 25 procedure FormCreate(Sender: TObject); 27 26 public 28 27 procedure SetHighlighter(SourceExt: string); 29 28 end; 30 29 31 var32 FormTargetCode: TFormTargetCode;33 30 34 31 implementation 35 32 36 33 {$R *.lfm} 34 35 uses 36 Core; 37 37 38 38 { TFormTargetCode } … … 84 84 end; 85 85 86 procedure TFormTargetCode.FormCreate(Sender: TObject); 87 begin 88 Core.Core.Translator.TranslateComponentRecursive(Self); 89 Core.Core.ThemeManager.UseTheme(Self); 90 end; 91 86 92 procedure TFormTargetCode.SetHighlighter(SourceExt: string); 87 93 begin -
trunk/Forms/FormTargetOptions.pas
r144 r145 1 unit UFormTargetOptions;1 unit FormTargetOptions; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 7 UTarget;7 Target; 8 8 9 9 type … … 26 26 procedure FormCreate(Sender: TObject); 27 27 procedure FormShow(Sender: TObject); 28 private29 { private declarations }30 28 public 31 29 procedure LoadControls(Target: TTarget); 32 30 procedure SaveControls(Target: TTarget); 33 31 end; 34 35 var36 FormTargetOptions: TFormTargetOptions;37 32 38 33 … … 42 37 43 38 uses 44 UCore;39 Core; 45 40 46 41 { TFormTargetOptions } … … 61 56 var CloseAction: TCloseAction); 62 57 begin 63 Core. PersistentForm1.Save(Self);58 Core.Core.PersistentForm1.Save(Self); 64 59 end; 65 60 66 61 procedure TFormTargetOptions.FormCreate(Sender: TObject); 67 62 begin 68 Core. Translator.TranslateComponentRecursive(Self);69 Core. ThemeManager.UseTheme(Self);63 Core.Core.Translator.TranslateComponentRecursive(Self); 64 Core.Core.ThemeManager.UseTheme(Self); 70 65 end; 71 66 72 67 procedure TFormTargetOptions.FormShow(Sender: TObject); 73 68 begin 74 Core. PersistentForm1.Load(Self);69 Core.Core.PersistentForm1.Load(Self); 75 70 end; 76 71 -
trunk/Forms/FormTargets.pas
r144 r145 1 unit UFormTargets;1 unit FormTargets; 2 2 3 3 interface … … 18 18 procedure ListView1DblClick(Sender: TObject); 19 19 procedure ListView1KeyPress(Sender: TObject; var Key: char); 20 private21 { private declarations }22 20 public 23 21 procedure ReloadList; 24 22 end; 25 23 26 var27 FormTargets: TFormTargets;28 24 29 25 implementation … … 32 28 33 29 uses 34 UCore, UTarget, UFormTargetOptions;30 Core, Target, FormTargetOptions; 35 31 36 32 { TFormTargets } … … 38 34 procedure TFormTargets.FormShow(Sender: TObject); 39 35 begin 40 Core. PersistentForm1.Load(Self);36 Core.Core.PersistentForm1.Load(Self); 41 37 ReloadList; 42 38 end; … … 44 40 procedure TFormTargets.FormCreate(Sender: TObject); 45 41 begin 46 Core. Translator.TranslateComponentRecursive(Self);47 Core. ThemeManager.UseTheme(Self);42 Core.Core.Translator.TranslateComponentRecursive(Self); 43 Core.Core.ThemeManager.UseTheme(Self); 48 44 end; 49 45 … … 51 47 ); 52 48 begin 53 Core. PersistentForm1.Save(Self);49 Core.Core.PersistentForm1.Save(Self); 54 50 end; 55 51 56 52 procedure TFormTargets.ListView1Data(Sender: TObject; Item: TListItem); 57 53 begin 58 if (Item.Index >= 0) and (Item.Index < Core. Targets.Count) then59 with TTarget(Core. Targets[Item.Index]) do begin54 if (Item.Index >= 0) and (Item.Index < Core.Core.Targets.Count) then 55 with TTarget(Core.Core.Targets[Item.Index]) do begin 60 56 Item.Caption := Name; 61 Item.Data := Core. Targets[Item.Index];57 Item.Data := Core.Core.Targets[Item.Index]; 62 58 Item.SubItems.Add(ExecutorPath); 63 59 Item.SubItems.Add(CompilerPath); … … 66 62 67 63 procedure TFormTargets.ListView1DblClick(Sender: TObject); 64 var 65 FormTargetOptions: TFormTargetOptions; 68 66 begin 69 67 FormTargetOptions := TFormTargetOptions.Create(nil); … … 86 84 procedure TFormTargets.ReloadList; 87 85 begin 88 ListView1.Items.Count := Core. Targets.Count;86 ListView1.Items.Count := Core.Core.Targets.Count; 89 87 ListView1.Refresh; 90 88 end;
Note:
See TracChangeset
for help on using the changeset viewer.