Discussion:
Dialogs controlled by tree control
(too old to reply)
Alexh
2010-08-23 18:05:20 UTC
Permalink
Hi,

I run into situations where lots of inputs are required from the user
before the user can run a routine. I have typically used tabbed
dialogs but the dialogs controlled by trees are much more elegant. For
example, in VS2005, the Project-Properties menu brings up a tree
controlled dialog.

I'm not sure how this can be implemented. Is the entire window a
dialog that somehow updates the controls based on the tree selection?

Thanks for any tips
Stuart Redmann
2010-08-24 14:44:14 UTC
Permalink
Post by Alexh
Hi,
I run into situations where lots of inputs are required from the user
before the user can run a routine. I have typically used tabbed
dialogs but the dialogs controlled by trees are much more elegant. For
example, in VS2005, the Project-Properties menu brings up a tree
controlled dialog.
I'm not sure how this can be implemented. Is the entire window a
dialog that somehow updates the controls based on the tree selection?
I wanted to have the same thing but could not find anything useful (I
believe that tree controls can only manage text and sometimes even
images but never controls). So in the end I wrote my own class (which
behaves more like the Windows Explorer [just expandable panes, no real
tree]).

I did the whole thing with MFC under VC6.0 (yes, I know). If you're
interested I could sent you some code fragments to get you started.

Regards,
Stuart
ScottMcP [MVP]
2010-08-25 00:22:03 UTC
Permalink
Post by Alexh
Hi,
I run into situations where lots of inputs are required from the user
before the user can run a routine. I have typically used tabbed
dialogs but the dialogs controlled by trees are much more elegant. For
example, in VS2005, the Project-Properties menu brings up a tree
controlled dialog.
I'm not sure how this can be implemented. Is the entire window a
dialog that somehow updates the controls based on the tree selection?
Thanks for any tips
Each set of controls is a modeless dialog, with its title bar and
border styles turned off. That makes it unmovable and visually appear
to be part of the main dialog. One of these dialogs at a time is made
visible, in response to a selection on the tree. It's really the same
technique as used with a tab control to make one "tab" at a time
visible.

To position the dialogs put a placeholder control on the main dialog,
like an invisible static control. Get the coordinates of the
placeholder, and as each child dialog is created use MoveWindow to put
it in the right place with the right size.

Loading...