15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Using a Property Sheet in an SDI View

Mark Johnson -- MJohnson@ixc-comm.net
Friday, February 07, 1997

Environment: NT 4.0, VC++ 4.2b

Is it possible to use a Property Sheet in an SDI View?  Looking around
i've found CFormView which appears to be for displaying window controls
via a 
dialog box. However, Property Sheet's don't have a specific "main"
dialog 
associated with it, so i can't use the CPropertySheet or the like for
the "client"
area of a view.

any suggestions...

thanks, mark.




Norman C. Byers -- nbyers@intxxnet.com
Sunday, February 09, 1997

It is possible to use an a property sheet in SDI using a couple of 
different methods. Here is the simpler method I use:

1) Create your app as a normal SDI with a standard CView derived view class 
(CMyView for discussion)
2) Use the component Gallery to insert a new CPropertySheet derived class. 
Select that the property sheet be accessible from the CMyView class. For 
discussion I'll assume you named your property sheet: CMySheet
3) You'll probably want to remove the OnProperties() function that the 
class wizard added into your CMyView class. You probably won't need this.
4) in you CMyView class header, add a member variable as:  CMySheet 
m_MySheet;
5) modify CMyView::OnInitialUpdate()  as follows:

void CMyView::OnInitialUpdate()
{
	CView::OnInitialUpdate();
	m_MySheet.Construct("caption", this,0);			// construct property sheet
	m_MySheet.Create(this,WS_CHILD | WS_VISIBLE);	// create the property sheet 
as a child window (modeless...)
	.....rest of code....
}

6) Note that you'll have to do some manual handling of some update issues.

The second method I use is to derive from CFormView, and Override the 
CFormView::Create function to create the FormView instead of a dialog. Look 
in  msdev\mfc\src\viewform.cpp to see what Microsoft did in Create and copy 
most of it.

----------
From: 	Mark Johnson
Sent: 	Friday, February 07, 1997 10:13 AM
To: 	'mfc-l@netcom.com'
Subject: 	Using a Property Sheet in an SDI View

Environment: NT 4.0, VC++ 4.2b

Is it possible to use a Property Sheet in an SDI View?  Looking around
i've found CFormView which appears to be for displaying window controls
via a
dialog box. However, Property Sheet's don't have a specific "main"
dialog
associated with it, so i can't use the CPropertySheet or the like for
the "client"
area of a view.

any suggestions...

thanks, mark.



Mike Blaszczak -- mikeblas@nwlink.com
Sunday, February 09, 1997

At 10:13 2/7/97 -0600, Mark Johnson wrote:
>Environment: NT 4.0, VC++ 4.2b

>Is it possible to use a Property Sheet in an SDI View?  Looking around
>i've found CFormView which appears to be for displaying window controls
>via a dialog box. However, Property Sheet's don't have a specific "main"
>dialog associated with it, so i can't use the CPropertySheet or
>the like for the "client" area of a view.

>any suggestions...

Have a look at the SNAPVW sample that ships in the product.  While it
uses an MDI window, the idea would be the same for an SDI application.


.B ekiM
http://www.nwlink.com/~mikeblas/
These words are my own. I do not speak on behalf of Microsoft.
           This performance was not lip-synched.




Tony B -- abaker@illuminet.net
Monday, February 10, 1997

Dear Group,
I sent Mr Elliot a zip file containing an example of the code mentioned.  I
am very new to the list so I am not sure but I "believe" he inserted in an
archive..

[Moderator's note: Like I told you, I put it in the archive as
http://www2.vertexgroup.com/mfc-l/Shell.zip.]

Tony Baker

----------
> From: Mike Blaszczak 
> To: mfc-l@netcom.com
> Subject: Re: Using a Property Sheet in an SDI View
> Date: Sunday, February 09, 1997 4:17 PM
> 
> At 10:13 2/7/97 -0600, Mark Johnson wrote:
> >Environment: NT 4.0, VC++ 4.2b
> 
> >Is it possible to use a Property Sheet in an SDI View?  Looking around
> >i've found CFormView which appears to be for displaying window controls
> >via a dialog box. However, Property Sheet's don't have a specific "main"
> >dialog associated with it, so i can't use the CPropertySheet or
> >the like for the "client" area of a view.
> 
> >any suggestions...
> 
> Have a look at the SNAPVW sample that ships in the product.  While it
> uses an MDI window, the idea would be the same for an SDI application.
> 
> 
> .B ekiM
> http://www.nwlink.com/~mikeblas/
> These words are my own. I do not speak on behalf of Microsoft.
>            This performance was not lip-synched.




Become an MFC-L member | Вернуться в корень Архива |