Changeset 220 for trunk/Forms


Ignore:
Timestamp:
Jan 17, 2025, 9:39:06 PM (5 days ago)
Author:
chronos
Message:
  • Added: Key shortcuts form.
  • Added: Action to switch to fullscreen mode.
Location:
trunk/Forms
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormMain.lfm

    r219 r220  
    11object FormMain: TFormMain
    22  Left = 417
    3   Height = 713
     3  Height = 679
    44  Top = 453
    55  Width = 1106
    66  Caption = 'Acronym Decoder'
    7   ClientHeight = 713
     7  ClientHeight = 679
    88  ClientWidth = 1106
    99  DesignTimePPI = 144
     
    1212  OnCloseQuery = FormCloseQuery
    1313  OnCreate = FormCreate
     14  OnDestroy = FormDestroy
    1415  OnHide = FormHide
    1516  OnResize = FormResize
     
    1819  object PanelMain: TPanel
    1920    Left = 0
    20     Height = 604
     21    Height = 570
    2122    Top = 81
    2223    Width = 1106
    2324    Align = alClient
    2425    BevelOuter = bvNone
    25     ClientHeight = 604
     26    ClientHeight = 570
    2627    ClientWidth = 1106
    2728    ParentFont = False
     
    3738    object ListViewAcronyms: TListView
    3839      Left = 5
    39       Height = 548
     40      Height = 514
    4041      Top = 50
    4142      Width = 1095
     
    157158        Width = 120
    158159      end>
    159     Images = Core.ImageList1
     160    Images = Core.ImageListSmall
    160161    ParentFont = False
    161162    object ToolBarFile: TToolBar
     
    173174      EdgeInner = esNone
    174175      EdgeOuter = esNone
    175       Images = Core.ImageList1
     176      Images = Core.ImageListSmall
    176177      ParentFont = False
    177178      ParentShowHint = False
     
    216217      EdgeInner = esNone
    217218      EdgeOuter = esNone
    218       Images = Core.ImageList1
     219      Images = Core.ImageListSmall
    219220      ParentFont = False
    220221      ParentShowHint = False
     
    257258      EdgeInner = esNone
    258259      EdgeOuter = esNone
    259       Images = Core.ImageList1
     260      Images = Core.ImageListSmall
    260261      ParentFont = False
    261262      ParentShowHint = False
     
    288289      EdgeInner = esNone
    289290      EdgeOuter = esNone
    290       Images = Core.ImageList1
     291      Images = Core.ImageListSmall
    291292      ParentFont = False
    292293      ParentShowHint = False
     
    317318    Left = 0
    318319    Height = 28
    319     Top = 685
     320    Top = 651
    320321    Width = 1106
    321322    Panels = <   
     
    330331  end
    331332  object ActionList1: TActionList
    332     Images = Core.ImageList1
     333    Images = Core.ImageListSmall
    333334    Left = 708
    334335    Top = 288
    335336    object AExit: TAction
     337      Category = 'File'
    336338      Caption = 'Exit'
    337339      ImageIndex = 2
     
    347349    end
    348350    object AImport: TAction
     351      Category = 'Tools'
    349352      Caption = 'Import'
    350353      OnExecute = AImportExecute
    351354    end
    352355    object AFileOpen: TAction
     356      Category = 'File'
    353357      Caption = 'Open'
    354358      ImageIndex = 8
     
    357361    end
    358362    object AFileNew: TAction
     363      Category = 'File'
    359364      Caption = 'New'
    360365      ImageIndex = 16
     
    363368    end
    364369    object AFileSave: TAction
     370      Category = 'File'
    365371      Caption = 'Save'
    366372      ImageIndex = 10
     
    369375    end
    370376    object AFileClose: TAction
     377      Category = 'File'
    371378      Caption = 'Close'
    372379      ImageIndex = 12
     
    374381    end
    375382    object AFileSaveAs: TAction
     383      Category = 'File'
    376384      Caption = 'Save as...'
    377385      ImageIndex = 10
     
    380388    end
    381389    object ASettings: TAction
     390      Category = 'Tools'
    382391      Caption = 'Settings'
    383392      ImageIndex = 6
     
    386395    end
    387396    object AShowCategories: TAction
     397      Category = 'View'
    388398      Caption = 'Categories'
    389399      ImageIndex = 11
     
    392402    end
    393403    object AShowAcronyms: TAction
     404      Category = 'View'
    394405      Caption = 'Acronyms'
    395406      ImageIndex = 15
     
    398409    end
    399410    object AShowImportSources: TAction
     411      Category = 'View'
    400412      Caption = 'Import sources'
    401413      ImageIndex = 13
     
    404416    end
    405417    object AShowAbout: TAction
     418      Category = 'Help'
    406419      Caption = 'About'
    407420      ImageIndex = 7
     
    409422    end
    410423    object AShowImportFormats: TAction
     424      Category = 'View'
    411425      Caption = 'Import formats'
    412426      ImageIndex = 14
     
    415429    end
    416430    object AProcessImports: TAction
     431      Category = 'Tools'
    417432      Caption = 'Process imports'
    418433      ImageIndex = 5
     
    421436    end
    422437    object AExport: TAction
     438      Category = 'Tools'
    423439      Caption = 'Export'
    424440      OnExecute = AExportExecute
     
    452468    end
    453469    object ADocumentCheck: TAction
     470      Category = 'Tools'
    454471      Caption = 'Document check'
    455472      ImageIndex = 20
    456473      OnExecute = ADocumentCheckExecute
    457474    end
     475    object AShowKeyShortCuts: TAction
     476      Category = 'Help'
     477      Caption = 'Key shortcuts'
     478      ImageIndex = 21
     479      OnExecute = AShowKeyShortcutsExecute
     480    end
     481    object AFullScreen: TAction
     482      Category = 'View'
     483      Caption = 'Full screen'
     484      ImageIndex = 22
     485      OnExecute = AFullScreenExecute
     486      ShortCut = 122
     487    end
    458488  end
    459489  object MainMenu1: TMainMenu
    460     Images = Core.ImageList1
     490    Images = Core.ImageListSmall
    461491    Left = 712
    462492    Top = 204
     
    505535        Caption = '-'
    506536      end
     537      object MenuItem29: TMenuItem
     538        Action = AFullScreen
     539      end
    507540      object MenuItemToolbar: TMenuItem
    508541        Caption = 'Toolbar'
     
    541574    object MenuItem5: TMenuItem
    542575      Caption = 'Help'
     576      object MenuItem28: TMenuItem
     577        Action = AShowKeyShortCuts
     578      end
    543579      object MenuItem6: TMenuItem
    544580        Action = AShowAbout
     
    574610  end
    575611  object PopupMenuOpenRecent: TPopupMenu
    576     Images = Core.ImageList1
     612    Images = Core.ImageListSmall
    577613    Left = 120
    578614    Top = 420
  • trunk/Forms/FormMain.lrj

    r219 r220  
    2727{"hash":267425709,"name":"tformmain.amanageacronym.caption","sourcebytes":[77,97,110,97,103,101,32,97,99,114,111,110,121,109],"value":"Manage acronym"},
    2828{"hash":63286139,"name":"tformmain.adocumentcheck.caption","sourcebytes":[68,111,99,117,109,101,110,116,32,99,104,101,99,107],"value":"Document check"},
     29{"hash":122803571,"name":"tformmain.ashowkeyshortcuts.caption","sourcebytes":[75,101,121,32,115,104,111,114,116,99,117,116,115],"value":"Key shortcuts"},
     30{"hash":131549534,"name":"tformmain.afullscreen.caption","sourcebytes":[70,117,108,108,32,115,99,114,101,101,110],"value":"Full screen"},
    2931{"hash":315429,"name":"tformmain.menuitem8.caption","sourcebytes":[70,105,108,101],"value":"File"},
    3032{"hash":131987540,"name":"tformmain.menuitemopenrecent.caption","sourcebytes":[79,112,101,110,32,114,101,99,101,110,116],"value":"Open recent"},
  • trunk/Forms/FormMain.pas

    r219 r220  
    77  ComCtrls, StdCtrls, ExtCtrls, ActnList, Grids, Acronym, PersistentForm,
    88  RegistryEx, LastOpenedList, ListViewSort, JobProgressView, FormAbout,
    9   Registry, Generics.Collections, LazUTF8, LazFileUtils, FormEx;
     9  Registry, Generics.Collections, LazUTF8, LazFileUtils, FormEx,
     10  FormKeyShortcuts;
    1011
    1112type
     
    1415
    1516  TFormMain = class(TFormEx)
     17    AFullScreen: TAction;
     18    AShowKeyShortCuts: TAction;
    1619    AFilterShowItemsWithoutFilter: TAction;
    1720    ADocumentCheck: TAction;
     
    5356    MenuItem26: TMenuItem;
    5457    MenuItem27: TMenuItem;
     58    MenuItem28: TMenuItem;
     59    MenuItem29: TMenuItem;
    5560    N1: TMenuItem;
    5661    MenuItem3: TMenuItem;
     
    117122    procedure AFilterSameLengthExecute(Sender: TObject);
    118123    procedure AFilterShowItemsWithoutFilterExecute(Sender: TObject);
     124    procedure AFullScreenExecute(Sender: TObject);
    119125    procedure AHideExecute(Sender: TObject);
    120126    procedure AImportExecute(Sender: TObject);
     
    129135    procedure AShowImportSourcesExecute(Sender: TObject);
    130136    procedure EditSearchChange(Sender: TObject);
     137    procedure FormDestroy(Sender: TObject);
    131138    procedure FormHide(Sender: TObject);
    132139    procedure FormResize(Sender: TObject);
     
    147154    procedure MenuItemStatusBarClick(Sender: TObject);
    148155    procedure MenuItemToolbarClick(Sender: TObject);
     156    procedure AShowKeyShortcutsExecute(Sender: TObject);
    149157  private
     158    FullScreen: Boolean;
    150159    RegistryContext: TRegistryContext;
    151160    ProjectClosed: Boolean;
    152161    ImportTotalItemCount: Integer;
     162    FormKeyShortcuts: TFormKeyShortcuts;
    153163    procedure AcronymDbUpdate(Sender: TObject);
    154164    function FilterCell(Text1, Text2: string): Boolean;
     
    165175  end;
    166176
     177const
     178  ProjectExt = '.adp';
     179
    167180resourcestring
    168181  SAddedCount = 'Imported %d acronyms. Added %d new.';
     
    170183  SAcronymsCount = 'Acronyms count: %d';
    171184  SMeaningsCount = 'Meanings count: %d';
    172   SFileFilter = 'Acronym Decoder project (.adp)|*.adp|All files|*.*';
     185  SFileFilter = 'Acronym Decoder project (' + ProjectExt + ')|*' + ProjectExt + '|All files|*.*';
    173186
    174187
     
    187200
    188201const
    189   ProjectExt = '.adp';
    190202  DefaultFileName = 'Acronyms' + ProjectExt;
    191203  RegistryRunKey = '\Software\Microsoft\Windows\CurrentVersion\Run';
     
    220232begin
    221233  UpdateAcronymsList;
     234end;
     235
     236procedure TFormMain.FormDestroy(Sender: TObject);
     237begin
     238  if Assigned(FormKeyShortcuts) then FreeAndNil(FormKeyShortcuts);
    222239end;
    223240
     
    371388end;
    372389
     390procedure TFormMain.AFullScreenExecute(Sender: TObject);
     391begin
     392  FullScreen := not FullScreen;
     393  TFormEx.PersistentForm.Form := Self;
     394  TFormEx.PersistentForm.SetFullScreen(FullScreen);
     395  UpdateInterface;
     396end;
     397
    373398procedure TFormMain.AHideExecute(Sender: TObject);
    374399begin
     
    530555procedure TFormMain.FormShow(Sender: TObject);
    531556begin
     557  FullScreen := Core.Core.PersistentForm1.FormFullScreen;
    532558  Core.Core.Initialize;
    533559
     
    594620    if ListViewSort1.Order = soDown then Result := -Result;
    595621  end else Result := 0;
     622end;
     623
     624procedure TFormMain.AShowKeyShortcutsExecute(Sender: TObject);
     625begin
     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;
    596634end;
    597635
     
    708746  Title: string;
    709747begin
     748  AFullscreen.Checked := FullScreen;
    710749  ListViewAcronyms.Enabled := Assigned(Core.Core.AcronymDb);
    711750  AFileClose.Enabled := Assigned(Core.Core.AcronymDb);
Note: See TracChangeset for help on using the changeset viewer.