Design issue
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 3 123 LastLast
Results 1 to 15 of 32

Thread: Design issue

  1. #1
    Join Date
    Oct 2006
    Posts
    128

    Design issue

    Hi All,
    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.

    Please someone suggest me.
    Thanks
    Attached Images Attached Images  

  2. #2
    Join Date
    Apr 1999
    Posts
    3,585

    Re: Design issue

    what kind of control should i use here
    That's difficult to determine without knowing more about your application. Given that, I think you're making this more complicated than it needs to be.
    Gort...Klaatu, Barada Nikto!

  3. #3
    Join Date
    Oct 2006
    Posts
    128

    Re: Design issue

    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?

  4. #4
    Join Date
    Apr 1999
    Posts
    3,585

    Re: Design issue

    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.
    Gort...Klaatu, Barada Nikto!

  5. #5
    Join Date
    Oct 2006
    Posts
    128

    Re: Design issue

    Let me explain what i am trying to do.

    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.
    Code:
    case FirstPage:
    		m_staticSelect2.ShowWindow(SW_SHOW);
    		m_comboRepType.ShowWindow(SW_SHOW);
    		m_btnNext.EnableWindow(TRUE);
    		m_btnBack.EnableWindow(FALSE);
    		m_btnClose.EnableWindow(FALSE);
    		m_staticSelect1.ShowWindow(SW_HIDE);
    		m_staticTape.ShowWindow(SW_HIDE);
    		.......
    		break;
    
    case SecondAPage:
    		m_btnBack.EnableWindow(TRUE);
    		m_btnClose.EnableWindow(TRUE);
    		m_static6.ShowWindow(SW_SHOW);
    		m_staticTape.ShowWindow(SW_SHOW);
    		m_comboVolList.ShowWindow(SW_SHOW);
    		m_comboRepOptions.ShowWindow(SW_SHOW);
    		m_comboSort.ShowWindow(SW_SHOW);
                                   ....
                                   break;
    case SecondBPage:
    		m_btnBack.EnableWindow(TRUE);
    		m_btnClose.EnableWindow(TRUE);
    		m_staticSelect1.ShowWindow(SW_SHOW);
    		m_staticSelect3.ShowWindow(SW_SHOW);
    		m_comboVolList.ShowWindow(SW_SHOW);
    		m_comboRepOptions.ShowWindow(SW_SHOW);
    		m_staticSelect3.ShowWindow(SW_SHOW);
                                   ... break;

    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.

    Thanks for your replies.

  6. #6
    Join Date
    Apr 1999
    Posts
    3,585

    Re: Design issue

    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.
    Gort...Klaatu, Barada Nikto!

  7. #7
    Join Date
    Oct 2006
    Posts
    128

    Re: Design issue

    But i need only one page to display everything as i have only couple of items to display. That's the reason i have to re-do the project.

    Also i want to be able to separate the userinterface from the other part of the project.

  8. #8
    Join Date
    Apr 1999
    Posts
    3,585

    Re: Design issue

    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.
    Gort...Klaatu, Barada Nikto!

  9. #9
    Join Date
    Oct 2006
    Posts
    128

    Re: Design issue

    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.

  10. #10
    Join Date
    Apr 1999
    Posts
    3,585

    Re: Design issue

    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.
    Gort...Klaatu, Barada Nikto!

  11. #11
    Join Date
    Oct 2006
    Posts
    128

    Re: Design issue

    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.

  12. #12
    Join Date
    Apr 1999
    Posts
    3,585

    Re: Design issue

    ... i couldn't extend the userinterface.
    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.
    Gort...Klaatu, Barada Nikto!

  13. #13
    Join Date
    Oct 2006
    Posts
    128

    Re: Design issue

    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.

  14. #14
    Join Date
    Apr 1999
    Posts
    3,585

    Re: Design issue

    Take a look at this article. . It should provide some insight into how to load an exported dialog from a dll.
    Gort...Klaatu, Barada Nikto!

  15. #15
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,357

    Re: Design issue

    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.

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center