Changeset 192 for trunk/Packages/Common/UPersistentForm.pas
- Timestamp:
- May 1, 2018, 10:18:03 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/UPersistentForm.pas
r132 r192 26 26 FormWindowState: TWindowState; 27 27 Form: TForm; 28 DefaultFormWindowState: TWindowState;29 28 procedure LoadFromRegistry(RegistryContext: TRegistryContext); 30 29 procedure SaveToRegistry(RegistryContext: TRegistryContext); 31 30 function CheckEntireVisible(Rect: TRect): TRect; 32 31 function CheckPartVisible(Rect: TRect; Part: Integer): TRect; 33 procedure Load(Form: TForm; Default FormWindowState: TWindowState = wsNormal);32 procedure Load(Form: TForm; DefaultMaximized: Boolean = False); 34 33 procedure Save(Form: TForm); 35 34 constructor Create(AOwner: TComponent); override; … … 135 134 + FormRestoredSize.Top; 136 135 // Other state 137 FormWindowState := TWindowState(ReadIntegerWithDefault('WindowState', Integer( DefaultFormWindowState)));136 FormWindowState := TWindowState(ReadIntegerWithDefault('WindowState', Integer(wsNormal))); 138 137 finally 139 138 Free; … … 216 215 end; 217 216 218 procedure TPersistentForm.Load(Form: TForm; Default FormWindowState: TWindowState = wsNormal);217 procedure TPersistentForm.Load(Form: TForm; DefaultMaximized: Boolean = False); 219 218 begin 220 219 Self.Form := Form; 221 Self.DefaultFormWindowState := DefaultFormWindowState;222 223 220 // Set default 224 221 FormNormalSize := Bounds((Screen.Width - Form.Width) div 2, … … 230 227 231 228 if not EqualRect(FormNormalSize, FormRestoredSize) or 232 (FormWindowState = wsMaximized)then begin229 DefaultMaximized then begin 233 230 // Restore to maximized state 234 231 Form.WindowState := wsNormal;
Note:
See TracChangeset
for help on using the changeset viewer.