I have a question regarding making a decision about a control.
I need to create a project which display a report according to the choice chosen from an initial dialog. Attached is how the dialog would look like ...
WHen the user makes the first choice that is chosing either catridge content or something else, the rest of the items gets updated with information. Even the checkbox may be appear in some of the choice.
what kind of control should i use here. I created an activex control for the rest of the items in the dialog and i feel there is no need for that as the control is mainly used for this project..I amy want to extend the project later on in other languges also.
Is it possible to create a MFC extension dll with dialog in itand call the dll from the exe dialog frame to display the dlldialog inside the exe dialog?
Here's an example of possible unnecessary complexity. Can you explain why you need a nested child dialog within your main dialog? And, why the child dialog needs to live in another dll? Keep in mind, you're seeking help from other developers who have no idea what your application design consists of. Rather than asking short ambiguous questions, it is better to provide some background information and sample code (when necessary) so we can get a clear picture of what you are doing.
I need to create an application which displays report. First i need to display the dialog for the user to choose and then it displays the report.
So i started with MFC application with Multidocument and created a dialog which displays the choice.
The first combo box which the user needs to choose will decide what is going to appear in the rest of the page.
I initially created a dialog with all the possible tool items and then displayed the first combobox on the first page, then once the user makes the choice displays items according to that in the secondpage.
THis was very difficult to maintain and was not extendable. So i was asked to do it in a different way, i.e, use an activex control to display the item once the first choice is made... I realsied activex for this project is too complicated and wondered if there is any other way to do this..
I work on my own with vague instructions thrown at me. I am not an expert in MFC, c++ but i am trying very hard to learn everything.
I would suggest you take a look at using a property sheet wizard dialog design. You can design each page of the wizard to collect the necessary information to generate your report. You use the resource editor to design and layout each page of the wizard. Then, process the user's response on a page by page basis until such time as you have enough data to generate your report. See CPropertySheet::SetWizardMode () for more info.
But i need only one page to display everything as i have only couple of items to display.
Ok, then, what is the need for using a nested dialog? I agree that if you only have a minimal amount of data to collect, one dialog should be sufficient.
Also i want to be able to separate the userinterface from the other part of the project.
I'm not sure what your future plans are for this, but, you can create a dll that contains a class that represents the entire data collection dialog. There's no need to nest it into a parent dialog. That should provide you with the interface separation you desire.
1. Like an html page, where you choose something in a combox and that refreshes the entire page, is it possible to do it in a dialog?
For eg. there are 5 items in the first combobox..
choice1,2,3. displays as it is in the image.
choice 4. i don't want the checkbox and the regularexpression edit box.
choice 5. don't want the sort box.
So let us say the dialog starts with choice1, displays as it is, the user makes choice 4, the entire dialog needs to refresh....
Also, the value in comboxbox two differs according to the comboxbox1.
Can i do this as a single dialog?
2. This project i may have to internationalize it,,,say spanish version of the userinterface.
Hope i am not making it complicated but i don't have any idea how i am going to do this.
If you're bound by using only one dialog, you can use ShowWindow () to hide the controls you don't need. Keep in mind, however, that hiding/showing controls is not the best UI practice. But, it will accomplish what you want.
The easiiest way to prepare for internationlization is to create a resource-only dll. This allows the resources to be translated into other languages.
ShowWindow() is the method i followed initially and as i mentioned before i couldn't extend the userinterface.
Coming back to where i started, Is it possible to display dll dialog in an exe dialog? if it's any idea how i would do that.
Not sure what you mean by this. As I stated earlier, you can create a derived (exported) dialog class in a dll and use it within your main program. If you take this approach, you'll need to make sure to set the resource handle to the dll before trying to work with the exported dialog class.
I couldn't extend the project -
the actual controls were placed one on top of others in the resourceview dialog , so it was dificult to maintain and if i needed more control, it was getting complicated. As i mentiioned before this is the way i did it in the first place.
I am not sure how i can make the dialog nested? where do i say attach the dll dialog to the exe dialog.
I would probably go the property sheet wizard route that Mike suggested earlier.
Even though your user only sees a single dialog (or page), the problem is the layout of the controls. If you cram them all on one dialog, then it's hard to maintain them. But I don't have to tell you this.
If you use a property sheet in wizard mode, you can separate the different 'views' based on what the user has chosen. You should be able to hide the default Next and Back buttons and then switch the view (page) based on the user changing a combobox or other control.
If you are going to go this route, I highly recommend that you take a data-centric approach the prop sheet/prop page architecture and leverage DDX as much as possible. I've written a sample app that shows how to use the prop sheet as a document with each page using DDX to tie the page controls to the data in the sheet. I'll see if I can dig it up and post it here.