mail-archives/mono-bugs/2006-February/038977.html

457 строки
9.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-bugs] [Bug 77479][Nor] New - Form ClientRectangle.Size
Ignores Menu and Scroll bar.
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%2077479%5D%5BNor%5D%20New%20-%20Form%20ClientRectangle.Size%0A%09Ignores%20Menu%20and%20Scroll%20bar.&In-Reply-To=bug-77479%40chernobyl.ximian.com">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="038976.html">
<LINK REL="Next" HREF="038978.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-bugs] [Bug 77479][Nor] New - Form ClientRectangle.Size
Ignores Menu and Scroll bar.</H1>
<B>bugzilla-daemon at bugzilla.ximian.com</B>
<A HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%2077479%5D%5BNor%5D%20New%20-%20Form%20ClientRectangle.Size%0A%09Ignores%20Menu%20and%20Scroll%20bar.&In-Reply-To=bug-77479%40chernobyl.ximian.com"
TITLE="[Mono-bugs] [Bug 77479][Nor] New - Form ClientRectangle.Size
Ignores Menu and Scroll bar.">bugzilla-daemon at bugzilla.ximian.com
</A><BR>
<I>Sun Feb 5 23:37:18 EST 2006</I>
<P><UL>
<LI>Previous message: <A HREF="038976.html">[Mono-bugs] [Bug 77258][Nor] Changed - Drawing of ownerdrawn
ComboBox dropdown list is broken
</A></li>
<LI>Next message: <A HREF="038978.html">[Mono-bugs] [Bug 77364][Wis] Changed -
System.Runtime.Remoting.Messaging.MethodCall.LogicalCallContext
difference to MS.NET
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#38977">[ date ]</a>
<a href="thread.html#38977">[ thread ]</a>
<a href="subject.html#38977">[ subject ]</a>
<a href="author.html#38977">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">kdaniels at usfamily.net.</A>
<A HREF="http://bugzilla.ximian.com/show_bug.cgi?id=77479">http://bugzilla.ximian.com/show_bug.cgi?id=77479</A>
--- shadow/77479 2006-02-05 23:37:18.000000000 -0500
+++ shadow/77479.tmp.30299 2006-02-05 23:37:18.000000000 -0500
@@ -0,0 +1,381 @@
+Bug#: 77479
+Product: Mono: Class Libraries
+Version: 1.1
+OS:
+OS Details: Fedora Core 3
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Windows.Forms
+AssignedTo: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">peter at novonyx.com</A>
+ReportedBy: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">kdaniels at usfamily.net</A>
+QAContact: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at ximian.com</A>
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Form ClientRectangle.Size Ignores Menu and Scroll bar.
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+With .NET the ClientRectangle.Size does not subtract the Menu bar or the
+Scrollbar area of the form.
+
+The following program with a Menu and a Scroll bar can be used to
+illustrate the problem:
+
+using System;
+
+using System.Drawing;
+
+using System.Collections;
+
+using System.ComponentModel;
+
+using System.Windows.Forms;
+
+using System.Data;
+
+
+
+namespace WinScreenArea
+
+{
+
+ /// &lt;summary&gt;
+
+ /// Summary description for Form1.
+
+ /// &lt;/summary&gt;
+
+ public class Form1 : System.Windows.Forms.Form
+
+ {
+
+ private System.Windows.Forms.MainMenu mainMenu1;
+
+ private System.Windows.Forms.MenuItem menuItem1;
+
+ private System.Windows.Forms.MenuItem menuItem2;
+
+ private System.Windows.Forms.MenuItem menuItem3;
+
+ private System.Windows.Forms.Label label1;
+
+ /// &lt;summary&gt;
+
+ /// Required designer variable.
+
+ /// &lt;/summary&gt;
+
+ private System.ComponentModel.Container components = null;
+
+
+
+ public Form1()
+
+ {
+
+ //
+
+ // Required for Windows Form Designer support
+
+ //
+
+ InitializeComponent();
+
+
+
+ //
+
+ // TODO: Add any constructor code after InitializeComponent call
+
+ //
+
+ }
+
+
+
+ /// &lt;summary&gt;
+
+ /// Clean up any resources being used.
+
+ /// &lt;/summary&gt;
+
+ protected override void Dispose( bool disposing )
+
+ {
+
+ if( disposing )
+
+ {
+
+ if (components != null)
+
+ {
+
+ components.Dispose();
+
+ }
+
+ }
+
+ base.Dispose( disposing );
+
+ }
+
+
+
+ #region Windows Form Designer generated code
+
+ /// &lt;summary&gt;
+
+ /// Required method for Designer support - do not modify
+
+ /// the contents of this method with the code editor.
+
+ /// &lt;/summary&gt;
+
+ private void InitializeComponent()
+
+ {
+
+ this.mainMenu1 = new System.Windows.Forms.MainMenu();
+
+ this.menuItem1 = new System.Windows.Forms.MenuItem();
+
+ this.menuItem2 = new System.Windows.Forms.MenuItem();
+
+ this.menuItem3 = new System.Windows.Forms.MenuItem();
+
+ this.label1 = new System.Windows.Forms.Label();
+
+ this.SuspendLayout();
+
+ //
+
+ // mainMenu1
+
+ //
+
+ this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+
+ this.menuItem1,
+
+ this.menuItem3});
+
+ //
+
+ // menuItem1
+
+ //
+
+ this.menuItem1.Index = 0;
+
+ this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+
+ this.menuItem2});
+
+ this.menuItem1.Text = &quot;Menu1&quot;;
+
+ //
+
+ // menuItem2
+
+ //
+
+ this.menuItem2.Index = 0;
+
+ this.menuItem2.Text = &quot;MenuItem2&quot;;
+
+ //
+
+ // menuItem3
+
+ //
+
+ this.menuItem3.Index = 1;
+
+ this.menuItem3.Text = &quot;Menu2&quot;;
+
+ //
+
+ // label1
+
+ //
+
+ this.label1.Location = new System.Drawing.Point(144, 288);
+
+ this.label1.Name = &quot;label1&quot;;
+
+ this.label1.Size = new System.Drawing.Size(120, 23);
+
+ this.label1.TabIndex = 0;
+
+ this.label1.Text = &quot;Label to force scollbar&quot;;
+
+ //
+
+ // Form1
+
+ //
+
+ this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+
+ this.AutoScroll = true;
+
+ this.ClientSize = new System.Drawing.Size(391, 294);
+
+ this.Controls.Add(this.label1);
+
+ this.Menu = this.mainMenu1;
+
+ this.Name = &quot;Form1&quot;;
+
+ this.Text = &quot;Form1&quot;;
+
+ this.MouseMove += new
+System.Windows.Forms.MouseEventHandler(this.Form1_MouseMove);
+
+ this.ResumeLayout(false);
+
+
+
+ }
+
+ #endregion
+
+
+
+ /// &lt;summary&gt;
+
+ /// The main entry point for the application.
+
+ /// &lt;/summary&gt;
+
+ [STAThread]
+
+ static void Main()
+
+ {
+
+ Application.Run(new Form1());
+
+ }
+
+ const int cursorMargin=50;
+
+ Cursor GetLocationCursor(int x,int y)
+
+ {
+
+ // returns the cursor type needed based on the location
+
+ // of the cursor. If the cursor is at least 50 pixels inside
+
+ // any edge of the ClientRectangle the desired cursor is
+
+ // the default cursor, otherwise it is one of the four
+
+ // arrow cursors.
+
+ int xMin,xMax,yMin,yMax;
+
+ xMin=this.ClientRectangle.Left+cursorMargin;
+
+ xMax=this.ClientRectangle.Right-cursorMargin;
+
+ yMin=this.ClientRectangle.Location.Y+cursorMargin; // positive Y is down.
+
+ yMax=this.ClientRectangle.Size.Height-cursorMargin;
+
+ if (y&lt;yMin)
+
+ {
+
+ return Cursors.IBeam;
+
+ }
+
+ else if(y&gt;yMax)
+
+ {
+
+ return Cursors.IBeam;
+
+ }
+
+ if (x&lt;=xMin)
+
+ {
+
+ return Cursors.IBeam;
+
+ }
+
+ else if(x&gt;xMax)
+
+ {
+
+ return Cursors.IBeam;
+
+ }
+
+ return Cursors.Default;
+
+
+
+ }
+
+
+
+ private void Form1_MouseMove(object sender,
+System.Windows.Forms.MouseEventArgs e)
+
+ {
+
+ if (this.Cursor != Cursors.WaitCursor)
+
+ {
+
+ this.Cursor=GetLocationCursor(e.X,e.Y);
+
+ }
+
+
+
+ }
+
+ }
+
+}
+
+
+
+Steps to reproduce the problem:
+1. Compile and execute the program.
+2. Using the Mouse, move the cursor around the screen. When you get within
+50 pixels of any border of the form the cursor will change to an IBeam.
+When you get to the end of the ClientRectangle area the cursor will change
+ back to an arrow.
+
+With .Net this will happen if you cross the menu bar on the top, or the
+Scroll bar on the right of the form. With Mono the IBar remains to the end
+of the Form, ignoring the menu bar and the scroll bar.
+3.
+
+Actual Results:
+Ibeam cursor does not change to an arrow when above the menu bar, or to the
+right of the scroll bar.
+
+Expected Results:
+Ibeam cursor should change to an Arrow when cursor is above the bottom of
+the menu bar, and to the right of the left most edge of the scroll bar.
+
+How often does this happen?
+Always
+
+Additional Information:
+
+Mono is from SVN
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="038976.html">[Mono-bugs] [Bug 77258][Nor] Changed - Drawing of ownerdrawn
ComboBox dropdown list is broken
</A></li>
<LI>Next message: <A HREF="038978.html">[Mono-bugs] [Bug 77364][Wis] Changed -
System.Runtime.Remoting.Messaging.MethodCall.LogicalCallContext
difference to MS.NET
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#38977">[ date ]</a>
<a href="thread.html#38977">[ thread ]</a>
<a href="subject.html#38977">[ subject ]</a>
<a href="author.html#38977">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/mono-bugs">More information about the mono-bugs
mailing list</a><br>
</body></html>