owned_forms = new Form.ControlCollection(this);
transparency_key = Color.Empty;
+ // FIXME: this should disappear just as soon as the handle creation is done in the right place (here is too soon()
+ UpdateBounds();
+
}
#endregion // Public Constructor & Destructor
mdi_parent.MdiContainer.Controls.Add (this);
mdi_parent.MdiContainer.Controls.SetChildIndex (this, 0);
- if (IsHandleCreated)
- RecreateHandle ();
+ RecreateHandle ();
} else if (mdi_parent != null) {
mdi_parent = null;
window_manager = null;
FormBorderStyle = form_border_style;
- if (IsHandleCreated)
- RecreateHandle ();
+ RecreateHandle ();
}
}
}
cp.Style = (int)(WindowStyles.WS_CLIPCHILDREN | WindowStyles.WS_CLIPSIBLINGS);
+ if (Parent != null) {
+ cp.Parent = Parent.Handle;
+ cp.Style |= (int) WindowStyles.WS_CHILD;
+ }
+
if (IsMdiChild) {
cp.Style |= (int)(WindowStyles.WS_CHILD | WindowStyles.WS_CAPTION);
if (Parent != null) {
}
}
}
+#if NET_2_0
+ [MonoTODO ("Implemented for Win32, needs X11 implementation")]
+ protected virtual bool ShowWithoutActivation {
+ get { return false; }
+ }
+#endif
#endregion // Protected Instance Properties
#region Public Static Methods
}
}
+ if (this.ShowWithoutActivation)
+ Hwnd.ObjectFromHandle (this.Handle).no_activate = true;
+
XplatUI.SetWindowMinMax(window.Handle, maximized_bounds, minimum_size, maximum_size);
if ((FormBorderStyle != FormBorderStyle.FixedDialog) && (icon != null)) {
XplatUI.SetIcon(window.Handle, icon);
}
[EditorBrowsable(EditorBrowsableState.Advanced)]
- protected override void SetVisibleCore(bool value)
- {
+ protected override void SetVisibleCore(bool value) {
is_changing_visible_state = true;
has_been_visible = value || has_been_visible;
base.SetVisibleCore (value);
}
// Menu drawing
- case Msg.WM_NCLBUTTONDOWN: {
+ case Msg.WM_NCHITTEST: {
+ if (XplatUI.IsEnabled (Handle) && ActiveMenu != null) {
+ int x = LowOrder ((int)m.LParam.ToInt32 ());
+ int y = HighOrder ((int)m.LParam.ToInt32 ());
+
+ XplatUI.ScreenToMenu (ActiveMenu.Wnd.window.Handle, ref x, ref y);
+
+ // If point is under menu return HTMENU, it prevents Win32 to return HTMOVE.
+ if ((x > 0) && (y > 0) && (x < ActiveMenu.Rect.Width) && (y < ActiveMenu.Rect.Height)) {
+ m.Result = new IntPtr ((int)HitTest.HTMENU);
+ return;
+ }
+ }
+
+ base.WndProc (ref m);
+ return;
+ }
+
+ case Msg.WM_NCLBUTTONDOWN: {
if (XplatUI.IsEnabled (Handle) && ActiveMenu != null) {
ActiveMenu.OnMouseDown(this, new MouseEventArgs (FromParamToMouseButtons ((int) m.WParam.ToInt32()), mouse_clicks, Control.MousePosition.X, Control.MousePosition.Y, 0));
}
base.WndProc(ref m);
return;
}
- case Msg.WM_NCLBUTTONUP: {
+
+ case Msg.WM_NCLBUTTONUP: {
if (ActiveMaximizedMdiChild != null) {
ActiveMaximizedMdiChild.HandleMenuMouseUp (ActiveMenu,
LowOrder ((int)m.LParam.ToInt32 ()),