I have to start working on a 'Wizard' which will be developed as an MFC
extension DLL for an existing MFC application.
I was thinking about how the design of the wizard should be. Currently I am
planning to create a dialog, and put all the common UI elements like Next,
Back buttons and a left pane which shows all the steps with the currently
active step highlighted in it.
Now, the main viewing area of the wizard will have to change its contents
based on which step of the wizard the user is currently in. I am planning to
put all the controls which are required in all steps in there, and show/hide
them dynamically when user clicks Next button or Back button.
MFC experts, please comment on this kind of an apporach, and also let me
know if there is a better way around to design a wizard...!
Thanks In Advance!!
Jessy
Cheers
Check Abdoul
---------------------
"Jessica" <Jes...@discussions.microsoft.com> wrote in message
news:29842C20-FF5A-42EB...@microsoft.com...
MFC does most of it for you, in a better way. See
CPropertySheet::SetWizardMode
--
Scott McPhillips [VC++ MVP]
Tom
"Jessica" <Jes...@discussions.microsoft.com> wrote in message
news:29842C20-FF5A-42EB...@microsoft.com...
-Jessy
Can I create a dialog, implement a left pane which displays the steps of the
wizard with the currently active step highlighted, and then put the
ProperySheet in the main area of the dialog? Or can I only display the
Propertysheet standalone in a frame?
Thanks again,
Jessy
Can I create a dialog, implement a left pane which displays the steps of the
wizard with the currently active step highlighted, and then put the
ProperySheet in the main area of the dialog? Or can I only display the
Propertysheet standalone in a frame?
Thanks again,
Jessy
http://www.codeproject.com/KB/tabs/resizeable_wizard97.aspx
http://www.codeproject.com/KB/tabs/conquering_wizard97.aspx
The nice thing about the property sheet approach is that it really is just
like a bunch of dialogs that sequence. You can put all kinds of nice
graphics and text on each page to indicate where you are in the sequence.
Tom
"Jessica" <Jes...@discussions.microsoft.com> wrote in message
news:7B981D9B-9D75-491F...@microsoft.com...
Dec '98 MSJ magazine.
Cheers
Check Abdoul
---------------------
"Jessica" <Jes...@discussions.microsoft.com> wrote in message
news:7B981D9B-9D75-491F...@microsoft.com...
There isn't any way of putting a PropertySheet into another dialog,
unfortunately. If you want to keep using the PropertySheet (and it is the
easiest way of creating a wizard), then you could make each "interior page"
(all pages except the first and last ones) show an image on the left side of
the page. This is what the first and last pages have by default. And the
image you show on the interior pages would have the list of steps, with the
one for the current page highlighted. But this is harder to localize, since
all of the text in the steps is put into a graphic.
-- David
David:
I've never done it, but I think you can put a modeless property sheet
inside a modal dialog (or anywhere).
--
David Wilkinson
Visual C++ MVP
http://www.codeproject.com/KB/dialog/csettingsdlg.aspx
Tom
"David Wilkinson" <no-r...@effisols.com> wrote in message
news:ua%23rKVOO...@TK2MSFTNGP05.phx.gbl...
BOOL CVMRDialog::OnInitDialog()
{
CDialog::OnInitDialog();
// load the menu
m_menu.LoadMenu(IDR_MAINFRAME);
SetMenu(&m_menu);
m_menu.EnableMenuItem(ID_CHANNEL_CLOSE, MF_GRAYED);
OnChannelNew(); // adds the initial prop -page-
// create the property -sheet-
m_propsheet.Create(this, WS_CHILD|WS_VISIBLE);
m_propsheet.ModifyStyleEx(0, WS_EX_CONTROLPARENT);
// tighten up the size of the main dialog box
// to fit neatly around the prop pages
CMainDlg* pp = (CMainDlg*)m_propsheet.GetActivePage();
RECT rect;
// no need to call ScreenToClient - we're only using
// values for relative sizing
pp->GetWindowRect(&rect);
// get the tab rect so the tab height can
// be accounted for
CTabCtrl* tcp = m_propsheet.GetTabControl();
RECT trect;
tcp->GetItemRect(0, &trect);
SetWindowPos(NULL,
0,0,rect.left+rect.right,rect.bottom+(trect.bottom-trect.top),
SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
return TRUE;
}
And OnChannelNew (a menu selection):
void CVMRDialog::OnChannelNew()
{
CMainDlg *pnewChannel;
pnewChannel = new CMainDlg(this);
if (pnewChannel != NULL)
{
m_chList.insert(m_chList.end(), pnewChannel);
m_chIter = m_chList.end();
m_propsheet.AddPage(pnewChannel);
m_propsheet.SetActivePage(pnewChannel);
if (m_chList.size() > 1)
m_menu.EnableMenuItem(ID_CHANNEL_CLOSE, MF_ENABLED);
}
else //pnewChannel != NULL
{
AfxMessageBox("New Port Create Failed");
}
}
"Tom Serface" <tom.n...@camaswood.com> wrote in message
news:6A68C4FB-1D85-4DBF...@microsoft.com...
Hey, neat! But does it look good? I'm not sure how the property sheet
header (the area at the top of each page which has the icon and boldface
subtitle) would look if that was spread across the property sheet child
wndow and not across the entire dialog?
Thanks,
David
"David Ching" <d...@remove-this.dcsoft.com> wrote in message
news:%Qe6j.3536$NY....@nlpi068.nbdc.sbc.com...
Sure, it would be interesting to see. I think maybe your technique would be
better suited to non-Wizard 97 compliant wizards without the banner on top.
-- David
http://home.centurytel.net/bobf/mon.jpg
"David Ching" <d...@remove-this.dcsoft.com> wrote in message
news:i_g6j.3173$Vq....@nlpi061.nbdc.sbc.com...
Wow, this looks great. I wanted to do something similar recently but ended
up sticking with a normal CTabCtrl. How did you get rid of the buttons on
the bottom which normally appear in a CPropertySheet? Also, for the record,
this really isn't a wizard, it is a PropertySheet but not used in wizard
mode, it is the mode with the tabs across the top. So that's why there is
no white banner on top to worry about.
Cheers,
David
I think that looks great. Thanks for sharing. Did you do this with a tab
control rather than a property sheet?
Tom
"BobF" <rNfOrS...@charter.net> wrote in message
news:%23ORsnna...@TK2MSFTNGP06.phx.gbl...
I'm well aware of the fact that it's not a wizard. I was just demonstrating
that property sheets on dialogs is possible - to decent effect <g>
As far as the buttons go, since this wasn't created with a wizard wizard ...
I simply added a dialog through the resource editor and chose the prop page
type of dialog. This gives you the ability to make it what ever you want it
to be.
CPropertySheet *is* a tabbed dialog:
<http://msdn2.microsoft.com/en-us/library/614xe086(VS.80).aspx>
What? Does your code use CPropertySheet and CPropertyPage or not? You
can't add either in the resource editor!
Thanks,
David
It uses obviously them both. The prop pages are -created- with the resource
editor and -added- programmatically during run-time.
What's throwing me off is the that in a normal CPropertySheet, there are
OK/Cancel/Apply buttons beneath the tabs. These don't appear in your screen
shot. How did you hide them?
Thanks,
David
m_propsheet.Create(this, WS_CHILD|WS_VISIBLE);
m_propsheet.ModifyStyleEx(0, WS_EX_CONTROLPARENT);
are the lines which create the sheet. By default, this creates a tabbed
dialog.
To get buttons instead of tabs would require calling SetWizardMode as shown
here:
<http://msdn2.microsoft.com/en-us/library/1sse9730(VS.80).aspx>
Look at http://www.microsoft.com/msj/0398/c0398.aspx and scroll down mid-way
to Figure 6. That's what my understanding of a CPropertySheet in non-wizard
mode looks like. It has the OK/Cancel/Apply buttons. Are you saying that
if you create the propertysheet with the WS_CHILD style, it doesn't have
those buttons? If so, that is major cool.
Thanks,
David
:-)) I've shown you everything I did with the prop sheet,
so I guess it *is* 'Major Kool', although I'm not sure it is the
WS_CHILD style that does the trick. If I understand it correctly,
not setting wizard mode is what does the trick.
> Look at http://www.microsoft.com/msj/0398/c0398.aspx and scroll down mid-way
> to Figure 6. That's what my understanding of a CPropertySheet in non-wizard
> mode looks like. It has the OK/Cancel/Apply buttons. Are you saying that
> if you create the propertysheet with the WS_CHILD style, it doesn't have
> those buttons? If so, that is major cool.
David:
If you look in "The MFC Answer Book" by Eugene Kain (which is easy for
me because I have a copy sitting on my lap...) there is a whole section
on embedding (non-Wizard) property sheets in a dialog. The example
illustrations do not show the standard property sheet buttons, and I do
not see anything in the example code that removes them.
That's because they are tabbed by default. You either get tabs or buttons
:-)
Thanks David, I will definitely need to revisit my app and most probably
replace the CTabCtrl with a CPropertySheet then!
-- David
No Bob, with the tabs you get OK/Cancel/Apply buttons, and with Wizard you
get Back/Next/Cancel/Finish buttons. Either mode you get buttons!
-- David
Then why doesn't mine have buttons? I did nothing to make them go away