Changeset 47 for trunk/Forms
- Timestamp:
- Jul 12, 2012, 8:21:21 AM (12 years ago)
- Location:
- trunk/Forms
- Files:
-
- 7 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
Note:
See TracChangeset
for help on using the changeset viewer.