Author: pbartok
Date: 2006-06-02 16:10:54 -0400 (Fri, 02 Jun 2006)
New Revision: 61421
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContainerControl.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
Log:
2006-06-02 Peter Dennis Bartok <[EMAIL PROTECTED]>
* Control.cs
- Select: Implemented to just use activate. Seems to match MS
behaviour closest. Documented to only do actual control walking
based on it's parameters if in a container control so I moved
the code there.
- Removed selection check logic from our internal Select() method
* ContainerControl.cs:
- Select: Moved selection logic from Control here, since MS documents
that containers obey the bool arguments. No longer calling base
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-06-02 19:59:15 UTC (rev 61420)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-06-02 20:10:54 UTC (rev 61421)
@@ -1,3 +1,15 @@
+2006-06-02 Peter Dennis Bartok <[EMAIL PROTECTED]>
+
+ * Control.cs
+ - Select: Implemented to just use activate. Seems to match MS
+ behaviour closest. Documented to only do actual control walking
+ based on it's parameters if in a container control so I moved
+ the code there.
+ - Removed selection check logic from our internal Select() method
+ * ContainerControl.cs:
+ - Select: Moved selection logic from Control here, since MS documents
+ that containers obey the bool arguments. No longer calling base
+
2006-06-02 Jackson Harper <[EMAIL PROTECTED]>
* TreeView.cs: If the selected node isn't changed when we get
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContainerControl.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContainerControl.cs
2006-06-02 19:59:15 UTC (rev 61420)
+++
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContainerControl.cs
2006-06-02 20:10:54 UTC (rev 61421)
@@ -323,7 +323,41 @@
}
protected override void Select(bool directed, bool forward) {
- base.Select(directed, forward);
+
+ int index;
+ bool result;
+
+ if (!directed) {
+ // Select this control
+ Select(this);
+ return;
+ }
+
+ if (parent == null) {
+ return;
+ }
+
+ // FIXME - this thing is doing the wrong stuff, needs
to be similar to SelectNextControl
+
+ index = parent.child_controls.IndexOf(this);
+ result = false;
+
+ do {
+ if (forward) {
+ if ((index+1) <
parent.child_controls.Count) {
+ index++;
+ } else {
+ index = 0;
+ }
+ } else {
+ if (index>0) {
+ index++;
+ } else {
+ index =
parent.child_controls.Count-1;
+ }
+ }
+ result = Select(parent.child_controls[index]);
+ } while (!result && parent.child_controls[index] !=
this);
}
protected virtual void UpdateDefaultButton() {
@@ -335,10 +369,12 @@
base.WndProc(ref m);
}
#endregion // Protected Instance Methods
-
+
+ #region Internal Methods
internal virtual void CheckAcceptButton()
{
// do nothing here, only called if it is a Form
}
+ #endregion // Internal Methods
}
}
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
2006-06-02 19:59:15 UTC (rev 61420)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
2006-06-02 20:10:54 UTC (rev 61421)
@@ -946,15 +946,6 @@
parent = control.parent;
- if (((control.control_style & ControlStyles.Selectable)
!=0) && (parent != null)) {
- while (parent != null) {
- if (!parent.Visible ||
!parent.is_enabled) {
- return false;
- }
- parent = parent.parent;
- }
- }
-
control.is_selected = true;
container = GetContainerControl();
@@ -3545,40 +3536,12 @@
}
protected virtual void Select(bool directed, bool forward) {
- int index;
- bool result;
+ IContainerControl container;
- if (!directed) {
- // Select this control
- Select(this);
- return;
+ container = GetContainerControl();
+ if (container != null) {
+ container.ActiveControl = this;
}
-
- if (parent == null) {
- return;
- }
-
- // FIXME - this thing is doing the wrong stuff, needs
to be similar to SelectNextControl
-
- index = parent.child_controls.IndexOf(this);
- result = false;
-
- do {
- if (forward) {
- if ((index+1) <
parent.child_controls.Count) {
- index++;
- } else {
- index = 0;
- }
- } else {
- if (index>0) {
- index++;
- } else {
- index =
parent.child_controls.Count-1;
- }
- }
- result = Select(parent.child_controls[index]);
- } while (!result && parent.child_controls[index] !=
this);
}
[EditorBrowsable(EditorBrowsableState.Advanced)]
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches