Skip to content

TPJWdwState - using Restore and Save methods other than Form's OnShow and OnHide #1

Description

@delphidabbler

Recreated from delphidabbler/ddablib repository issue 3

Recreated from SourceForge ticket no.35

Project: wdwstate

Original creator was Ivo Ungermann - 2016-01-03

Even if demos recommend using form's Show and Hide as places for Restore and Restore methods of TPJWdwState components, there can be reasons to place it e.g. in Create and Destroy. And there is code in Restore method reflecting this situation and factical restoring is to be postponed for time of form showing. In contrast, Save method doesn't check if factical restoring took place (affected form is not shown during session) and form's design-time state is saved instead. There is my correction of Save method source code:

begin
Assert(not (csDesigning in ComponentState));

// Check if there is an owning window - get out if not
if fWindow = nil then
Exit;

if fRestorePending then
Exit;

Other similar components can be affected the same way.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions