dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] Handling Top Level Windows


From: Rich Baumann
Subject: [Pnet-developers] Handling Top Level Windows
Date: Mon, 06 Dec 2004 04:45:02 -0500

Hey all,

        I'm posting this here before writing the code because I'd like to hear
any objections and/or suggestions beforehand. I discovered this problem
while trying to fix the, hopefully, last of the control z-ordering bugs;
if you're waiting on that fix, this is the only thing holding it up.

        As a fix for handling the case where the Form::TopLevel property is set
to false, the Form::CreateToolkitWindow method returns a plain
IToolkitWindow (via a call to the base Control::CreateToolkitWindow
method) rather than the usual IToolkitTopLevelWindow. If the handle
(i.e. the toolkit window) is created before the Form::TopLevel property
is set to false then the later setting of this property does nothing,
making embedding such forms in other controls impossible. Additionally,
System.Windows.Forms/Form.cs contains a lot of code which is based on
the assumption that the handle is an IToolkitTopLevelWindow, and this
code breaks if the handle is simply an IToolkitWindow.

        To fix these problems, in my opinion, we need a second concrete
implementation of IToolkitTopLevelWindow which inherits from the
concrete IToolkitWindow implementation and fakes the normal top-level
functionality. When the Form::TopLevel property is set the handle would
be recreated with the appropriate implementation and the data from the
old underlying widget would be copied to the new one.


Rich



reply via email to

[Prev in Thread] Current Thread [Next in Thread]