Changeset 3 for trunk/UFormMain.pas


Ignore:
Timestamp:
Apr 20, 2016, 9:25:55 PM (9 years ago)
Author:
chronos
Message:
  • Added: Remember last form position.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UFormMain.pas

    r2 r3  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
    9   ComCtrls, StdCtrls, ExtCtrls, ActnList, UAcronym, Contnrs;
     9  ComCtrls, StdCtrls, ExtCtrls, ActnList, UAcronym, UPersistentForm, Contnrs,
     10  URegistry, Registry;
    1011
    1112type
     
    2324    MenuItem2: TMenuItem;
    2425    MenuItem3: TMenuItem;
     26    PersistentForm1: TPersistentForm;
    2527    PopupMenu1: TPopupMenu;
    2628    TrayIcon1: TTrayIcon;
     
    7375begin
    7476  AcronymDB.SaveToFile(DefaultFileName);
     77  PersistentForm1.Save(Self);
    7578end;
    7679
     
    103106
    104107procedure TFormMain.FormShow(Sender: TObject);
     108const
     109  DefaultRegKey = '\Software\Acronym Decoder';
    105110begin
     111  PersistentForm1.RegistryContext := RegContext(HKEY_CURRENT_USER, DefaultRegKey);
     112  PersistentForm1.Load(Self);
    106113  if FileExists(DefaultFileName) then
    107114    AcronymDB.LoadFromFile(DefaultFileName);
Note: See TracChangeset for help on using the changeset viewer.