Changeset 47
- Timestamp:
- Jul 12, 2012, 8:21:21 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r46 r47 829 829 Caption = 'Tools' 830 830 object MenuItem25: TMenuItem 831 Action = AFormatSource831 Action = FormSourceCode.AFormatSource 832 832 end 833 833 object MenuItem27: TMenuItem 834 Action = AShrinkSource834 Action = FormSourceCode.AShrinkSource 835 835 end 836 836 object MenuItem28: TMenuItem 837 Action = AGenerateNumber837 Action = FormSourceCode.AGenerateNumber 838 838 Bitmap.Data = { 839 839 36040000424D3604000000000000360000002800000010000000100000000100 … … 1083 1083 OnExecute = AOptionsExecute 1084 1084 end 1085 object AFormatSource: TAction1086 Category = 'Tool'1087 Caption = 'Format source'1088 OnExecute = AFormatSourceExecute1089 end1090 object AShrinkSource: TAction1091 Category = 'Tool'1092 Caption = 'Shrink source'1093 OnExecute = AShrinkSourceExecute1094 end1095 object AGenerateNumber: TAction1096 Category = 'Tool'1097 Caption = 'Generate code for number'1098 ImageIndex = 131099 OnExecute = AGenerateNumberExecute1100 end1101 1085 object AViewCompilers: TAction 1102 1086 Category = 'View' … … 1124 1108 top = 72 1125 1109 Bitmap = { 1126 4C691 200000010000000100000000000000000000000000000000000000000001110 4C69150000001000000010000000000000000000000000000000000000000000 1127 1111 0000000000000000000000000000000000000000000000000000000000000000 1128 1112 000000000000000000000000000000000000000000FF000000FF000000FF0000 … … 1700 1684 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 1701 1685 FF00FFFFFF00FFFFFF000000ABA60000AB5B0000AA06FFFFFF00FFFFFF00FFFF 1686 FF00FFFFFF00FFFFFF00FFFFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 1687 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 1688 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 1689 FF00000000FF000000FF000000FF000000FFFF00FF00FF00FF00FF00FF00FF00 1690 FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF000000FF000000FF0000 1691 00FF000000FF00FFFFFF00FFFFFF000000FF000000FF000000FF000000FF0000 1692 00FFFF00FF00FF00FF00FF00FF00000000FF008484FF848484FF008484FF0000 1693 00FF00FFFFFF000000FF000000FF00FFFFFF000000FF848484FF008484FF8484 1694 84FF000000FFFF00FF00FF00FF00000000FF848484FF848484FF000000FFFF00 1695 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF848484FF0084 1696 84FF000000FFFF00FF00FF00FF00000000FF008484FF848484FF000000FF0000 1697 00FF000000FF000000FF000000FF000000FF000000FF000000FF848484FF8484 1698 84FF000000FFFF00FF00FF00FF00000000FF848484FF008484FF848484FF0084 1699 84FF848484FF008484FF848484FF008484FF848484FF008484FF848484FF0084 1700 84FF000000FFFF00FF00FF00FF00000000FF008484FF848484FF008484FF8484 1701 84FF008484FF840000FF840000FF840000FF840000FF840000FF840000FF8400 1702 00FF000000FFFF00FF00FF00FF00000000FF848484FF008484FF848484FF0084 1703 84FF848484FF840000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8400 1704 00FF840000FFFF00FF00FF00FF00000000FF008484FF848484FF008484FF8484 1705 84FF008484FF840000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8400 1706 00FFFFFFFFFF840000FFFF00FF00000000FF848484FF008484FF848484FF0084 1707 84FF848484FF840000FFFFFFFFFF000000FF000000FF000000FFFFFFFFFF8400 1708 00FF840000FF840000FF840000FF000000FF008484FF848484FF008484FF8484 1709 84FF008484FF840000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 1710 FFFFFFFFFFFFFFFFFFFF840000FF000000FF848484FF008484FF848484FF0084 1711 84FF848484FF840000FFFFFFFFFF000000FF000000FF000000FF000000FF0000 1712 00FF000000FFFFFFFFFF840000FFFF00FF00000000FF000000FF000000FF0000 1713 00FF000000FF840000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 1714 FFFFFFFFFFFFFFFFFFFF840000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00 1715 FF00FF00FF00840000FF840000FF840000FF840000FF840000FF840000FF8400 1716 00FF840000FF840000FF840000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00 1717 FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 1718 FF00FF00FF00FF00FF00FF00FF00000000000000000000000000000000000000 1719 0000000000000000000000000000000000000000000000000000000000000000 1720 0000000000000000000000000000000000000000000000000000000000000000 1721 0000000000000000000000000000000000000000000000000000000000000000 1722 000000000000000000000000000000000000000000FF000000FF000000FF0000 1723 00FF000000FF000000FF00000000000000000000000000000000000000000000 1724 000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFF 1725 FFFFFFFFFFFF000000FF000000FF000000000000000000000000000000000000 1726 000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFF 1727 FFFFFFFFFFFF000000FFFFFFFFFF000000FF0000000000000000000000000000 1728 000000000000000000000000000000000000000000FFFFFFFFFF000000FF0000 1729 00FFFFFFFFFF000000FF840000FF840000FF840000FF840000FF840000FF8400 1730 00FF00000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFF 1731 FFFFFFFFFFFFFFFFFFFF840000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8400 1732 00FF840000FF000000000000000000000000000000FFFFFFFFFF000000FF0000 1733 00FF000000FF000000FF840000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8400 1734 00FFFFFFFFFF840000FF0000000000000000000000FFFFFFFFFFFFFFFFFFFFFF 1735 FFFFFFFFFFFFFFFFFFFF840000FFFFFFFFFF000000FF000000FFFFFFFFFF8400 1736 00FF840000FF840000FF840000FF00000000000000FFFFFFFFFF000000FF0000 1737 00FF000000FF000000FF840000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 1738 FFFFFFFFFFFFFFFFFFFF840000FF00000000000000FFFFFFFFFFFFFFFFFFFFFF 1739 FFFFFFFFFFFFFFFFFFFF840000FFFFFFFFFF000000FF000000FF000000FF0000 1740 00FF000000FFFFFFFFFF840000FF00000000000000FF000000FF000000FF0000 1741 00FF000000FF000000FF840000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 1742 FFFFFFFFFFFFFFFFFFFF840000FF000000000000000000000000000000000000 1743 00000000000000000000840000FFFFFFFFFF000000FF000000FF000000FF0000 1744 00FF000000FFFFFFFFFF840000FF000000000000000000000000000000000000 1745 00000000000000000000840000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 1746 FFFFFFFFFFFFFFFFFFFF840000FF000000000000000000000000000000000000 1747 00000000000000000000840000FF840000FF840000FF840000FF840000FF8400 1748 00FF840000FF840000FF840000FF000000000000000000000000000000000000 1749 0000000000000000000000000000000000000000000000000000000000000000 1750 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 1751 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 1752 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 1753 FF00000000FFFFFFFF00FFFFFF00FFFFFF00000000FFFFFFFF00FFFFFF00FFFF 1754 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 1755 FF00000000FFFFFFFF00FFFFFF00FFFFFF00000000FFFFFFFF00FFFFFF00FFFF 1756 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 1757 FF00000000FFFFFFFF00FFFFFF00FFFFFF00000000FFFFFFFF00FFFFFF00FFFF 1758 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 1759 FF00000000FF000000FFFFFFFF00000000FF000000FFFFFFFF00FFFFFF00FFFF 1760 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 1761 FF00FFFFFF00000000FFFFFFFF00000000FFFFFFFF00FFFFFF00FFFFFF00FFFF 1762 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 1763 FF00FFFFFF00000000FF000000FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFF 1764 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 1765 FF00FFFFFF00FFFFFF00000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 1766 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 1767 FF00FFFFFF00800000FF000000FF800000FFFFFFFF00FFFFFF00FFFFFF00FFFF 1768 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 1769 FF00FFFFFF00800000FFFFFFFF00800000FF800000FF800000FFFFFFFF00FFFF 1770 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008000 1771 00FF800000FF800000FFFFFFFF00800000FFFFFFFF00FFFFFF00800000FFFFFF 1772 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00800000FFFFFF 1773 FF00FFFFFF00800000FFFFFFFF00800000FFFFFFFF00FFFFFF00800000FFFFFF 1774 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00800000FFFFFF 1775 FF00FFFFFF00800000FFFFFFFF00800000FFFFFFFF00FFFFFF00800000FFFFFF 1776 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00800000FFFFFF 1777 FF00FFFFFF00800000FFFFFFFF00FFFFFF00800000FF800000FFFFFFFF00FFFF 1778 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008000 1779 00FF800000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 1780 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 1781 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 1702 1782 FF00FFFFFF00FFFFFF00FFFFFF00 1703 1783 } -
trunk/Forms/UFormMain.lrt
r44 r47 31 31 TMAINFORM.ABREAKPOINTTOGGLE.CAPTION=Toggle breakpoint 32 32 TMAINFORM.AOPTIONS.CAPTION=Options 33 TMAINFORM.AFORMATSOURCE.CAPTION=Format source34 TMAINFORM.ASHRINKSOURCE.CAPTION=Shrink source35 TMAINFORM.AGENERATENUMBER.CAPTION=Generate code for number36 33 TMAINFORM.AVIEWCOMPILERS.CAPTION=Compilers 37 34 TMAINFORM.ASHOWTARGETPOSITION.CAPTION=Show position in target -
trunk/Forms/UFormMain.pas
r46 r47 27 27 ABreakpointToggle: TAction; 28 28 AViewCompilers: TAction; 29 AGenerateNumber: TAction;30 AShrinkSource: TAction;31 AFormatSource: TAction;32 29 AOptions: TAction; 33 30 AProgramStepOut: TAction; … … 119 116 procedure ABreakpointToggleExecute(Sender: TObject); 120 117 procedure AExitExecute(Sender: TObject); 121 procedure AFormatSourceExecute(Sender: TObject);122 procedure AGenerateNumberExecute(Sender: TObject);123 118 procedure AOptionsExecute(Sender: TObject); 124 119 procedure AProgramCompileExecute(Sender: TObject); … … 138 133 procedure AShowSourcePositionExecute(Sender: TObject); 139 134 procedure AShowTargetPositionExecute(Sender: TObject); 140 procedure AShrinkSourceExecute(Sender: TObject);141 135 procedure AViewCompilersExecute(Sender: TObject); 142 136 procedure AViewInterpretterExecute(Sender: TObject); … … 145 139 procedure FormDestroy(Sender: TObject); 146 140 procedure FormShow(Sender: TObject); 147 procedure MemoSourceChange(Sender: TObject);148 procedure MemoSourceKeyDown(Sender: TObject; var Key: Word;149 Shift: TShiftState);150 procedure MemoSourceKeyPress(Sender: TObject; var Key: char);151 procedure MemoSourceKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState152 );153 procedure MemoSourceMouseDown(Sender: TObject; Button: TMouseButton;154 Shift: TShiftState; X, Y: Integer);155 141 procedure TimerRefreshTimer(Sender: TObject); 156 142 private … … 193 179 194 180 resourcestring 195 SEnterNumber = 'Enter number';196 SNumberGeneration = 'Number generation';197 181 SProgramExited = 'Program exited'; 198 182 SProgramStarted = 'Program started'; … … 215 199 end; 216 200 217 procedure TMainForm.MemoSourceChange(Sender: TObject);218 begin219 Modified := True;220 CurrentTarget.Compiled := False;221 UpdateInterface;222 end;223 224 procedure TMainForm.MemoSourceKeyDown(Sender: TObject; var Key: Word;225 Shift: TShiftState);226 begin227 end;228 229 procedure TMainForm.MemoSourceKeyPress(Sender: TObject; var Key: char);230 begin231 end;232 233 procedure TMainForm.MemoSourceKeyUp(Sender: TObject; var Key: Word;234 Shift: TShiftState);235 begin236 UpdateStatusBar;237 end;238 239 procedure TMainForm.MemoSourceMouseDown(Sender: TObject; Button: TMouseButton;240 Shift: TShiftState; X, Y: Integer);241 begin242 UpdateStatusBar;243 end;244 245 201 procedure TMainForm.TimerRefreshTimer(Sender: TObject); 246 202 begin … … 281 237 LastOpenedList.AddItem(FileName); 282 238 ProjectFileName := FileName; 283 UpdateInterface;284 239 Modified := False; 285 240 CurrentTarget.Compiled := False; 241 UpdateInterface; 286 242 end; 287 243 … … 485 441 end; 486 442 487 procedure TMainForm.AShrinkSourceExecute(Sender: TObject);488 var489 Source: string;490 Pos: Integer;491 I: Integer;492 begin493 Source := FormSourceCode.MemoSource.Text;494 Pos := 1;495 for I := 1 to Length(Source) do begin496 if Source[I] > ' ' then begin497 Source[Pos] := Source[I];498 Inc(Pos);499 end;500 end;501 SetLength(Source, Pos - 1);502 FormSourceCode.MemoSource.Text := Source;503 end;504 505 443 procedure TMainForm.AViewCompilersExecute(Sender: TObject); 506 444 begin … … 521 459 begin 522 460 Close; 523 end;524 525 procedure TMainForm.AFormatSourceExecute(Sender: TObject);526 var527 Source: string;528 NewSource: string;529 Indent: Integer;530 I: Integer;531 const532 IndentText = ' ';533 begin534 Source := FormSourceCode.MemoSource.Text;535 NewSource := '';536 Indent := 0;537 for I := 1 to Length(Source) do begin538 if Source[I] = '[' then begin539 NewSource := NewSource + LineEnding + DupeString(IndentText, Indent) + Source[I] + LineEnding ;540 Inc(Indent);541 NewSource := NewSource + DupeString(IndentText, Indent);542 end543 else if Source[I] = ']' then begin544 Dec(Indent);545 NewSource := NewSource + LineEnding + DupeString(IndentText, Indent) + Source[I] + LineEnding + DupeString(IndentText, Indent);546 end547 else if Ord(Source[I]) > $20 then548 NewSource := NewSource + Source[I];549 end;550 FormSourceCode.MemoSource.Text := NewSource;551 end;552 553 procedure TMainForm.AGenerateNumberExecute(Sender: TObject);554 var555 NumberText: string;556 Number: Integer;557 I: Integer;558 begin559 NumberText := InputBox(SNumberGeneration, SEnterNumber, '1');560 if TryStrToInt(NumberText, Number) then begin561 NumberText := '';562 for I := 0 to Number - 1 do563 NumberText := NumberText + '+';564 FormSourceCode.MemoSource.Text := FormSourceCode.MemoSource.Text + NumberText;565 end;566 461 end; 567 462 … … 665 560 procedure TMainForm.AProjectCloseExecute(Sender: TObject); 666 561 begin 562 if Modified then AProjectSaveAs.Execute; 667 563 AProgramStop.Execute; 668 Modified := False;669 564 ProjectFileName := ''; 670 565 FormSourceCode.MemoSource.Clear; 566 Modified := False; 671 567 UpdateInterface; 672 568 end; … … 689 585 procedure TMainForm.AProjectOpenExecute(Sender: TObject); 690 586 begin 587 AProjectClose.Execute; 691 588 OpenDialog1.FileName := ProjectFileName; 692 589 if OpenDialog1.Execute then begin -
trunk/Forms/UFormSourceCode.lfm
r46 r47 1 1 object FormSourceCode: TFormSourceCode 2 Left = 3732 Left = 627 3 3 Height = 240 4 Top = 2164 Top = 182 5 5 Width = 320 6 6 Caption = 'Source code' … … 16 16 Font.Height = -12 17 17 Font.Name = 'Courier New' 18 OnChange = MemoSourceChange 19 OnKeyDown = MemoSourceKeyDown 20 OnKeyPress = MemoSourceKeyPress 21 OnKeyUp = MemoSourceKeyUp 22 OnMouseDown = MemoSourceMouseDown 18 23 ParentFont = False 19 24 PopupMenu = PopupMenuSource … … 23 28 object PopupMenuSource: TPopupMenu 24 29 Images = MainForm.ImageList1 25 left = 8426 top = 1 5630 left = 128 31 top = 112 27 32 object MenuItem23: TMenuItem 28 Bitmap.Data = { 29 36040000424D3604000000000000360000002800000010000000100000000100 30 2000000000000004000064000000640000000000000000000000FFFFFF00FFFF 31 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 32 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 33 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 34 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 35 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 36 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 37 FF000000810000007500000064200000607E000060B2000060C8000060B20000 38 607E000064200000750000008100FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 39 FF00000081000000784102027DC10A0AA8E70F0FCAF81111D5FE0F0FCAF80A0A 40 A8E702027DC10000784100008100FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 41 FF0000008420030389C11515BFF31212CDFF1111CCFF1111CCFF1111CCFF1111 42 CCFF0E0EBCF3020288C100008420FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 43 FF000000897E1818AFE61414C1FF1111BFFF1111BFFF1111BFFF1111BFFF1111 44 BFFF1111BFFF0A0AA6E60000897EFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 45 FF0000008FB23434C3F81414B2FF1111B1FF1111B1FF1111B1FF1111B1FF1111 46 B1FF1111B1FF1414B0F800008FB2FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 47 FF00000095C84848D0FE2E2EB8FF1D1DADFF1212A5FF1111A4FF1111A4FF1111 48 A4FF1111A4FF1B1BADFE000095C8FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 49 FF0000009AB24A4AD4F83737BFFF3737BFFF3131BAFF2727B0FF1C1CA6FF1616 50 A0FF12129CFF2323AEF800009AB2FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 51 FF0000009E7E3939CCE64A4AD2FF4545CDFF4545CDFF4545CDFF4545CDFF4545 52 CDFF4848D0FF3131C3E600009E7EFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 53 FF000000A3200A0AABC15555E3F35A5AE2FF5656DEFF5656DEFF5656DEFF5959 54 E1FF5050DEF30909AAC10000A320FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 55 FF000000A4000000A6410A0AAEC13F3FD5E76060EDF86A6AF3FE6060ECF83E3E 56 D4E70A0AADC10000A6410000A400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 57 FF000000A4000000A6000000A9200000AA7E0000AAB20000AAC80000AAB20000 58 AA7E0000A9200000A6000000A400FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 59 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 60 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 61 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 62 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00 63 } 33 Action = MainForm.ABreakpointToggle 64 34 end 65 35 object MenuItem26: TMenuItem 36 Action = AFormatSource 66 37 end 67 38 object MenuItem21: TMenuItem 39 Action = AGenerateNumber 68 40 end 69 41 object MenuItem29: TMenuItem 42 Action = MainForm.AShowTargetPosition 70 43 Bitmap.Data = { 71 44 36040000424D3604000000000000360000002800000010000000100000000100 … … 106 79 end 107 80 object MenuItem36: TMenuItem 81 Action = AShrinkSource 82 end 83 object MenuItem1: TMenuItem 84 Caption = '-' 85 end 86 object MenuItem2: TMenuItem 87 Action = ACopyToClipboard 88 end 89 object MenuItem3: TMenuItem 90 Action = APasteFromClipboard 91 end 92 object MenuItem6: TMenuItem 93 Action = ACutToClipboard 94 end 95 object MenuItem4: TMenuItem 96 Action = AClear 97 end 98 object MenuItem5: TMenuItem 99 Action = ASelectAll 100 end 101 end 102 object ActionList1: TActionList 103 Images = MainForm.ImageList1 104 left = 128 105 top = 56 106 object AGenerateNumber: TAction 107 Caption = 'Generate number' 108 ImageIndex = 13 109 OnExecute = AGenerateNumberExecute 110 end 111 object AShrinkSource: TAction 112 Caption = 'Shrink source' 113 Hint = 'Shrink source' 114 OnExecute = AShrinkSourceExecute 115 end 116 object AFormatSource: TAction 117 Caption = 'Format source' 118 Hint = 'Format source' 119 OnExecute = AFormatSourceExecute 120 end 121 object APasteFromClipboard: TAction 122 Caption = 'Paste' 123 Hint = 'Paste' 124 ImageIndex = 18 125 OnExecute = APasteFromClipboardExecute 126 ShortCut = 16470 127 end 128 object ACopyToClipboard: TAction 129 Caption = 'Copy' 130 Hint = 'Copy' 131 ImageIndex = 19 132 OnExecute = ACopyToClipboardExecute 133 ShortCut = 16451 134 end 135 object AClear: TAction 136 Caption = 'Clear' 137 Hint = 'Clear' 138 ImageIndex = 4 139 OnExecute = AClearExecute 140 end 141 object ASelectAll: TAction 142 Caption = 'Select all' 143 Hint = 'Select all' 144 OnExecute = ASelectAllExecute 145 ShortCut = 16449 146 end 147 object ACutToClipboard: TAction 148 Caption = 'Cut' 149 Hint = 'Cut' 150 ImageIndex = 20 151 OnExecute = ACutToClipboardExecute 152 ShortCut = 16472 108 153 end 109 154 end -
trunk/Forms/UFormSourceCode.lrt
r46 r47 1 1 TFORMSOURCECODE.CAPTION=Source code 2 TFORMSOURCECODE.MENUITEM1.CAPTION=- 3 TFORMSOURCECODE.AGENERATENUMBER.CAPTION=Generate number 4 TFORMSOURCECODE.ASHRINKSOURCE.CAPTION=Shrink source 5 TFORMSOURCECODE.ASHRINKSOURCE.HINT=Shrink source 6 TFORMSOURCECODE.AFORMATSOURCE.CAPTION=Format source 7 TFORMSOURCECODE.AFORMATSOURCE.HINT=Format source 8 TFORMSOURCECODE.APASTEFROMCLIPBOARD.CAPTION=Paste 9 TFORMSOURCECODE.APASTEFROMCLIPBOARD.HINT=Paste 10 TFORMSOURCECODE.ACOPYTOCLIPBOARD.CAPTION=Copy 11 TFORMSOURCECODE.ACOPYTOCLIPBOARD.HINT=Copy 12 TFORMSOURCECODE.ACLEAR.CAPTION=Clear 13 TFORMSOURCECODE.ACLEAR.HINT=Clear 14 TFORMSOURCECODE.ASELECTALL.CAPTION=Select all 15 TFORMSOURCECODE.ASELECTALL.HINT=Select all 16 TFORMSOURCECODE.ACUTTOCLIPBOARD.CAPTION=Cut 17 TFORMSOURCECODE.ACUTTOCLIPBOARD.HINT=Cut -
trunk/Forms/UFormSourceCode.pas
r46 r47 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 Menus ;9 Menus, ActnList, strutils; 10 10 11 11 type … … 14 14 15 15 TFormSourceCode = class(TForm) 16 ACutToClipboard: TAction; 17 ASelectAll: TAction; 18 APasteFromClipboard: TAction; 19 ACopyToClipboard: TAction; 20 AClear: TAction; 21 AFormatSource: TAction; 22 AShrinkSource: TAction; 23 AGenerateNumber: TAction; 24 ActionList1: TActionList; 16 25 MemoSource: TMemo; 26 MenuItem1: TMenuItem; 27 MenuItem2: TMenuItem; 17 28 MenuItem21: TMenuItem; 18 29 MenuItem23: TMenuItem; 19 30 MenuItem26: TMenuItem; 20 31 MenuItem29: TMenuItem; 32 MenuItem3: TMenuItem; 21 33 MenuItem36: TMenuItem; 34 MenuItem4: TMenuItem; 35 MenuItem5: TMenuItem; 36 MenuItem6: TMenuItem; 22 37 PopupMenuSource: TPopupMenu; 38 procedure AClearExecute(Sender: TObject); 39 procedure ACopyToClipboardExecute(Sender: TObject); 40 procedure ACutToClipboardExecute(Sender: TObject); 41 procedure AFormatSourceExecute(Sender: TObject); 42 procedure AGenerateNumberExecute(Sender: TObject); 43 procedure APasteFromClipboardExecute(Sender: TObject); 44 procedure ASelectAllExecute(Sender: TObject); 45 procedure AShrinkSourceExecute(Sender: TObject); 46 procedure MemoSourceChange(Sender: TObject); 47 procedure MemoSourceKeyDown(Sender: TObject; var Key: Word; 48 Shift: TShiftState); 49 procedure MemoSourceKeyPress(Sender: TObject; var Key: char); 50 procedure MemoSourceKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState 51 ); 52 procedure MemoSourceMouseDown(Sender: TObject; Button: TMouseButton; 53 Shift: TShiftState; X, Y: Integer); 23 54 private 24 { private declarations }25 55 public 26 { public declarations }56 procedure UpdateInterface; 27 57 end; 28 58 … … 30 60 FormSourceCode: TFormSourceCode; 31 61 62 32 63 implementation 64 65 uses 66 UFormMain; 67 68 resourcestring 69 SNumberGeneration = 'Number generation'; 70 SEnterNumber = 'Enter number'; 71 33 72 34 73 {$R *.lfm} 35 74 75 { TFormSourceCode } 76 77 procedure TFormSourceCode.AGenerateNumberExecute(Sender: TObject); 78 var 79 NumberText: string; 80 Number: Integer; 81 I: Integer; 82 begin 83 NumberText := InputBox(SNumberGeneration, SEnterNumber, '1'); 84 if TryStrToInt(NumberText, Number) then begin 85 NumberText := ''; 86 for I := 0 to Number - 1 do 87 NumberText := NumberText + '+'; 88 MemoSource.SelText := NumberText; 89 end; 90 end; 91 92 procedure TFormSourceCode.APasteFromClipboardExecute(Sender: TObject); 93 begin 94 MemoSource.PasteFromClipboard; 95 end; 96 97 procedure TFormSourceCode.ASelectAllExecute(Sender: TObject); 98 begin 99 MemoSource.SelectAll; 100 end; 101 102 procedure TFormSourceCode.AFormatSourceExecute(Sender: TObject); 103 var 104 Source: string; 105 NewSource: string; 106 Indent: Integer; 107 I: Integer; 108 const 109 IndentText = ' '; 110 begin 111 Source := MemoSource.Text; 112 NewSource := ''; 113 Indent := 0; 114 for I := 1 to Length(Source) do begin 115 if Source[I] = '[' then begin 116 NewSource := NewSource + LineEnding + DupeString(IndentText, Indent) + Source[I] + LineEnding ; 117 Inc(Indent); 118 NewSource := NewSource + DupeString(IndentText, Indent); 119 end 120 else if Source[I] = ']' then begin 121 Dec(Indent); 122 NewSource := NewSource + LineEnding + DupeString(IndentText, Indent) + Source[I] + LineEnding + DupeString(IndentText, Indent); 123 end 124 else if Ord(Source[I]) > $20 then 125 NewSource := NewSource + Source[I]; 126 end; 127 MemoSource.Text := NewSource; 128 end; 129 130 procedure TFormSourceCode.ACopyToClipboardExecute(Sender: TObject); 131 begin 132 MemoSource.CopyToClipboard; 133 end; 134 135 procedure TFormSourceCode.ACutToClipboardExecute(Sender: TObject); 136 begin 137 MemoSource.CutToClipboard; 138 end; 139 140 procedure TFormSourceCode.AClearExecute(Sender: TObject); 141 begin 142 MemoSource.Clear; 143 end; 144 145 procedure TFormSourceCode.AShrinkSourceExecute(Sender: TObject); 146 var 147 Source: string; 148 Pos: Integer; 149 I: Integer; 150 begin 151 Source := MemoSource.Text; 152 Pos := 1; 153 for I := 1 to Length(Source) do begin 154 if Source[I] > ' ' then begin 155 Source[Pos] := Source[I]; 156 Inc(Pos); 157 end; 158 end; 159 SetLength(Source, Pos - 1); 160 MemoSource.Text := Source; 161 end; 162 163 procedure TFormSourceCode.UpdateInterface; 164 begin 165 166 end; 167 168 procedure TFormSourceCode.MemoSourceChange(Sender: TObject); 169 begin 170 MainForm.Modified := True; 171 MainForm.CurrentTarget.Compiled := False; 172 MainForm.UpdateInterface; 173 end; 174 175 procedure TFormSourceCode.MemoSourceKeyDown(Sender: TObject; var Key: Word; 176 Shift: TShiftState); 177 begin 178 end; 179 180 procedure TFormSourceCode.MemoSourceKeyPress(Sender: TObject; var Key: char); 181 begin 182 end; 183 184 procedure TFormSourceCode.MemoSourceKeyUp(Sender: TObject; var Key: Word; 185 Shift: TShiftState); 186 begin 187 MainForm.UpdateStatusBar; 188 end; 189 190 procedure TFormSourceCode.MemoSourceMouseDown(Sender: TObject; Button: TMouseButton; 191 Shift: TShiftState; X, Y: Integer); 192 begin 193 MainForm.UpdateStatusBar; 194 end; 195 196 36 197 end. 37 198 -
trunk/Forms/UFormTargetCode.lfm
r46 r47 24 24 top = 100 25 25 object MenuItem20: TMenuItem 26 Action = MainForm.AShowSourcePosition 26 27 end 27 28 end -
trunk/Languages/LazFuckIDE.cs.po
r46 r47 138 138 msgstr "VÃœstup:" 139 139 140 #: tformsourcecode.aclear.caption 141 msgctxt "tformsourcecode.aclear.caption" 142 msgid "Clear" 143 msgstr "" 144 145 #: tformsourcecode.aclear.hint 146 msgctxt "tformsourcecode.aclear.hint" 147 msgid "Clear" 148 msgstr "" 149 150 #: tformsourcecode.acopytoclipboard.caption 151 msgctxt "tformsourcecode.acopytoclipboard.caption" 152 msgid "Copy" 153 msgstr "" 154 155 #: tformsourcecode.acopytoclipboard.hint 156 msgctxt "tformsourcecode.acopytoclipboard.hint" 157 msgid "Copy" 158 msgstr "" 159 160 #: tformsourcecode.acuttoclipboard.caption 161 msgctxt "tformsourcecode.acuttoclipboard.caption" 162 msgid "Cut" 163 msgstr "" 164 165 #: tformsourcecode.acuttoclipboard.hint 166 msgctxt "tformsourcecode.acuttoclipboard.hint" 167 msgid "Cut" 168 msgstr "" 169 170 #: tformsourcecode.aformatsource.caption 171 msgctxt "tformsourcecode.aformatsource.caption" 172 msgid "Format source" 173 msgstr "Formátovat zdroj" 174 175 #: tformsourcecode.aformatsource.hint 176 msgctxt "tformsourcecode.aformatsource.hint" 177 msgid "Format source" 178 msgstr "Formátovat zdroj" 179 180 #: tformsourcecode.ageneratenumber.caption 181 msgid "Generate number" 182 msgstr "" 183 184 #: tformsourcecode.apastefromclipboard.caption 185 msgctxt "tformsourcecode.apastefromclipboard.caption" 186 msgid "Paste" 187 msgstr "" 188 189 #: tformsourcecode.apastefromclipboard.hint 190 msgctxt "tformsourcecode.apastefromclipboard.hint" 191 msgid "Paste" 192 msgstr "" 193 194 #: tformsourcecode.aselectall.caption 195 msgctxt "tformsourcecode.aselectall.caption" 196 msgid "Select all" 197 msgstr "" 198 199 #: tformsourcecode.aselectall.hint 200 msgctxt "tformsourcecode.aselectall.hint" 201 msgid "Select all" 202 msgstr "" 203 204 #: tformsourcecode.ashrinksource.caption 205 msgctxt "tformsourcecode.ashrinksource.caption" 206 msgid "Shrink source" 207 msgstr "Srazit kód" 208 209 #: tformsourcecode.ashrinksource.hint 210 msgctxt "tformsourcecode.ashrinksource.hint" 211 msgid "Shrink source" 212 msgstr "Srazit kód" 213 140 214 #: tformsourcecode.caption 141 215 msgctxt "tformsourcecode.caption" 142 216 msgid "Source code" 143 217 msgstr "ZdrojovÃœ kód" 218 219 #: tformsourcecode.menuitem1.caption 220 msgctxt "tformsourcecode.menuitem1.caption" 221 msgid "-" 222 msgstr "-" 144 223 145 224 #: tformtargetcode.caption … … 231 310 msgstr "UkonÄit" 232 311 233 #: tmainform.aformatsource.caption234 msgid "Format source"235 msgstr "Formátovat zdroj"236 237 #: tmainform.ageneratenumber.caption238 msgid "Generate code for number"239 msgstr "Generovat kód z ÄÃsla"240 241 312 #: tmainform.ahelp.caption 242 313 msgctxt "tmainform.ahelp.caption" … … 318 389 msgstr "UkaÅŸ pozici v cÃli" 319 390 320 #: tmainform.ashrinksource.caption321 msgid "Shrink source"322 msgstr "Srazit kód"323 324 391 #: tmainform.aviewcompilers.caption 325 392 msgctxt "tmainform.aviewcompilers.caption" … … 475 542 msgstr " kroků/s" 476 543 477 #: uformmain.senternumber478 msgctxt "uformmain.senternumber"479 msgid "Enter number"480 msgstr "Zadejte ÄÃslo"481 482 544 #: uformmain.snewproject 483 545 msgid "New project" 484 546 msgstr "NovÃœ projekt" 485 486 #: uformmain.snumbergeneration487 msgctxt "uformmain.snumbergeneration"488 msgid "Number generation"489 msgstr "Generovánà ÄÃsla"490 547 491 548 #: uformmain.sprogramexited … … 502 559 msgstr "Program zastaven" 503 560 561 #: uformsourcecode.senternumber 562 msgctxt "uformsourcecode.senternumber" 563 msgid "Enter number" 564 msgstr "Zadejte ÄÃslo" 565 566 #: uformsourcecode.snumbergeneration 567 msgctxt "uformsourcecode.snumbergeneration" 568 msgid "Number generation" 569 msgstr "Generovánà ÄÃsla" 570 504 571 #: uformtargets.scompileroptions 505 572 msgctxt "uformtargets.scompileroptions" -
trunk/Languages/LazFuckIDE.po
r46 r47 128 128 msgstr "" 129 129 130 #: tformsourcecode.aclear.caption 131 msgctxt "tformsourcecode.aclear.caption" 132 msgid "Clear" 133 msgstr "" 134 135 #: tformsourcecode.aclear.hint 136 msgctxt "TFORMSOURCECODE.ACLEAR.HINT" 137 msgid "Clear" 138 msgstr "" 139 140 #: tformsourcecode.acopytoclipboard.caption 141 msgctxt "tformsourcecode.acopytoclipboard.caption" 142 msgid "Copy" 143 msgstr "" 144 145 #: tformsourcecode.acopytoclipboard.hint 146 msgctxt "TFORMSOURCECODE.ACOPYTOCLIPBOARD.HINT" 147 msgid "Copy" 148 msgstr "" 149 150 #: tformsourcecode.acuttoclipboard.caption 151 msgctxt "tformsourcecode.acuttoclipboard.caption" 152 msgid "Cut" 153 msgstr "" 154 155 #: tformsourcecode.acuttoclipboard.hint 156 msgctxt "TFORMSOURCECODE.ACUTTOCLIPBOARD.HINT" 157 msgid "Cut" 158 msgstr "" 159 160 #: tformsourcecode.aformatsource.caption 161 msgctxt "TFORMSOURCECODE.AFORMATSOURCE.CAPTION" 162 msgid "Format source" 163 msgstr "" 164 165 #: tformsourcecode.aformatsource.hint 166 msgctxt "TFORMSOURCECODE.AFORMATSOURCE.HINT" 167 msgid "Format source" 168 msgstr "" 169 170 #: tformsourcecode.ageneratenumber.caption 171 msgid "Generate number" 172 msgstr "" 173 174 #: tformsourcecode.apastefromclipboard.caption 175 msgctxt "tformsourcecode.apastefromclipboard.caption" 176 msgid "Paste" 177 msgstr "" 178 179 #: tformsourcecode.apastefromclipboard.hint 180 msgctxt "TFORMSOURCECODE.APASTEFROMCLIPBOARD.HINT" 181 msgid "Paste" 182 msgstr "" 183 184 #: tformsourcecode.aselectall.caption 185 msgctxt "tformsourcecode.aselectall.caption" 186 msgid "Select all" 187 msgstr "" 188 189 #: tformsourcecode.aselectall.hint 190 msgctxt "TFORMSOURCECODE.ASELECTALL.HINT" 191 msgid "Select all" 192 msgstr "" 193 194 #: tformsourcecode.ashrinksource.caption 195 msgctxt "TFORMSOURCECODE.ASHRINKSOURCE.CAPTION" 196 msgid "Shrink source" 197 msgstr "" 198 199 #: tformsourcecode.ashrinksource.hint 200 msgctxt "TFORMSOURCECODE.ASHRINKSOURCE.HINT" 201 msgid "Shrink source" 202 msgstr "" 203 130 204 #: tformsourcecode.caption 131 205 msgctxt "TFORMSOURCECODE.CAPTION" … … 133 207 msgstr "" 134 208 209 #: tformsourcecode.menuitem1.caption 210 msgctxt "TFORMSOURCECODE.MENUITEM1.CAPTION" 211 msgid "-" 212 msgstr "" 213 135 214 #: tformtargetcode.caption 136 215 msgctxt "TFORMTARGETCODE.CAPTION" … … 220 299 msgstr "" 221 300 222 #: tmainform.aformatsource.caption223 msgid "Format source"224 msgstr ""225 226 #: tmainform.ageneratenumber.caption227 msgid "Generate code for number"228 msgstr ""229 230 301 #: tmainform.ahelp.caption 231 302 msgctxt "TMAINFORM.AHELP.CAPTION" … … 307 378 msgstr "" 308 379 309 #: tmainform.ashrinksource.caption310 msgid "Shrink source"311 msgstr ""312 313 380 #: tmainform.aviewcompilers.caption 314 381 msgctxt "TMAINFORM.AVIEWCOMPILERS.CAPTION" … … 464 531 msgstr "" 465 532 466 #: uformmain.senternumber467 msgctxt "uformmain.senternumber"468 msgid "Enter number"469 msgstr ""470 471 533 #: uformmain.snewproject 472 534 msgid "New project" 473 msgstr ""474 475 #: uformmain.snumbergeneration476 msgctxt "uformmain.snumbergeneration"477 msgid "Number generation"478 535 msgstr "" 479 536 … … 491 548 msgstr "" 492 549 550 #: uformsourcecode.senternumber 551 msgctxt "uformsourcecode.senternumber" 552 msgid "Enter number" 553 msgstr "" 554 555 #: uformsourcecode.snumbergeneration 556 msgctxt "uformsourcecode.snumbergeneration" 557 msgid "Number generation" 558 msgstr "" 559 493 560 #: uformtargets.scompileroptions 494 561 msgctxt "uformtargets.scompileroptions" -
trunk/Target/UTarget.pas
r43 r47 99 99 destructor Destroy; override; 100 100 procedure Reset; virtual; 101 procedure OptimizeSource; 101 procedure OptimizeSource; virtual; 102 102 procedure Compile; virtual; 103 103 procedure CompileToFile; virtual; -
trunk/Target/UTargetInterpretter.pas
r40 r47 66 66 Input: string; 67 67 InputPosition: Integer; 68 procedure OptimizeSource; override; 68 69 procedure Reset; override; 69 70 procedure Compile; override; … … 345 346 end; 346 347 348 procedure TTargetInterpretter.OptimizeSource; 349 begin 350 inherited OptimizeSource; 351 end; 352 347 353 procedure TTargetInterpretter.Run; 348 354 begin
Note:
See TracChangeset
for help on using the changeset viewer.