Function to Draw Controls from a different dialog box template
I have a section in a FormView in which I draw different groups of controls depending on the situation. I have to programaticlly adjust each control
I was thinking of leveraging the resource graphical editor to position the controls.
I need a function that would take a dialog template file and just draw the controls. I will add the programing code manually.
Any suggestions?
Re: Function to Draw Controls from a different dialog box template
How many different groups of controls do you have?
Re: Function to Draw Controls from a different dialog box template
Re: Function to Draw Controls from a different dialog box template
Use a property sheet control set to wizard mode.
Set the property sheet to a child style and make it a child of your dialog. Create a CPropertyPage for each group of controls, when you need to change groups, just set the active page in the property sheet.
The advantage with this approach is you can use the dialog editor to lay out the groups of controls.
Re: Function to Draw Controls from a different dialog box template
Quote:
Originally Posted by
Arjay
Use a property sheet control set to wizard mode.
Set the property sheet to a child style and make it a child of your dialog. Create a CPropertyPage for each group of controls, when you need to change groups, just set the active page in the property sheet.
The advantage with this approach is you can use the dialog editor to lay out the groups of controls.
Don't I want to use a TabCtrl??
Re: Function to Draw Controls from a different dialog box template
Quote:
Originally Posted by
ADSOFT
Don't I want to use a TabCtrl??
If you want to do it the hard way, then sure.
Re: Function to Draw Controls from a different dialog box template
Quote:
Originally Posted by
ADSOFT
Don't I want to use a TabCtrl??
You know better what you want. :)
Well, for the actual problem, the Arjay's solution is better...
Re: Function to Draw Controls from a different dialog box template
Re: Function to Draw Controls from a different dialog box template
Yep I'm using MFC.
btw, do you have an example of what you are talking about. I couldn't find anything on property sheet wizards ..... etc.
Re: Function to Draw Controls from a different dialog box template
Quote:
Originally Posted by
ADSOFT
Yep I'm using MFC.
btw, do you have an example of what you are talking about. I couldn't find anything on property sheet wizards ..... etc.
Help me understand here - I'm confused that you can't find anything. What search terms are you trying in google and msdn?
Re: Function to Draw Controls from a different dialog box template
Quote:
Originally Posted by
Arjay
Help me understand here - I'm confused that you can't find anything. What search terms are you trying in google and msdn?
Ok I have the following:
Code:
::CPropertySheet nameSheet( "Hobby List");
CNamePage pgName;
CHobbyPage pgHobby;
nameSheet.AddPage(&pgName);
nameSheet.AddPage(&pgHobby);
nameSheet.DoModal();
I'm using VS6, I don't see a Property Sheet Control. Do I have to import it from the Gallery?
Also, how do I set the position on where I want it to be placed in my dialog/formview.
Re: Function to Draw Controls from a different dialog box template
As mentioned in my first post, set the style of the property sheet to child.
Then inside the parent dialog use CreateWindow to create the sheet (and DestroyWindow).
Btw, does the dialog hold any other controls besides what is contained within the 'group' of controls?
Re: Function to Draw Controls from a different dialog box template
I'm not sure if you are talking about CPropertySheet or CPropertyPage.
There is no way I can see of as setting CPropertySheet to wizard mode as there is no control for it.
Still don't see how you position the the PropertyPage. ... all I get is a popup centered on the screen.
Re: Function to Draw Controls from a different dialog box template
Please, search MSDN for something like using cpropertysheet cpropertypage... :cool:
Re: Function to Draw Controls from a different dialog box template
It's not very clear what exactly you want to accomplish, so please clarfy the points below:
- you want a property sheet which is is in wizard mode or not?
- you want a property sheet which is child or is owned by a (form) view?
- what exactly this mean?
Quote:
There is no way I can see of as setting CPropertySheet to wizard mode as there is no control for it.
To see the difference between child and owned, take a look at these FAQs:
Anyhow, the initial idea of using a tab control to switch between viwes or to show/hide different sets of controls is not so good.
Using the property sheet is easier and more elegant.