Author: jackson
Date: 2007-02-16 15:32:08 -0500 (Fri, 16 Feb 2007)
New Revision: 73043
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
Log:
* ListView.cs: Make AfterLabelEdit work correctly.
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2007-02-16 20:26:02 UTC (rev 73042)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2007-02-16 20:32:08 UTC (rev 73043)
@@ -1,5 +1,9 @@
2007-02-16 Jackson Harper <[EMAIL PROTECTED]>
+ * ListView.cs: Make AfterLabelEdit work correctly.
+
+2007-02-16 Jackson Harper <[EMAIL PROTECTED]>
+
* X11Dnd.cs: Implement aliases on mime handlers, so things like
System.String are mapped to text.
- Handle dataobjects, getting all the possible formats out of them
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
2007-02-16 20:26:02 UTC (rev 73042)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
2007-02-16 20:32:08 UTC (rev 73043)
@@ -1800,7 +1800,7 @@
{
EndEdit (edit_item);
}
-
+
internal void BeginEdit (ListViewItem item)
{
if (edit_item != null)
@@ -1847,35 +1847,30 @@
edit_text_box.Visible = true;
edit_text_box.Focus ();
edit_text_box.SelectAll ();
-
+
+ edit_item = item;
edit_args = new LabelEditEventArgs
(owner.Items.IndexOf(edit_item));
owner.OnBeforeLabelEdit (edit_args);
if (edit_args.CancelEdit)
EndEdit (item);
-
- edit_item = item;
}
internal void EndEdit (ListViewItem item)
{
- if (edit_text_box != null &&
edit_text_box.Visible) {
- edit_text_box.Visible = false;
- }
-
if (edit_item != null && edit_item == item) {
+
+ edit_args.SetLabel (edit_text_box.Text);
owner.OnAfterLabelEdit (edit_args);
-
- if (!edit_args.CancelEdit) {
- if (edit_args.Label != null)
- edit_item.Text =
edit_args.Label;
- else
- edit_item.Text =
edit_text_box.Text;
- }
-
+
+ if (!edit_args.CancelEdit &&
edit_args.Label != null)
+ edit_item.Text =
edit_text_box.Text;
}
-
-
+
+ if (edit_text_box != null &&
edit_text_box.Visible) {
+ edit_text_box.Visible = false;
+ }
+
edit_item = null;
}
@@ -1998,7 +1993,7 @@
protected override void OnKeyDown (KeyEventArgs e)
{
if (e.KeyCode == Keys.Return && Visible) {
- this.Visible = false;
+ Visible = false;
OnEditingFinished (e);
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches