If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Dialog like Window for settings parameters

Hi guys,

I got a main window with menu and the option settings. When I click settings a "dialog" should appear, where the user is able to set some parameters - into a global variable. This window will have something like 12 columns and 8/16/32 (this will vary) rows. This gives us plenty of controls, mostly Edit Controls, which can be filled by the user.

My question is, how to make this window effectively. I was considering dialog box modal/modeless, the problem is the way you have to define a dialog box -> resource file. Defining all the controls in a resource makes the code somehow not very flexible, when I want to change something.
I was trying to make some sort of child window, which is created as follows:

But it's not the child of the main window, which can probably cause trouble in the future (don't know right now). What is good approach to create such "complex" setting windows like in Code::Blocks for example or other pieces of SW? Is it done with dialog boxes through resources? What are the pros and cons of different approaches?
Thank you for advices! :-)

Re: Dialog like Window for settings parameters

Originally Posted by VictorN

In VC++ the simplest way to create a dialog is doing it in a resource editor.

Thx for your reply Victor. Even when creating a window with cca 250 controls? When I want to change something, then I've to move all of them. Is Dialog the only way? No other techniques I should look for?

Re: Dialog like Window for settings parameters

But it's not the child of the main window, which can probably cause trouble in the future

I'm not sure I'm following what you mean. Any window created specifying a parent window is a child of that window. A child of the desktop is a top-level window.

All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

Re: Dialog like Window for settings parameters

2kaud, don't focus on that. The child window will be inside it's parent window, which is not wanted. The origin of my question is how to implement such setting dialogs. The dialog should be used by the user to setup some parameters, which will be then used by the HW. And because I want him to set as much as possible, the number of controls is high and dialog is probably not the best or the solution of the dialog is not the best.... So I'm investigating my possibilities.

Re: Dialog like Window for settings parameters

and one important thing. I'm able to use a custom control in a dialog, I was not aware of that! So I can create a class, which can be then used in this dialog! What I was wondering was, how the guy in the project above overrided all the edit boxes in listview at once... Didn't have time yesterday to study it more in detail.

Igor:
I agree its unusual. I want a dialog, where the user is able to set a message, which will be sent over a bus. This means at least ID and up to 8 boxes (8 bytes) + delay time to wait for sending a next message. There are other options to be set, but this is the minumim => 10 columns. To represent a real situation, not only one message will be sent over the bus. The user should be able to set another other messages. So its some sort of setting dialog for a scheduler.

Re: Dialog like Window for settings parameters

the resource editor is by far the easiest way to design a dialog but you can do it all by yourself.
Create the dialog directly, then create all the individual controls you need to put on it.

The dialog editor is limited to 255 controls. MS has hinted in the past that they aren't going to make any changes to this claiming "you should never have a dialog with that many controls".
If you need more than 255 controls: make 2 separate templates. and either merge them at runtime
or merge them manually in the resource file. (doing so will prevent you from further using the editor on that dialog).

You are limited in the amount of controls on a dialog because there is a hard per-process-window limit. (16K iirc).

If you have many controls, you'll also notice the dialog starts behaving slowly/sluggishly because of the window messages that need to be passed down to all child controls. It may also confuse users of your software.

You really want to limit the amount of controls on a dialog. Instead of a lot of checkboxes, you could use a listbox/listcontrol with checkboxes. Instead of a lot of editboxes you could use a listcontrol or a grid. For large amounts of settings, there's the CMFCProperyGridControl.

You can also customize another existing control, or even design your own control.

Or rethink the UI entirely. Is what you're doing now really "the best" way, or is it simply the "easiest" way to do it. Or have you not given it much thought and is it simply the only possible solution you considered.