Author: rolf
Date: 2007-03-16 14:43:52 -0500 (Fri, 16 Mar 2007)
New Revision: 74481
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/InternalWindowManager.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiClient.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiWindowManager.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Menu.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIStructs.cs
Log:
* Menu.cs: MergeMenu: Check menu argument for null before looping over
it.
* MdiWindowManager.cs: Add IsVisiblePending to track the pending
visibility of mdi child forms. FormSizeChangedHandler: update the
maximized size if size has changed while maximized.
* MdiClient.cs: SizeScrollbars/ArrangeWindows/ActivateChild: Avoid
creating the handle.
* InternalWindowManager.cs: UpdateBorderStyle/FormSizeChangedHandler:
avoid creating the handle if not created.
* XplatUI.cs: Update debug output.
* XplatUIStructs.cs: Added ToString's for a couple of structs.
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2007-03-16 19:41:33 UTC (rev 74480)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2007-03-16 19:43:52 UTC (rev 74481)
@@ -1,3 +1,17 @@
+2007-03-16 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
+
+ * Menu.cs: MergeMenu: Check menu argument for null before looping over
+ it.
+ * MdiWindowManager.cs: Add IsVisiblePending to track the pending
+ visibility of mdi child forms. FormSizeChangedHandler: update the
+ maximized size if size has changed while maximized.
+ * MdiClient.cs: SizeScrollbars/ArrangeWindows/ActivateChild: Avoid
+ creating the handle.
+ * InternalWindowManager.cs: UpdateBorderStyle/FormSizeChangedHandler:
+ avoid creating the handle if not created.
+ * XplatUI.cs: Update debug output.
+ * XplatUIStructs.cs: Added ToString's for a couple of structs.
+
2007-03-16 Jonathan Pobst <[EMAIL PROTECTED]>
* ContainerControl.cs: Give ToolStripManager the opportunity to handle
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/InternalWindowManager.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/InternalWindowManager.cs
2007-03-16 19:41:33 UTC (rev 74480)
+++
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/InternalWindowManager.cs
2007-03-16 19:43:52 UTC (rev 74481)
@@ -341,7 +341,9 @@
public virtual void UpdateBorderStyle (FormBorderStyle
border_style)
{
- XplatUI.SetBorderStyle (form.Handle, border_style);
+ if (form.IsHandleCreated) {
+ XplatUI.SetBorderStyle (form.Handle,
border_style);
+ }
if (ShouldRemoveWindowManager (border_style)) {
form.RemoveWindowManager ();
@@ -414,8 +416,10 @@
private void FormSizeChangedHandler (object sender, EventArgs e)
{
- ThemeEngine.Current.ManagedWindowSetButtonLocations
(this);
- XplatUI.InvalidateNC (form.Handle);
+ if (form.IsHandleCreated) {
+
ThemeEngine.Current.ManagedWindowSetButtonLocations (this);
+ XplatUI.InvalidateNC (form.Handle);
+ }
}
protected virtual bool HandleRButtonDown (ref Message m)
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiClient.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiClient.cs
2007-03-16 19:41:33 UTC (rev 74480)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiClient.cs
2007-03-16 19:43:52 UTC (rev 74481)
@@ -355,6 +355,9 @@
{
if (lock_sizing)
return;
+
+ if (!IsHandleCreated)
+ return;
if (Controls.Count == 0 || ((Form) Controls
[0]).WindowState == FormWindowState.Maximized) {
if (hbar != null)
@@ -522,6 +525,9 @@
private void ArrangeWindows ()
{
+ if (!IsHandleCreated)
+ return;
+
int change = 0;
if (prev_bottom != -1)
change = Bottom - prev_bottom;
@@ -673,8 +679,10 @@
SetWindowStates (wm);
if (current != form) {
form.has_focus = false;
- XplatUI.InvalidateNC (current.Handle);
- XplatUI.InvalidateNC (form.Handle);
+ if (current.IsHandleCreated)
+ XplatUI.InvalidateNC (current.Handle);
+ if (form.IsHandleCreated)
+ XplatUI.InvalidateNC (form.Handle);
}
active_child = (Form) Controls [0];
@@ -815,8 +823,8 @@
if (mdiclient_layout)
Parent.PerformLayout ();
- //XplatUI.RequestNCRecalc (Parent.Handle);
- //XplatUI.RequestNCRecalc (form.Handle);
+ XplatUI.RequestNCRecalc (Parent.Handle);
+ XplatUI.RequestNCRecalc (form.Handle);
if (!setting_windowstates)
SizeScrollBars ();
}
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiWindowManager.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiWindowManager.cs
2007-03-16 19:41:33 UTC (rev 74480)
+++
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiWindowManager.cs
2007-03-16 19:43:52 UTC (rev 74481)
@@ -51,7 +51,17 @@
private bool icon_dont_show_popup;
private TitleButtons maximized_title_buttons;
-
+ private bool is_visible_pending;
+
+ internal bool IsVisiblePending {
+ get {
+ return is_visible_pending;
+ }
+ set {
+ is_visible_pending = value;
+ }
+ }
+
private TitleButtons MaximizedTitleButtons {
get {
if (maximized_title_buttons == null) {
@@ -127,6 +137,9 @@
private void FormSizeChangedHandler (object sender, EventArgs e)
{
+ if (form.window_state == FormWindowState.Maximized &&
form.Bounds != MaximizedBounds)
+ form.Bounds = MaximizedBounds;
+
form.MdiParent.MdiContainer.SizeScrollBars ();
}
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Menu.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Menu.cs
2007-03-16 19:41:33 UTC (rev 74480)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Menu.cs
2007-03-16 19:43:52 UTC (rev 74481)
@@ -263,6 +263,9 @@
if (menuSrc == this)
throw new ArgumentException ("The menu cannot
be merged with itself");
+ if (menuSrc == null)
+ return;
+
for (int i = 0; i < menuSrc.MenuItems.Count; i++) {
MenuItem sourceitem = menuSrc.MenuItems[i];
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs
2007-03-16 19:41:33 UTC (rev 74480)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs
2007-03-16 19:43:52 UTC (rev 74481)
@@ -752,7 +752,7 @@
internal static int SendInput (IntPtr hwnd, Queue keys) {
#if DriverDebug
- Console.WriteLine("SendInput({0}): Called",
charCode);
+ Console.WriteLine("SendInput({0}, {1}):
Called", hwnd, keys);
#endif
return driver.SendInput (hwnd, keys);
}
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIStructs.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIStructs.cs
2007-03-16 19:41:33 UTC (rev 74480)
+++
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIStructs.cs
2007-03-16 19:43:52 UTC (rev 74481)
@@ -378,6 +378,11 @@
{
return new Point (x, y);
}
+
+ public override string ToString ()
+ {
+ return "Point {" + x.ToString () + ", " + y.ToString ()
+ ")";
+ }
}
[StructLayout(LayoutKind.Sequential)]
@@ -389,6 +394,11 @@
internal uint time;
internal POINT pt;
internal object refobject;
+
+ public override string ToString ()
+ {
+ return String.Format ("msg=0x{0:x} ({1}) hwnd=0x{2:x}
wparam=0x{3:x} lparam=0x{4:x} pt=0x{5:x}", (int) message, message.ToString (),
hwnd.ToInt32 (), wParam.ToInt32 (), lParam.ToInt32 (), pt);
+ }
}
[Flags]
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches