2007-02-09 Chris Toshok <toshok@ximian.com>
commit7e341e71449c5c71716d87f6690311f95e06748e
authorChris Toshok <toshok@novell.com>
Sat, 10 Feb 2007 02:33:49 +0000 (10 02:33 -0000)
committerChris Toshok <toshok@novell.com>
Sat, 10 Feb 2007 02:33:49 +0000 (10 02:33 -0000)
tree7c55edb3bfd746b8313c38f30bd4dded446e22fb
parent8b2bcc5736bddd89b24921a6e95342ad33433ed9
2007-02-09  Chris Toshok  <toshok@ximian.com>

[big change, fixes #80020]

* AccessibleObject.cs: we need to make owner internal again to fix
some of ControlAccessibleObject.

* Control.cs: lots of changes here.  add support for WM_CREATE,
for which we generate OnHandleCreated.  Remove the OnHandleCreated
call from CreateHandle.  Also add support for WM_SHOWWINDOW where
we create child controls.  leave the MonoTODO's for the
accessibility calls, but fix the exceptions so the tests pass.

Add the InvalidOperationExceptions to Invoke methods, and remove a
couple of InvokeInternal methods we aren't using.

Also, add a couple of CreateHandle calls in places where we know
the handles are being created but our code doesn't reference
.Handle.

Make SetVisibleCore call OnVisibleChange if the handle isn't
created.  If the handle is created, we rely on XplatUI.SetVisible
generating the event synchronously.

Lastly, make sure we don't use this.Handle inside CreateHandle,
because we can call back into client (and that code can dispose of
the control).

* XplatUIStructs.cs: misc/cleanup.

* XplatUIX11.cs: Map/Unmap X events correspond to WM_SHOWWINDOW,
although we don't populate the wParam properly.
(CreateWindow): generate WM_CREATE.
(MapWindow,UnmapWindow): make these calls synchronous, at great
performance expense (particularly in the unmap case), to match
win32 behavior.

* Form.cs (.ctor): remove the call to UpdateBounds. we don't need
to call it.
(set_MdiParent): don't recreate the handle unless it's been
created already.

* MdiClient.cs (OnResize): don't InvalidateNC Parent.Handle unless
it's created.

* NativeWindow.cs: this is probably the weirdest part of the
patch.  We need a way to link up the window being created to the
WM_CREATE message.  Since we can only be creating one window at a
time on a given thread, we keep track of a per-thread reference so
we can dispatch it properly.  We also need to keep track of the
Hwnd currently being created so that the win32 backend doesn't
have problems.

* XplatUIWin32.cs: a similar change to the one we made in
NativeWindow.cs.

svn path=/trunk/mcs/; revision=72565
mcs/class/Managed.Windows.Forms/System.Windows.Forms/AccessibleObject.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiClient.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/NativeWindow.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIStructs.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs