Changeset 143 for trunk/Forms
- Timestamp:
- Mar 8, 2022, 10:55:43 AM (3 years ago)
- Location:
- trunk/Forms
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r136 r143 322 322 Action = FormSourceCode.AGenerateNumber 323 323 end 324 object MenuItem21: TMenuItem 325 Action = FormSourceCode.AGenerateText 326 end 324 327 end 325 328 object MenuItem9: TMenuItem … … 386 389 object ActionList1: TActionList 387 390 Images = Core.ImageListMain 388 Left = 27 0391 Left = 272 389 392 Top = 240 390 393 object AProjectOpen: TAction -
trunk/Forms/UFormMain.pas
r136 r143 54 54 MenuItem2: TMenuItem; 55 55 MenuItem20: TMenuItem; 56 MenuItem21: TMenuItem; 56 57 MenuItem22: TMenuItem; 57 58 MenuItem24: TMenuItem; -
trunk/Forms/UFormMemory.lfm
r112 r143 1 1 object FormMemory: TFormMemory 2 2 Left = 565 3 Height = 3884 Top = 1 825 Width = 5863 Height = 418 4 Top = 168 5 Width = 1082 6 6 Caption = 'Memory' 7 ClientHeight = 3888 ClientWidth = 5869 DesignTimePPI = 1 4410 LCLVersion = '2. 0.2.0'7 ClientHeight = 418 8 ClientWidth = 1082 9 DesignTimePPI = 150 10 LCLVersion = '2.2.0.4' 11 11 object Label6: TLabel 12 12 Left = 6 13 Height = 2 613 Height = 27 14 14 Top = 6 15 Width = 57415 Width = 1070 16 16 Align = alTop 17 17 BorderSpacing.Around = 6 18 18 Caption = 'Memory:' 19 ParentColor = False20 19 ParentFont = False 21 20 end 22 21 object ListViewMemory: TListView 23 22 Left = 6 24 Height = 3 4425 Top = 3 826 Width = 57423 Height = 373 24 Top = 39 25 Width = 1070 27 26 Align = alClient 28 27 BorderSpacing.Around = 6 … … 30 29 item 31 30 Caption = 'Address' 32 Width = 12 031 Width = 125 33 32 end 34 33 item 35 34 Caption = 'Data' 36 Width = 495 35 Width = 516 36 end 37 item 38 Caption = 'Text' 39 Width = 414 37 40 end> 38 Font.Height = -1 841 Font.Height = -19 39 42 Font.Name = 'Courier New' 40 43 OwnerData = True -
trunk/Forms/UFormMemory.lrj
r112 r143 3 3 {"hash":63203738,"name":"tformmemory.label6.caption","sourcebytes":[77,101,109,111,114,121,58],"value":"Memory:"}, 4 4 {"hash":128683235,"name":"tformmemory.listviewmemory.columns[0].caption","sourcebytes":[65,100,100,114,101,115,115],"value":"Address"}, 5 {"hash":305313,"name":"tformmemory.listviewmemory.columns[1].caption","sourcebytes":[68,97,116,97],"value":"Data"} 5 {"hash":305313,"name":"tformmemory.listviewmemory.columns[1].caption","sourcebytes":[68,97,116,97],"value":"Data"}, 6 {"hash":371956,"name":"tformmemory.listviewmemory.columns[2].caption","sourcebytes":[84,101,120,116],"value":"Text"} 6 7 ]} -
trunk/Forms/UFormMemory.pas
r112 r143 54 54 Row: string; 55 55 I: Integer; 56 Text: string; 57 Address: Integer; 56 58 begin 57 59 if Core.CurrentTarget is TTargetInterpretter then … … 60 62 Item.Caption := IntToHex(Item.Index * RowSize, 8); 61 63 Row := ''; 62 for I := 0 to RowSize - 1 do 63 if (Item.Index * RowSize + I) < (MemoryMaxUsedAddr + 1) then 64 Row := Row + ' ' + IntToHex(Memory[Item.Index * RowSize + I], 2); 64 Text := Default(string); 65 SetLength(Text, RowSize); 66 for I := 0 to RowSize - 1 do begin 67 Address := Item.Index * RowSize + I; 68 if Address < (MemoryMaxUsedAddr + 1) then begin 69 Row := Row + ' ' + IntToHex(Memory[Address], 2); 70 if Memory[Address] > Ord(' ') then Text[I + 1] := Chr(Memory[Address]) 71 else Text[I + 1] := ' '; 72 end else Text[I + 1] := ' '; 73 end; 65 74 Item.SubItems.Add(Row); 75 Item.SubItems.Add(Text); 66 76 end; 67 77 end; -
trunk/Forms/UFormSourceCode.lfm
r133 r143 1 1 object FormSourceCode: TFormSourceCode 2 2 Left = 459 3 Height = 5893 Height = 614 4 4 Top = 278 5 Width = 6725 Width = 700 6 6 Caption = 'Source code' 7 ClientHeight = 5898 ClientWidth = 6729 DesignTimePPI = 1 447 ClientHeight = 614 8 ClientWidth = 700 9 DesignTimePPI = 150 10 10 OnCreate = FormCreate 11 11 OnDestroy = FormDestroy … … 13 13 inline SynEditSource: TSynEdit 14 14 Left = 0 15 Height = 58915 Height = 614 16 16 Top = 0 17 Width = 67217 Width = 700 18 18 Align = alClient 19 Font.Height = -1 619 Font.Height = -17 20 20 Font.Name = 'Courier New' 21 21 Font.Pitch = fpFixed … … 29 29 OnKeyUp = MemoSourceKeyUp 30 30 OnMouseDown = MemoSourceMouseDown 31 Gutter.Width = 8 031 Gutter.Width = 83 32 32 Gutter.MouseActions = <> 33 33 RightGutter.Width = 0 … … 479 479 inline SynLeftGutterPartList1: TSynGutterPartList 480 480 object SynGutterMarks1: TSynGutterMarks 481 Width = 3 6481 Width = 38 482 482 MouseActions = <> 483 483 end … … 506 506 object SynGutterCodeFolding1: TSynGutterCodeFolding 507 507 AutoSize = False 508 Width = 1 4508 Width = 15 509 509 MouseActions = <> 510 510 MarkupInfo.Background = clNone … … 517 517 object PopupMenuSource: TPopupMenu 518 518 Images = Core.ImageListMain 519 Left = 1 54520 Top = 1 54519 Left = 160 520 Top = 160 521 521 object MenuItem23: TMenuItem 522 522 Action = FormMain.ABreakpointToggle 523 end524 object MenuItem26: TMenuItem525 Action = AFormatSource526 end527 object MenuItem21: TMenuItem528 Action = AGenerateNumber529 523 end 530 524 object MenuItem29: TMenuItem … … 567 561 } 568 562 end 563 object Separator1: TMenuItem 564 Caption = '-' 565 end 566 object MenuItem26: TMenuItem 567 Action = AFormatSource 568 end 569 569 object MenuItem36: TMenuItem 570 570 Action = AShrinkSource 571 end 572 object MenuItem21: TMenuItem 573 Action = AGenerateNumber 574 end 575 object MenuItem7: TMenuItem 576 Action = AGenerateText 571 577 end 572 578 object MenuItem1: TMenuItem … … 591 597 object ActionList1: TActionList 592 598 Images = Core.ImageListMain 593 Left = 15 2594 Top = 67599 Left = 158 600 Top = 70 595 601 object AGenerateNumber: TAction 596 602 Caption = 'Generate number' … … 641 647 ShortCut = 16472 642 648 end 649 object AGenerateText: TAction 650 Caption = 'Generate text' 651 ImageIndex = 29 652 OnExecute = AGenerateTextExecute 653 end 643 654 end 644 655 object SynJavaSyn1: TSynJavaSyn 645 656 DefaultFilter = 'Soubory Java (*.java)|*.java' 646 657 Enabled = False 647 Left = 486648 Top = 3 16658 Left = 506 659 Top = 329 649 660 end 650 661 end -
trunk/Forms/UFormSourceCode.lrj
r115 r143 15 15 {"hash":195296268,"name":"tformsourcecode.aselectall.hint","sourcebytes":[83,101,108,101,99,116,32,97,108,108],"value":"Select all"}, 16 16 {"hash":19140,"name":"tformsourcecode.acuttoclipboard.caption","sourcebytes":[67,117,116],"value":"Cut"}, 17 {"hash":19140,"name":"tformsourcecode.acuttoclipboard.hint","sourcebytes":[67,117,116],"value":"Cut"} 17 {"hash":19140,"name":"tformsourcecode.acuttoclipboard.hint","sourcebytes":[67,117,116],"value":"Cut"}, 18 {"hash":129197108,"name":"tformsourcecode.ageneratetext.caption","sourcebytes":[71,101,110,101,114,97,116,101,32,116,101,120,116],"value":"Generate text"} 18 19 ]} -
trunk/Forms/UFormSourceCode.pas
r131 r143 15 15 16 16 TFormSourceCode = class(TForm) 17 AGenerateText: TAction; 17 18 ACutToClipboard: TAction; 18 19 ASelectAll: TAction; … … 35 36 MenuItem5: TMenuItem; 36 37 MenuItem6: TMenuItem; 38 MenuItem7: TMenuItem; 39 Separator1: TMenuItem; 37 40 PopupMenuSource: TPopupMenu; 38 41 SynEditSource: TSynEdit; … … 43 46 procedure AFormatSourceExecute(Sender: TObject); 44 47 procedure AGenerateNumberExecute(Sender: TObject); 48 procedure AGenerateTextExecute(Sender: TObject); 45 49 procedure APasteFromClipboardExecute(Sender: TObject); 46 50 procedure ASelectAllExecute(Sender: TObject); … … 72 76 73 77 uses 74 UCore, UFormMain ;78 UCore, UFormMain, UBFCodeTools; 75 79 76 80 resourcestring 77 81 SNumberGeneration = 'Number generation'; 78 82 SEnterNumber = 'Enter number'; 79 83 STextGeneration = 'Text generation'; 84 SEnterText = 'Enter text'; 80 85 81 86 { TFormSourceCode } … … 83 88 procedure TFormSourceCode.AGenerateNumberExecute(Sender: TObject); 84 89 var 90 Number: Integer; 85 91 NumberText: string; 86 Number: Integer;87 I: Integer;88 92 begin 89 93 NumberText := InputBox(SNumberGeneration, SEnterNumber, '1'); 90 94 if TryStrToInt(NumberText, Number) then begin 91 NumberText := ''; 92 for I := 0 to Number - 1 do 93 NumberText := NumberText + '+'; 94 SynEditSource.SelText := NumberText; 95 SynEditSource.SelText := GenerateNumber(Number); 95 96 end; 96 97 end; 97 98 99 procedure TFormSourceCode.AGenerateTextExecute(Sender: TObject); 100 var 101 Text: string; 102 begin 103 Text := InputBox(STextGeneration, SEnterText, ''); 104 SynEditSource.SelText := GenerateText(Text); 105 end; 106 98 107 procedure TFormSourceCode.APasteFromClipboardExecute(Sender: TObject); 99 108 begin … … 107 116 108 117 procedure TFormSourceCode.AFormatSourceExecute(Sender: TObject); 109 var 110 Source: string; 111 NewSource: string; 112 Indent: Integer; 113 I: Integer; 114 const 115 IndentText = ' '; 116 begin 117 Source := SynEditSource.Text; 118 NewSource := ''; 119 Indent := 0; 120 for I := 1 to Length(Source) do begin 121 if Source[I] = '[' then begin 122 NewSource := NewSource + LineEnding + DupeString(IndentText, Indent) + Source[I] + LineEnding ; 123 Inc(Indent); 124 NewSource := NewSource + DupeString(IndentText, Indent); 125 end 126 else if Source[I] = ']' then begin 127 Dec(Indent); 128 NewSource := NewSource + LineEnding + DupeString(IndentText, Indent) + Source[I] + LineEnding + DupeString(IndentText, Indent); 129 end 130 else if Ord(Source[I]) > $20 then 131 NewSource := NewSource + Source[I]; 132 end; 133 SynEditSource.Text := NewSource; 118 begin 119 SynEditSource.Text := FormatCode(SynEditSource.Text); 134 120 MemoSourceChange(nil); 135 121 end; … … 151 137 152 138 procedure TFormSourceCode.AShrinkSourceExecute(Sender: TObject); 153 var 154 Source: string; 155 Pos: Integer; 156 I: Integer; 157 begin 158 Source := SynEditSource.Text; 159 Pos := 1; 160 for I := 1 to Length(Source) do begin 161 if Source[I] > ' ' then begin 162 Source[Pos] := Source[I]; 163 Inc(Pos); 164 end; 165 end; 166 SetLength(Source, Pos - 1); 167 SynEditSource.Text := Source; 139 begin 140 SynEditSource.Text := ShrinkCode(SynEditSource.Text); 168 141 MemoSourceChange(nil); 169 142 end;
Note:
See TracChangeset
for help on using the changeset viewer.