Selaa lähdekoodia

* TextBoxBase.cs: Need to display the caret after letting the
* base
wndproc handle the focus methods, because the caret display
methods check the focus state.
- Try to display the caret after updating it's position with
SelectWord.
- Don't need to do an immediate update on this recalc, since
there
will be an invalidate anyways.


svn path=/trunk/mcs/; revision=74304

Jackson Harper 19 vuotta sitten
vanhempi
sitoutus
704fa2daed

+ 9 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog

@@ -1,3 +1,12 @@
+2007-03-14  Jackson Harper  <[email protected]>
+
+	* TextBoxBase.cs: Need to display the caret after letting the base
+	wndproc handle the focus methods, because the caret display
+	methods check the focus state.
+	- Try to display the caret after updating it's position with SelectWord.
+	- Don't need to do an immediate update on this recalc, since there
+	will be an invalidate anyways.
+
 2007-03-14  Jackson Harper  <[email protected]>
 
 	* TreeView.cs: Some workarounds so that we can match event order a

+ 4 - 4
mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs

@@ -1263,13 +1263,13 @@ namespace System.Windows.Forms {
 			}
 
 			case Msg.WM_SETFOCUS:
-				document.CaretHasFocus ();
 				base.WndProc(ref m);
+				document.CaretHasFocus ();
 				break;
 
 			case Msg.WM_KILLFOCUS:
-				document.CaretLostFocus ();
 				base.WndProc(ref m);
+				document.CaretLostFocus ();
 				break;
 
 			default:
@@ -1590,6 +1590,7 @@ namespace System.Windows.Forms {
 
 			document.SetSelection (document.caret.line, start, document.caret.line, end);
 			document.PositionCaret (document.selection_end.line, document.selection_end.pos);
+			document.DisplayCaret ();
 		}
 
 		internal void CalculateDocument() {
@@ -1764,8 +1765,7 @@ namespace System.Windows.Forms {
 							ThemeEngine.Current.ResPool.GetSolidBrush(ForeColor),
 							null, FormatSpecified.Font | FormatSpecified.Color);
 				}
-				document.UpdateView (document.GetLine (1), 0);
-				document.ResumeRecalc (true);
+				document.ResumeRecalc (false);
 
 				// Make sure the caret height is matching the new font height
 				document.AlignCaret();