Author: rolf
Date: 2007-04-24 12:32:37 -0400 (Tue, 24 Apr 2007)
New Revision: 76200

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBox.cs
Log:
* ComboBox.cs: Forward ContextMenu to the underlying textbox, if any.
  Fixes #80163.
* Control.cs: Replace GetContextMenuInternal() with ContextMenuInternal
  property, so that the setter can be overriden too.
* TextBox.cs: Change GetContextMenuInternal() to use
  ContextMenuInternal.

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-04-24 16:29:51 UTC (rev 76199)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-04-24 16:32:37 UTC (rev 76200)
@@ -1,5 +1,14 @@
 2007-04-24  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 
 
+       * ComboBox.cs: Forward ContextMenu to the underlying textbox, if any.
+         Fixes #80163.
+       * Control.cs: Replace GetContextMenuInternal() with ContextMenuInternal
+         property, so that the setter can be overriden too.
+       * TextBox.cs: Change GetContextMenuInternal() to use
+         ContextMenuInternal.
+
+2007-04-24  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 
+
        * ThemeWin32Classic.cs: Use a black pen to draw checkboxes, fixes
          #81406.
 

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs      
2007-04-24 16:29:51 UTC (rev 76199)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs      
2007-04-24 16:32:37 UTC (rev 76200)
@@ -418,6 +418,7 @@
                                        textbox_ctrl.BorderStyle = 
BorderStyle.None;
                                        textbox_ctrl.TextChanged += new 
EventHandler (OnTextChangedEdit);
                                        textbox_ctrl.Click += new EventHandler 
(OnTextBoxClick);
+                                       textbox_ctrl.ContextMenu = ContextMenu;
 
                                        if (IsHandleCreated == true)
                                                Controls.AddImplicit 
(textbox_ctrl);
@@ -1500,6 +1501,18 @@
                        return -1;
                }
 
+               internal override ContextMenu ContextMenuInternal {
+                       get {
+                               return base.ContextMenuInternal;
+                       }
+                       set {
+                               base.ContextMenuInternal = value;
+                               if (textbox_ctrl != null) {
+                                       textbox_ctrl.ContextMenu = value;
+                               }
+                       }
+               }
+
                private void OnKeyDownCB(object sender, KeyEventArgs e)
                {
                        if (Items.Count == 0)

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2007-04-24 16:29:51 UTC (rev 76199)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2007-04-24 16:32:37 UTC (rev 76200)
@@ -2355,21 +2355,26 @@
                [MWFCategory("Behavior")]
                public virtual ContextMenu ContextMenu {
                        get {
-                               return GetContextMenuInternal ();
+                               return ContextMenuInternal;
                        }
 
                        set {
+                               ContextMenuInternal = value;
+                       }
+               }
+
+               internal virtual ContextMenu ContextMenuInternal {
+                       get {
+                               return context_menu;
+                       }
+                       set {
                                if (context_menu != value) {
                                        context_menu = value;
-                                       OnContextMenuChanged(EventArgs.Empty);
+                                       OnContextMenuChanged (EventArgs.Empty);
                                }
                        }
                }
 
-               internal virtual ContextMenu GetContextMenuInternal () {
-                       return context_menu;
-               }
-
 #if NET_2_0
                [DefaultValue (null)]
                public virtual ContextMenuStrip ContextMenuStrip {

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBox.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBox.cs       
2007-04-24 16:29:51 UTC (rev 76199)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBox.cs       
2007-04-24 16:32:37 UTC (rev 76200)
@@ -398,12 +398,16 @@
 
                #region Private Methods
 
-               internal override ContextMenu GetContextMenuInternal ()
-               {
-                       ContextMenu  res = base.GetContextMenuInternal ();
-                       if (res == menu)
-                               return null;
-                       return res;
+               internal override ContextMenu ContextMenuInternal {
+                       get {
+                               ContextMenu res = base.ContextMenuInternal;
+                               if (res == menu)
+                                       return null;
+                               return res;
+                       }
+                       set {
+                               base.ContextMenuInternal = value;
+                       }
                }
 
                private void menu_Popup(object sender, EventArgs e) {

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to