The problem is as follows:
- There is an Interface with two methods Load and Save and isChanged property
- There are many TFrame frames that support this interface.
- Frames have different components with data entry capability, such as TEdit , TCheckBox , TComboBox , TMemo , and possibly others.
- Load - fills the fields with values
- Save - writes (only if isChanged = true )
- isChanged - set if any input field has been changed
- When writing a request to save the changes, with a positive answer Save , negative, if something changed - Load .
In general, all components have an onChange event in which you can set isChanged , BUT ... You need to recursively bypass all the components and subcomponents of the frame ( TPageControl , TScrollBox , etc.) to initialize the event (or add, if it is already set), and boot all disable them, then assign again. Somehow it's all long, slow and not beautiful.
In general, a fresh look at the problem is needed ... Maybe it is possible to somehow globally intercept input from all components in the frame in order to include the isChanged flag? Is it possible to create an event in the frame that will react to a change in the input fields of one of its components? Or how to approach this issue better?