Home » Category » Microsoft Visual C & C++

Microsoft Visual C & C++: Line between dialogs

205| Mon, 02 Jun 2008 12:37:00 GMT| anonymous| Comments (2)
Hello,

I am creating modeless dialogs on a modal dialog, by using :

CLittleDialog *og = new CLittleDialog();
og->Create(IDD_LITTLEDIALOG,this);
og->SetWindowText("HELLO");
og->ShowWindow(SW_SHOW);

each time I click on a button of the modal dialog, and it works
perfectly (the little dialogs appear).

What I would like to know is :

1) How can I prevent somebody to move them outside of the modal dialog
(I just want to make possible that the dialogs are moved on the surface
of the modal dialog) ?

2) I would like to allow the user to link two of those little dialogs
with a black line between the two dialogs. How could I make a line
appear between the dialogs, and make it unbreakable (keep the line
between the dialogs even when they are moved ...) ?

Thanks !

--
N'est-ce pas étrange que les ordinateurs fassent aujourd'hui des choses
jugées inutiles il y a vingt ans ? [Gene Perret]

Keywords & Tags: line, dialogs, microsoft, visual c++, vc

URL: http://www.7prog.com/visual-c-c++/187435/
 
«« Prev - Next »» 2 helpful answers below.
It really sounds to me like you want child controls, not "little dialogs". You are likely
describing the creation of a custom control class.

As for drawing a line between these, this is simple enough. During the handling of the WM_PAINT by
the parent, you can use the MoveTo and LineTo functions of the CDC class. You'll need to create a
CPen object that you select into the DC before drawing the line.

As for keeping the line as the little windows move, this is certainly possible, but much more
complex than I can describe in this newsgroup.

"ByB" <email...email.com> wrote in message news:mn.94e87d57801dae00.13846...email.com...
> Hello,
> I am creating modeless dialogs on a modal dialog, by using :
> CLittleDialog *og = new CLittleDialog();
> og->Create(IDD_LITTLEDIALOG,this);
> og->SetWindowText("HELLO");
> og->ShowWindow(SW_SHOW);
> each time I click on a button of the modal dialog, and it works perfectly (the little dialogs
> appear).
> What I would like to know is :
> 1) How can I prevent somebody to move them outside of the modal dialog (I just want to make
> possible that the dialogs are moved on the surface of the modal dialog) ?
> 2) I would like to allow the user to link two of those little dialogs with a black line between
> the two dialogs. How could I make a line appear between the dialogs, and make it unbreakable (keep
> the line between the dialogs even when they are moved ...) ?
> Thanks !
>
>
> --
> N'est-ce pas étrange que les ordinateurs fassent aujourd'hui des choses jugées inutiles il y a
> vingt ans ? [Gene Perret]
>

scot | Mon, 02 Jun 2008 12:38:00 GMT |

Si Scot T Brennecke ne nous l'avait pas dit, on n'aurait jamais cru que
> It really sounds to me like you want child controls, not "little dialogs".
> You are likely describing the creation of a custom control class.
> As for drawing a line between these, this is simple enough. During the
> handling of the WM_PAINT by the parent, you can use the MoveTo and LineTo
> functions of the CDC class. You'll need to create a CPen object that you
> select into the DC before drawing the line.
> As for keeping the line as the little windows move, this is certainly
> possible, but much more complex than I can describe in this newsgroup.
>

Thank you for those informations and hints.
:-)
--
L'EVALUATION RENFORCE LES SAVOIR-FAIRE ORGANISATIONNELS DES PRATIQUES

byb | Mon, 02 Jun 2008 12:39:00 GMT |

Microsoft Visual C & C++ Hot Answers

Microsoft Visual C & C++ New questions

Microsoft Visual C & C++ Related Categories