* Application.cs: Need to handle keyboard menu deselection here.
* Control.cs: Use WM_SYSKEYUP instead of WM_SYSCOMMAND to start menu keyboard
navigation, allowing keyboard to work on X11.
* ToolStrip.cs: Don't worry about handling the Menu key here anymore.
svn path=/trunk/mcs/; revision=76392
* Application.cs: Create a shortcut path so that currently selected
MenuStrips can intercept keyboard events without having focus.
* Control.cs: Handle WM_SYSCOMMAND message to activate MenuStrips.
* MenuStrip.cs, ToolStrip.cs, ToolStripDropDown.cs, ToolStripDropDownItem.cs,
ToolStripItem.cs, ToolStripManager.cs, ToolStripMenuItem.cs: Support
keyboard navigation (arrows, tab, enter, esc) on Windows. Still need to
generate WM_SYSCOMMAND message in X11 for other platforms.
* ToolStripProfessionalRenderer.cs: ToolStripMenuItems need to be painted
in OnRenderMenuItemBackground instead of OnRenderButtonBackground.
* ToolStripSplitButton.cs: Add DefaultItem property.
svn path=/trunk/mcs/; revision=76353
virtual method so that Form can override it.
* MaskedTextBox.cs: Corcompare fixes.
* Form.cs: Override UpdateWindowText and only update the styles if the
form has been shown (fixes#81405).
svn path=/trunk/mcs/; revision=76300
* Control.cs, Form.cs: Use the better supported WM_?BUTTONDOWN and
WM_ACTIVATE messages instead of WM_MOUSEACTIVATE and
WM_ACTIVATEAPP. This fixes menus not disappearing on X11 when
the form lost focus or another control was clicked.
svn path=/trunk/mcs/; revision=76278
handle.
* FormCollection.cs: Don't add a form if it's already in the
collection.
* Form.cs: Change ShowDialog () to call ShowDialog (owner) with a null
according to behaviour and MSDN. The ownerWin32 is the active
window at the moment when we call ShowDialog, not the context's
main form (the context's main form may open another form that opens
a form with ShowDialog, the win32 owner is the second form). Add
and remove forms to the Application.OpenForms in other places to
better match MS behaviour. Add an IsActive property that raises
On(de)Activated only if the active state has changed (we were
raising OnDeactivated before OnActivated while creating forms).
* Application.cs: Refactor Enabling/Disabling of windows for modal
dialog loops out to separate methods, and restore the thread
context when we quit the method. Fixes#81407.
svn path=/trunk/mcs/; revision=76242
Fixes#80163.
* Control.cs: Replace GetContextMenuInternal() with ContextMenuInternal
property, so that the setter can be overriden too.
* TextBox.cs: Change GetContextMenuInternal() to use
ContextMenuInternal.
svn path=/trunk/mcs/; revision=76200
* Control.cs: Use DefaultSize for Size, calculate ClientSize from
that. We were incorrectly doing it the other way around. Also,
update ClientSize if we change the BorderStyle before the control
is created.
svn path=/trunk/mcs/; revision=76021
* Control.cs (CreateControl): turns out in 2.0 we don't need this
OnBindingContextChanged thing here. It's only generated from
ContainerControl.OnCreateControl. Fixes a newly written unit test
- BindingTest.BindingContextChangedTest4.
svn path=/trunk/mcs/; revision=75853
* Control.cs (CreateControl): talk about a bizarre corner case.
Don't emit OnBindingContextChanged here if we're a parentless
control (i.e. if we're a form.). Fixes
BindingTest.BindingContextChangedTest2.
svn path=/trunk/mcs/; revision=75841
[Fixes#79447]
* Control.cs: Call invalidate in set_Region.
* XplatUIX11.cs, XplatUIWin32.cs: Remove invalidate from SetClipRegion as
it dont works here.
svn path=/trunk/mcs/; revision=75776
* Control.cs: In WmRButtonUp, send the WM_CONTEXTMENU message to
the control after firing the OnMouseUp event, instead of sending
the message before the mentioned event. This is so we can match the
MS behaviour. Fixes part of #80385.
svn path=/trunk/mcs/; revision=75698
* Form.cs: Consider the implicit controls in
GetRealChildAtPoint. We need it since this method
is called on Form when handling the some messages in
WndProc, and need to consider those implicit ones too.
Fixes#80385.
svn path=/trunk/mcs/; revision=75667
* Control.cs: When we CreateControl, we need to also create all of the
control's children. The child's OnLoad must also fire before the parent's
OnLoad. Fixes the toolbox size in PDN.
svn path=/trunk/mcs/; revision=75399
* Control.cs: GetRealChildAtPoint method added, it make an
recursive child control search for the point.
* Form.cs: Makes use of GetRealChildAtPoint in mouse event after closes
menu.
* MenuAPI.cs: Makes use of GetRealChildAtPoint in UpdateCursor.
svn path=/trunk/mcs/; revision=75376
* Control.cs: Fix an issue where if a user resized a control inside
a sizing method like OnResize, we would overwrite their explicit
value. Also, only call DefaultSize once in the constructor instead
of 4 times. Also, do not call SetBoundsCore from SetBounds if
nothing actually changed.
svn path=/trunk/mcs/; revision=75367
* CreateParams.cs: Fix IsSet, wasn't working correctly when the style
to check for is a mix of several styles (such as WS_CAPTION for
instance).
* Control.cs: Don't paint an area bigger than the client area when
painting the background colour. Add an internal GetCreateParams.
Update calls to XplatUI.CalculateWindowRect due to API change.
* XplatUIX11.cs: In PerformNCCalc set the initial size to the whole
window's size, and handle WM_NCCALCSIZE in DefWndProc to calculate
the size if it hasn't been handled by any windows. When creating
and moving windows, X wants the location of the entire window, but
the size of the client window, so add
TranslateClientRectangleToXClientRectangle,
TranslateWindowSizeToXWindowSIze and
TranslatedXWindowSizeToWindowSize to cope with this, and call them
before every window creation and move. Update CalculateWIndowRect
to use Hwnd.GetWindowRect (one step towards removing DeriveStyles).
In AddConfigureNotify don't do anything if the hwnd is a zombie
(fixes the BadWindow we were getting while running the tests),
always calculate the offsets when it's a parentless window, not
only when reparented, and translate the window size, since we're
getting the client size of the whole window, excluding entire
window.
* Theme.cs: Added BorderSizableSize.
* XplatUIWin32.cs: Fix RECT Height and Width. Don't fake styles here
anymore. Update calls to XplatUI.CalculateWindowRect due to API
chang
* Form.cs: Update calls to XplatUI.CalculateWindowRect due to API
change. Fake the window styles here instead of in XplatUIWin32 so
that all back-ends get the same window styles (and it's Form that's
deciding when to use wm, not the Win32 backend anyways)
* Hwnd.cs: Completely reworked GetWindowRectangle and
GetClientRectangle - they are now passed a CreateParams and they
only use Style and ExStyle to determine the rectangles (they should
now work just like Win32AdjustWindowRectEx - though quite a few
special cases are probably missing). They should also be 100%
complimentary (i.e. GetWindowRectangle (GetClientRectangle (rect))
== rect), and all numbers (borders, menu sizes) are taken from the
current theme. Added a GetBorders helper function that will return
the borders for any given CreateParams (including captions and
menus), and GetBorderSize that returns the given border size only.
* XplatUIOSX.cs: Update calls to CalculateWindowRect and
Hwnd.GetClientRectangle.
svn path=/trunk/mcs/; revision=75328
control is removed from a control collecftion.
* XplatUIX11.cs: The first location for toplevel form is (22, 22).
Fixes FormPropertyTest (failed on rare occasions).
* XplatUIWin32.cs: Add a workaround in SetParent for strange behaviour
of Win32SetParent (when changing from no parent to a parent it
might add the new parent's location in screen coordinates to this
window's location).
* Form.cs: Rework ChangingParent once again, now the handle is
recreated whenever a FormWindowManager is added or removed (that is
whenever a normal form is parented or abandoned). Also change
CreateParams so that all non-toplevel windows always get the
specified sice (StartupPosition is never considered for
non-TopLevel forms).
* ContainerControl.cs: Add ChildControlRemoved, the container control
needs to be notified when a control is removed from it's
collection, in the case the removed control is the active control.
* Hwnd.cs: Completely reworked GetWindowRectangle and
GetClientRectangle - they are now passed a CreateParams and they
only use Style and ExStyle to determine the rectangles (they should
now work just like Win32AdjustWindowRectEx - though quite a few
special cases are probably missing). They should also be 100%
complimentary (i.e. GetWindowRectangle (GetClientRectangle (rect))
== rect), and all numbers (borders, menu sizes) are taken from the
current theme. Added a GetBorders helper function that will return
the borders for any given CreateParams (including captions and
menus), and GetBorderSize that returns the given border size only.
svn path=/trunk/mcs/; revision=75287
* Control.cs: We need to call OnVisibleChanged for our implicit
children as well as our normal children. Fixes scrollbars in
comboboxes not showing up.
svn path=/trunk/mcs/; revision=75102
* Control.cs, Form.cs: Anywhere we call CreateHandle, we need to do
the check for IsHandleCreated first. The check in CreateHandle is not
good enough because CreateHandle can be overriden, and the override
should not be called if the handle is already created.
svn path=/trunk/mcs/; revision=75094
* Control.cs: Call OnVisibleChanged in SetVisibleCore for non-forms.
Fixes tab control issues where controls would not show up because they
never received their OnVisibleChanged call.
svn path=/trunk/mcs/; revision=75034
* Control.cs: We won't get a WM_SHOWWINDOW when we create a window that
is maximized or minimized, so move CreateControl to Control.OnVisibleChanged.
* Form.cs: After we set the form visible, send a fake WM_SHOWWINDOW if we
are max or min. Remove WS_VISIBLE from CreateParams unless we are recreating
the handle. Fix WindowState by using the internal variable until we are
sure that we've been shown.
* XplatUIX11.cs: Do not generate a WM_SHOWWINDOW message if new form is
max or min.
[Fixes bug #81198]
svn path=/trunk/mcs/; revision=75026
* Control.cs: Make SetBoundsCore match MS better. The BoundsSpecified
parameter indicates which aspects were explicit/user-set.
* ComboBox.cs, ListBox.cs: Call SetBoundsCore correctly. (no 0 parameters).
2007-03-24 Jonathan Pobst <[email protected]>
* DefaultLayout.cs: Call SetBounds with BoundsSpecified.None instead
of using SetImplicitBounds.
* TableLayout.cs: Call SetBounds with BoundsSpecified.None instead of
modifying Control.Bounds.
2007-03-24 Jonathan Pobst <[email protected]>
* DefaultLayoutTest.cs: Enable some NotWorking tests that now
work correctly.
svn path=/trunk/mcs/; revision=74947
handle is not created yet.
* Form.cs: Select: Don't call CreateHandle if the handle is already
created, avoids a stack overflow on Windows when we are recreating
controls.
* ScrollableControl.cs: Set the correct z-order for the scrollbars when
they are made visible, and override AfterTopMostControl to keep
them on top when other controls are brought to front.
CalculateCanvas: Scrollbars are only visible if auto_scroll is true
or force_*scroll_visible is true (old implementation always shows
scrollbars when needed, no matter what auto_scroll was set to).
* InternalWindowManager.cs: UpdateWindowDecorations: Add a
IsHandleCreated check.
svn path=/trunk/mcs/; revision=74798
[Fixes#80380]
* Control.cs:
- UpdateCursor method added to update the screen cursor.
- GetAvailableCursor method added to return cursor for enabled tree,
it searches for cursor on control and it's parent's for enabled control.
- Call UpdateCursor method on setter of Cursor property.
- On setter of Enabled call UpdateCursor when it is false, we need to
change cursor to normal (or to this parent cursor) because cursor
setting theres no effect to disabled controls.
- Some minor source changes to follow the coding style guidelines.
* XplatUIX11.cs: In MotionNotify only dispatch SET_CURSOR event for enabled
controls.
svn path=/trunk/mcs/; revision=74790
* Control.cs: Don't trigger a layout if an implicit control is added
that isn't visible. Also, don't notify the owner when an implicit control
is added. (Owners shouldn't even know about their implicit controls.)
svn path=/trunk/mcs/; revision=74755
* Control.cs (WmPaint): don't make use of the Handle property
after an event is emitted, as the user could have closed the
form/destroyed the control. Store the Handle in a local variable
and make use of that. Fixes bug #80768.
svn path=/trunk/mcs/; revision=74662
casts and throw if setting the parent of an mdichild that already
has an mdiparent. Update signature for 2.0 profile. ProductName: If
there's no AssemblyProductAttribute in the assembly, use the type's
namespace (as MS seems to do). CreateControl: don't create the
handle if the control is not visible (according to MS behaviour and
spec). SetTopLevel: Only create handle if the control is not a
form. Change FocusInternal to virtual so that it can be overriden
by Form.
* TextBox.cs: Update call to FocusInternal.
* Form.cs: Always create the handle when calling Focus on a MdiChild.
The form is not a toplevel form when it's a mdi child, so update
is_toplevel accordingly. ShowIcon/TransparencyKey: avoid creating
the handle if it hasn't been created. Show (IWin32Window): Don't
allow this overload for toplevel windows.
CenterToParent/CenterToScreen/Select: create the handle as MS does.
SetVisibleCore: if called on a MdiChild and the parent isn't
visible yet, save the visibility and restore it when the parent is
made visible.
* ScrollableControl.cs: Refactor out scrollbar visibility code to
separate methods, since the visibility of the scrollbars can be
changed from several places, not only from AutoScroll.
svn path=/trunk/mcs/; revision=74609
[ Fixes bug #80604]
* XplatUIX11.cs (WaitForHwndMessage): change this to actually
swallow the message we're waiting on, instead of delivering it, as
this is only used for the WM_SHOWWINDOW raised from
MapWindow/UnmapWindow, and the message needs to be generated
(MapWindow, UnmapWindow): generate the WM_SHOWWINDOW message
before doing the Map/Unmap. Also make sure that the Hwnd is still
alive after the message has been handled.
*before* the window is shown.
* Control.cs (CreateControl): guard a few more things inside the
if (!is_created) block, as we might end up being called again -
yay .net.
(WmShowWindow): call CreateControl if we're showing the control.
svn path=/trunk/mcs/; revision=74599
controls without a handle if they have any parent with a handle. In
Dispose add a check whether the handle is created or not before
calling BeginInvoke, this removes the need of the extra disposing
parameter (which was bogus anyway since it didn't prevent the
invoke from happening, it only skipped the check for an existing
handle, meaning that the invoke would call on an inexistent
handle).
svn path=/trunk/mcs/; revision=74593
* Control.cs: Modify UpdateStyles to store distances when bounds >=
0 instead of just bounds > 0. [Fixes bug #80912]
svn path=/trunk/mcs/; revision=74397
2007-03-15 Ivan N. Zlatev <[email protected]>
* Common.cs, TestHelper.cs: Replaces all uses of the custom
WM_MOUSE_LEAVE with the system WM_MOUSELEAVE message.
In System.Windows.Forms:
2007-03-15 Ivan N. Zlatev <[email protected]>
* ComboBox.cs, Control.cs, XplatUIStructs.cs, XplatUIX11GTK.cs,
XplatUIX11.cs, XplatUIWin32.cs, InternalWindowManager.cs,
XplatUIOSX.cs, TextControl.cs: Replaces all uses of the custom
WM_MOUSE_LEAVE with the system WM_MOUSELEAVE message.
In System.Windows.Forms.X11Internal:
2007-03-15 Ivan N. Zlatev <[email protected]>
* X11Display.cs: Replaces all uses of the custom
WM_MOUSE_LEAVE with the system WM_MOUSELEAVE message.
svn path=/trunk/mcs/; revision=74346
2007-03-15 Chris Toshok <[email protected]>
[ Fixes#81101 ]
* Control.cs: add Ivan's fix for 81101, with a slight modification
- you can set control.Target to null.
In Test/System.Windows.Forms:
2007-03-15 Chris Toshok <[email protected]>
* ControlTest.cs: add Ivan's WindowTargetTest after fixing them,
with an extra one included.
svn path=/trunk/mcs/; revision=74344
* Control.cs: Another place we don't call SizeFromClientSize.
* Form.cs: Another place we don't call SizeFromClientSize.
[Fixes bug #81125]
2007-03-12 Jonathan Pobst <[email protected]>
* ControlTest.cs: Add test for bug #81125.
svn path=/trunk/mcs/; revision=74152
* Control.cs: We can't call SizeFromClientSize in the constructor,
but we still need to do the same work, so make an internal version.
[Fixes bug #80621]
svn path=/trunk/mcs/; revision=74129
* Control.cs: Create internal setter for client_size to allow it to be
set without triggering resizing code.
* Form.cs: Calculate client_size in constructor, only change client_size
in FormBorderStyle property if Handle has been created.
[Fixes#80574, #80791]
2007-03-08 Jonathan Pobst <[email protected]>
* FormTest.cs: Add tests for bugs #80574, #80791.
svn path=/trunk/mcs/; revision=73943
* XplatUIWin32.cs: The no_activate stuff was forcing us to create a
Handle before we were supposed to. Now checks ActivateOnShow property
in Control.
* Control.cs: Add internal ActivateOnShow property.
* ComboBox.cs, Form.cs, MenuAPI.cs, ToolStripDropDown.cs: Return false
for ActivateOnShow.
* Hwnd.cs Remove no longer needed no_activate field.
svn path=/trunk/mcs/; revision=73921
2007-03-05 Chris Toshok <[email protected]>
[merge -r72718:73765 from mwf-handle-branch]
2007-03-05 Chris Toshok <[email protected]>
* ControlHandleTest.cs: make this build on both 1.1 and 2.0
profiles.
2007-02-28 Chris Toshok <[email protected]>
* ControlTest.cs: Flesh out ControlInvokeTest to make sure that
the Control thread dies (that Application.Run returns, basically).
This works in isolation, but for some reason it isn't exiting when
run in concert with other tests (this test is the cause of the
hangs running the unit tests.) Marking NotWorking for the time
being. This needs to be fixed before merging back to the
mainline, imo.
In System.Windows.Forms:
2007-03-07 Chris Toshok <[email protected]>
[merge -r72718:73765 from mwf-handle-branch, and include 2 changes
to make the rest of the world happy]
* Control.cs (CreateHandle): there's no need to call
XplatUI.SetVisible here, it's effectively done by
XplatUI.CreateWindow on X now, and always was on windows.
* XplatUIX11.cs (WaitForHwndMessage): only use the PostQuitState
shortcircuit out of the loop if we have a message loop running on
this thread.
[Changelog from merge]
2007-03-05 Chris Toshok <[email protected]>
* Control.cs (AccessibilityNotifyClients): turns out in 1.1 this
causes handle creation.
2007-02-28 Chris Toshok <[email protected]>
* ApplicationContext.cs: Add a flag to make sure we only raise the
ThreadExit event once (ExitThreadCore can be indirectly called
from a few places.) I don't like the additional flag, but it
makes the event ordering/count correct.
* Application.cs (MWFThread.LoopCount): don't use an enumerator
without locking the collection. An enumerator doesn't give us any
protection from modification anyway. Lock the thread hash and
replace the complicated enumerator loop with a foreach.
(Application.CloseForms): make internal so it can be called from
ApplicationContext. This should probably be moved to MWFThread.
(Application.ExitThread): don't call MWFThread.Current.Exit()
here. just call XplatUI.PostQuitMessage. We'll exit the thread
when the runloop exits (in response to WM_QUIT.)
(Application.RunLoop): add a comment (and check) for
context.MainForm being null after setting context.MainForm.Visible
= true. This is because you're perfectly free to dispose of a
form in VisibilityChanged. Chalk this up to another case where we
need to synchronously generate WM_ACTIVATE from Control.Show.
Also, add handling for WM_QUIT here so we'll exit the loop.
* XplatUIX11.cs: clean up MapWindow and UnmapWindow a bit. The
fact that we don't wait if we're only unmapping the whole_window
makes me a bit nervous, but it doesn't seem to cause any problems
yet.
also, add a comment about the stupid, broken and wrong resetting
of PostQuitState to false in GetMessage().
In PostQuitMessage, we need to add a WM_QUIT message to the
thread's queue. We use the FosterParent to get the right
handle/hwnd/queue.
Lastly, in SetVisible, we need to unmap both windows, since the
waiting only happens when we're unmapping the client window. So
now, the *only* time we unmap just the whole_window is in the hack
for resizing a control to 0,0.
2007-02-21 Chris Toshok <[email protected]>
* Application.cs (CloseForms): rewrite this so that we don't
modify the list while we're traversing it.
2007-02-20 Chris Toshok <[email protected]>
* ListBox.cs (.ctor): move the Control.AddImplicits here instead
of OnHandleCreated.
(HorizontalScrollEvent): only call XplatUI.ScrollWindow if the
handle is created. otherwise we'll create it here.
(VerticalScrollEvent): same here.
* Application.cs (CloseForms): call Form.Dispose, don't post
WM_CLOSE_INTERNAL.
* Form.cs (WndProc): we don't need to use CLOSE_INTERNAL
here. Application should Dispose() of the Form's.
* XplatUIX11.cs (WaitForHwndMessage): break out of the loop on
WM_DESTROY as well.
(MapWindow,UnmapWindow): only actually do the waiting for
SHOWWINDOW if the control we're dealing with is a Form.
(CreateWindow): if the control isn't a form, SendMessage
WM_SHOWWINDOW here (if the WS_VISIBLE style is set).
* Control.cs (SetVisibleCore): always use is_visible here, not
value. If we use value, we can end up re-setting something
visible if, for instance, you do Control.Hide() in a delegate
attached to VisibleChanged as we do in FormTest.ShowDialogTest.
2007-02-20 Chris Toshok <[email protected]>
* XplatUIX11.cs (WaitForHwndMessage): we need to loop until we get
the message we need. PeekMessage returning false should not be a
condition under which we exit the loop.
2007-02-15 Chris Toshok <[email protected]>
* Control.cs (Refresh): only refresh if we've got a handle and are
visible.
(CreateAccessibilityInstance): CreateControl() here.
(UpdateChildrenZOrder): complicate the code loop even more by
taking into account controls that haven't had their handle
created, and those that aren't visible. But on the flip side,
simplify the code by splitting it into two loops. one which
builds up the list of child controls we're interested in, and the
other that sets the z order of those children.
2007-02-14 Chris Toshok <[email protected]>
* Control.cs: Control.AccessibilityObject causes the control to be
created, not just the handle.
2007-02-14 Chris Toshok <[email protected]>
* Control.cs: rework UpdateChildrenZOrder to correctly handle the
problem on X where a window might have its handle created (and be
visible) while the window is unmapped. calling XConfigureWindow
on an unmapped window is bad, and generates X errors.
2007-02-13 Chris Toshok <[email protected]>
* Control.cs (CreateHandle): don't loop over our children setting
their parent here. do it when in WndProc when we're shown.
(UpdateChildrenZOrder): make this internal so we can call it from
ScrollableControl.
(WndProc): for WM_SHOWWINDOW, reparent the child control after
creating its handle. Also, remove the calls to PerformLayout from
here. they're done in ScrollableControl.OnVisibleChanged. Also,
OnVisibleChanged only seems to be called directly here for the
toplevel control. It's propagated down the window hierarchy by
calls to child.OnParentVisibleChanged.
(OnVisibleChanged): don't do layout here - it's done (oddly
enough, according to a glance at stack traces on ms.net..) in
ScrollableControl.
* ScrollableControl.cs (OnVisibleChanged): make sure we update the
z order of our children before calling PerformLayout.
2007-02-12 Chris Toshok <[email protected]>
[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=73907
ToolWindowManager.cs
* System.Windows.Forms/ToolWindowManager.cs: Added, contains logic for
tool windows.
* System.Windows.Forms/CreateParams.cs: Add a few helper methods and an
internal variable to know which control the CreateParams belongs
to.
* System.Windows.Forms/Control.cs: Call Form.ChangingParent when the
parent is about to be changed.
* System.Windows.Forms/XplatUIX11.cs: DeriveStyles (): Set
caption_height for all windows that have captions and are children.
Update to use ToolWindowManager instead of InternalWindowManager
for ToolWindows.
* System.Windows.Forms/XplatUIWin32.cs: Set fake window styles for all
windows that have window managers.
* System.Windows.Forms/MdiWindowManager.cs: Added MaximizedTitleButtons
(the buttons are now duplicated for mdi windows when they are
maximized, first for the buttons the window itself has, then for
the buttons that appear in the menu bar. Makes things a little
easier). Updated UpdateWindowDecorations, SetWindowState and the
mouse eventhandlers accordingly.
* System.Windows.Forms/Form.cs: Add ChangingParent (), contains the
logic of what should happen when the parent changes. In MdiParent
don't set things that ChangingParent () is doing. When handling
WM_CLOSE, we can close the form if there are any other modal forms
and the current form is a descendent of the modal form.
* System.Windows.Forms/InternalWindowManager.cs: A lot of refactoring,
the title buttons are now extracted to a separate container class
that takes care of all button code (clicks, tooltips, etc). Moved
Iconic|Maximized|Normal Bounds properties to this class from
MdiWindowManager, so that the window state logic can succeed for
other than mdi wm's. Implemented general window state change logic.
Moved CreateButtons to ThemeWin32Classic, since the theme might
override which buttons are available when as well as the exact
location.
* System.Windows.Forms/FormWindowManager.cs: Added, contains logic for
normal forms.
* System.Windows.Forms/ThemeWin32Classic.cs:
ManagedWindowSetButtonLocations now decides which buttons go where
(and if they are at all visible). Removed special handling of
maximized windows, since they aren't special. In
DrawManagedWindowDecorations don't try to draw the text if it is
empty.
* System.Windows.Forms/MdiClient.cs: ArrangeIconicWindows: Don't
calculate any sizes, use whatever the wm gives us.
* System.Windows.Forms.X11Internal/X11Hwnd.cs: Update to use
ToolWindowManager.
* Test/System.Windows.Forms/FormTest.cs: Added
MaximizedParentedFormTest.
svn path=/trunk/mcs/; revision=73636
* XplatUIWin32.cs: Register a new class with Windows each time we get
a new ClassStyle. [Fixes bugs #79432, #80817]
* Controls.cs: Set the correct ClassStyle in CreateParams.
* ToolStripDropDown.cs: Don't request an invalid ClassStyle.
svn path=/trunk/mcs/; revision=73629
* Control.cs: Fix BeginInvoke signature for 2.0 profile.
Seems like the class status pages doesn't catch params differences.
svn path=/trunk/mcs/; revision=73173
disable any descendants of the main form (such as mdi children or
other parented forms). Fixes#80822 on Windows.
* Form.cs: If we have a parent, set the WS_CHILD style.
* Control.cs: Update the window styles if the control whose parent has
changed is a form (the WS_CHILD style has to be switched).
svn path=/trunk/mcs/; revision=73105
- Reorganize the WndProc cases so that each case has it's own handling method,
to help with the no-line-numbering stack traces.
- Formatting changes (it's vstudio's fault, really :p)
2007-02-13 Andreia Gaita <[email protected]>
svn path=/trunk/mcs/; revision=72776
[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
* Control.cs (SetVisibleCore): check in the proposed patch for
80604, and set is_visible before calling CreateControl.
svn path=/trunk/mcs/; revision=72456