Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Request for design suggestions

Posted on 2003-03-30
Medium Priority
Last Modified: 2013-11-20
I am still a relative beginner to MFC, and as such what I would like to do is ask for general design suggestions, and I will actually give 20 points to the first four answers with good suggestions - I marked the question as worth 20, but they told me that I can post a zero-point question in the main area to ask a moderator to split the points out.  So if someone else answers my question and you have an additional suggestion/idea, please give it - I'd love to hear it.

I am working on a low-level 3D modelling tool.  The way I would like to implement it is to use a splitter view where the left pane is a CFormView and the right pane is the rendering context (I'm using OpenGL).

I'm fairly confident that I know what to do with the right pane, but the left pane I'm not so sure about.  What I would ideally like is to have the dialog in the left pane change based on the user's choice of menu items, i.e. if he wanted to "move the camera" he'd click the Edit/Move Camera... button and the dialog for moving the camera would appear on the left, if he wanted to adjust the properties of one of the lights he'd click Lighting/Light 0... and the dialog for adjusting light 0 would appear on the left etc.  I'll probably have about 17 different dialogs.  The reason I want them to appear on the left instead of just using a CDialog class is because I want them to be interactive, i.e. if they move the camera I want them to be able to see the results in the view pane as they adjust.

I would certainly guess that my CDocument-derived class should house *all* of the above information, i.e. all of the shapes in the project, all of the light settings, all of the geometry settings et al.

Really the only part I'm not sure about is what to do about the left-hand pane, i.e.

Should I create a different CFormView-derived class for every possible dialog, and if so, what's the "best" way to change the view in the left-hand pane?

Should I embed a CPropertySheet on the dialog, remove the tabs, and call SetActivePage based on the user's menu click?

Is the "best practice" something I haven't thought of?

Any suggestions will be entertained.
Question by:DalTXColtsFan
LVL 12

Accepted Solution

williamcampbell earned 60 total points
ID: 8241595

  Take a look at this sample.


  This allows you change either side of the spitter with any dialog you like.

  So you setup your 17 Formviews give each a unique ID and using the code above with minimal change will do what you need.


Author Comment

ID: 8277082
This wasn't really what I was looking for but I'm going to go ahead and accept your comment as an answer because that site is cool - thank you for pointing me to it.  Codeguru has some good stuff doesn't it?  I've also been impressed by Code Project - can't remember if it's www.codeproject.com or www.thecodeproject.com.

I have since figured out (thanks to the help of expertsexchange and "The MFC Answer Book") how to remove all tabs and buttons from a Property Sheet and embed it on a dialog, so I think this is how I'm going to go forward.  I was hoping more for some forewarnings of like if I go that route and use SetActivePage to cycle the pages what problems I'd later have, but I guess I'll find 'em out the hard way!

Thanks again

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question