Changeset 81 for trunk/Packages
- Timestamp:
- Jun 21, 2017, 4:02:31 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/UPersistentForm.pas
r74 r81 26 26 FormWindowState: TWindowState; 27 27 Form: TForm; 28 DefaultFormWindowState: TWindowState; 28 29 procedure LoadFromRegistry(RegistryContext: TRegistryContext); 29 30 procedure SaveToRegistry(RegistryContext: TRegistryContext); 30 31 function CheckEntireVisible(Rect: TRect): TRect; 31 32 function CheckPartVisible(Rect: TRect; Part: Integer): TRect; 32 procedure Load(Form: TForm; Default Maximized: Boolean = False);33 procedure Load(Form: TForm; DefaultFormWindowState: TWindowState = wsNormal); 33 34 procedure Save(Form: TForm); 34 35 constructor Create(AOwner: TComponent); override; … … 56 57 I: Integer; 57 58 WinControl: TWinControl; 58 Count: Integer;59 59 begin 60 60 if Control is TListView then begin … … 135 135 + FormRestoredSize.Top; 136 136 // Other state 137 FormWindowState := TWindowState(ReadIntegerWithDefault('WindowState', Integer( wsNormal)));137 FormWindowState := TWindowState(ReadIntegerWithDefault('WindowState', Integer(DefaultFormWindowState))); 138 138 finally 139 139 Free; … … 216 216 end; 217 217 218 procedure TPersistentForm.Load(Form: TForm; DefaultMaximized: Boolean = False); 219 var 220 LoadDefaults: Boolean; 218 procedure TPersistentForm.Load(Form: TForm; DefaultFormWindowState: TWindowState = wsNormal); 221 219 begin 222 220 Self.Form := Form; 221 Self.DefaultFormWindowState := DefaultFormWindowState; 222 223 223 // Set default 224 224 FormNormalSize := Bounds((Screen.Width - Form.Width) div 2, … … 230 230 231 231 if not EqualRect(FormNormalSize, FormRestoredSize) or 232 ( LoadDefaults and DefaultMaximized) then begin232 (FormWindowState = wsMaximized) then begin 233 233 // Restore to maximized state 234 234 Form.WindowState := wsNormal;
Note:
See TracChangeset
for help on using the changeset viewer.