Ignore:
Timestamp:
May 1, 2018, 10:18:03 AM (7 years ago)
Author:
chronos
Message:
  • Modified: Updated newer Common package files.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/UPersistentForm.pas

    r132 r192  
    2626    FormWindowState: TWindowState;
    2727    Form: TForm;
    28     DefaultFormWindowState: TWindowState;
    2928    procedure LoadFromRegistry(RegistryContext: TRegistryContext);
    3029    procedure SaveToRegistry(RegistryContext: TRegistryContext);
    3130    function CheckEntireVisible(Rect: TRect): TRect;
    3231    function CheckPartVisible(Rect: TRect; Part: Integer): TRect;
    33     procedure Load(Form: TForm; DefaultFormWindowState: TWindowState = wsNormal);
     32    procedure Load(Form: TForm; DefaultMaximized: Boolean = False);
    3433    procedure Save(Form: TForm);
    3534    constructor Create(AOwner: TComponent); override;
     
    135134      + FormRestoredSize.Top;
    136135    // Other state
    137     FormWindowState := TWindowState(ReadIntegerWithDefault('WindowState', Integer(DefaultFormWindowState)));
     136    FormWindowState := TWindowState(ReadIntegerWithDefault('WindowState', Integer(wsNormal)));
    138137  finally
    139138    Free;
     
    216215end;
    217216
    218 procedure TPersistentForm.Load(Form: TForm; DefaultFormWindowState: TWindowState = wsNormal);
     217procedure TPersistentForm.Load(Form: TForm; DefaultMaximized: Boolean = False);
    219218begin
    220219  Self.Form := Form;
    221   Self.DefaultFormWindowState := DefaultFormWindowState;
    222 
    223220  // Set default
    224221  FormNormalSize := Bounds((Screen.Width - Form.Width) div 2,
     
    230227
    231228  if not EqualRect(FormNormalSize, FormRestoredSize) or
    232     (FormWindowState = wsMaximized) then begin
     229    DefaultMaximized then begin
    233230    // Restore to maximized state
    234231    Form.WindowState := wsNormal;
Note: See TracChangeset for help on using the changeset viewer.