- Timestamp:
- Mar 4, 2022, 10:57:08 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r131 r133 1 1 object FormMain: TFormMain 2 2 Left = 430 3 Height = 7 033 Height = 732 4 4 Top = 249 5 Width = 10 325 Width = 1075 6 6 Caption = 'LazFuck' 7 ClientHeight = 6 698 ClientWidth = 10 329 DesignTimePPI = 1 447 ClientHeight = 697 8 ClientWidth = 1075 9 DesignTimePPI = 150 10 10 Menu = MainMenu1 11 11 OnClose = FormClose … … 18 18 object StatusBarMain: TStatusBar 19 19 Left = 0 20 Height = 2 721 Top = 6 4222 Width = 10 3220 Height = 28 21 Top = 669 22 Width = 1075 23 23 Panels = < 24 24 item 25 Width = 8 425 Width = 88 26 26 end 27 27 item 28 Width = 8 428 Width = 88 29 29 end 30 30 item 31 Width = 9631 Width = 100 32 32 end> 33 33 ParentFont = False … … 36 36 object ToolBarMain: TToolBar 37 37 Left = 0 38 Height = 3 338 Height = 34 39 39 Top = 0 40 Width = 10 3240 Width = 1075 41 41 Images = Core.ImageListMain 42 42 ParentFont = False … … 50 50 end 51 51 object ToolButton2: TToolButton 52 Left = 3 652 Left = 37 53 53 Top = 2 54 54 Action = AProjectOpen … … 57 57 end 58 58 object ToolButton3: TToolButton 59 Left = 8959 Left = 92 60 60 Top = 2 61 61 Action = AProjectSave 62 62 end 63 63 object ToolButton4: TToolButton 64 Left = 12 464 Left = 128 65 65 Top = 2 66 66 Action = AProjectClose 67 67 end 68 68 object ToolButton5: TToolButton 69 Left = 19470 Height = 3 369 Left = 200 70 Height = 34 71 71 Top = 2 72 72 Style = tbsSeparator 73 73 end 74 74 object ToolButton6: TToolButton 75 Left = 2 3775 Left = 244 76 76 Top = 2 77 77 Action = AProgramRun 78 78 end 79 79 object ToolButton7: TToolButton 80 Left = 20 280 Left = 208 81 81 Top = 2 82 82 Action = AProgramCompile 83 83 end 84 84 object ToolButton8: TToolButton 85 Left = 1 5985 Left = 164 86 86 Top = 2 87 87 Action = AOptions 88 88 end 89 89 object ToolButton9: TToolButton 90 Left = 3 4290 Left = 352 91 91 Top = 2 92 92 Action = ABreakpointToggle 93 93 end 94 94 object ToolButton10: TToolButton 95 Left = 2 7295 Left = 280 96 96 Top = 2 97 97 Action = AProgramPause 98 98 end 99 99 object ToolButton11: TToolButton 100 Left = 3 07100 Left = 316 101 101 Top = 2 102 102 Action = AProgramStop 103 103 end 104 104 object ToolButton12: TToolButton 105 Left = 3 77105 Left = 388 106 106 Top = 2 107 107 Action = AProgramStepOver 108 108 end 109 109 object ToolButton13: TToolButton 110 Left = 4 12110 Left = 424 111 111 Top = 2 112 112 Action = AProgramStepInto 113 113 end 114 114 object ToolButton14: TToolButton 115 Left = 4 47115 Left = 460 116 116 Top = 2 117 117 Action = AProgramStepOut 118 118 end 119 119 object ToolButton15: TToolButton 120 Left = 4 82120 Left = 496 121 121 Top = 2 122 122 Action = AProgramRunToCursor 123 123 end 124 124 object ToolButtonTarget: TToolButton 125 Left = 5 17125 Left = 532 126 126 Hint = 'Target select' 127 127 Top = 2 … … 132 132 end 133 133 object PageControlRight: TPageControl 134 Left = 5 60135 Height = 6 09136 Top = 3 3137 Width = 4 72134 Left = 583 135 Height = 635 136 Top = 34 137 Width = 492 138 138 ActivePage = TabSheetDebug 139 139 Align = alRight … … 144 144 object TabSheetDebug: TTabSheet 145 145 Caption = 'Debug' 146 ClientHeight = 6 05147 ClientWidth = 390146 ClientHeight = 631 147 ClientWidth = 405 148 148 ParentFont = False 149 149 object PanelInput: TPanel 150 150 Left = 0 151 Height = 77151 Height = 80 152 152 Top = 0 153 Width = 390153 Width = 405 154 154 Align = alTop 155 155 BevelOuter = bvNone … … 161 161 Left = 0 162 162 Height = 6 163 Top = 77164 Width = 390163 Top = 80 164 Width = 405 165 165 Align = alTop 166 166 ResizeAnchor = akTop … … 168 168 object PanelOutput: TPanel 169 169 Left = 0 170 Height = 3 11171 Top = 8 3172 Width = 390170 Height = 324 171 Top = 86 172 Width = 405 173 173 Align = alTop 174 174 BevelOuter = bvNone … … 180 180 Left = 0 181 181 Height = 6 182 Top = 394183 Width = 390182 Top = 410 183 Width = 405 184 184 Align = alTop 185 185 ResizeAnchor = akTop … … 187 187 object PanelCPU: TPanel 188 188 Left = 0 189 Height = 10 3190 Top = 4 00191 Width = 390189 Height = 107 190 Top = 416 191 Width = 405 192 192 Align = alTop 193 193 BevelOuter = bvNone … … 199 199 Left = 0 200 200 Height = 6 201 Top = 5 03202 Width = 390201 Top = 523 202 Width = 405 203 203 Align = alTop 204 204 ResizeAnchor = akTop … … 206 206 object PanelMemory: TPanel 207 207 Left = 0 208 Height = 96209 Top = 5 09210 Width = 390208 Height = 102 209 Top = 529 210 Width = 405 211 211 Align = alClient 212 212 BevelOuter = bvNone … … 217 217 end 218 218 object Splitter1: TSplitter 219 Left = 5 54220 Height = 6 09221 Top = 3 3219 Left = 577 220 Height = 635 221 Top = 34 222 222 Width = 6 223 223 Align = alRight … … 226 226 object PanelLeft: TPanel 227 227 Left = 0 228 Height = 6 09229 Top = 3 3230 Width = 5 54228 Height = 635 229 Top = 34 230 Width = 577 231 231 Align = alClient 232 232 BevelOuter = bvNone 233 ClientHeight = 6 09234 ClientWidth = 5 54233 ClientHeight = 635 234 ClientWidth = 577 235 235 ParentFont = False 236 236 TabOrder = 4 237 237 object PageControlMain: TPageControl 238 238 Left = 0 239 Height = 4 61239 Height = 481 240 240 Top = 0 241 Width = 5 54241 Width = 577 242 242 ActivePage = TabSheetSource 243 243 Align = alClient … … 256 256 object PageControlBottom: TPageControl 257 257 Left = 0 258 Height = 14 2259 Top = 4 67260 Width = 5 54258 Height = 148 259 Top = 487 260 Width = 577 261 261 ActivePage = TabSheetMessages 262 262 Align = alBottom … … 274 274 Left = 0 275 275 Height = 6 276 Top = 4 61277 Width = 5 54276 Top = 481 277 Width = 577 278 278 Align = alBottom 279 279 ResizeAnchor = akBottom … … 282 282 object MainMenu1: TMainMenu 283 283 Images = Core.ImageListMain 284 Left = 2 59285 Top = 16 0284 Left = 270 285 Top = 167 286 286 object MenuItem1: TMenuItem 287 Caption = ' Project'287 Caption = 'File' 288 288 object MenuItem8: TMenuItem 289 289 Action = AProjectNew … … 311 311 end 312 312 end 313 object MenuItem24: TMenuItem 314 Caption = 'Edit' 315 object MenuItem25: TMenuItem 316 Action = FormSourceCode.AFormatSource 317 end 318 object MenuItem27: TMenuItem 319 Action = FormSourceCode.AShrinkSource 320 end 321 object MenuItem28: TMenuItem 322 Action = FormSourceCode.AGenerateNumber 323 end 324 end 313 325 object MenuItem9: TMenuItem 314 Caption = ' Program'326 Caption = 'Run' 315 327 object MenuItem11: TMenuItem 316 328 Action = AProgramCompile 317 329 end 330 object MenuItem20: TMenuItem 331 Action = AProgramCompileMultiple 332 end 318 333 object MenuItemTarget: TMenuItem 319 334 Caption = 'Target' … … 347 362 end 348 363 end 349 object MenuItem 24: TMenuItem364 object MenuItem18: TMenuItem 350 365 Caption = 'Tools' 351 object MenuItem25: TMenuItem352 Action = FormSourceCode.AFormatSource353 end354 object MenuItem27: TMenuItem355 Action = FormSourceCode.AShrinkSource356 end357 object MenuItem28: TMenuItem358 Action = FormSourceCode.AGenerateNumber359 end360 end361 object MenuItem18: TMenuItem362 Caption = 'View'363 366 object MenuItem22: TMenuItem 364 367 Action = AOptions … … 383 386 object ActionList1: TActionList 384 387 Images = Core.ImageListMain 385 Left = 2 59386 Top = 2 30388 Left = 270 389 Top = 240 387 390 object AProjectOpen: TAction 388 391 Category = 'Project' … … 525 528 OnExecute = AViewLogExecute 526 529 end 530 object AProgramCompileMultiple: TAction 531 Category = 'Program' 532 Caption = 'Compile multiple...' 533 OnExecute = AProgramCompileMultipleExecute 534 end 527 535 end 528 536 object OpenDialog1: TOpenDialog 529 537 DefaultExt = '.b' 530 538 Filter = 'BrainFuck (*.b)|*.b|Any file (*.*)|*.*' 531 Left = 67532 Top = 2 21539 Left = 70 540 Top = 230 533 541 end 534 542 object SaveDialog1: TSaveDialog 535 543 DefaultExt = '.b' 536 544 Filter = 'BrainFuck (*.b)|*.b|Any file (*.*)|*.*' 537 Left = 67538 Top = 288545 Left = 70 546 Top = 300 539 547 end 540 548 object TimerRefresh: TTimer 541 549 OnTimer = TimerRefreshTimer 542 Left = 67543 Top = 3 55550 Left = 70 551 Top = 370 544 552 end 545 553 object PopupMenuRecentFiles: TPopupMenu 546 Left = 67547 Top = 77554 Left = 70 555 Top = 80 548 556 end 549 557 object PopupMenuTargets: TPopupMenu 550 Left = 67 551 Top = 143 558 Images = Core.ImageListMain 559 Left = 70 560 Top = 149 552 561 end 553 562 end -
trunk/Forms/UFormMain.lrj
r113 r133 7 7 {"hash":205270389,"name":"tformmain.tabsheettarget.caption","sourcebytes":[84,97,114,103,101,116,32,99,111,100,101],"value":"Target code"}, 8 8 {"hash":212433139,"name":"tformmain.tabsheetmessages.caption","sourcebytes":[77,101,115,115,97,103,101,115],"value":"Messages"}, 9 {"hash": 127273972,"name":"tformmain.menuitem1.caption","sourcebytes":[80,114,111,106,101,99,116],"value":"Project"},9 {"hash":315429,"name":"tformmain.menuitem1.caption","sourcebytes":[70,105,108,101],"value":"File"}, 10 10 {"hash":131987540,"name":"tformmain.menuitemopenrecent.caption","sourcebytes":[79,112,101,110,32,114,101,99,101,110,116],"value":"Open recent"}, 11 {"hash":127264813,"name":"tformmain.menuitem9.caption","sourcebytes":[80,114,111,103,114,97,109],"value":"Program"}, 11 {"hash":310020,"name":"tformmain.menuitem24.caption","sourcebytes":[69,100,105,116],"value":"Edit"}, 12 {"hash":22974,"name":"tformmain.menuitem9.caption","sourcebytes":[82,117,110],"value":"Run"}, 12 13 {"hash":94932420,"name":"tformmain.menuitemtarget.caption","sourcebytes":[84,97,114,103,101,116],"value":"Target"}, 13 {"hash":5989939,"name":"tformmain.menuitem24.caption","sourcebytes":[84,111,111,108,115],"value":"Tools"}, 14 {"hash":380871,"name":"tformmain.menuitem18.caption","sourcebytes":[86,105,101,119],"value":"View"}, 14 {"hash":5989939,"name":"tformmain.menuitem18.caption","sourcebytes":[84,111,111,108,115],"value":"Tools"}, 15 15 {"hash":322608,"name":"tformmain.menuitem10.caption","sourcebytes":[72,101,108,112],"value":"Help"}, 16 16 {"hash":353982,"name":"tformmain.aprojectopen.caption","sourcebytes":[79,112,101,110],"value":"Open"}, … … 36 36 {"hash":248107685,"name":"tformmain.ashowsourceposition.caption","sourcebytes":[83,104,111,119,32,112,111,115,105,116,105,111,110,32,105,110,32,115,111,117,114,99,101],"value":"Show position in source"}, 37 37 {"hash":78944612,"name":"tformmain.aprogramshowexecutionpoint.caption","sourcebytes":[83,104,111,119,32,101,120,101,99,117,116,105,111,110,32,112,111,105,110,116],"value":"Show execution point"}, 38 {"hash":21335,"name":"tformmain.aviewlog.caption","sourcebytes":[76,111,103],"value":"Log"} 38 {"hash":21335,"name":"tformmain.aviewlog.caption","sourcebytes":[76,111,103],"value":"Log"}, 39 {"hash":226669790,"name":"tformmain.aprogramcompilemultiple.caption","sourcebytes":[67,111,109,112,105,108,101,32,109,117,108,116,105,112,108,101,46,46,46],"value":"Compile multiple..."} 39 40 ]} -
trunk/Forms/UFormMain.pas
r128 r133 15 15 16 16 TFormMain = class(TForm) 17 AProgramCompileMultiple: TAction; 17 18 AViewLog: TAction; 18 19 AProgramShowExecutionPoint: TAction; … … 52 53 MenuItem19: TMenuItem; 53 54 MenuItem2: TMenuItem; 55 MenuItem20: TMenuItem; 54 56 MenuItem22: TMenuItem; 55 57 MenuItem24: TMenuItem; … … 117 119 procedure AOptionsExecute(Sender: TObject); 118 120 procedure AProgramCompileExecute(Sender: TObject); 121 procedure AProgramCompileMultipleExecute(Sender: TObject); 119 122 procedure AProgramPauseExecute(Sender: TObject); 120 123 procedure AProgramRunToCursorExecute(Sender: TObject); … … 171 174 UCore, UFormCPU, UFormOptions, UFormMessages, UFormTargets, UFormOutput, UFormInput, 172 175 UFormMemory, UFormSourceCode, UFormTargetCode, UTargetInterpretter, UFormLog, 173 UBFTarget, UCommon ;176 UBFTarget, UCommon, UFormCompileMultiple; 174 177 175 178 resourcestring … … 206 209 FormSourceCode.UpdateTheme; 207 210 end; 211 Core.Messages.OnChange := FormMain.MessagesChanged; 208 212 end; 209 213 … … 227 231 AProgramShowExecutionPoint.Execute; 228 232 if Core.CurrentTarget.State = rsStopped then 229 Core. CurrentTarget.Messages.AddMessage(SProgramStopped);233 Core.Messages.AddMessage(SProgramStopped); 230 234 end; 231 235 … … 405 409 if not Core.CurrentTarget.Compiled then AProgramCompile.Execute; 406 410 Core.CurrentTarget.Run; 407 Core. CurrentTarget.Messages.AddMessage(SProgramStarted);411 Core.Messages.AddMessage(SProgramStarted); 408 412 end; 409 413 … … 432 436 procedure TFormMain.AViewCompilersExecute(Sender: TObject); 433 437 begin 434 if not Assigned(FormTargets) then FormTargets := TFormTargets.Create(Self); 435 FormTargets.Show; 438 with TFormTargets.Create(nil) do 439 try 440 ShowModal; 441 finally 442 Free; 443 end; 436 444 end; 437 445 … … 493 501 with Core.CurrentTarget do 494 502 try 503 Core.Messages.Clear; 495 504 AProgramStop.Execute; 496 505 SourceCode := FormSourceCode.SynEditSource.Text; … … 499 508 if Core.CurrentTarget is TBFTarget then 500 509 TBFTarget(Core.CurrentTarget).Optimizations := Core.Optimizations; 501 Core.CurrentTarget.Messages.AddMessage(SCompileStart); 510 DebugEnabled := Core.DebugEnabled; 511 Core.Messages.AddMessage(SCompileStart); 502 512 Application.ProcessMessages; 503 513 Compile; 504 Core. CurrentTarget.Messages.AppendMessage(SDone);514 Core.Messages.AppendMessage(SDone); 505 515 FormTargetCode.SynEditTarget.Text := TargetCode; 506 516 FormTargetCode.SetHighlighter(Core.CurrentTarget.SourceExtension); … … 509 519 on E: Exception do 510 520 MessageDlg(SError, E.Message, mtError, [mbOk], 0); 521 end; 522 end; 523 524 procedure TFormMain.AProgramCompileMultipleExecute(Sender: TObject); 525 var 526 I: Integer; 527 begin 528 AProgramStop.Execute; 529 with TFormCompileMultiple.Create(nil) do 530 try 531 Targets := Core.Targets; 532 if ShowModal = mrOk then begin 533 Core.Messages.Clear; 534 for I := 0 to Targets.Count - 1 do 535 with Targets[I] do 536 if Selected then 537 try 538 AProgramStop.Execute; 539 SourceCode := FormSourceCode.SynEditSource.Text; 540 ProjectFileName := Core.Project.FileName; 541 ProgramName := ExtractFileNameOnly(Core.Project.FileName); 542 if Targets[I] is TBFTarget then 543 TBFTarget(Targets[I]).Optimizations := Core.Optimizations; 544 DebugEnabled := Core.DebugEnabled; 545 Core.Messages.AddMessage(Name + ' ' + SCompileStart); 546 Application.ProcessMessages; 547 Compile; 548 Core.Messages.AppendMessage(SDone); 549 FormTargetCode.SynEditTarget.Text := TargetCode; 550 FormTargetCode.SetHighlighter(Core.CurrentTarget.SourceExtension); 551 UpdateInterface; 552 except 553 on E: Exception do 554 MessageDlg(SError, E.Message, mtError, [mbOk], 0); 555 end; 556 end; 557 finally 558 Free; 511 559 end; 512 560 end; -
trunk/Forms/UFormMessages.pas
r131 r133 37 37 procedure TFormMessages.ListView1Data(Sender: TObject; Item: TListItem); 38 38 begin 39 with Core .CurrentTargetdo39 with Core do 40 40 if (Item.Index >= 0) and (Item.Index < Messages.Count) then 41 with TMessage(Messages[Item.Index])do begin41 with Messages[Item.Index] do begin 42 42 Item.Caption := Text; 43 43 Item.Data := Messages[Item.Index]; … … 51 51 procedure TFormMessages.Reload; 52 52 begin 53 ListView1.Items.Count := Core. CurrentTarget.Messages.Count;53 ListView1.Items.Count := Core.Messages.Count; 54 54 ListView1.Refresh; 55 55 end; -
trunk/Forms/UFormSourceCode.lfm
r128 r133 591 591 object ActionList1: TActionList 592 592 Images = Core.ImageListMain 593 Left = 15 4593 Left = 152 594 594 Top = 67 595 595 object AGenerateNumber: TAction -
trunk/Forms/UFormTargets.lfm
r103 r133 1 1 object FormTargets: TFormTargets 2 Left = 29 23 Height = 4 134 Top = 1 385 Width = 6892 Left = 294 3 Height = 430 4 Top = 172 5 Width = 718 6 6 Caption = 'Compilers' 7 ClientHeight = 413 8 ClientWidth = 689 9 DesignTimePPI = 144 7 ClientHeight = 430 8 ClientWidth = 718 9 DesignTimePPI = 150 10 OnClose = FormClose 10 11 OnCreate = FormCreate 11 12 OnShow = FormShow 12 LCLVersion = '2. 0.0.4'13 LCLVersion = '2.2.0.4' 13 14 object ListView1: TListView 14 15 Left = 10 15 Height = 39316 Height = 410 16 17 Top = 10 17 Width = 67218 Width = 701 18 19 Anchors = [akTop, akLeft, akRight, akBottom] 19 20 Columns = < 20 21 item 21 22 Caption = 'Name' 22 Width = 9623 Width = 100 23 24 end 24 25 item 25 26 Caption = 'Execution path' 26 Width = 2 4027 Width = 250 27 28 end 28 29 item 29 30 Caption = 'Compiler path' 30 Width = 3 1331 Width = 336 31 32 end> 32 33 OwnerData = True -
trunk/Forms/UFormTargets.pas
r115 r133 14 14 TFormTargets = class(TForm) 15 15 ListView1: TListView; 16 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 16 17 procedure FormCreate(Sender: TObject); 17 18 procedure FormShow(Sender: TObject); … … 39 40 procedure TFormTargets.FormShow(Sender: TObject); 40 41 begin 42 Core.PersistentForm1.Load(Self); 41 43 ReloadList; 42 44 end; … … 46 48 Core.Translator.TranslateComponentRecursive(Self); 47 49 Core.ThemeManager.UseTheme(Self); 50 end; 51 52 procedure TFormTargets.FormClose(Sender: TObject; var CloseAction: TCloseAction 53 ); 54 begin 55 Core.PersistentForm1.Save(Self); 48 56 end; 49 57 -
trunk/Languages/LazFuck.cs.po
r129 r133 16 16 msgstr "Jednoduché BrainFuck IDE napsané v Lazarus/FPC." 17 17 18 #: tformcompilemultiple.buttoncancel.caption 19 #, fuzzy 20 msgctxt "tformcompilemultiple.buttoncancel.caption" 21 msgid "Cancel" 22 msgstr "ZruÅ¡it" 23 24 #: tformcompilemultiple.buttoncompile.caption 25 msgctxt "tformcompilemultiple.buttoncompile.caption" 26 msgid "Compile" 27 msgstr "PÅeloÅŸit" 28 29 #: tformcompilemultiple.caption 30 msgctxt "tformcompilemultiple.caption" 31 msgid "Compile multiple" 32 msgstr "PÅeloÅŸit vÃce" 33 34 #: tformcompilemultiple.listviewtargets.columns[0].caption 35 msgctxt "tformcompilemultiple.listviewtargets.columns[0].caption" 36 msgid "Name" 37 msgstr "Jméno" 38 39 #: tformcompilemultiple.listviewtargets.columns[1].caption 40 msgid "Result" 41 msgstr "VÃœsledek" 42 18 43 #: tformcpu.caption 19 44 msgid "CPU" … … 92 117 93 118 #: tformmain.aprogramcompile.caption 119 msgctxt "tformmain.aprogramcompile.caption" 94 120 msgid "Compile" 95 121 msgstr "PÅeloÅŸit" 122 123 #: tformmain.aprogramcompilemultiple.caption 124 msgctxt "tformmain.aprogramcompilemultiple.caption" 125 msgid "Compile multiple..." 126 msgstr "PÅeloÅŸit vÃce..." 96 127 97 128 #: tformmain.aprogrampause.caption … … 100 131 101 132 #: tformmain.aprogramrun.caption 133 msgctxt "tformmain.aprogramrun.caption" 102 134 msgid "Run" 103 135 msgstr "Spustit" … … 170 202 171 203 #: tformmain.menuitem1.caption 172 msgid " Project"173 msgstr " Projekt"204 msgid "File" 205 msgstr "Soubor" 174 206 175 207 #: tformmain.menuitem10.caption … … 179 211 180 212 #: tformmain.menuitem18.caption 181 msgid "View" 182 msgstr "ZobrazenÃ" 183 184 #: tformmain.menuitem24.caption 213 msgctxt "tformmain.menuitem18.caption" 185 214 msgid "Tools" 186 215 msgstr "Nástroje" 187 216 217 #: tformmain.menuitem24.caption 218 msgctxt "tformmain.menuitem24.caption" 219 msgid "Edit" 220 msgstr "Ãpravy" 221 188 222 #: tformmain.menuitem9.caption 189 msgid "Program" 190 msgstr "Program" 223 msgctxt "tformmain.menuitem9.caption" 224 msgid "Run" 225 msgstr "Spustit" 191 226 192 227 #: tformmain.menuitemopenrecent.caption … … 470 505 471 506 #: tformtargets.listview1.columns[0].caption 507 msgctxt "tformtargets.listview1.columns[0].caption" 472 508 msgid "Name" 473 509 msgstr "Jméno" 474 510 475 511 #: tformtargets.listview1.columns[1].caption 512 msgctxt "tformtargets.listview1.columns[1].caption" 476 513 msgid "Execution path" 477 514 msgstr "Cesta vykonánÃ" 478 515 479 516 #: tformtargets.listview1.columns[2].caption 517 msgctxt "tformtargets.listview1.columns[2].caption" 480 518 msgid "Compiler path" 481 519 msgstr "Cesta pÅekladaÄe" -
trunk/Languages/LazFuck.pot
r128 r133 4 4 #: tcore.applicationinfo.description 5 5 msgid "A simple BrainFuck IDE written in Lazarus/FPC." 6 msgstr "" 7 8 #: tformcompilemultiple.buttoncancel.caption 9 msgctxt "tformcompilemultiple.buttoncancel.caption" 10 msgid "Cancel" 11 msgstr "" 12 13 #: tformcompilemultiple.buttoncompile.caption 14 msgctxt "tformcompilemultiple.buttoncompile.caption" 15 msgid "Compile" 16 msgstr "" 17 18 #: tformcompilemultiple.caption 19 msgctxt "tformcompilemultiple.caption" 20 msgid "Compile multiple" 21 msgstr "" 22 23 #: tformcompilemultiple.listviewtargets.columns[0].caption 24 msgctxt "tformcompilemultiple.listviewtargets.columns[0].caption" 25 msgid "Name" 26 msgstr "" 27 28 #: tformcompilemultiple.listviewtargets.columns[1].caption 29 msgid "Result" 6 30 msgstr "" 7 31 … … 82 106 83 107 #: tformmain.aprogramcompile.caption 108 msgctxt "tformmain.aprogramcompile.caption" 84 109 msgid "Compile" 110 msgstr "" 111 112 #: tformmain.aprogramcompilemultiple.caption 113 msgctxt "tformmain.aprogramcompilemultiple.caption" 114 msgid "Compile multiple..." 85 115 msgstr "" 86 116 … … 90 120 91 121 #: tformmain.aprogramrun.caption 122 msgctxt "tformmain.aprogramrun.caption" 92 123 msgid "Run" 93 124 msgstr "" … … 160 191 161 192 #: tformmain.menuitem1.caption 162 msgid " Project"193 msgid "File" 163 194 msgstr "" 164 195 … … 169 200 170 201 #: tformmain.menuitem18.caption 171 msgid "View" 202 msgctxt "tformmain.menuitem18.caption" 203 msgid "Tools" 172 204 msgstr "" 173 205 174 206 #: tformmain.menuitem24.caption 175 msgid "Tools" 207 msgctxt "tformmain.menuitem24.caption" 208 msgid "Edit" 176 209 msgstr "" 177 210 178 211 #: tformmain.menuitem9.caption 179 msgid "Program" 212 msgctxt "tformmain.menuitem9.caption" 213 msgid "Run" 180 214 msgstr "" 181 215 … … 460 494 461 495 #: tformtargets.listview1.columns[0].caption 496 msgctxt "tformtargets.listview1.columns[0].caption" 462 497 msgid "Name" 463 498 msgstr "" 464 499 465 500 #: tformtargets.listview1.columns[1].caption 501 msgctxt "tformtargets.listview1.columns[1].caption" 466 502 msgid "Execution path" 467 503 msgstr "" 468 504 469 505 #: tformtargets.listview1.columns[2].caption 506 msgctxt "tformtargets.listview1.columns[2].caption" 470 507 msgid "Compiler path" 471 508 msgstr "" -
trunk/LazFuck.lpi
r128 r133 97 97 </Item4> 98 98 </RequiredPackages> 99 <Units Count="2 7">99 <Units Count="28"> 100 100 <Unit0> 101 101 <Filename Value="LazFuck.lpr"/> … … 245 245 <IsPartOfProject Value="True"/> 246 246 </Unit26> 247 <Unit27> 248 <Filename Value="Forms\UFormCompileMultiple.pas"/> 249 <IsPartOfProject Value="True"/> 250 <ComponentName Value="FormCompileMultiple"/> 251 <HasResources Value="True"/> 252 <ResourceBaseClass Value="Form"/> 253 </Unit27> 247 254 </Units> 248 255 </ProjectOptions> -
trunk/LazFuck.lpr
r122 r133 13 13 UFormOutput, UFormInput, UFormMemory, UFormMessages, UFormSourceCode, 14 14 UFormTargetCode, UFormTargetOptions, UCore, Common, 15 UFormLog, UProject, UBFTarget, SysUtils ;15 UFormLog, UProject, UBFTarget, SysUtils, UFormCompileMultiple; 16 16 17 17 {$R *.res} -
trunk/Packages/Common/UCommon.pas
r129 r133 8 8 {$IFDEF WINDOWS}Windows,{$ENDIF} 9 9 {$IFDEF UNIX}baseunix,{$ENDIF} 10 Classes, SysUtils, StrUtils, Dialogs, Process, LCLIntf, 10 Classes, SysUtils, StrUtils, Dialogs, Process, LCLIntf, Graphics, 11 11 FileUtil; //, ShFolder, ShellAPI; 12 12 13 13 type 14 14 TArrayOfByte = array of Byte; 15 TArrayOfString = array of string;16 15 TExceptionEvent = procedure(Sender: TObject; E: Exception) of object; 17 16 … … 35 34 DLLHandle1: HModule; 36 35 36 const 37 clLightBlue = TColor($FF8080); 38 clLightGreen = TColor($80FF80); 39 clLightRed = TColor($8080FF); 40 37 41 {$IFDEF WINDOWS} 38 42 GetUserNameEx: procedure (NameFormat: DWORD; … … 51 55 function ComputerName: string; 52 56 procedure DeleteFiles(APath, AFileSpec: string); 57 function Explode(Separator: Char; Data: string): TStringArray; 53 58 procedure ExecuteProgram(Executable: string; Parameters: array of string); 54 59 procedure FileDialogUpdateFilterFileType(FileDialog: TOpenDialog); … … 65 70 function LoadFileToStr(const FileName: TFileName): AnsiString; 66 71 function LoggedOnUserNameEx(Format: TUserNameFormat): string; 67 function MergeArray(A, B: array of string): T ArrayOfString;72 function MergeArray(A, B: array of string): TStringArray; 68 73 function OccurenceOfChar(What: Char; Where: string): Integer; 69 74 procedure OpenWebPage(URL: string); 75 procedure OpenEmail(Email: string); 70 76 procedure OpenFileInShell(FileName: string); 71 77 function PosFromIndex(SubStr: string; Text: string; … … 83 89 function SplitString(var Text: string; Count: Word): string; 84 90 function StripTags(const S: string): string; 85 function TryHexToInt(Data: string; varValue: Integer): Boolean;86 function TryBinToInt(Data: string; varValue: Integer): Boolean;91 function TryHexToInt(Data: string; out Value: Integer): Boolean; 92 function TryBinToInt(Data: string; out Value: Integer): Boolean; 87 93 procedure SortStrings(Strings: TStrings); 88 94 … … 246 252 end; 247 253 248 function TryHexToInt(Data: string; varValue: Integer): Boolean;254 function TryHexToInt(Data: string; out Value: Integer): Boolean; 249 255 var 250 256 I: Integer; … … 262 268 end; 263 269 264 function TryBinToInt(Data: string; varValue: Integer): Boolean;270 function TryBinToInt(Data: string; out Value: Integer): Boolean; 265 271 var 266 272 I: Integer; … … 290 296 end; 291 297 292 function Explode(Separator: char; Data: string): TArrayOfString; 293 begin 294 Result := nil; 295 SetLength(Result, 0); 296 while Pos(Separator, Data) > 0 do begin 298 function Explode(Separator: Char; Data: string): TStringArray; 299 var 300 Index: Integer; 301 begin 302 Result := Default(TStringArray); 303 repeat 304 Index := Pos(Separator, Data); 305 if Index > 0 then begin 306 SetLength(Result, Length(Result) + 1); 307 Result[High(Result)] := Copy(Data, 1, Index - 1); 308 Delete(Data, 1, Index); 309 end else Break; 310 until False; 311 if Data <> '' then begin 297 312 SetLength(Result, Length(Result) + 1); 298 Result[High(Result)] := Copy(Data, 1, Pos(Separator, Data) - 1); 299 Delete(Data, 1, Pos(Separator, Data)); 300 end; 301 SetLength(Result, Length(Result) + 1); 302 Result[High(Result)] := Data; 303 end; 304 305 {$IFDEF Windows} 313 Result[High(Result)] := Data; 314 end; 315 end; 316 317 {$IFDEF WINDOWS} 306 318 function GetUserName: string; 307 319 const … … 311 323 begin 312 324 L := MAX_USERNAME_LENGTH + 2; 325 Result := Default(string); 313 326 SetLength(Result, L); 314 327 if Windows.GetUserName(PChar(Result), L) and (L > 0) then begin … … 324 337 end; 325 338 end; 326 {$ endif}339 {$ENDIF} 327 340 328 341 function ComputerName: string; 329 {$ ifdef mswindows}342 {$IFDEF WINDOWS} 330 343 const 331 344 INFO_BUFFER_SIZE = 32767; … … 342 355 end; 343 356 end; 344 {$ endif}345 {$ ifdef unix}357 {$ENDIF} 358 {$IFDEF UNIX} 346 359 var 347 360 Name: UtsName; … … 351 364 Result := Name.Nodename; 352 365 end; 353 {$ endif}354 355 {$ ifdef windows}366 {$ENDIF} 367 368 {$IFDEF WINDOWS} 356 369 function LoggedOnUserNameEx(Format: TUserNameFormat): string; 357 370 const … … 431 444 procedure LoadLibraries; 432 445 begin 433 {$IFDEF W indows}446 {$IFDEF WINDOWS} 434 447 DLLHandle1 := LoadLibrary('secur32.dll'); 435 448 if DLLHandle1 <> 0 then … … 442 455 procedure FreeLibraries; 443 456 begin 444 {$IFDEF W indows}457 {$IFDEF WINDOWS} 445 458 if DLLHandle1 <> 0 then FreeLibrary(DLLHandle1); 446 459 {$ENDIF} … … 475 488 end; 476 489 490 procedure OpenEmail(Email: string); 491 begin 492 OpenURL('mailto:' + Email); 493 end; 494 477 495 procedure OpenFileInShell(FileName: string); 478 496 begin … … 503 521 end; 504 522 505 function MergeArray(A, B: array of string): T ArrayOfString;506 var 507 I: Integer; 508 begin 509 Result := Default(T ArrayOfString);523 function MergeArray(A, B: array of string): TStringArray; 524 var 525 I: Integer; 526 begin 527 Result := Default(TStringArray); 510 528 SetLength(Result, Length(A) + Length(B)); 511 529 for I := 0 to Length(A) - 1 do -
trunk/Packages/Common/ULastOpenedList.pas
r102 r133 84 84 destructor TLastOpenedList.Destroy; 85 85 begin 86 Items.Free;86 FreeAndNil(Items); 87 87 inherited; 88 88 end; … … 94 94 begin 95 95 if Assigned(MenuItem) then begin 96 MenuItem.Clear; 96 while MenuItem.Count > Items.Count do 97 MenuItem.Delete(MenuItem.Count - 1); 98 while MenuItem.Count < Items.Count do begin 99 NewMenuItem := TMenuItem.Create(MenuItem); 100 MenuItem.Add(NewMenuItem); 101 end; 97 102 for I := 0 to Items.Count - 1 do begin 98 NewMenuItem := TMenuItem.Create(MenuItem); 99 NewMenuItem.Caption := Items[I]; 100 NewMenuItem.OnClick := ClickAction; 101 MenuItem.Add(NewMenuItem); 103 MenuItem.Items[I].Caption := Items[I]; 104 MenuItem.Items[I].OnClick := ClickAction; 102 105 end; 103 106 end; -
trunk/Packages/Common/UTheme.pas
r122 r133 41 41 property Theme: TTheme read FTheme write SetTheme; 42 42 end; 43 44 const 45 ThemeNameSystem = 'System'; 46 ThemeNameLight = 'Light'; 47 ThemeNameDark = 'Dark'; 43 48 44 49 procedure Register; … … 105 110 inherited; 106 111 Themes := TThemes.Create; 107 with Themes.AddNew( 'System') do begin112 with Themes.AddNew(ThemeNameSystem) do begin 108 113 ColorWindow := clWindow; 109 114 ColorWindowText := clWindowText; … … 113 118 end; 114 119 Theme := TTheme(Themes.First); 115 with Themes.AddNew( 'Dark') do begin120 with Themes.AddNew(ThemeNameDark) do begin 116 121 ColorWindow := RGBToColor($20, $20, $20); 117 122 ColorWindowText := clWhite; … … 120 125 ColorControlSelected := RGBToColor(96, 125, 155); 121 126 end; 122 with Themes.AddNew( 'Light') do begin127 with Themes.AddNew(ThemeNameLight) do begin 123 128 ColorWindow := clWhite; 124 129 ColorWindowText := clBlack; … … 175 180 procedure TThemeManager.UseTheme(Form: TForm); 176 181 begin 177 if not Used and (FTheme.Name = 'System') then Exit;182 if not Used and (FTheme.Name = ThemeNameSystem) then Exit; 178 183 ApplyTheme(Form); 179 184 Used := True; -
trunk/Target/UTargetC.pas
r126 r133 31 31 begin 32 32 inherited; 33 Name := 'C';34 SourceExtension := '.c';35 ImageIndex := 23;36 Capabilities := [tcCompile, tcRun];33 FName := 'C'; 34 FSourceExtension := '.c'; 35 FImageIndex := 23; 36 FCapabilities := [tcCompile, tcRun]; 37 37 {$IFDEF WINDOWS} 38 38 CompilerPath := 'c:\Program Files\MinGW\bin\gcc.exe'; … … 42 42 {$IFDEF UNIX} 43 43 CompilerPath := '/usr/bin/gcc'; 44 CompiledExtension := '';45 RunExtension := '';44 FCompiledExtension := ''; 45 FRunExtension := ''; 46 46 {$ENDIF} 47 47 end; -
trunk/Target/UTargetCSharp.pas
r126 r133 29 29 begin 30 30 inherited; 31 Name := 'C#';32 SourceExtension := '.cs';33 CompiledExtension := '.exe';34 RunExtension := '';35 ImageIndex := 27;36 Capabilities := [tcCompile, tcRun];31 FName := 'C#'; 32 FSourceExtension := '.cs'; 33 FCompiledExtension := '.exe'; 34 FRunExtension := ''; 35 FImageIndex := 27; 36 FCapabilities := [tcCompile, tcRun]; 37 37 {$IFDEF WINDOWS} 38 38 CompilerPath := 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Roslyn\csc.exe'; -
trunk/Target/UTargetDelphi.pas
r126 r133 28 28 begin 29 29 inherited; 30 Name := 'Delphi';31 SourceExtension := '.pas';32 ImageIndex := 22;33 Capabilities := [tcCompile, tcRun];30 FName := 'Delphi'; 31 FSourceExtension := '.pas'; 32 FImageIndex := 22; 33 FCapabilities := [tcCompile, tcRun]; 34 34 {$IFDEF Windows} 35 35 CompilerPath := 'c:\Program Files\Embarcadero\RAD Studio\9.0\bin\DCC32.EXE'; -
trunk/Target/UTargetFPC.pas
r126 r133 28 28 begin 29 29 inherited; 30 Name := 'FPC';31 SourceExtension := '.pas';32 ImageIndex := 22;33 Capabilities := [tcCompile, tcRun];30 FName := 'FPC'; 31 FSourceExtension := '.pas'; 32 FImageIndex := 22; 33 FCapabilities := [tcCompile, tcRun]; 34 34 {$IFDEF WINDOWS} 35 35 CompiledExtension := '.exe'; … … 38 38 {$ENDIF} 39 39 {$IFDEF UNIX} 40 CompiledExtension := '';40 FCompiledExtension := ''; 41 41 CompilerPath := '/usr/bin/fpc'; 42 RunExtension := '';42 FRunExtension := ''; 43 43 {$ENDIF} 44 44 end; -
trunk/Target/UTargetInterpretter.pas
r128 r133 448 448 begin 449 449 inherited; 450 Name := 'Interpretter';451 ImageIndex := 25;452 Capabilities := [tcRun, tcPause, tcStop, tcCompile, tcStepOut, tcStepInto,450 FName := 'Interpretter'; 451 FImageIndex := 25; 452 FCapabilities := [tcRun, tcPause, tcStop, tcCompile, tcStepOut, tcStepInto, 453 453 tcStepOver, tcRunToCursor]; 454 454 // Base commands -
trunk/Target/UTargetJava.pas
r126 r133 29 29 begin 30 30 inherited; 31 Name := 'Java';32 SourceExtension := '.java';33 CompiledExtension := '.class';34 RunExtension := '';35 ImageIndex := 24;36 Capabilities := [tcCompile, tcRun];31 FName := 'Java'; 32 FSourceExtension := '.java'; 33 FCompiledExtension := '.class'; 34 FRunExtension := ''; 35 FImageIndex := 24; 36 FCapabilities := [tcCompile, tcRun]; 37 37 {$IFDEF WINDOWS} 38 38 CompilerPath := 'c:\Program Files\Java\bin\javac.exe'; -
trunk/Target/UTargetJavascript.pas
r126 r133 32 32 begin 33 33 inherited; 34 Name := 'Javascript';35 SourceExtension := '.js';36 ImageIndex := 28;37 Capabilities := [tcCompile, tcRun];34 FName := 'Javascript'; 35 FSourceExtension := '.js'; 36 FImageIndex := 28; 37 FCapabilities := [tcCompile, tcRun]; 38 38 CompilerPath := ''; 39 CompiledExtension := '';40 RunExtension := '';39 FCompiledExtension := ''; 40 FRunExtension := ''; 41 41 end; 42 42 -
trunk/Target/UTargetPHP.pas
r126 r133 29 29 begin 30 30 inherited; 31 Name := 'PHP';32 SourceExtension := '.php';33 RunExtension := '.php';34 CompiledExtension := '.php';35 ImageIndex := 21;36 Capabilities := [tcCompile, tcRun];31 FName := 'PHP'; 32 FSourceExtension := '.php'; 33 FRunExtension := '.php'; 34 FCompiledExtension := '.php'; 35 FImageIndex := 21; 36 FCapabilities := [tcCompile, tcRun]; 37 37 {$IFDEF WINDOWS} 38 38 CompilerPath := ''; -
trunk/Target/UTargetPython.pas
r126 r133 29 29 begin 30 30 inherited; 31 Name := 'Python';32 SourceExtension := '.py';33 RunExtension := '.py';34 CompiledExtension := '.py';35 ImageIndex := 26;36 Capabilities := [tcCompile, tcRun];31 FName := 'Python'; 32 FSourceExtension := '.py'; 33 FRunExtension := '.py'; 34 FCompiledExtension := '.py'; 35 FImageIndex := 26; 36 FCapabilities := [tcCompile, tcRun]; 37 37 {$IFDEF WINDOWS} 38 38 CompilerPath := ''; -
trunk/UCore.lfm
r132 r133 3 3 OnDestroy = DataModuleDestroy 4 4 OldCreateOrder = False 5 Height = 4 336 HorizontalOffset = 7937 VerticalOffset = 4 448 Width = 5 099 PPI = 1 445 Height = 451 6 HorizontalOffset = 826 7 VerticalOffset = 463 8 Width = 530 9 PPI = 150 10 10 object ApplicationInfo: TApplicationInfo 11 11 Identification = 1 … … 541 541 0000000000000000000000000000000000000000000000000000 542 542 } 543 Left = 1 08544 Top = 2 4543 Left = 113 544 Top = 25 545 545 end 546 546 object Translator: TTranslator 547 547 POFilesFolder = 'Languages' 548 Left = 1 08549 Top = 1 08548 Left = 113 549 Top = 113 550 550 end 551 551 object LastOpenedList: TLastOpenedList 552 552 MaxCount = 10 553 Left = 1 08554 Top = 192553 Left = 113 554 Top = 200 555 555 end 556 556 object PersistentForm1: TPersistentForm 557 557 MinVisiblePart = 50 558 558 EntireVisible = False 559 Left = 1 08560 Top = 2 76559 Left = 113 560 Top = 288 561 561 end 562 562 object ImageListMain: TImageList 563 Left = 3 72564 Top = 2 4563 Left = 388 564 Top = 25 565 565 Bitmap = { 566 566 4C7A1D00000010000000100000007B1600000000000078DAED9C07585557B6C7 … … 749 749 object ScaleDPI1: TScaleDPI 750 750 AutoDetect = False 751 Left = 3 72752 Top = 12 0751 Left = 388 752 Top = 125 753 753 end 754 754 object ThemeManager: TThemeManager 755 Left = 3 62756 Top = 2 09755 Left = 377 756 Top = 218 757 757 end 758 758 object AboutDialog: TAboutDialog … … 760 760 ThemeManager = ThemeManager 761 761 ApplicationInfo = ApplicationInfo 762 Left = 3 62763 Top = 288762 Left = 377 763 Top = 300 764 764 end 765 765 end -
trunk/UCore.pas
r131 r133 28 28 FCurrentTarget: TTarget; 29 29 StoredDimension: TControlDimension; 30 procedure InitTargets; 30 31 procedure SetCurrentTarget(AValue: TTarget); 31 32 procedure ScaleDPI; 33 procedure TargetMessageExecute(Text: string); 32 34 public 33 35 DataDir: string; 34 36 Project: TProject; 35 Targets: TTargetList; 37 Targets: TTargets; 38 Messages: TMessages; 36 39 OpenProjectOnStart: Boolean; 37 40 OptimizationLevel: TCompilerOptimization; … … 82 85 83 86 Project := TProject.Create; 84 Targets := TTargetList.Create; 87 Targets := TTargets.Create; 88 Messages := TMessages.Create; 89 85 90 StoredDimension := TControlDimension.Create; 86 87 // Init targets list 88 Targets.Add(TTargetInterpretter.Create); 89 Targets.Add(TTargetDelphi.Create); 90 Targets.Add(TTargetFPC.Create); 91 Targets.Add(TTargetPHP.Create); 92 Targets.Add(TTargetC.Create); 93 Targets.Add(TTargetJava.Create); 94 Targets.Add(TTargetPython.Create); 95 Targets.Add(TTargetCSharp.Create); 96 Targets.Add(TTargetJavascript.Create); 97 91 InitTargets; 98 92 LoadFromRegistry(Core.ApplicationInfo.GetRegistryContext); 99 93 end; … … 102 96 begin 103 97 SaveToRegistry(Core.ApplicationInfo.GetRegistryContext); 98 FreeAndNil(Messages); 104 99 FreeAndNil(Targets); 105 100 FreeAndNil(Project); 106 101 FreeAndNil(StoredDimension); 102 end; 103 104 procedure TCore.InitTargets; 105 var 106 I: Integer; 107 begin 108 with Targets do begin 109 Clear; 110 Add(TTargetInterpretter.Create); 111 Add(TTargetDelphi.Create); 112 Add(TTargetFPC.Create); 113 Add(TTargetPHP.Create); 114 Add(TTargetC.Create); 115 Add(TTargetJava.Create); 116 Add(TTargetPython.Create); 117 Add(TTargetCSharp.Create); 118 Add(TTargetJavascript.Create); 119 for I := 0 to Count - 1 do 120 Items[I].OnMessage := TargetMessageExecute; 121 end; 107 122 end; 108 123 … … 170 185 FCurrentTarget.OnLog := FormMain.TargetLogExecute; 171 186 FCurrentTarget.OptimizationLevel := OptimizationLevel; 172 FCurrentTarget.Messages.OnChange := FormMain.MessagesChanged;173 187 if FCurrentTarget is TBFTarget then begin 174 188 TBFTarget(FCurrentTarget).MemorySize := MemorySize; … … 199 213 end; 200 214 215 procedure TCore.TargetMessageExecute(Text: string); 216 begin 217 Messages.AddMessage(Text); 218 end; 219 201 220 procedure TCore.Init; 202 221 begin -
trunk/UTarget.pas
r128 r133 16 16 TTargetCapabilities = set of TTargetCapability; 17 17 18 TRunState = (rsStopped, rsPaused, rsRunning );18 TRunState = (rsStopped, rsPaused, rsRunning, rsCompiling); 19 19 20 20 TStepOperation = (soNormal, soStepIn, soStepOut); … … 27 27 end; 28 28 29 { TDebugStep List}30 31 TDebugStep List= class(TFPGObjectList<TDebugStep>)29 { TDebugSteps } 30 31 TDebugSteps = class(TFPGObjectList<TDebugStep>) 32 32 function SearchBySourcePos(Pos: Integer): TDebugStep; 33 33 function SearchByProgramPos(Pos: Integer): TDebugStep; … … 44 44 end; 45 45 46 { TBreakPoint List}47 48 TBreakPoint List= class(TFPGObjectList<TBreakPoint>)46 { TBreakPoints } 47 48 TBreakPoints = class(TFPGObjectList<TBreakPoint>) 49 49 procedure AddItem(TargetAddress: Integer); 50 50 procedure SetSystem(TargetAddress: Integer); … … 59 59 end; 60 60 61 { TMessage List}62 63 TMessage List= class(TFPGObjectList<TMessage>)61 { TMessages } 62 63 TMessages = class(TFPGObjectList<TMessage>) 64 64 private 65 65 FOnChange: TNotifyEvent; … … 72 72 73 73 TLogEvent = procedure (Lines: TStrings) of object; 74 TMessageEvent = procedure (Text: string) of object; 74 75 75 76 { TTarget } … … 78 79 private 79 80 FOnLog: TLogEvent; 81 FOnMessage: TMessageEvent; 80 82 protected 83 FCompiledExtension: string; 84 FRunExtension: string; 85 FSourceExtension: string; 86 FName: string; 87 FImageIndex: Integer; 88 FCapabilities: TTargetCapabilities; 81 89 FCompiled: Boolean; 82 90 function SourceReadNext: Char; … … 96 104 procedure SetState(AValue: TRunState); virtual; 97 105 public 98 Name: string;99 106 ProgramName: string; 100 ImageIndex: Integer;101 107 OptimizationLevel: TCompilerOptimization; 102 108 CompilerPath: string; 103 109 ExecutorPath: string; 104 SourceExtension: string;105 RunExtension: string;106 CompiledExtension: string;107 110 ProjectFileName: string; 108 Capabilities: TTargetCapabilities; 109 BreakPoints: TBreakPointList; 110 DebugSteps: TDebugStepList; 111 BreakPoints: TBreakPoints; 112 DebugSteps: TDebugSteps; 111 113 DebugEnabled: Boolean; 112 Messages: TMessageList;114 Selected: Boolean; 113 115 constructor Create; virtual; 114 116 destructor Destroy; override; … … 127 129 procedure LoadFromRegistry(Context: TRegistryContext); virtual; 128 130 procedure SaveToRegistry(Context: TRegistryContext); virtual; 131 property SourceExtension: string read FSourceExtension; 132 property RunExtension: string read FRunExtension; 133 property CompiledExtension: string read FCompiledExtension; 134 property Name: string read FName; 135 property ImageIndex: Integer read FImageIndex; 129 136 property State: TRunState read FState write SetState; 130 137 property SourceCode: string write SetSourceCode; … … 132 139 property Compiled: Boolean read FCompiled write FCompiled; 133 140 property ExecutionPosition: Integer read GetExecutionPosition; 141 property Capabilities: TTargetCapabilities read FCapabilities; 134 142 property OnChangeState: TNotifyEvent read FOnChangeState write FOnChangeState; 135 143 property OnLog: TLogEvent read FOnLog write FOnLog; 136 end; 137 138 { TTargetList } 139 140 TTargetList = class(TFPGObjectList<TTarget>) 144 property OnMessage: TMessageEvent read FOnMessage write FOnMessage; 145 end; 146 147 { TTargets } 148 149 TTargets = class(TFPGObjectList<TTarget>) 141 150 procedure LoadFromRegistry(Context: TRegistryContext); 142 151 procedure SaveToRegistry(Context: TRegistryContext); … … 146 155 end; 147 156 157 const 158 RunStateText: array[TRunState] of string = ('Stopped', 'Paused', 'Running', 159 'Compiling'); 160 148 161 149 162 resourcestring … … 155 168 implementation 156 169 157 { TMessage List}158 159 procedure TMessage List.DoChange;170 { TMessages } 171 172 procedure TMessages.DoChange; 160 173 begin 161 174 if Assigned(FOnChange) then FOnChange(Self); 162 175 end; 163 176 164 procedure TMessage List.AddMessage(Text: string);177 procedure TMessages.AddMessage(Text: string); 165 178 var 166 179 NewItem: TMessage; … … 172 185 end; 173 186 174 procedure TMessage List.AppendMessage(Text: string);187 procedure TMessages.AppendMessage(Text: string); 175 188 begin 176 189 if Count > 0 then begin … … 180 193 end; 181 194 182 { TBreakPoint List}183 184 procedure TBreakPoint List.AddItem(TargetAddress: Integer);195 { TBreakPoints } 196 197 procedure TBreakPoints.AddItem(TargetAddress: Integer); 185 198 var 186 199 NewItem: TBreakPoint; … … 191 204 end; 192 205 193 procedure TBreakPoint List.SetSystem(TargetAddress: Integer);206 procedure TBreakPoints.SetSystem(TargetAddress: Integer); 194 207 begin 195 208 ClearSystem; … … 197 210 end; 198 211 199 procedure TBreakPoint List.AddSystem(TargetAddress: Integer);212 procedure TBreakPoints.AddSystem(TargetAddress: Integer); 200 213 var 201 214 NewItem: TBreakPoint; … … 207 220 end; 208 221 209 procedure TBreakPoint List.ClearSystem;222 procedure TBreakPoints.ClearSystem; 210 223 var 211 224 I: Integer; … … 215 228 end; 216 229 217 function TBreakPoint List.SearchByTargetPos(Pos: Integer): TBreakPoint;230 function TBreakPoints.SearchByTargetPos(Pos: Integer): TBreakPoint; 218 231 var 219 232 I: Integer; … … 225 238 end; 226 239 227 { TDebugStep List}228 229 function TDebugStep List.SearchBySourcePos(Pos: Integer240 { TDebugSteps } 241 242 function TDebugSteps.SearchBySourcePos(Pos: Integer 230 243 ): TDebugStep; 231 244 var … … 238 251 end; 239 252 240 function TDebugStep List.SearchByProgramPos(Pos: Integer): TDebugStep;253 function TDebugSteps.SearchByProgramPos(Pos: Integer): TDebugStep; 241 254 var 242 255 I: Integer; … … 248 261 end; 249 262 250 function TDebugStep List.SearchByTargetPos(Pos: Integer263 function TDebugSteps.SearchByTargetPos(Pos: Integer 251 264 ): TDebugStep; 252 265 var … … 259 272 end; 260 273 261 function TDebugStep List.SearchIndexByProgramPos(Pos: Integer): Integer;274 function TDebugSteps.SearchIndexByProgramPos(Pos: Integer): Integer; 262 275 var 263 276 I: Integer; … … 269 282 end; 270 283 271 procedure TDebugStep List.AddStep(SourcePos, TargetPos: Integer;284 procedure TDebugSteps.AddStep(SourcePos, TargetPos: Integer; 272 285 Operation: TStepOperation); 273 286 var … … 282 295 end; 283 296 284 procedure TDebugStep List.UpdateTargetPos(OldProgramFrom, OldProgramTo, NewProgramFrom,297 procedure TDebugSteps.UpdateTargetPos(OldProgramFrom, OldProgramTo, NewProgramFrom, 285 298 NewProgramTo: Integer; NewTarget: Integer = 0); 286 299 var … … 311 324 end; 312 325 313 { TTarget List}314 315 procedure TTarget List.LoadFromRegistry(Context: TRegistryContext);326 { TTargets } 327 328 procedure TTargets.LoadFromRegistry(Context: TRegistryContext); 316 329 var 317 330 I: Integer; … … 327 340 end; 328 341 329 procedure TTarget List.SaveToRegistry(Context: TRegistryContext);342 procedure TTargets.SaveToRegistry(Context: TRegistryContext); 330 343 var 331 344 I: Integer; … … 342 355 end; 343 356 344 function TTarget List.FindByName(Name: string): TTarget;357 function TTargets.FindByName(Name: string): TTarget; 345 358 var 346 359 I: Integer; … … 352 365 end; 353 366 354 procedure TTarget List.LoadToMenuItem(MenuItem: TMenuItem; Action: TNotifyEvent367 procedure TTargets.LoadToMenuItem(MenuItem: TMenuItem; Action: TNotifyEvent 355 368 ; CurrentTarget: TTarget); 356 369 var … … 359 372 begin 360 373 if Assigned(MenuItem) then begin 361 MenuItem.Clear; 374 while MenuItem.Count > Count do 375 MenuItem.Delete(MenuItem.Count - 1); 376 while MenuItem.Count < Count do begin 377 NewMenuItem := TMenuItem.Create(MenuItem); 378 MenuItem.Add(NewMenuItem); 379 end; 362 380 for I := 0 to Count - 1 do begin 363 NewMenuItem := TMenuItem.Create(MenuItem); 364 NewMenuItem.Caption := Items[I].Name; 365 NewMenuItem.OnClick := Action; 366 NewMenuItem.ImageIndex := Items[I].ImageIndex; 367 if Items[I] = CurrentTarget then NewMenuItem.Checked := True; 368 MenuItem.Add(NewMenuItem); 381 MenuItem.Items[I].Caption := Items[I].Name; 382 MenuItem.Items[I].OnClick := Action; 383 MenuItem.Items[I].ImageIndex := Items[I].ImageIndex; 384 if Items[I] = CurrentTarget then MenuItem.Items[I].Checked := True; 369 385 end; 370 386 end; … … 414 430 inherited; 415 431 OptimizationLevel := coNormal; 416 BreakPoints := TBreakPointList.Create; 417 DebugSteps := TDebugStepList.Create; 418 Messages := TMessageList.Create; 432 BreakPoints := TBreakPoints.Create; 433 DebugSteps := TDebugSteps.Create; 419 434 end; 420 435 421 436 destructor TTarget.Destroy; 422 437 begin 423 FreeAndNil(Messages);424 438 FreeAndNil(DebugSteps); 425 439 FreeAndNil(BreakPoints); … … 429 443 procedure TTarget.Reset; 430 444 begin 431 Messages.Clear;432 445 end; 433 446 … … 551 564 CompilerPath := ReadStringWithDefault('CompilerPath', CompilerPath); 552 565 ExecutorPath := ReadStringWithDefault('ExecutorPath', ExecutorPath); 566 Selected := ReadBoolWithDefault('Selected', Selected); 553 567 finally 554 568 Free; … … 561 575 try 562 576 CurrentContext := Context; 563 if CompilerPath <> '' then WriteString('CompilerPath', CompilerPath) 564 else DeleteValue('CompilerPath'); 565 if ExecutorPath <> '' then WriteString('ExecutorPath', ExecutorPath) 566 else DeleteValue('ExecutorPath'); 577 WriteString('CompilerPath', CompilerPath); 578 WriteString('ExecutorPath', ExecutorPath); 579 WriteBool('Selected', Selected); 567 580 finally 568 581 Free;
Note:
See TracChangeset
for help on using the changeset viewer.