Link to home
Start Free TrialLog in
Avatar of GRST
GRST

asked on

Data update on property page

I got a bunch of property pages, and am creating more. I am looking for a way to detect changes in the controls (mostly Edit, Check box and radio buttons) on the property pages. The way I want it to work is like this:

Associated with the controls, I have data members with current values. When the user makes the changes on the property page and switch to another page before doing UpdateData() or Apply(), I want some way to know that and give an alert.

I know I could write a function for each control to handle this, but that is a lot of repeated work. Ideally I want to have a common base class, say CMyPropertyPage, that handles this once for all, and a particular property page, say CMySpecificPage, will be derived from CMyPropertyPage.

The best would be it will compare the values on the page with the data members and alert any differences. Or it would also be fine if any actions by the user on the controls are detected, values change or not.

Thank you very much. I am new here with only 75 points. I thought the problems is worth more than that.

GRST
ASKER CERTIFIED SOLUTION
Avatar of skibud2
skibud2

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of skibud2
skibud2

Did this work for you?
Avatar of GRST

ASKER

Hi skibud2,

Thanks for the response. I tried your method. It worked to certain extent, but is somewhat over sensitive and over simplified. It is triggered whenever the edit box is touched, even when the dialog (prop page) is initialized, during which it is simply loading the data members to the edit boxes. Another case is when the edit box is changed then changed back to the original before being saved to the data members. It is essentially not changed.

If there is no better way, I might just adapt your way to the program. But what I'm really looking for is a check such that:

- when the page is initialized, the associated data members, with initial values already, are loaded to the dialog and this should not trigger the check,

- when the page is becoming inactive, the function will check to see whether the data on the page become different from the associated data members.

I was thinking about modifying/overwriting those DDX_***()'s in DoDataExchange().

Do you, or anybody, have better ideas?

Thanks again. I appreciate it.

GRST