}
}
set {
- if (this.checked_state != (value ? CheckState.Checked : CheckState.Unchecked)) {
- this.checked_state = value ? CheckState.Checked : CheckState.Unchecked;
- this.Invalidate ();
- this.OnCheckedChanged (EventArgs.Empty);
- }
+ CheckState = value ? CheckState.Checked : CheckState.Unchecked;
}
}
[DefaultValue (false)]
public bool CheckOnClick {
get { return this.check_on_click; }
- set { this.check_on_click = value; }
+ set {
+ if (this.check_on_click != value) {
+ this.check_on_click = value;
+ OnUIACheckOnClickChangedEvent (EventArgs.Empty);
+ }
+ }
}
[Bindable (true)]
if (!Enum.IsDefined (typeof (CheckState), value))
throw new InvalidEnumArgumentException (string.Format ("Enum argument value '{0}' is not valid for CheckState", value));
+ if (value == checked_state)
+ return;
+
this.checked_state = value;
this.Invalidate ();
+ this.OnCheckedChanged (EventArgs.Empty);
this.OnCheckStateChanged (EventArgs.Empty);
}
}
// If DropDown.ShowImageMargin is false, we don't display the image
Image draw_image = this.UseImageMargin ? this.Image : null;
- // Figure out our text color
- Color font_color = this.ForeColor == SystemColors.ControlText ? SystemColors.MenuText : this.ForeColor;
+ // Disable this color detection until we do the color detection for ToolStrip *completely*
+ // Color font_color = this.ForeColor == SystemColors.ControlText ? SystemColors.MenuText : this.ForeColor;
+ Color font_color = ForeColor;
if ((this.Selected || this.Pressed) && this.IsOnDropDown && font_color == SystemColors.MenuText)
font_color = SystemColors.HighlightText;
}
#endregion
+ #region UIA Framework Events
+ static object UIACheckOnClickChangedEvent = new object ();
+
+ internal event EventHandler UIACheckOnClickChanged {
+ add { Events.AddHandler (UIACheckOnClickChangedEvent, value); }
+ remove { Events.RemoveHandler (UIACheckOnClickChangedEvent, value); }
+ }
+
+ internal void OnUIACheckOnClickChangedEvent (EventArgs args)
+ {
+ EventHandler eh
+ = (EventHandler) Events [UIACheckOnClickChangedEvent];
+ if (eh != null)
+ eh (this, args);
+ }
+ #endregion
+
#region Internal Properties
internal Form MdiClientForm {
get { return this.mdi_client_form; }
}
}
- internal override void HandleClick (EventArgs e)
+ internal override void HandleClick (int mouse_clicks, EventArgs e)
{
this.OnClick (e);