Changeset 126 for trunk/Forms
- Timestamp:
- Apr 6, 2022, 11:36:27 AM (3 years ago)
- Location:
- trunk/Forms
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r120 r126 1 1 object FormMain: TFormMain 2 2 Left = 553 3 Height = 8293 Height = 796 4 4 Top = 401 5 Width = 1 2275 Width = 1178 6 6 Caption = 'vCard Studio' 7 ClientHeight = 7 948 ClientWidth = 1 2279 DesignTimePPI = 1 507 ClientHeight = 762 8 ClientWidth = 1178 9 DesignTimePPI = 144 10 10 Menu = MainMenu1 11 11 OnClose = FormClose … … 18 18 object CoolBar1: TCoolBar 19 19 Left = 0 20 Height = 4 420 Height = 43 21 21 Top = 0 22 Width = 1 22722 Width = 1178 23 23 AutoSize = True 24 24 Bands = < … … 39 39 AnchorSideTop.Control = CoolBar1 40 40 Left = 24 41 Height = 3 441 Height = 33 42 42 Top = 5 43 Width = 1 6443 Width = 159 44 44 Align = alNone 45 45 AutoSize = True … … 60 60 end 61 61 object ToolButton2: TToolButton 62 Left = 3 762 Left = 36 63 63 Top = 0 64 64 Action = Core.AFileOpen … … 67 67 end 68 68 object ToolButton3: TToolButton 69 Left = 9269 Left = 89 70 70 Top = 0 71 71 Action = Core.AFileSave 72 72 end 73 73 object ToolButton4: TToolButton 74 Left = 12 874 Left = 124 75 75 Top = 0 76 76 Action = Core.AFileClose … … 81 81 AnchorSideTop.Control = CoolBar1 82 82 Left = 188 83 Height = 3 483 Height = 33 84 84 Top = 5 85 Width = 14 585 Width = 141 86 86 Align = alNone 87 87 AutoSize = True … … 97 97 Transparent = True 98 98 object ToolButton5: TToolButton 99 Left = 10 999 Left = 106 100 100 Top = 0 101 101 Action = Core.ASettings 102 102 end 103 103 object ToolButton6: TToolButton 104 Left = 3 7104 Left = 36 105 105 Top = 0 106 106 Action = Core.AFindDuplicate … … 112 112 end 113 113 object ToolButton8: TToolButton 114 Left = 7 3114 Left = 71 115 115 Top = 0 116 116 Action = Core.AFileCompare … … 120 120 object MainMenu1: TMainMenu 121 121 Images = Core.ImageList1 122 Left = 200123 Top = 12 5122 Left = 192 123 Top = 120 124 124 object MenuItemFile: TMenuItem 125 125 Caption = 'File' … … 186 186 Caption = '-' 187 187 end 188 object MenuItem13: TMenuItem 189 Action = Core.ARemoveExactDuplicates 190 end 188 191 object MenuItem5: TMenuItem 189 192 Action = Core.AGenerate … … 207 210 end 208 211 object PopupMenuOpenRecent: TPopupMenu 209 Left = 4 38210 Top = 12 5212 Left = 420 213 Top = 120 211 214 end 212 215 end -
trunk/Forms/UFormMain.pas
r120 r126 20 20 MenuItem11: TMenuItem; 21 21 MenuItem12: TMenuItem; 22 MenuItem13: TMenuItem; 22 23 MenuItem3: TMenuItem; 23 24 MenuItem4: TMenuItem; -
trunk/Forms/UFormTest.pas
r116 r126 34 34 Selected: Boolean); 35 35 private 36 FTestCases: TTestCases; 36 37 procedure ReloadList; 38 procedure SetTestCases(AValue: TTestCases); 37 39 procedure UpdateInterface; 38 procedure InitTestCases;39 40 public 40 TestCases: TTestCases;41 property TestCases: TTestCases read FTestCases write SetTestCases; 41 42 end; 42 43 … … 50 51 51 52 uses 52 UCore, UFormTestCase, UContact; 53 54 resourcestring 55 SPassed = 'Passed'; 56 SFailed = 'Failed'; 53 UCore, UFormTestCase, UContact, UTestCases; 57 54 58 55 { TFormTest } … … 80 77 end; 81 78 79 procedure TFormTest.SetTestCases(AValue: TTestCases); 80 begin 81 if FTestCases = AValue then Exit; 82 FTestCases := AValue; 83 ReloadList; 84 UpdateInterface; 85 end; 86 82 87 procedure TFormTest.UpdateInterface; 83 88 var … … 101 106 LabelResult.Caption := SPassed + ' ' + IntToStr(Passed) + ', ' + 102 107 SFailed + ' ' + IntToStr(Failed); 103 end;104 105 procedure TFormTest.InitTestCases;106 const107 VCardVersion = 'VERSION:2.1';108 begin109 TestCases := TTestCases.Create;110 with TestCases do begin111 with TTestCaseLoadSave(AddNew('Load and save', TTestCaseLoadSave)) do begin112 Input := VCardBegin + LineEnding +113 VCardVersion + LineEnding +114 'N:Surname;Name' + LineEnding +115 'FN:Name Surname' + LineEnding +116 VCardEnd + LineEnding;117 Output := Input;118 end;119 with TTestCaseLoadSave(AddNew('Long text', TTestCaseLoadSave)) do begin120 Input := VCardBegin + LineEnding +121 VCardVersion + LineEnding +122 'NOTE:This is some long test which is really multi-lined each line is on dif' + LineEnding +123 ' ferent line so it is on multiple lines.' + LineEnding +124 VCardEnd + LineEnding;125 Output := Input;126 end;127 with TTestCaseLoadSave(AddNew('Multi-line', TTestCaseLoadSave)) do begin128 Input := VCardBegin + LineEnding +129 VCardVersion + LineEnding +130 'NOTE:First line\nsecond line\nempty line\n\nlast line' + LineEnding +131 VCardEnd + LineEnding;132 Output := Input;133 end;134 with TTestCaseLoadSave(AddNew('Quoted-printable load-save', TTestCaseLoadSave)) do begin135 Input := VCardBegin + LineEnding +136 VCardVersion + LineEnding +137 'FN;ENCODING=QUOTED-PRINTABLE:Jm=C3=A9no=20P=C5=99=C3=ADjmen=C3=AD' + LineEnding +138 VCardEnd + LineEnding;139 Output := Input;140 end;141 with TTestCaseLoadSave(AddNew('Quoted-printable load-save multi-line', TTestCaseLoadSave)) do begin142 Input := VCardBegin + LineEnding +143 VCardVersion + LineEnding +144 'FN;ENCODING=QUOTED-PRINTABLE:Jm=C3=A9no=20P=C5=99=C3=ADjmen=C3=ADJm=C3=A9n=' + LineEnding +145 'o=20P=C5=99=C3=ADjmen=C3=AD' + LineEnding +146 VCardEnd + LineEnding;147 Output := Input;148 end;149 with TTestCaseLoadSave(AddNew('Base64 load-save (encoding=base64)', TTestCaseLoadSave)) do begin150 Input := VCardBegin + LineEnding +151 VCardVersion + LineEnding +152 'FN;ENCODING=BASE64:VGVzdCBzdHJpbmc=' + LineEnding +153 VCardEnd + LineEnding;154 Output := Input;155 end;156 with TTestCaseLoadSave(AddNew('Base64 load-save (base64)', TTestCaseLoadSave)) do begin157 Input := VCardBegin + LineEnding +158 VCardVersion + LineEnding +159 'FN;BASE64:VGVzdCBzdHJpbmc=' + LineEnding +160 VCardEnd + LineEnding;161 Output := Input;162 end;163 with TTestCaseLoadSave(AddNew('Base64 load-save (encoding=b)', TTestCaseLoadSave)) do begin164 Input := VCardBegin + LineEnding +165 VCardVersion + LineEnding +166 'FN;ENCODING=B:VGVzdCBzdHJpbmc=' + LineEnding +167 VCardEnd + LineEnding;168 Output := Input;169 end;170 with TTestCaseLoadSave(AddNew('Base64 load-save multi-line', TTestCaseLoadSave)) do begin171 Input := VCardBegin + LineEnding +172 VCardVersion + LineEnding +173 'FN;ENCODING=BASE64:U29tZSB2ZXJ5IGxvbmcgc3RyaW5nIFNvbWUgdmVyeSBsb25nIHN0cmlu' + LineEnding +174 ' ZyBTb21lIHZlcnkgbG9uZyBzdHJpbmcgU29tZSB2ZXJ5IGxvbmcgc3RyaW5n' + LineEnding +175 VCardEnd + LineEnding;176 Output := Input;177 end;178 //AddNew('Image format', TTestCaseLoadSave);179 with TTestCaseLoadSave(AddNew('Empty', TTestCaseLoadSave)) do begin180 Input := '';181 Output := '';182 end;183 with TTestCaseLoadSave(AddNew('Begin only', TTestCaseLoadSave)) do begin184 Input := VCardBegin;185 Output := '';186 end;187 with TTestCaseLoadSave(AddNew('Missing end', TTestCaseLoadSave)) do begin188 Input := VCardBegin + LineEnding +189 VCardVersion + LineEnding +190 'N:Surname;Name' + LineEnding +191 'FN:Name Surname' + LineEnding;192 Output := '';193 end;194 with TTestCaseLoadSave(AddNew('Missing start', TTestCaseLoadSave)) do begin195 Input := VCardVersion + LineEnding +196 'N:Surname;Name' + LineEnding +197 'FN:Name Surname' + LineEnding +198 VCardEnd + LineEnding;199 Output := '';200 end;201 with TTestCaseCheckProperty(AddNew('Property FN', TTestCaseCheckProperty)) do begin202 Index := cfFullName;203 Value := 'Name Surname';204 Input := VCardBegin + LineEnding +205 VCardVersion + LineEnding +206 'FN:' + Value + LineEnding +207 VCardEnd + LineEnding;208 end;209 with TTestCaseCheckProperty(AddNew('Escaped new lines in text', TTestCaseCheckProperty)) do begin210 Index := cfNote;211 Value := 'Line' + #13#10 + 'Line';212 Input := VCardBegin + LineEnding +213 VCardVersion + LineEnding +214 'NOTE:Line\nLine' + LineEnding +215 VCardEnd + LineEnding;216 end;217 with TTestCaseCheckProperty(AddNew('Compound value', TTestCaseCheckProperty)) do begin218 Index := cfFirstName;219 Value := 'FirstName';220 Input := VCardBegin + LineEnding +221 VCardVersion + LineEnding +222 'N:Surname;FirstName;;;' + LineEnding +223 VCardEnd + LineEnding;224 end;225 with TTestCaseCheckProperty(AddNew('Quoted-printable special symbols', TTestCaseCheckProperty)) do begin226 Index := cfFullName;227 Value := 'Jméno Příjmení';228 Input := VCardBegin + LineEnding +229 VCardVersion + LineEnding +230 'FN;ENCODING=QUOTED-PRINTABLE:Jm=C3=A9no=20P=C5=99=C3=ADjmen=C3=AD' + LineEnding +231 VCardEnd + LineEnding;232 end;233 with TTestCaseCheckProperty(AddNew('Base64 special symbols', TTestCaseCheckProperty)) do begin234 Index := cfFullName;235 Value := 'Jméno Příjmení';236 Input := VCardBegin + LineEnding +237 VCardVersion + LineEnding +238 'FN;ENCODING=BASE64:Sm3DqW5vIFDFmcOtam1lbsOt' + LineEnding +239 VCardEnd + LineEnding;240 end;241 end;242 108 end; 243 109 … … 282 148 Core.Translator.TranslateComponentRecursive(Self); 283 149 Core.ThemeManager1.UseTheme(Self); 284 285 InitTestCases;286 150 end; 287 151 288 152 procedure TFormTest.FormDestroy(Sender: TObject); 289 153 begin 290 FreeAndNil(TestCases);291 154 end; 292 155
Note:
See TracChangeset
for help on using the changeset viewer.