Author: toshok
Date: 2006-12-06 20:04:29 -0500 (Wed, 06 Dec 2006)
New Revision: 69147
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
Log:
2006-12-06 Chris Toshok <[EMAIL PROTECTED]>
* Control.cs: make control_style private.
* TextBoxBase.cs: fix the HandleClick override. it was explicitly
setting the styles to true, then setting them to false instead of
reverting to their previous values.
also, call SetStyle on the scrollbars instead of using
control_style directly.
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-12-07 01:00:57 UTC (rev 69146)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-12-07 01:04:29 UTC (rev 69147)
@@ -1,3 +1,14 @@
+2006-12-06 Chris Toshok <[EMAIL PROTECTED]>
+
+ * Control.cs: make control_style private.
+
+ * TextBoxBase.cs: fix the HandleClick override. it was explicitly
+ setting the styles to true, then setting them to false instead of
+ reverting to their previous values.
+
+ also, call SetStyle on the scrollbars instead of using
+ control_style directly.
+
2006-12-06 Jonathan Pobst <[EMAIL PROTECTED]>
* FormCollection.cs: Implement. [2.0]
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
2006-12-07 01:00:57 UTC (rev 69146)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
2006-12-07 01:04:29 UTC (rev 69147)
@@ -83,7 +83,7 @@
bool is_disposed; // has the window already been disposed?
Size client_size; // size of the client area (window excluding
decorations)
Rectangle client_rect; // rectangle with the client area
(window excluding decorations)
- internal ControlStyles control_style; //
rather win32-specific, style bits for control
+ ControlStyles control_style; // rather win32-specific, style
bits for control
internal ImeMode ime_mode = ImeMode.Inherit;
bool layout_pending; // true if our parent needs to re-layout us
object control_tag; // object that contains data about our
control
@@ -3445,7 +3445,7 @@
}
}
- protected bool GetStyle(ControlStyles flag) {
+ protected internal bool GetStyle(ControlStyles flag) {
return (control_style & flag) != 0;
}
@@ -3808,7 +3808,7 @@
}
[EditorBrowsable(EditorBrowsableState.Advanced)]
- protected void SetStyle(ControlStyles flag, bool value) {
+ protected internal void SetStyle(ControlStyles flag, bool
value) {
if (value) {
control_style |= flag;
} else {
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
2006-12-07 01:00:57 UTC (rev 69146)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
2006-12-07 01:04:29 UTC (rev 69147)
@@ -118,14 +118,14 @@
hscroll = new ImplicitHScrollBar();
hscroll.ValueChanged += new
EventHandler(hscroll_ValueChanged);
- hscroll.control_style &= ~ControlStyles.Selectable;
+ hscroll.SetStyle (ControlStyles.Selectable, false);
hscroll.Enabled = false;
hscroll.Visible = false;
hscroll.Maximum = Int32.MaxValue;
vscroll = new ImplicitVScrollBar();
vscroll.ValueChanged += new
EventHandler(vscroll_ValueChanged);
- vscroll.control_style &= ~ControlStyles.Selectable;
+ vscroll.SetStyle (ControlStyles.Selectable, false);
vscroll.Enabled = false;
vscroll.Visible = false;
vscroll.Maximum = Int32.MaxValue;
@@ -165,9 +165,19 @@
internal override void HandleClick(int clicks, MouseEventArgs
me) {
// MS seems to fire the click event in spite of the
styles they set
- control_style |= ControlStyles.StandardClick |
ControlStyles.StandardDoubleClick;
+ bool click_set = GetStyle (ControlStyles.StandardClick);
+ bool doubleclick_set = GetStyle
(ControlStyles.StandardDoubleClick);
+
+ // so explicitly set them to true first
+ SetStyle (ControlStyles.StandardClick |
ControlStyles.StandardDoubleClick, true);
+
base.HandleClick (clicks, me);
- control_style ^= ControlStyles.StandardClick |
ControlStyles.StandardDoubleClick;
+
+ // then revert to our previous state
+ if (!click_set)
+ SetStyle (ControlStyles.StandardClick, false);
+ if (!doubleclick_set)
+ SetStyle (ControlStyles.StandardDoubleClick,
false);
}
#endregion // Private and Internal Methods
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches