Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating a professional-looking (and behaving!) form designer
    primarykey
    data
    text
    <p>When I began programming (some 10+ years ago), three things amazed me:</p> <ul> <li>Compilers/interpreters (back then I knew them as "programs that make my programs work", often followed by the qualifier "whatever they are")</li> <li>Code editors</li> <li>Form designers</li> </ul> <p>Back then, I accepted all of them as facts of life. I was able to make my own special-purpose programs, but "programs that made my programs work", code editors and form editors were made by the Gods and there was no way I could mess with them.</p> <p>Then I went to university, and took a course on formal language processing. After learning formal grammars, parsers, abstract syntax trees, etc.; all the magic about compilers, interpreters and code editors was soon gone. Compilers and interpreters could be written in sane and simple ways, and the only non-sane thing a syntax highlighting code editor could require were Windows API hacks.</p> <p>However, to this day, form editors remain a mystery to me. Either I lack the technical knowledge required to make a form designer, or I have such knowledge, but cannot find a way to use it to implement a form designer.</p> <p>Using Visual C++ and the MFC, I would like to implement a form designer inspired by the best form designer ever:</p> <p><img src="https://i.stack.imgur.com/9kZXK.jpg" alt="Visual Basic 6&#39;s form designer"></p> <p>In particular, I would like to imitate its two features that I like the most:</p> <ul> <li><p>The form being designed is inside a container. Thus, an arbitrarily large form may be designed without wasting too much screen real estate, by simply resizing the container to an appropriate size.</p></li> <li><p>The "Align to Grid" option makes designing professional-looking user interfaces a lot less frustrating. In fact, I would go as far as saying creating professional-looking user interfaces using Visual Basic's form designer is actually easy, fun and enjoyable. Even for left-brained programmers like me.</p></li> </ul> <p>So, I have the following questions: </p> <ol> <li><p>How do I make a form designer, in which the form being designed is inside a container? Is the form being designed an actual window contained inside another window? Or is it just a mockup "manually" painted by the form designer?</p></li> <li><p>Do the Windows API and/or the MFC contain functions, classes, whatever that make it easy to create "selectable" items (surrounded by little white or blue boxes when they are selected, resizable when they are "grabbed" by one of these "edges")?</p></li> <li><p>How do I implement the "Align to Grid" functionality?</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload