Re: CProperty***/Page
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Thu, 14 Dec 2006 17:31:07 -0500
Duh, I shouldn't type when I'm falling asleep. Key to all of this is to create an
instance of a data structure which is common to all pages and put the variables in this
data structure (so it is shared among all the instances!) Just went back and looked at my
code (after napping)
joe
On Thu, 14 Dec 2006 16:18:56 -0500, Joseph M. Newcomer <newcomer@xxxxxxxxxxxx> wrote:
Whatever the parent of your property pages is, that's what you use. All the dialogs shareJoseph M. Newcomer [MVP]
this common parent. That's your "document". What I did was add a method
__inline CParent * GetDocument() { return (CParent*)GetParent(); }
to each property page dialog, where "CParent" stands for whatever your parent window is.
There's another approach; see my essay on subclassing dialogs and property pages. Often I
will create a single superclass of all propertypages,
class CMyMasterPropertyPage : public CPropertyPage {
...
}
and hand-edit all my property pages from
class CMyPage1 : public CPropertyPage {...}
to be
class CMyPage1 : public CMyMasterPropertyPage
(This takes a bit more editing than I show here, because the constructors have to be
changed, but see my essay)
Now all common data is placed in the CMyMasterPropertyPage. In an OnKillActive, values
are snatched out of the controls and stored in these variables, and in an OnSetActive,
values are taken from these variables and put into the controls.
See my essay on dialog control management. Having set all the values, I call
updateControls() to make sure that all values result in consistent behavior of the
controls, e.g., if the color is red, green, or blue, the thus-and-such option is disabled,
or the primary-color checkbox is checked, or something like that.
joe
On Thu, 14 Dec 2006 09:01:00 -0500, "Bob" <bsagusti@xxxxxxxxxxx> wrote:
Joe,Joseph M. Newcomer [MVP]
I understand the concept that you have proposed i.e.doc/view, but I don't
understand the mechanics. How do you utilize the property pages without the
***? Are you talking about dialogs (CDialog) in different views? If so,
what about the sweet tabbing mechanism?
Bob
"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:03t0o251re3nau052ldmj61afs2fu40541@xxxxxxxxxx
Wrong approach.
Instead, treat the parent of your property pages as a "document:" and the
property pages
as "views". In the OnKillActive of each page, you store into variables of
the parent the
values you want other property pages to see. In the OnSetActive of a
page, you retrieve
these values. PSM_QUERYSIBLINGS is almost totally useless.
joe
On Wed, 13 Dec 2006 13:44:42 -0500, "Bob" <bsagusti@xxxxxxxxxxx> wrote:
Hello,Joseph M. Newcomer [MVP]
I am creating a dialog app but the info that I must handle requires more
space than just one dialog. I decided to go with a property ***, that
way
I can convey data to the user in a non-cluttered, orderly fashion. The
first
prop page gets data from a socket and elements of that data is to be
displayed on all the pages. I'm using QuerySiblings() to notify the other
pages and pass a pointer to the data.
My problem is that unless the user clicks the tabs to cause InitDialog()
to
be called on the other property pages, the PSM_QUERYSIBLINGS message is
not
sent to those pages. I need the data to be in the controls of those
property
pages when the user clicks on them the first time.
Is there a way to cause InitDialog() to get called? i.e. some way to cause
a
WM_NOTIFY?
Am I going about this wrong?
Thanks a lot.
Bob
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- References:
- CProperty***/Page
- From: Bob
- Re: CProperty***/Page
- From: Joseph M . Newcomer
- Re: CProperty***/Page
- From: Bob
- Re: CProperty***/Page
- From: Joseph M . Newcomer
- CProperty***/Page
- Prev by Date: Re: Webcam questions
- Next by Date: Re: English-> German and GetNumberFormat()
- Previous by thread: Re: CProperty***/Page
- Next by thread: Re: CProperty***/Page
- Index(es):