CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Dialogs and SDI

  1. #1
    Join Date
    May 1999
    Posts
    30

    Dialogs and SDI

    Hello, I am having a tough time finding info so I thought I' check here.

    What I am trying to do is create and editor for making maps in a game. I would like to have the screen setup so that 2/3 of the area displays the map (which is scrollable by keys) and the other 1/3 has the buttons i need to add and change things. It seems that the 1/3 of the screen I need for controls would be ebst done as a Dialog (since I can add images, buttons, tabs, etc) and the other 2/3 just as a client area of an SDI.

    What I would like to know is if there is any way I can add dialog controls to an SDI application without adding a dialog. Or if i need a dialog is there any way to lock it into position in my app? Should I just make a dialog app and make some new control where I display the map off to the side? The map, btw is a bunch of images (textures). Should I be using DirectDraw to draw these?

    I could really use some help here. I wrote this using my own bitmap UI in opengl but I am trying to learn mfc because the controls are so much better and i dont have to spend time writing a UI. I also need a fast way to draw the textured map since I am giving up the speed of hardware acceleration.

    i hope i ddint come off sounding like too much of an idiot in this post.

    thanks




  2. #2
    Guest

    Re: Dialogs and SDI

    I don't have an answer for your "Dialog/SDI" question, but I do have an alternate solution: a "fixed" splitter window with a CFormView in one pane, and your application-specific view in the other. A CFormView-derived class will allow you to place and automate controls fairly easily without badly abusing the Doc/View design of MFC. Farther on down the road, you can also switch between multiple CFormView-derived classes to provide context-specific controls in one pane, based on what the user is doing in the other pane/view.

    A word of advice about MFC: if something is proving to be really hard to accomplish, step back and do a sanity check of (1) is there another way to do it or (2) should I be doing it at all? I speak from personal experience: I once replaced 3 fulls days of coding in the "wrong place" with 15 minutes of coding in the "right place".

    And no...you didn't sound like an idiot in your post...

    Cheers!
    Humble Programmer
    ,,,^..^,,,


  3. #3
    Join Date
    May 1999
    Posts
    30

    Re: Dialogs and SDI

    Ahh, ok i think i get it.

    So what I would need to do is use the resource editor and create a dialog with all my controls on it and when I create a class for that dialog, instead of having the base class be CDialog, I use CFormView.

    Then I have a split fixed window, where i plop the CFormView I created into one side and the client/drawing area on the other...

    is that right?

    Ill go start tinkering with that...

    thanks


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured