Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Can I create a dialog template for other dialog boxes?

Can I create a dialog template for other dialog boxes?

Scheduled Pinned Locked Moved C / C++ / MFC
questionlearning
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DeepT
    wrote on last edited by
    #1

    I am not sure this is possible, but I would like to create a basic dialog that serves as a template for other dialog boxes. Ideally Ill make the first base dialog with the size and properties I want. At this point I know I could then go into the resource editor and add a copy of it and work on the copies. However, I would like to have the ability to then go back and make a change to the template and have the other dialog boxes take on the changes from the template dialog. This add copy method will not do that.

    L A R T 4 Replies Last reply
    0
    • D DeepT

      I am not sure this is possible, but I would like to create a basic dialog that serves as a template for other dialog boxes. Ideally Ill make the first base dialog with the size and properties I want. At this point I know I could then go into the resource editor and add a copy of it and work on the copies. However, I would like to have the ability to then go back and make a change to the template and have the other dialog boxes take on the changes from the template dialog. This add copy method will not do that.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      My gut reaction with MFC, which is all I know for UI dev, is no. The dialog script file is just plain crude and doesnt have inheritance built in.

      1 Reply Last reply
      0
      • D DeepT

        I am not sure this is possible, but I would like to create a basic dialog that serves as a template for other dialog boxes. Ideally Ill make the first base dialog with the size and properties I want. At this point I know I could then go into the resource editor and add a copy of it and work on the copies. However, I would like to have the ability to then go back and make a change to the template and have the other dialog boxes take on the changes from the template dialog. This add copy method will not do that.

        A Offline
        A Offline
        Albert Holguin
        wrote on last edited by
        #3

        What would you like on your template? ...really will depend on that... but yes, you should be able to do that, only not through the resource editor, you'll have to do it all through code pretty much.

        D 1 Reply Last reply
        0
        • A Albert Holguin

          What would you like on your template? ...really will depend on that... but yes, you should be able to do that, only not through the resource editor, you'll have to do it all through code pretty much.

          D Offline
          D Offline
          DeepT
          wrote on last edited by
          #4

          I figured as much. I was just hoping there was some mechanism I did not know about. I am not sure what all I want, other than for all the dialogs to have the same size and base styles. It may change which will be a PITA if I have to redo a bunch of dialogs because someone decides they want them just a little wider or some new logo graphic of a different size.

          A 1 Reply Last reply
          0
          • D DeepT

            I figured as much. I was just hoping there was some mechanism I did not know about. I am not sure what all I want, other than for all the dialogs to have the same size and base styles. It may change which will be a PITA if I have to redo a bunch of dialogs because someone decides they want them just a little wider or some new logo graphic of a different size.

            A Offline
            A Offline
            Albert Holguin
            wrote on last edited by
            #5

            If you're good with MFC or the WinAPI, should be easy to do if the constant is the size and logos. That's easy to accomplish, except when you want to use your template, anything that goes on it will have to be defined programatically rather than though the editor. That will probably only be hard the first time. The somewhat annoying issue with that is the variable text sizes on Win Vista/7 can make drawing things a pain because you have to size anything containing text according to the text size.

            1 Reply Last reply
            0
            • D DeepT

              I am not sure this is possible, but I would like to create a basic dialog that serves as a template for other dialog boxes. Ideally Ill make the first base dialog with the size and properties I want. At this point I know I could then go into the resource editor and add a copy of it and work on the copies. However, I would like to have the ability to then go back and make a change to the template and have the other dialog boxes take on the changes from the template dialog. This add copy method will not do that.

              R Offline
              R Offline
              Rolf Kristensen
              wrote on last edited by
              #6

              Here is an example Enhanced MFC Message Boxes[^] (Download 1.2 lite)

              1 Reply Last reply
              0
              • D DeepT

                I am not sure this is possible, but I would like to create a basic dialog that serves as a template for other dialog boxes. Ideally Ill make the first base dialog with the size and properties I want. At this point I know I could then go into the resource editor and add a copy of it and work on the copies. However, I would like to have the ability to then go back and make a change to the template and have the other dialog boxes take on the changes from the template dialog. This add copy method will not do that.

                T Offline
                T Offline
                ThatsAlok
                wrote on last edited by
                #7

                DeepT wrote:

                At this point I know I could then go into the resource editor and add a copy of it and work on the copies. However, I would like to have the ability to then go back and make a change to the template and have the other dialog boxes take on the changes from the template dialog. This add copy method will not do that.

                i have done that, however i store my template in XML files and load them on runtime. Little difficult and also no UI is available for same, so you have depends on your Gut feeling and principle of coordinate geometry!

                "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
                Never mind - my own stupidity is the source of every "problem" - Mixture

                cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups