Changeset 149 for trunk/Forms
- Timestamp:
- Jun 5, 2023, 8:45:38 PM (18 months ago)
- Location:
- trunk/Forms
- Files:
-
- 51 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormColumns.pas
r148 r149 1 unit UFormColumns;1 unit FormColumns; 2 2 3 3 interface … … 40 40 end; 41 41 42 var43 FormColumns: TFormColumns;44 45 42 46 43 implementation … … 49 46 50 47 uses 51 UCore;48 Core; 52 49 53 50 { TFormColumns } … … 55 52 procedure TFormColumns.FormShow(Sender: TObject); 56 53 begin 57 Core. PersistentForm1.Load(Self);54 Core.Core.PersistentForm1.Load(Self); 58 55 59 56 ListBoxActive.Items.Assign(ActiveColumns); … … 93 90 ); 94 91 begin 95 Core. PersistentForm1.Save(Self);92 Core.Core.PersistentForm1.Save(Self); 96 93 end; 97 94 … … 139 136 procedure TFormColumns.FormCreate(Sender: TObject); 140 137 begin 141 Core. Translator.TranslateComponentRecursive(Self);142 Core. ThemeManager1.UseTheme(Self);138 Core.Core.Translator.TranslateComponentRecursive(Self); 139 Core.Core.ThemeManager1.UseTheme(Self); 143 140 ActiveColumns := TStringList.Create; 144 141 AvailableColumns := TStringList.Create; -
trunk/Forms/FormCompare.pas
r148 r149 1 unit UFormCompare;1 unit FormCompare; 2 2 3 3 interface … … 74 74 end; 75 75 76 var77 FormCompare: TFormCompare;78 79 76 80 77 implementation … … 83 80 84 81 uses 85 UCore, UVCardFile;82 Core, VCardFile; 86 83 87 84 { TFormCompare } … … 90 87 ); 91 88 begin 92 Core. PersistentForm1.Save(Self);89 Core.Core.PersistentForm1.Save(Self); 93 90 end; 94 91 … … 146 143 procedure TFormCompare.FormCreate(Sender: TObject); 147 144 begin 148 Core. Translator.TranslateComponentRecursive(Self);149 Core. ThemeManager1.UseTheme(Self);145 Core.Core.Translator.TranslateComponentRecursive(Self); 146 Core.Core.ThemeManager1.UseTheme(Self); 150 147 Diff := TDiff.Create(Self); 151 148 … … 199 196 procedure TFormCompare.FormShow(Sender: TObject); 200 197 begin 201 Core. PersistentForm1.Load(Self);198 Core.Core.PersistentForm1.Load(Self); 202 199 UpdateInterface; 203 200 ReloadContent; -
trunk/Forms/FormContact.pas
r148 r149 1 unit UFormContact;1 unit FormContact; 2 2 3 3 interface … … 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 7 7 ComCtrls, ActnList, Menus, ExtCtrls, ExtDlgs, Buttons, VCard, LCLIntf, 8 UFormProperties, DateUtils, {$IFDEF LCLGTK2}Gtk2Globals, {$ENDIF}ContactImage,8 FormProperties, DateUtils, {$IFDEF LCLGTK2}Gtk2Globals, {$ENDIF}ContactImage, 9 9 ubarcodes; 10 10 … … 248 248 end; 249 249 250 var251 FormContact: TFormContact;252 253 250 254 251 implementation … … 257 254 258 255 uses 259 UCore, Common, UFormImage, UFormNameDetails, DataFile;256 Core, Common, FormImage, FormNameDetails, DataFile; 260 257 261 258 resourcestring … … 328 325 if Visible then LastMouse.WinControl := PageControlContact.ActivePage; 329 326 {$ENDIF} 330 Core. PersistentForm1.Load(Self);327 Core.Core.PersistentForm1.Load(Self); 331 328 PhotoChange(nil); 332 329 … … 363 360 SavePictureDialog1.FilterIndex := 2; 364 361 SavePictureDialog1.DefaultExt := '.png'; 365 if Core. LastQrCodeFileName = '' then366 Core. LastQrCodeFileName := 'QR code.png';367 SavePictureDialog1.InitialDir := ExtractFileDir(Core. LastQrCodeFileName);368 SavePictureDialog1.FileName := ExtractFileName(Core. LastQrCodeFileName);362 if Core.Core.LastQrCodeFileName = '' then 363 Core.Core.LastQrCodeFileName := 'QR code.png'; 364 SavePictureDialog1.InitialDir := ExtractFileDir(Core.Core.LastQrCodeFileName); 365 SavePictureDialog1.FileName := ExtractFileName(Core.Core.LastQrCodeFileName); 369 366 if SavePictureDialog1.Execute then begin 370 367 F := LowerCase(ExtractFileExt(SavePictureDialog1.FileName)); … … 377 374 else if (F = '.eps') or (F = '.ps') then BarcodeQR1.SaveToEpsFile(SavePictureDialog1.FileName) 378 375 else raise Exception.Create(SImageTypeNotSupported); 379 Core. LastQrCodeFileName := SavePictureDialog1.FileName;376 Core.Core.LastQrCodeFileName := SavePictureDialog1.FileName; 380 377 end; 381 378 end; … … 674 671 if FPhoto.Used and (FPhoto.Url = '') then 675 672 ImagePhoto.Picture.Bitmap.Assign(FPhoto.Bitmap) 676 else ImagePhoto.Picture.Assign(Core. GetProfileImage.Picture);673 else ImagePhoto.Picture.Assign(Core.Core.GetProfileImage.Picture); 677 674 UpdateInterface; 678 675 end; … … 697 694 PageControlContact.ActivePage.Hide; 698 695 699 Core. LastContactTabIndex := PageControlContact.TabIndex;700 Core. PersistentForm1.Save(Self);696 Core.Core.LastContactTabIndex := PageControlContact.TabIndex; 697 Core.Core.PersistentForm1.Save(Self); 701 698 end; 702 699 … … 709 706 procedure TFormContact.APhotoLoadExecute(Sender: TObject); 710 707 begin 711 OpenPictureDialog1.InitialDir := ExtractFileDir(Core. LastPhotoFileName);712 OpenPictureDialog1.FileName := ExtractFileName(Core. LastPhotoFileName);708 OpenPictureDialog1.InitialDir := ExtractFileDir(Core.Core.LastPhotoFileName); 709 OpenPictureDialog1.FileName := ExtractFileName(Core.Core.LastPhotoFileName); 713 710 if OpenPictureDialog1.Execute then begin 714 711 FPhoto.LoadFromFile(OpenPictureDialog1.FileName); 715 Core. LastPhotoFileName := OpenPictureDialog1.FileName;712 Core.Core.LastPhotoFileName := OpenPictureDialog1.FileName; 716 713 end; 717 714 end; … … 724 721 procedure TFormContact.APhotoSaveExecute(Sender: TObject); 725 722 begin 726 SavePictureDialog1.InitialDir := ExtractFileDir(Core. LastPhotoFileName);727 SavePictureDialog1.FileName := ExtractFileName(Core. LastPhotoFileName);723 SavePictureDialog1.InitialDir := ExtractFileDir(Core.Core.LastPhotoFileName); 724 SavePictureDialog1.FileName := ExtractFileName(Core.Core.LastPhotoFileName); 728 725 if SavePictureDialog1.Execute then begin 729 726 ImagePhoto.Picture.SaveToFile(SavePictureDialog1.FileName); 730 Core. LastPhotoFileName := SavePictureDialog1.FileName;727 Core.Core.LastPhotoFileName := SavePictureDialog1.FileName; 731 728 end; 732 729 end; … … 762 759 if EditHomeAddressCountry.Text <> '' then Address := Address + ' ' + EditHomeAddressCountry.Text; 763 760 if Trim(Address) <> '' then 764 OpenURL(Core. MapUrl + URLEncode(Trim(Address)));761 OpenURL(Core.Core.MapUrl + URLEncode(Trim(Address))); 765 762 end; 766 763 … … 814 811 if EditWorkAddressCountry.Text <> '' then Address := Address + ' ' + EditWorkAddressCountry.Text; 815 812 if Trim(Address) <> '' then 816 OpenURL(Core. MapUrl + URLEncode(Trim(Address)));813 OpenURL(Core.Core.MapUrl + URLEncode(Trim(Address))); 817 814 end; 818 815 … … 840 837 procedure TFormContact.FormCreate(Sender: TObject); 841 838 begin 842 Core. Translator.TranslateComponentRecursive(Self);843 Core. ThemeManager1.UseTheme(Self);839 Core.Core.Translator.TranslateComponentRecursive(Self); 840 Core.Core.ThemeManager1.UseTheme(Self); 844 841 FContact := nil; 845 842 FormProperties := TFormProperties.Create(nil); … … 852 849 BarcodeQR1.PopupMenu := PopupMenuQrCode; 853 850 854 PageControlContact.TabIndex := Core. LastContactTabIndex;851 PageControlContact.TabIndex := Core.Core.LastContactTabIndex; 855 852 end; 856 853 -
trunk/Forms/FormContacts.pas
r148 r149 1 unit UFormContacts;1 unit FormContacts; 2 2 3 3 interface … … 100 100 end; 101 101 102 var103 FormContacts: TFormContacts;104 105 102 106 103 implementation … … 109 106 110 107 uses 111 UFormContact, UCore, UVCardFile, UFormColumns;108 FormContact, Core, VCardFile, FormColumns; 112 109 113 110 resourcestring … … 386 383 procedure TFormContacts.FormShow(Sender: TObject); 387 384 begin 388 Core. Translator.TranslateComponentRecursive(Self);389 Core. ThemeManager1.UseTheme(Self);390 Core. PersistentForm1.Load(Self);385 Core.Core.Translator.TranslateComponentRecursive(Self); 386 Core.Core.ThemeManager1.UseTheme(Self); 387 Core.Core.PersistentForm1.Load(Self); 391 388 LoadFromRegistry(Context); 392 389 ReloadList; … … 408 405 FormContact.OnGetPrevious := GetPreviousContact; 409 406 FormContact.OnGetNext := GetNextContact; 410 Contact.Properties.AddNew('VERSION', Core. DefaultVcardVersion);407 Contact.Properties.AddNew('VERSION', Core.Core.DefaultVcardVersion); 411 408 if FormContact.ShowModal = mrOK then begin 412 409 Contacts.Add(Contact); 413 Core. DataFile.Modified := True;410 Core.Core.DataFile.Modified := True; 414 411 ReloadList; 415 412 UpdateInterface; … … 442 439 Contacts.Add(Contact); 443 440 Contact := nil; 444 Core. DataFile.Modified := True;441 Core.Core.DataFile.Modified := True; 445 442 ReloadList; 446 443 UpdateInterface; … … 548 545 TempFile.Free; 549 546 end; 550 OpenDialog1.InitialDir := ExtractFileDir(Core. LastContactFileName);551 OpenDialog1.FileName := ExtractFileName(Core. LastContactFileName);547 OpenDialog1.InitialDir := ExtractFileDir(Core.Core.LastContactFileName); 548 OpenDialog1.FileName := ExtractFileName(Core.Core.LastContactFileName); 552 549 if OpenDialog1.Execute then begin 553 550 TContact(ListView1.Selected.Data).LoadFromFile(OpenDialog1.FileName); 554 Core. LastContactFileName := OpenDialog1.FileName;551 Core.Core.LastContactFileName := OpenDialog1.FileName; 555 552 ReloadList; 556 553 end; … … 574 571 if FormContact.ShowModal = mrOK then begin 575 572 if not TContact(ListView1.Selected.Data).CompareTo(Contact) then 576 Core. DataFile.Modified := True;573 Core.Core.DataFile.Modified := True; 577 574 TContact(ListView1.Selected.Data).Assign(Contact); 578 575 ReloadList; … … 602 599 PasteContacts.VCard.Contacts); 603 600 end else Contacts.AddContacts(PasteContacts.VCard.Contacts); 604 Core. DataFile.Modified := True;601 Core.Core.DataFile.Modified := True; 605 602 ReloadList; 606 603 UpdateInterface; … … 623 620 Contacts.Delete(Contacts.IndexOf(ListView1.Items[I].Data)); 624 621 end; 625 Core. DataFile.Modified := True;622 Core.Core.DataFile.Modified := True; 626 623 ReloadList; 627 624 UpdateInterface; … … 641 638 TempFile.Free; 642 639 end; 643 SaveDialog1.InitialDir := ExtractFileDir(Core. LastContactFileName);640 SaveDialog1.InitialDir := ExtractFileDir(Core.Core.LastContactFileName); 644 641 SaveDialog1.FileName := TContact(ListView1.Selected.Data).FullNameToFileName + 645 642 VCardFileExt; 646 643 if SaveDialog1.Execute then begin 647 644 TContact(ListView1.Selected.Data).SaveToFile(SaveDialog1.FileName); 648 Core. LastContactFileName := SaveDialog1.FileName;645 Core.Core.LastContactFileName := SaveDialog1.FileName; 649 646 end; 650 647 end; … … 674 671 begin 675 672 SaveToRegistry(Context); 676 Core. PersistentForm1.Save(Self);673 Core.Core.PersistentForm1.Save(Self); 677 674 end; 678 675 -
trunk/Forms/FormError.pas
r148 r149 1 unit UFormError;1 unit FormError; 2 2 3 3 interface … … 17 17 end; 18 18 19 var20 FormError: TFormError;21 22 19 23 20 implementation … … 26 23 27 24 uses 28 UCore;25 Core; 29 26 30 27 { TFormError } … … 32 29 procedure TFormError.FormCreate(Sender: TObject); 33 30 begin 34 Core. Translator.TranslateComponentRecursive(Self);35 Core. ThemeManager1.UseTheme(Self);31 Core.Core.Translator.TranslateComponentRecursive(Self); 32 Core.Core.ThemeManager1.UseTheme(Self); 36 33 end; 37 34 38 35 procedure TFormError.FormShow(Sender: TObject); 39 36 begin 40 Core. PersistentForm1.Load(Self);37 Core.Core.PersistentForm1.Load(Self); 41 38 end; 42 39 43 40 procedure TFormError.FormClose(Sender: TObject; var CloseAction: TCloseAction); 44 41 begin 45 Core. PersistentForm1.Save(Self);42 Core.Core.PersistentForm1.Save(Self); 46 43 end; 47 44 -
trunk/Forms/FormFind.pas
r148 r149 1 unit UFormFind;1 unit FormFind; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 7 ExtCtrls, StdCtrls, ActnList, Menus, VCard, UFormContacts;7 ExtCtrls, StdCtrls, ActnList, Menus, VCard, FormContacts; 8 8 9 9 type … … 34 34 end; 35 35 36 var37 FormFind: TFormFind;38 39 36 40 37 implementation … … 43 40 44 41 uses 45 UCore;42 Core; 46 43 47 44 resourcestring … … 96 93 procedure TFormFind.FormCreate(Sender: TObject); 97 94 begin 98 Core. Translator.TranslateComponentRecursive(Self);99 Core. ThemeManager1.UseTheme(Self);95 Core.Core.Translator.TranslateComponentRecursive(Self); 96 Core.Core.ThemeManager1.UseTheme(Self); 100 97 101 98 ContactFieldIndex := cfNone; … … 131 128 var CloseAction: TCloseAction); 132 129 begin 133 Core. PersistentForm1.Save(Self);130 Core.Core.PersistentForm1.Save(Self); 134 131 end; 135 132 … … 141 138 procedure TFormFind.FormShow(Sender: TObject); 142 139 begin 143 Core. PersistentForm1.Load(Self);140 Core.Core.PersistentForm1.Load(Self); 144 141 145 142 FormContacts.ManualDock(Self, nil, alClient); -
trunk/Forms/FormFindDuplicity.pas
r148 r149 1 unit UFormFindDuplicity;1 unit FormFindDuplicity; 2 2 3 3 interface … … 56 56 end; 57 57 58 var59 FormFindDuplicity: TFormFindDuplicity;60 61 58 62 59 implementation … … 65 62 66 63 uses 67 UCore, UFormContacts, UVCardFile;64 Core, FormContacts, VCardFile; 68 65 69 66 { TFoundItems } … … 168 165 procedure TFormFindDuplicity.FormCreate(Sender: TObject); 169 166 begin 170 Core. Translator.TranslateComponentRecursive(Self);171 Core. ThemeManager1.UseTheme(Self);167 Core.Core.Translator.TranslateComponentRecursive(Self); 168 Core.Core.ThemeManager1.UseTheme(Self); 172 169 173 170 FoundItems := TFoundItems.Create; … … 238 235 var CloseAction: TCloseAction); 239 236 begin 240 Core. PersistentForm1.Save(Self);237 Core.Core.PersistentForm1.Save(Self); 241 238 end; 242 239 … … 248 245 procedure TFormFindDuplicity.FormShow(Sender: TObject); 249 246 begin 250 Core. PersistentForm1.Load(Self);247 Core.Core.PersistentForm1.Load(Self); 251 248 Find; 252 249 end; -
trunk/Forms/FormGenerate.pas
r148 r149 1 unit UFormGenerate;1 unit FormGenerate; 2 2 3 3 interface … … 24 24 end; 25 25 26 var27 FormGenerate: TFormGenerate;28 29 26 30 27 implementation … … 33 30 34 31 uses 35 UCore;32 Core; 36 33 37 34 { TFormGenerate } … … 45 42 Contact := Contacts.AddNew; 46 43 with Contact do begin 47 Fields[cfVersion] := Core. DefaultVcardVersion;44 Fields[cfVersion] := Core.Core.DefaultVcardVersion; 48 45 Fields[cfFirstName] := 'First ' + IntToStr(Random(10000)); 49 46 Fields[cfLastName] := 'Last ' + IntToStr(Random(10000)); … … 68 65 ); 69 66 begin 70 Core. GenerateCount := SpinEditCount.Value;71 Core. PersistentForm1.Save(Self);67 Core.Core.GenerateCount := SpinEditCount.Value; 68 Core.Core.PersistentForm1.Save(Self); 72 69 end; 73 70 74 71 procedure TFormGenerate.FormCreate(Sender: TObject); 75 72 begin 76 Core. Translator.TranslateComponentRecursive(Self);77 Core. ThemeManager1.UseTheme(Self);73 Core.Core.Translator.TranslateComponentRecursive(Self); 74 Core.Core.ThemeManager1.UseTheme(Self); 78 75 end; 79 76 80 77 procedure TFormGenerate.FormShow(Sender: TObject); 81 78 begin 82 Core. PersistentForm1.Load(Self);83 SpinEditCount.Value := Core. GenerateCount;79 Core.Core.PersistentForm1.Load(Self); 80 SpinEditCount.Value := Core.Core.GenerateCount; 84 81 UpdateInterface; 85 82 end; -
trunk/Forms/FormImage.pas
r148 r149 1 unit UFormImage;1 unit FormImage; 2 2 3 3 interface … … 37 37 end; 38 38 39 var40 FormImage: TFormImage;41 42 39 43 40 implementation … … 46 43 47 44 uses 48 UCore;45 Core; 49 46 50 47 { TFormImage } … … 52 49 procedure TFormImage.FormClose(Sender: TObject; var CloseAction: TCloseAction); 53 50 begin 54 Core. PersistentForm1.Save(Self);51 Core.Core.PersistentForm1.Save(Self); 55 52 end; 56 53 57 54 procedure TFormImage.FormCreate(Sender: TObject); 58 55 begin 59 Core. Translator.TranslateComponentRecursive(Self);60 Core. ThemeManager1.UseTheme(Self);56 Core.Core.Translator.TranslateComponentRecursive(Self); 57 Core.Core.ThemeManager1.UseTheme(Self); 61 58 62 59 Image := TContactImage.Create(nil); … … 71 68 procedure TFormImage.ButtonLoadClick(Sender: TObject); 72 69 begin 73 OpenPictureDialog1.InitialDir := ExtractFileDir(Core. LastPhotoFileName);74 OpenPictureDialog1.FileName := ExtractFileName(Core. LastPhotoFileName);70 OpenPictureDialog1.InitialDir := ExtractFileDir(Core.Core.LastPhotoFileName); 71 OpenPictureDialog1.FileName := ExtractFileName(Core.Core.LastPhotoFileName); 75 72 if OpenPictureDialog1.Execute then begin 76 73 Image.LoadFromFile(OpenPictureDialog1.FileName); 77 Core. LastPhotoFileName := OpenPictureDialog1.FileName;74 Core.Core.LastPhotoFileName := OpenPictureDialog1.FileName; 78 75 end; 79 76 end; … … 86 83 procedure TFormImage.ButtonSaveClick(Sender: TObject); 87 84 begin 88 SavePictureDialog1.InitialDir := ExtractFileDir(Core. LastPhotoFileName);89 SavePictureDialog1.FileName := ExtractFileName(Core. LastPhotoFileName);85 SavePictureDialog1.InitialDir := ExtractFileDir(Core.Core.LastPhotoFileName); 86 SavePictureDialog1.FileName := ExtractFileName(Core.Core.LastPhotoFileName); 90 87 if SavePictureDialog1.Execute then begin 91 88 Image.SaveToFile(SavePictureDialog1.FileName); 92 Core. LastPhotoFileName := SavePictureDialog1.FileName;89 Core.Core.LastPhotoFileName := SavePictureDialog1.FileName; 93 90 end; 94 91 end; … … 101 98 procedure TFormImage.FormShow(Sender: TObject); 102 99 begin 103 Core. PersistentForm1.Load(Self);100 Core.Core.PersistentForm1.Load(Self); 104 101 105 102 ImageChange(nil); … … 109 106 begin 110 107 if Image.Used and (Image.Url = '') then ImagePhoto.Picture.Bitmap.Assign(Image.Bitmap) 111 else ImagePhoto.Picture.Assign(Core. GetProfileImage.Picture);108 else ImagePhoto.Picture.Assign(Core.Core.GetProfileImage.Picture); 112 109 EditUrl.Text := Image.Url; 113 110 UpdateInterface; -
trunk/Forms/FormMain.pas
r148 r149 1 unit UFormMain;1 unit FormMain; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, LazFileUtils, Forms, Controls, Graphics, Dialogs, Menus, 7 ComCtrls ;7 ComCtrls, FormContacts; 8 8 9 9 type … … 65 65 procedure SetToolbarHints; 66 66 procedure UpdateFormTitle; 67 procedure DataFileChangeExecute(Sender: TObject); 68 procedure LastOpenedFileChangeExecute(Sender: TObject); 69 procedure LoadConfig; 70 procedure SaveConfig; 67 71 public 72 FormContacts: TFormContacts; 68 73 procedure UpdateInterface; 69 74 end; 70 75 71 var72 FormMain: TFormMain;73 74 76 75 77 implementation … … 78 80 79 81 uses 80 UCore, UFormContacts, VCard, UVCardFile, RegistryEx;82 Core, VCard, VCardFile, RegistryEx; 81 83 82 84 resourcestring … … 88 90 begin 89 91 FormContacts.Close; 90 Core.PersistentForm1.Save(Self); 92 Core.Core.PersistentForm1.Save(Self); 93 Application.Terminate; 91 94 end; 92 95 93 96 procedure TFormMain.FormCloseQuery(Sender: TObject; var CanClose: boolean); 94 97 begin 95 Core. AFileClose.Execute;96 CanClose := Core. FileClosed;98 Core.Core.AFileClose.Execute; 99 CanClose := Core.Core.FileClosed; 97 100 end; 98 101 99 102 procedure TFormMain.FormCreate(Sender: TObject); 100 103 begin 104 Core.Core.Translator.TranslateComponentRecursive(Self); 105 Core.Core.ThemeManager1.UseTheme(Self); 106 101 107 FormContacts := TFormContacts.Create(nil); 108 Core.Core.OnDataFileChange := DataFileChangeExecute; 109 Core.Core.OnLastOpenedListChange := LastOpenedFileChangeExecute; 102 110 end; 103 111 … … 117 125 try 118 126 SetToolbarHints; 119 Core. Initialize;120 Core. ThemeManager1.UseTheme(Self);121 Core. PersistentForm1.Load(Self);122 Core. ScaleDPI1.ScaleControl(CoolBar1,Core.ScaleDPI1.DesignDPI);127 Core.Core.Initialize; 128 Core.Core.ThemeManager1.UseTheme(Self); 129 Core.Core.PersistentForm1.Load(Self); 130 Core.Core.ScaleDPI1.ScaleControl(CoolBar1, Core.Core.ScaleDPI1.DesignDPI); 123 131 CoolBar1.AutosizeBands; 124 132 125 FormContacts.Context := TRegistryContext.Create(Core. ApplicationInfo1.RegistryRoot,126 Core. ApplicationInfo1.RegistryKey + '\ContactsColumns');127 FormContacts.Contacts := TVCardFile(Core. DataFile).VCard.Contacts;133 FormContacts.Context := TRegistryContext.Create(Core.Core.ApplicationInfo1.RegistryRoot, 134 Core.Core.ApplicationInfo1.RegistryKey + '\ContactsColumns'); 135 FormContacts.Contacts := TVCardFile(Core.Core.DataFile).VCard.Contacts; 128 136 FormContacts.ManualDock(Self, nil, alClient); 129 137 FormContacts.Align := alClient; … … 166 174 begin 167 175 Title := ''; 168 if Assigned(Core. DataFile) and169 (ExtractFileNameWithoutExt(ExtractFileName(Core. DataFile.FileName)) <> '') then170 Title := Title + ExtractFileNameWithoutExt(ExtractFileName(Core. DataFile.FileName));171 if Assigned(Core. DataFile) andCore.DataFile.Modified then176 if Assigned(Core.Core.DataFile) and 177 (ExtractFileNameWithoutExt(ExtractFileName(Core.Core.DataFile.FileName)) <> '') then 178 Title := Title + ExtractFileNameWithoutExt(ExtractFileName(Core.Core.DataFile.FileName)); 179 if Assigned(Core.Core.DataFile) and Core.Core.DataFile.Modified then 172 180 Title := Title + ' (' + SModified + ')'; 173 181 if Title <> '' then Title := Title + ' - '; 174 Title := Title + Core. ApplicationInfo1.AppName;182 Title := Title + Core.Core.ApplicationInfo1.AppName; 175 183 //Application.Title := Title; 176 184 Caption := Title; 177 185 end; 178 186 187 procedure TFormMain.DataFileChangeExecute(Sender: TObject); 188 begin 189 if Assigned(FormContacts) then begin 190 if Assigned(Core.Core.DataFile) then 191 FormContacts.Contacts := TVCardFile(Core.Core.DataFile).VCard.Contacts 192 else FormContacts.Contacts := nil; 193 end; 194 195 FormContacts.ReloadList; 196 FormContacts.UpdateInterface; 197 UpdateInterface; 198 end; 199 200 procedure TFormMain.LastOpenedFileChangeExecute(Sender: TObject); 201 begin 202 Core.Core.LastOpenedList1.LoadToMenuItem(MenuItemFileOpenRecent, Core.Core.AFileOpenRecentExecute); 203 Core.Core.LastOpenedList1.LoadToMenuItem(PopupMenuOpenRecent.Items, Core.Core.AFileOpenRecentExecute); 204 end; 205 206 procedure TFormMain.LoadConfig; 207 begin 208 with TRegistryEx.Create do 209 try 210 CurrentContext := Core.Core.ApplicationInfo1.GetRegistryContext; 211 MenuItemToolbar.Checked := ReadBoolWithDefault('ToolBarVisible', True); 212 finally 213 Free; 214 end; 215 end; 216 217 procedure TFormMain.SaveConfig; 218 begin 219 with TRegistryEx.Create do 220 try 221 CurrentContext := Core.Core.ApplicationInfo1.GetRegistryContext; 222 WriteBool('ToolBarVisible', MenuItemToolbar.Checked); 223 finally 224 Free; 225 end; 226 end; 227 179 228 procedure TFormMain.UpdateInterface; 180 229 begin -
trunk/Forms/FormNameDetails.pas
r148 r149 1 unit UFormNameDetails;1 unit FormNameDetails; 2 2 3 3 interface … … 28 28 end; 29 29 30 var31 FormNameDetails: TFormNameDetails;32 33 30 34 31 implementation … … 37 34 38 35 uses 39 UCore;36 Core; 40 37 41 38 { TFormNameDetails } … … 44 41 var CloseAction: TCloseAction); 45 42 begin 46 Core. PersistentForm1.Save(Self);43 Core.Core.PersistentForm1.Save(Self); 47 44 end; 48 45 49 46 procedure TFormNameDetails.FormCreate(Sender: TObject); 50 47 begin 51 Core. Translator.TranslateComponentRecursive(Self);52 Core. ThemeManager1.UseTheme(Self);48 Core.Core.Translator.TranslateComponentRecursive(Self); 49 Core.Core.ThemeManager1.UseTheme(Self); 53 50 end; 54 51 55 52 procedure TFormNameDetails.FormShow(Sender: TObject); 56 53 begin 57 Core. PersistentForm1.Load(Self);54 Core.Core.PersistentForm1.Load(Self); 58 55 end; 59 56 -
trunk/Forms/FormProperties.pas
r148 r149 1 unit UFormProperties;1 unit FormProperties; 2 2 3 3 interface … … 76 76 end; 77 77 78 var79 FormProperties: TFormProperties;80 81 78 82 79 implementation … … 85 82 86 83 uses 87 UFormProperty, UCore, Common;84 FormProperty, Core, Common; 88 85 89 86 resourcestring … … 207 204 procedure TFormProperties.FormShow(Sender: TObject); 208 205 begin 209 Core. PersistentForm1.Load(Self);206 Core.Core.PersistentForm1.Load(Self); 210 207 ReloadList; 211 208 UpdateInterface; … … 269 266 OpenDialog1.Filter := STextFiles + '|*' + TextFileExt + '|' + SAllFiles + '|*.*'; 270 267 OpenDialog1.DefaultExt := TextFileExt; 271 OpenDialog1.InitialDir := ExtractFileDir(Core. LastPropertyValueFileName);272 OpenDialog1.FileName := ExtractFileName(Core. LastPropertyValueFileName);268 OpenDialog1.InitialDir := ExtractFileDir(Core.Core.LastPropertyValueFileName); 269 OpenDialog1.FileName := ExtractFileName(Core.Core.LastPropertyValueFileName); 273 270 if OpenDialog1.Execute then begin 274 271 TContactProperty(ListView1.Selected.Data).Value := LoadFileToStr(OpenDialog1.FileName); 275 Core. LastPropertyValueFileName := OpenDialog1.FileName;272 Core.Core.LastPropertyValueFileName := OpenDialog1.FileName; 276 273 ReloadList; 277 274 end; … … 324 321 SaveDialog1.Filter := STextFiles + '|*' + TextFileExt + '|' + SAllFiles + '|*.*'; 325 322 SaveDialog1.DefaultExt := TextFileExt; 326 SaveDialog1.InitialDir := ExtractFileDir(Core. LastPropertyValueFileName);323 SaveDialog1.InitialDir := ExtractFileDir(Core.Core.LastPropertyValueFileName); 327 324 SaveDialog1.FileName := SValue + TextFileExt; 328 325 if SaveDialog1.Execute then begin 329 326 SaveStringToFile(TContactProperty(ListView1.Selected.Data).Value, SaveDialog1.FileName); 330 Core. LastPropertyValueFileName := SaveDialog1.FileName;327 Core.Core.LastPropertyValueFileName := SaveDialog1.FileName; 331 328 end; 332 329 end; … … 342 339 ); 343 340 begin 344 Core. PersistentForm1.Save(Self);341 Core.Core.PersistentForm1.Save(Self); 345 342 end; 346 343 … … 349 346 I: Integer; 350 347 begin 351 Core. Translator.TranslateComponentRecursive(Self);352 Core. ThemeManager1.UseTheme(Self);348 Core.Core.Translator.TranslateComponentRecursive(Self); 349 Core.Core.ThemeManager1.UseTheme(Self); 353 350 354 351 FProperties := nil; -
trunk/Forms/FormProperty.pas
r148 r149 1 unit UFormProperty;1 unit FormProperty; 2 2 3 3 interface … … 38 38 end; 39 39 40 var41 FormProperty: TFormProperty;42 43 40 44 41 implementation … … 47 44 48 45 uses 49 UCore;46 Core; 50 47 51 48 { TFormProperty } … … 93 90 procedure TFormProperty.FormClose(Sender: TObject; var CloseAction: TCloseAction); 94 91 begin 95 Core. PersistentForm1.Save(Self);92 Core.Core.PersistentForm1.Save(Self); 96 93 end; 97 94 98 95 procedure TFormProperty.FormCreate(Sender: TObject); 99 96 begin 100 Core. Translator.TranslateComponentRecursive(Self);101 Core. ThemeManager1.UseTheme(Self);97 Core.Core.Translator.TranslateComponentRecursive(Self); 98 Core.Core.ThemeManager1.UseTheme(Self); 102 99 103 100 FContactProperty := nil; … … 107 104 procedure TFormProperty.FormShow(Sender: TObject); 108 105 begin 109 Core. PersistentForm1.Load(Self);106 Core.Core.PersistentForm1.Load(Self); 110 107 end; 111 108 -
trunk/Forms/FormSettings.pas
r148 r149 1 unit UFormSettings;1 unit FormSettings; 2 2 3 3 interface … … 40 40 end; 41 41 42 var43 FormSettings: TFormSettings;44 45 42 46 43 implementation … … 49 46 50 47 uses 51 UCore, Theme;48 Core, Theme; 52 49 53 50 { TFormSettings } … … 55 52 procedure TFormSettings.FormShow(Sender: TObject); 56 53 begin 57 Core. PersistentForm1.Load(Self);54 Core.Core.PersistentForm1.Load(Self); 58 55 59 Core. Translator.LanguageListToStrings(ComboBoxLanguage.Items);60 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core. Translator.Language);56 Core.Core.Translator.LanguageListToStrings(ComboBoxLanguage.Items); 57 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.Core.Translator.Language); 61 58 if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0; 62 59 63 Core. ThemeManager1.Themes.LoadToStrings(ComboBoxTheme.Items);64 ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(Core. ThemeManager1.Theme);60 Core.Core.ThemeManager1.Themes.LoadToStrings(ComboBoxTheme.Items); 61 ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(Core.Core.ThemeManager1.Theme); 65 62 if ComboBoxTheme.ItemIndex = -1 then ComboBoxTheme.ItemIndex := 0; 66 63 end; … … 69 66 begin 70 67 if ComboBoxLanguage.ItemIndex <> -1 then 71 Core. Translator.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);68 Core.Core.Translator.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]); 72 69 if ComboBoxTheme.ItemIndex <> -1 then 73 Core. ThemeManager1.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]);70 Core.Core.ThemeManager1.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]); 74 71 end; 75 72 … … 87 84 ); 88 85 begin 89 Core. PersistentForm1.Save(Self);86 Core.Core.PersistentForm1.Save(Self); 90 87 end; 91 88 92 89 procedure TFormSettings.FormCreate(Sender: TObject); 93 90 begin 94 Core. Translator.TranslateComponentRecursive(Self);95 Core. ThemeManager1.UseTheme(Self);91 Core.Core.Translator.TranslateComponentRecursive(Self); 92 Core.Core.ThemeManager1.UseTheme(Self); 96 93 end; 97 94 98 95 procedure TFormSettings.LoadData; 99 96 begin 100 CheckBoxAutomaticDPI.Checked := Core.ScaleDPI1.AutoDetect; 101 SpinEditDPI.Value := Core.ScaleDPI1.DPI.X; 102 CheckBoxReopenLastFileOnStart.Checked := Core.ReopenLastFileOnStart; 103 EditDefaultVcardVersion.Text := Core.DefaultVcardVersion; 104 EditMapUrl.Text := Core.MapUrl; 97 with Core.Core do begin 98 CheckBoxAutomaticDPI.Checked := ScaleDPI1.AutoDetect; 99 SpinEditDPI.Value := ScaleDPI1.DPI.X; 100 CheckBoxReopenLastFileOnStart.Checked := ReopenLastFileOnStart; 101 EditDefaultVcardVersion.Text := DefaultVcardVersion; 102 EditMapUrl.Text := MapUrl; 103 end; 105 104 UpdateInterface; 106 105 end; … … 108 107 procedure TFormSettings.SaveData; 109 108 begin 110 Core.ScaleDPI1.AutoDetect := CheckBoxAutomaticDPI.Checked; 111 Core.ScaleDPI1.DPI := Point(SpinEditDPI.Value, SpinEditDPI.Value); 112 Core.ReopenLastFileOnStart := CheckBoxReopenLastFileOnStart.Checked; 113 Core.DefaultVcardVersion := EditDefaultVcardVersion.Text; 114 Core.MapUrl := EditMapUrl.Text; 109 with Core.Core do begin 110 ScaleDPI1.AutoDetect := CheckBoxAutomaticDPI.Checked; 111 ScaleDPI1.DPI := Point(SpinEditDPI.Value, SpinEditDPI.Value); 112 ReopenLastFileOnStart := CheckBoxReopenLastFileOnStart.Checked; 113 DefaultVcardVersion := EditDefaultVcardVersion.Text; 114 MapUrl := EditMapUrl.Text; 115 end; 115 116 end; 116 117 -
trunk/Forms/FormSource.pas
r148 r149 1 unit UFormSource;1 unit FormSource; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ActnList, Menus, 7 StdCtrls, SynEdit, SynHighlighterAny, UVCardHighlighter, Common;7 StdCtrls, SynEdit, SynHighlighterAny, VCardHighlighter, Common; 8 8 9 9 type … … 42 42 end; 43 43 44 var45 FormSource: TFormSource;46 47 44 48 45 implementation … … 51 48 52 49 uses 53 UCore, Theme, VCard;50 Core, Theme, VCard; 54 51 55 52 { TFormSource } … … 57 54 procedure TFormSource.FormClose(Sender: TObject; var CloseAction: TCloseAction); 58 55 begin 59 Core. PersistentForm1.Save(Self);56 Core.Core.PersistentForm1.Save(Self); 60 57 end; 61 58 … … 85 82 I: Integer; 86 83 begin 87 Core. Translator.TranslateComponentRecursive(Self);88 Core. ThemeManager1.UseTheme(Self);84 Core.Core.Translator.TranslateComponentRecursive(Self); 85 Core.Core.ThemeManager1.UseTheme(Self); 89 86 90 87 VCardHighlighter := TSynVCardHighlighter.Create(nil); … … 105 102 procedure TFormSource.FormShow(Sender: TObject); 106 103 begin 107 Core. PersistentForm1.Load(Self);104 Core.Core.PersistentForm1.Load(Self); 108 105 UpdateTheme; 109 106 end; … … 123 120 C: TColor; 124 121 begin 125 if Core. ThemeManager1.Theme.Name = ThemeNameDark then begin122 if Core.Core.ThemeManager1.Theme.Name = ThemeNameDark then begin 126 123 SynEditSource.Color := clBlack; 127 124 VCardHighlighter.IdentAttri.Foreground := clWhite; … … 130 127 VCardHighlighter.PropertyAttri.Foreground := clLightRed; 131 128 end else 132 if Core. ThemeManager1.Theme.Name = ThemeNameLight then begin129 if Core.Core.ThemeManager1.Theme.Name = ThemeNameLight then begin 133 130 SynEditSource.Color := clWhite; 134 131 VCardHighlighter.IdentAttri.Foreground := clBlack; -
trunk/Forms/FormTest.pas
r148 r149 1 unit UFormTest;1 unit FormTest; 2 2 3 3 interface … … 39 39 end; 40 40 41 var42 FormTest: TFormTest;43 44 41 45 42 implementation … … 48 45 49 46 uses 50 UCore, UFormTestCase, VCard;47 Core, FormTestCase, VCard; 51 48 52 49 { TFormTest } … … 107 104 procedure TFormTest.FormClose(Sender: TObject; var CloseAction: TCloseAction); 108 105 begin 109 Core. PersistentForm1.Save(Self);106 Core.Core.PersistentForm1.Save(Self); 110 107 end; 111 108 … … 143 140 procedure TFormTest.FormCreate(Sender: TObject); 144 141 begin 145 Core. Translator.TranslateComponentRecursive(Self);146 Core. ThemeManager1.UseTheme(Self);142 Core.Core.Translator.TranslateComponentRecursive(Self); 143 Core.Core.ThemeManager1.UseTheme(Self); 147 144 end; 148 145 149 146 procedure TFormTest.FormShow(Sender: TObject); 150 147 begin 151 Core. PersistentForm1.Load(Self);148 Core.Core.PersistentForm1.Load(Self); 152 149 ReloadList; 153 150 UpdateInterface; -
trunk/Forms/FormTestCase.lfm
r148 r149 1 1 object FormTestCase: TFormTestCase 2 2 Left = 579 3 Height = 5 433 Height = 521 4 4 Top = 468 5 Width = 9015 Width = 865 6 6 Caption = 'Test case' 7 ClientHeight = 5 438 ClientWidth = 9019 DesignTimePPI = 1 507 ClientHeight = 521 8 ClientWidth = 865 9 DesignTimePPI = 144 10 10 OnClose = FormClose 11 11 OnCreate = FormCreate 12 12 OnShow = FormShow 13 LCLVersion = '2.2. 0.4'13 LCLVersion = '2.2.6.0' 14 14 object MemoLog: TMemo 15 15 Left = 8 16 Height = 5 2716 Height = 505 17 17 Top = 8 18 Width = 8 8518 Width = 849 19 19 Align = alClient 20 20 BorderSpacing.Around = 8 -
trunk/Forms/FormTestCase.pas
r148 r149 1 unit UFormTestCase;1 unit FormTestCase; 2 2 3 3 interface … … 15 15 procedure FormCreate(Sender: TObject); 16 16 procedure FormShow(Sender: TObject); 17 private18 19 public20 21 17 end; 22 23 var24 FormTestCase: TFormTestCase;25 18 26 19 … … 30 23 31 24 uses 32 UCore;25 Core; 33 26 34 27 { TFormTestCase } … … 37 30 ); 38 31 begin 39 Core. PersistentForm1.Save(Self);32 Core.Core.PersistentForm1.Save(Self); 40 33 end; 41 34 42 35 procedure TFormTestCase.FormCreate(Sender: TObject); 43 36 begin 44 Core. Translator.TranslateComponentRecursive(Self);45 Core. ThemeManager1.UseTheme(Self);37 Core.Core.Translator.TranslateComponentRecursive(Self); 38 Core.Core.ThemeManager1.UseTheme(Self); 46 39 end; 47 40 48 41 procedure TFormTestCase.FormShow(Sender: TObject); 49 42 begin 50 Core. PersistentForm1.Load(Self);43 Core.Core.PersistentForm1.Load(Self); 51 44 end; 52 45
Note:
See TracChangeset
for help on using the changeset viewer.