[Mono-bugs] [Bug 499851] Need notification for UIA when a PopupButton gains focus

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon May 4 11:35:19 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=499851

User mgorse at novell.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=499851#c3


Michael Gorse <mgorse at novell.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #289732|0                           |1
           is patch|                            |




--- Comment #3 from Michael Gorse <mgorse at novell.com>  2009-05-04 09:35:18 MDT ---
(From update of attachment 289732)





>Index: System.Windows.Forms/FileDialog.cs
>===================================================================
>--- System.Windows.Forms/FileDialog.cs	(revision 133190)
>+++ System.Windows.Forms/FileDialog.cs	(working copy)
>@@ -1546,7 +1546,7 @@
> 				
> 				if (panel.focusButton != null && panel.focusButton.ButtonState == PopupButtonState.Up) {
> 					panel.focusButton.ButtonState = PopupButtonState.Normal;
>-					panel.focusButton = null;
>+					panel.SetFocusButton (null);
> 				}
> 				Invalidate ();
> 				base.OnMouseEnter (e);
>@@ -1648,7 +1648,7 @@
> 			
> 			SetStyle (ControlStyles.StandardClick, false);
> 		}
>-		
>+
> 		void OnClickButton (object sender, EventArgs e)
> 		{
> 			if (lastPopupButton != null && lastPopupButton != sender as PopupButton)
>@@ -1676,6 +1676,28 @@
> 				eh (this, EventArgs.Empty);
> 		}
> 		
>+#if NET_2_0
>+		static object UIAFocusedItemChangedEvent = new object ();
>+
>+		internal event EventHandler UIAFocusedItemChanged {
>+			add { Events.AddHandler (UIAFocusedItemChangedEvent, value); }
>+			remove { Events.RemoveHandler (UIAFocusedItemChangedEvent, value); }
>+		}
>+
>+		internal void OnUIAFocusedItemChanged ()
>+		{
>+			EventHandler eh = (EventHandler) Events [UIAFocusedItemChangedEvent];
>+			if (eh != null)
>+				eh (this, EventArgs.Empty);
>+		}
>+
>+		internal PopupButton UIAFocusButton {
>+			get {
>+				return focusButton;
>+			}
>+		}
>+#endif
>+
> 		public string CurrentFolder {
> 			set {
> 				string currentPath = value;
>@@ -1734,7 +1756,7 @@
> 		{
> 			if (lastPopupButton != recentlyusedButton) {
> 				recentlyusedButton.ButtonState = PopupButton.PopupButtonState.Up;
>-				focusButton = recentlyusedButton;
>+				SetFocusButton (recentlyusedButton);
> 			}
> 			currentFocusIndex = 0;
> 			
>@@ -1792,7 +1814,7 @@
> 					focusButton.ButtonState = PopupButton.PopupButtonState.Normal;
> 				if (newfocusButton.ButtonState != PopupButton.PopupButtonState.Down)
> 					newfocusButton.ButtonState = PopupButton.PopupButtonState.Up;
>-				focusButton = newfocusButton;
>+				SetFocusButton (newfocusButton);
> 			}
> 			
> 			e.Handled = true;
>@@ -1804,6 +1826,17 @@
> 			add { Events.AddHandler (PDirectoryChangedEvent, value); }
> 			remove { Events.RemoveHandler (PDirectoryChangedEvent, value); }
> 		}
>+
>+		internal void SetFocusButton (PopupButton button)
>+		{
>+			if (button == focusButton)
>+			return;
>+
>+			focusButton = button;
>+#if NET_2_0
>+				OnUIAFocusedItemChanged ();
>+#endif
>+		}
> 	}
> 	#endregion
> 	
>@@ -2758,6 +2791,19 @@
> 			}
> 		}
> 		
>+#if NET_2_0
>+		#region UIA Framework Members
>+		internal void PerformClick ()
>+		{
>+			OnClick (EventArgs.Empty);
>+		}
>+
>+		internal void PerformDoubleClick ()
>+		{
>+			OnDoubleClick (EventArgs.Empty);
>+		}
>+		#endregion
>+#endif
> 		protected override void OnClick (EventArgs e)
> 		{
> 			if (!MultiSelect) {

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list