Changeset 220 for trunk/Forms/FormMain.pas
- Timestamp:
- Jan 17, 2025, 9:39:06 PM (4 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormMain.pas
r219 r220 7 7 ComCtrls, StdCtrls, ExtCtrls, ActnList, Grids, Acronym, PersistentForm, 8 8 RegistryEx, LastOpenedList, ListViewSort, JobProgressView, FormAbout, 9 Registry, Generics.Collections, LazUTF8, LazFileUtils, FormEx; 9 Registry, Generics.Collections, LazUTF8, LazFileUtils, FormEx, 10 FormKeyShortcuts; 10 11 11 12 type … … 14 15 15 16 TFormMain = class(TFormEx) 17 AFullScreen: TAction; 18 AShowKeyShortCuts: TAction; 16 19 AFilterShowItemsWithoutFilter: TAction; 17 20 ADocumentCheck: TAction; … … 53 56 MenuItem26: TMenuItem; 54 57 MenuItem27: TMenuItem; 58 MenuItem28: TMenuItem; 59 MenuItem29: TMenuItem; 55 60 N1: TMenuItem; 56 61 MenuItem3: TMenuItem; … … 117 122 procedure AFilterSameLengthExecute(Sender: TObject); 118 123 procedure AFilterShowItemsWithoutFilterExecute(Sender: TObject); 124 procedure AFullScreenExecute(Sender: TObject); 119 125 procedure AHideExecute(Sender: TObject); 120 126 procedure AImportExecute(Sender: TObject); … … 129 135 procedure AShowImportSourcesExecute(Sender: TObject); 130 136 procedure EditSearchChange(Sender: TObject); 137 procedure FormDestroy(Sender: TObject); 131 138 procedure FormHide(Sender: TObject); 132 139 procedure FormResize(Sender: TObject); … … 147 154 procedure MenuItemStatusBarClick(Sender: TObject); 148 155 procedure MenuItemToolbarClick(Sender: TObject); 156 procedure AShowKeyShortcutsExecute(Sender: TObject); 149 157 private 158 FullScreen: Boolean; 150 159 RegistryContext: TRegistryContext; 151 160 ProjectClosed: Boolean; 152 161 ImportTotalItemCount: Integer; 162 FormKeyShortcuts: TFormKeyShortcuts; 153 163 procedure AcronymDbUpdate(Sender: TObject); 154 164 function FilterCell(Text1, Text2: string): Boolean; … … 165 175 end; 166 176 177 const 178 ProjectExt = '.adp'; 179 167 180 resourcestring 168 181 SAddedCount = 'Imported %d acronyms. Added %d new.'; … … 170 183 SAcronymsCount = 'Acronyms count: %d'; 171 184 SMeaningsCount = 'Meanings count: %d'; 172 SFileFilter = 'Acronym Decoder project ( .adp)|*.adp|All files|*.*';185 SFileFilter = 'Acronym Decoder project (' + ProjectExt + ')|*' + ProjectExt + '|All files|*.*'; 173 186 174 187 … … 187 200 188 201 const 189 ProjectExt = '.adp';190 202 DefaultFileName = 'Acronyms' + ProjectExt; 191 203 RegistryRunKey = '\Software\Microsoft\Windows\CurrentVersion\Run'; … … 220 232 begin 221 233 UpdateAcronymsList; 234 end; 235 236 procedure TFormMain.FormDestroy(Sender: TObject); 237 begin 238 if Assigned(FormKeyShortcuts) then FreeAndNil(FormKeyShortcuts); 222 239 end; 223 240 … … 371 388 end; 372 389 390 procedure TFormMain.AFullScreenExecute(Sender: TObject); 391 begin 392 FullScreen := not FullScreen; 393 TFormEx.PersistentForm.Form := Self; 394 TFormEx.PersistentForm.SetFullScreen(FullScreen); 395 UpdateInterface; 396 end; 397 373 398 procedure TFormMain.AHideExecute(Sender: TObject); 374 399 begin … … 530 555 procedure TFormMain.FormShow(Sender: TObject); 531 556 begin 557 FullScreen := Core.Core.PersistentForm1.FormFullScreen; 532 558 Core.Core.Initialize; 533 559 … … 594 620 if ListViewSort1.Order = soDown then Result := -Result; 595 621 end else Result := 0; 622 end; 623 624 procedure TFormMain.AShowKeyShortcutsExecute(Sender: TObject); 625 begin 626 if not Assigned(FormKeyShortcuts) then 627 FormKeyShortcuts := TFormKeyShortcuts.Create(nil); 628 with FormKeyShortcuts do begin 629 Images := Core.Core.ImageListSmall; 630 SourceComponents.Clear; 631 SourceComponents.Add(Self); 632 Show; 633 end; 596 634 end; 597 635 … … 708 746 Title: string; 709 747 begin 748 AFullscreen.Checked := FullScreen; 710 749 ListViewAcronyms.Enabled := Assigned(Core.Core.AcronymDb); 711 750 AFileClose.Enabled := Assigned(Core.Core.AcronymDb);
Note:
See TracChangeset
for help on using the changeset viewer.