Author: jackson
Date: 2006-12-11 14:00:31 -0500 (Mon, 11 Dec 2006)
New Revision: 69349
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
Log:
- If the window is resized and scrolling is no longer needed
(the
whole doc is visible) set the scroll position to zero.
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-12-11 18:52:02 UTC (rev 69348)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-12-11 19:00:31 UTC (rev 69349)
@@ -6,8 +6,6 @@
TextBox but not for TextBoxBase.
- If the window is resized and scrolling is no longer needed (the
whole doc is visible) set the scroll position to zero.
- - Scroll to the caret when the document is recalculated (this
- might be wrong, need a lot of testing here)
- The default SelectWord (the one TextBox uses) should move the
caret to the end of the word.
- SelectAll moves the caret to the end of the selection.
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
2006-12-11 18:52:02 UTC (rev 69348)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
2006-12-11 19:00:31 UTC (rev 69349)
@@ -1651,8 +1651,14 @@
}
document.RecalculateDocument(CreateGraphicsInternal());
CalculateScrollBars();
- ScrollToCaret ();
- Invalidate();
+
+ if (document.caret.line != null &&
document.caret.line.Y < document.ViewPortHeight) {
+ // The window has probably been resized, making
the entire thing visible, so
+ // we need to set the scroll position back to
zero.
+ vscroll.Value = 0;
+ }
+
+ Invalidate();
}
internal void CalculateScrollBars () {
@@ -1885,10 +1891,6 @@
if (pos.Y < document.ViewPortY) {
vscroll.Value = pos.Y;
- } else if (pos.Y < document.ViewPortHeight) {
- // The window has probably been resized, making
the entire thing visible, so
- // we need to set the scroll position back to
zero.
- vscroll.Value = 0;
}
if ((pos.Y + height) > (document.ViewPortY +
canvas_height)) {
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches