From b8ad4b03d469393ba463dc659fe178220ea76d8d Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 6 Dec 2006 16:50:40 +0000 Subject: [PATCH] * TextControl.cs: Make this operation undoable. * TextBoxBase.cs: Factor the border width into the preferred height. - implement Modified as per the spec. svn path=/trunk/mcs/; revision=69115 --- .../Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 7 +++++++ .../System.Windows.Forms/TextBoxBase.cs | 15 +++++++++++++-- .../System.Windows.Forms/TextControl.cs | 4 +++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 3747c39dd64..a0988fe8a9f 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,10 @@ +2006-12-06 Jackson Harper + + * TextControl.cs: Make this operation undoable. + * TextBoxBase.cs: Factor the border width into the preferred + height. + - implement Modified as per the spec. + 2006-12-06 Chris Toshok * Timer.cs, Control.cs, Menu.cs: make control_tag private. diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs index b870c487ba6..4880e711ed6 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs @@ -89,7 +89,7 @@ namespace System.Windows.Forms { character_casing = CharacterCasing.Normal; hide_selection = true; max_length = 32767; - modified = false; + modified = true; multiline = false; password_char = '\0'; read_only = false; @@ -446,7 +446,16 @@ namespace System.Windows.Forms { [EditorBrowsable(EditorBrowsableState.Advanced)] public int PreferredHeight { get { - return this.Font.Height + 7; // FIXME - consider border style as well + int bs = 0; + switch (border_style) { + case BorderStyle.FixedSingle: + bs = 2; + break; + case BorderStyle.Fixed3D: + bs = ThemeEngine.Current.Border3DSize.Width * 2; + break; + } + return this.Font.Height + 7 + bs; } } @@ -581,6 +590,8 @@ namespace System.Windows.Forms { CalculateDocument(); } + // set the var so OnModifiedChanged is not raised + modified = false; OnTextChanged(EventArgs.Empty); } } diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs index b53802ce52a..449db6c50f5 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs @@ -2093,7 +2093,8 @@ if (owner.backcolor_set || (owner.Enabled && !owner.read_only)) { LineTag tag = LineTag.FindTag (line, pos); NoRecalc = true; - + undo.BeginCompoundAction (); + base_line = line.line_no; old_line_count = lines; @@ -2158,6 +2159,7 @@ if (owner.backcolor_set || (owner.Enabled && !owner.read_only)) { DisplayCaret (); } + undo.EndCompoundAction (); } // Inserts a character at the given position -- 2.11.4.GIT