Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
delphidabbler opened this issue Jun 25, 2022 · 1 comment
Assignees
Labels
accepted enhancement New feature or request

Comments

@delphidabbler
Copy link
Member

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.

@delphidabbler
Copy link
Member Author

Recreated from delphidabbler/ddablib repository issue 3

Recreated from SourceForge ticket no.35

Reply from: Peter Johnson ( @delphidabbler ) - 2021-09-14

Well it's taken a while - I've not been maintaining this code, but i see the sense in this.

Sorry for the horrendous delay

@delphidabbler delphidabbler self-assigned this Jul 17, 2022
@delphidabbler delphidabbler added accepted enhancement New feature or request labels Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant