private delegate void RemoveDelegate(object c);
protected override void Dispose(bool disposing) {
- is_disposed = true;
if (dc_mem!=null) {
dc_mem.Dispose();
dc_mem=null;
DestroyHandle();
controls.Remove(this);
}
+ is_disposed = true;
+ base.Dispose(disposing);
}
#endregion // Public Constructors
[Localizable(true)]
[DefaultValue(null)]
+ [MWFCategory("Accessibility")]
public string AccessibleDescription {
get {
return AccessibilityObject.description;
[Localizable(true)]
[DefaultValue(null)]
+ [MWFCategory("Accessibility")]
public string AccessibleName {
get {
return AccessibilityObject.Name;
}
[DefaultValue(false)]
+ [MWFCategory("Behavior")]
public virtual bool AllowDrop {
get {
return allow_drop;
if (allow_drop == value)
return;
allow_drop = value;
- UpdateStyles();
- XplatUI.SetAllowDrop (Handle, value);
+ if (IsHandleCreated) {
+ UpdateStyles();
+ XplatUI.SetAllowDrop (Handle, value);
+ }
}
}
[Localizable(true)]
[RefreshProperties(RefreshProperties.Repaint)]
- [DefaultValue(AnchorStyles.Top | AnchorStyles.Left)]
+ [DefaultValue(AnchorStyles.Top | AnchorStyles.Left)]
+ [MWFCategory("Layout")]
public virtual AnchorStyles Anchor {
get {
return anchor_style;
#endif // NET_2_0
[DispId(-501)]
+ [MWFCategory("Appearance")]
public virtual Color BackColor {
get {
if (background_color.IsEmpty) {
[Localizable(true)]
[DefaultValue(null)]
+ [MWFCategory("Appearance")]
public virtual Image BackgroundImage {
get {
return background_image;
}
}
+ internal virtual bool InternalCapture {
+ get {
+ return Capture;
+ }
+
+ set {
+ Capture = value;
+ }
+ }
+
[EditorBrowsable(EditorBrowsableState.Advanced)]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
}
[DefaultValue(true)]
+ [MWFCategory("Focus")]
public bool CausesValidation {
get {
return this.causes_validation;
}
[DefaultValue(null)]
+ [MWFCategory("Behavior")]
public virtual ContextMenu ContextMenu {
get {
return context_menu;
}
[AmbientValue(null)]
+ [MWFCategory("Appearance")]
public virtual Cursor Cursor {
get {
if (cursor != null) {
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[ParenthesizePropertyName(true)]
[RefreshProperties(RefreshProperties.All)]
+ [MWFCategory("Data")]
public ControlBindingsCollection DataBindings {
get {
if (data_bindings == null)
[Localizable(true)]
[RefreshProperties(RefreshProperties.Repaint)]
[DefaultValue(DockStyle.None)]
+ [MWFCategory("Layout")]
public virtual DockStyle Dock {
get {
return dock_style;
[DispId(-514)]
[Localizable(true)]
+ [MWFCategory("Behavior")]
public bool Enabled {
get {
if (!is_enabled) {
[DispId(-512)]
[AmbientValue(null)]
[Localizable(true)]
+ [MWFCategory("Appearance")]
public virtual Font Font {
get {
if (font != null) {
}
[DispId(-513)]
+ [MWFCategory("Appearance")]
public virtual Color ForeColor {
get {
if (foreground_color.IsEmpty) {
[AmbientValue(ImeMode.Inherit)]
[Localizable(true)]
+ [MWFCategory("Behavior")]
public ImeMode ImeMode {
get {
if (ime_mode == DefaultImeMode) {
}
[Localizable(true)]
+ [MWFCategory("Layout")]
public Point Location {
get {
return new Point(bounds.X, bounds.Y);
[AmbientValue(RightToLeft.Inherit)]
[Localizable(true)]
+ [MWFCategory("Appearance")]
public virtual RightToLeft RightToLeft {
get {
if (right_to_left == RightToLeft.Inherit) {
}
[Localizable(true)]
+ [MWFCategory("Layout")]
public Size Size {
get {
return new Size(Width, Height);
[Localizable(true)]
[MergableProperty(false)]
+ [MWFCategory("Behavior")]
public int TabIndex {
get {
if (tab_index != -1) {
[DispId(-516)]
[DefaultValue(true)]
+ [MWFCategory("Behavior")]
public bool TabStop {
get {
return tab_stop;
[Bindable(true)]
[TypeConverter(typeof(StringConverter))]
[DefaultValue(null)]
+ [MWFCategory("Data")]
public object Tag {
get {
return control_tag;
[DispId(-517)]
[Localizable(true)]
[BindableAttribute(true)]
+ [MWFCategory("Appearance")]
public virtual string Text {
get {
// Our implementation ignores ControlStyles.CacheText - we always cache
}
[Localizable(true)]
+ [MWFCategory("Behavior")]
public bool Visible {
get {
if (!is_visible) {
public virtual void Refresh() {
if (IsHandleCreated == true) {
-
Invalidate();
XplatUI.UpdateWindow(window.Handle);
}
}
- // Find out where the window manager placed us
UpdateStyles();
+ XplatUI.SetAllowDrop (Handle, allow_drop);
+
+ // Find out where the window manager placed us
if ((CreateParams.Style & (int)WindowStyles.WS_CHILD) != 0) {
XplatUI.SetBorderStyle(window.Handle, (FormBorderStyle)border_style);
}
protected virtual void SetVisibleCore(bool value) {
if (value!=is_visible) {
- is_visible=value;
-
- if (is_visible && !is_created) {
+ if (value && !is_created) {
CreateControl();
}
+ is_visible=value;
+
if (IsHandleCreated) {
XplatUI.SetVisible(Handle, value);
// Explicitly move Toplevel windows to where we want them;
HandleClick(mouse_clicks, me);
OnMouseUp (me);
- if (Capture) {
- Capture = false;
+ if (InternalCapture) {
+ InternalCapture = false;
}
if (mouse_clicks > 1) {
if (CanSelect && !is_selected) {
Select(this);
}
- Capture = true;
+ InternalCapture = true;
OnMouseDown (new MouseEventArgs (FromParamToMouseButtons ((int) m.WParam.ToInt32()),
mouse_clicks, LowOrder ((int) m.LParam.ToInt32 ()), HighOrder ((int) m.LParam.ToInt32 ()),
0));
}
case Msg.WM_LBUTTONDBLCLK: {
- Capture = true;
+ InternalCapture = true;
mouse_clicks++;
OnMouseDown (new MouseEventArgs (FromParamToMouseButtons ((int) m.WParam.ToInt32()),
mouse_clicks, LowOrder ((int) m.LParam.ToInt32 ()), HighOrder ((int) m.LParam.ToInt32 ()),
HandleClick(mouse_clicks, me);
OnMouseUp (me);
- if (Capture) {
- Capture = false;
+ if (InternalCapture) {
+ InternalCapture = false;
}
if (mouse_clicks > 1) {
mouse_clicks = 1;
}
case Msg.WM_MBUTTONDOWN: {
- Capture = true;
+ InternalCapture = true;
OnMouseDown (new MouseEventArgs (FromParamToMouseButtons ((int) m.WParam.ToInt32()),
mouse_clicks, LowOrder ((int) m.LParam.ToInt32 ()), HighOrder ((int) m.LParam.ToInt32 ()),
0));
}
case Msg.WM_MBUTTONDBLCLK: {
- Capture = true;
+ InternalCapture = true;
mouse_clicks++;
OnMouseDown (new MouseEventArgs (FromParamToMouseButtons ((int) m.WParam.ToInt32()),
mouse_clicks, LowOrder ((int) m.LParam.ToInt32 ()), HighOrder ((int) m.LParam.ToInt32 ()),
}
case Msg.WM_RBUTTONUP: {
- MouseEventArgs me;
+ MouseEventArgs me;
+ Point pt;
+
+ pt = new Point(LowOrder ((int) m.LParam.ToInt32 ()), HighOrder ((int) m.LParam.ToInt32 ()));
+ pt = PointToScreen(pt);
+
+ XplatUI.SendMessage(m.HWnd, Msg.WM_CONTEXTMENU, m.HWnd, (IntPtr)(pt.X + (pt.Y << 16)));
- if (context_menu != null) {
- context_menu.Show(this, new Point(LowOrder ((int) m.LParam.ToInt32 ()), HighOrder ((int) m.LParam.ToInt32 ())));
- }
me = new MouseEventArgs (FromParamToMouseButtons ((int) m.WParam.ToInt32()) | MouseButtons.Right,
mouse_clicks,
LowOrder ((int) m.LParam.ToInt32 ()), HighOrder ((int) m.LParam.ToInt32 ()),
HandleClick(mouse_clicks, me);
OnMouseUp (me);
- if (Capture) {
- Capture = false;
+ if (InternalCapture) {
+ InternalCapture = false;
}
if (mouse_clicks > 1) {
}
case Msg.WM_RBUTTONDOWN: {
- Capture = true;
+ InternalCapture = true;
OnMouseDown (new MouseEventArgs (FromParamToMouseButtons ((int) m.WParam.ToInt32()),
mouse_clicks, LowOrder ((int) m.LParam.ToInt32 ()), HighOrder ((int) m.LParam.ToInt32 ()),
0));
}
case Msg.WM_RBUTTONDBLCLK: {
- Capture = true;
+ InternalCapture = true;
mouse_clicks++;
OnMouseDown (new MouseEventArgs (FromParamToMouseButtons ((int) m.WParam.ToInt32()),
mouse_clicks, LowOrder ((int) m.LParam.ToInt32 ()), HighOrder ((int) m.LParam.ToInt32 ()),
return;
}
+ case Msg.WM_CONTEXTMENU: {
+ if (context_menu != null) {
+ Point pt;
+
+ pt = new Point(LowOrder ((int) m.LParam.ToInt32 ()), HighOrder ((int) m.LParam.ToInt32 ()));
+ context_menu.Show(this, PointToClient(pt));
+ return;
+ }
+
+ DefWndProc(ref m);
+ return;
+ }
+
case Msg.WM_MOUSEWHEEL: {
OnMouseWheel (new MouseEventArgs (FromParamToMouseButtons ((int) m.WParam.ToInt32()),