Author: jackson
Date: 2006-06-16 17:44:45 -0400 (Fri, 16 Jun 2006)
New Revision: 61815
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/ThemeWin32Classic.cs
Log:
* MdiClient.cs: Instead of just sizing maximized windows when
there is a resize we also have to adjust the Y of minimized
windows, so they stay pinned to the bottom of the mdi container.
* InternalWindowManager.cs:
* ThemeWin32Classic.cs: Minimized windows get all three buttons
even if they are a tool window.
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-06-16 20:37:18 UTC (rev 61814)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-06-16 21:44:45 UTC (rev 61815)
@@ -1,3 +1,12 @@
+2006-06-16 Jackson Harper <[EMAIL PROTECTED]>
+
+ * MdiClient.cs: Instead of just sizing maximized windows when
+ there is a resize we also have to adjust the Y of minimized
+ windows, so they stay pinned to the bottom of the mdi container.
+ * InternalWindowManager.cs:
+ * ThemeWin32Classic.cs: Minimized windows get all three buttons
+ even if they are a tool window.
+
2006-06-15 Peter Dennis Bartok <[EMAIL PROTECTED]>
* TextControl.cs (Undo): Handle non-existent cursor locations in the
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/InternalWindowManager.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/InternalWindowManager.cs
2006-06-16 20:37:18 UTC (rev 61814)
+++
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/InternalWindowManager.cs
2006-06-16 21:44:45 UTC (rev 61815)
@@ -345,13 +345,13 @@
close_button = null;
minimize_button = null;
maximize_button = null;
- if (IsMaximized)
+ if (IsMaximized || IsMinimized)
goto case FormBorderStyle.Sizable;
break;
case FormBorderStyle.FixedToolWindow:
case FormBorderStyle.SizableToolWindow:
close_button = new TitleButton
(CaptionButton.Close, new EventHandler (CloseClicked));
- if (IsMaximized)
+ if (IsMaximized || IsMinimized)
goto case FormBorderStyle.Sizable;
break;
case FormBorderStyle.FixedSingle:
@@ -420,6 +420,7 @@
protected virtual void HandleTitleBarDown (int x, int y)
{
foreach (TitleButton button in title_buttons) {
+ Console.WriteLine ("BUTTON RECTANGLE: {0}",
button.Rectangle);
if (button != null && button.Rectangle.Contains
(x, y)) {
button.State = ButtonState.Pushed;
return;
@@ -553,6 +554,10 @@
get { return GetWindowState () ==
FormWindowState.Maximized; }
}
+ public bool IsMinimized {
+ get { return GetWindowState () ==
FormWindowState.Minimized; }
+ }
+
public bool IsSizable {
get {
switch (form.FormBorderStyle) {
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiClient.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiClient.cs
2006-06-16 20:37:18 UTC (rev 61814)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiClient.cs
2006-06-16 21:44:45 UTC (rev 61815)
@@ -43,6 +43,7 @@
private int hbar_value;
private int vbar_value;
private bool lock_sizing;
+ private int prev_bottom;
private LayoutEventHandler initial_layout_handler;
#endregion // Local Variables
@@ -121,7 +122,7 @@
// Should probably make this into one loop
SizeScrollBars ();
- SizeMaximized ();
+ ArrangeWindows ();
}
protected override void ScaleCore (float dx, float dy)
@@ -380,15 +381,26 @@
lock_sizing = false;
}
- private void SizeMaximized ()
+ private void ArrangeWindows ()
{
+ int change = 0;
+ if (prev_bottom != -1)
+ change = Bottom - prev_bottom;
+
foreach (Form child in Controls) {
if (!child.Visible)
continue;
MdiWindowManager wm = (MdiWindowManager)
child.WindowManager;
if (wm.GetWindowState () ==
FormWindowState.Maximized)
wm.SizeMaximized ();
+
+ if (wm.GetWindowState () ==
FormWindowState.Minimized) {
+ child.Top += change;
+ }
+
}
+
+ prev_bottom = Bottom;
}
private void FormLocationChanged (object sender, EventArgs e)
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
2006-06-16 20:37:18 UTC (rev 61814)
+++
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
2006-06-16 21:44:45 UTC (rev 61815)
@@ -4210,7 +4210,7 @@
public override int ManagedWindowTitleBarHeight
(InternalWindowManager wm)
{
- if (wm.IsToolWindow)
+ if (wm.IsToolWindow && !wm.IsMinimized)
return
SystemInformation.ToolWindowCaptionHeight;
if (wm.Form.FormBorderStyle == FormBorderStyle.None)
return 0;
@@ -4234,7 +4234,7 @@
int btw = btsize.Width;
int bth = btsize.Height;
- if (!wm.IsToolWindow && wm.HasBorders) {
+ if ((!wm.IsToolWindow || wm.IsMinimized) &&
wm.HasBorders) {
if (!wm.IsMaximized) {
wm.close_button.Rectangle = new
Rectangle (wm.Form.Width - bw - btw - 2,
bw + 2, btw, bth);
@@ -4307,7 +4307,7 @@
}
if (!wm.IsMaximized) {
- if (!wm.IsToolWindow) {
+ if (!wm.IsToolWindow || wm.IsMinimized)
{
DrawTitleButton (dc,
wm.minimize_button, clip);
DrawTitleButton (dc,
wm.maximize_button, clip);
}
@@ -4321,7 +4321,7 @@
public override Size ManagedWindowButtonSize
(InternalWindowManager wm)
{
int height = ManagedWindowTitleBarHeight (wm);
- if (!wm.IsMaximized) {
+ if (!wm.IsMaximized && !wm.IsMinimized) {
if (wm.IsToolWindow)
return new Size
(SystemInformation.ToolWindowCaptionButtonSize.Width - 2,
height - 5);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches