+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ protected override void OnPaint (PaintEventArgs pevent) {
+ base.OnPaint (pevent);
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ protected override void OnResize(EventArgs e) {
+ base.OnResize(e);
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ protected override void OnStyleChanged(EventArgs e) {
+ base.OnStyleChanged (e);
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ protected override void OnTextChanged(EventArgs e) {
+ base.OnTextChanged (e);
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ protected override void OnVisibleChanged(EventArgs e) {
+ base.OnVisibleChanged (e);
+ }
+
+ protected override bool ProcessCmdKey(ref Message msg, Keys keyData) {
+ if (base.ProcessCmdKey (ref msg, keyData)) {
+ return true;
+ }
+
+ // Give our menu a shot
+ if (menu != null) {
+ return menu.ProcessCmdKey(ref msg, keyData);
+ }
+
+ return false;
+ }
+
+ // LAMESPEC - Not documented that Form overrides ProcessDialogChar; class-status showed
+ [EditorBrowsable (EditorBrowsableState.Advanced)]
+ protected override bool ProcessDialogChar(char charCode) {
+ return base.ProcessDialogChar (charCode);
+ }
+
+ protected override bool ProcessDialogKey(Keys keyData) {
+ if ((keyData & Keys.Modifiers) == 0) {
+ if (keyData == Keys.Enter && accept_button != null) {
+ accept_button.PerformClick();
+ return true;
+ } else if (keyData == Keys.Escape && cancel_button != null) {
+ cancel_button.PerformClick();
+ return true;
+ }
+ }
+ return base.ProcessDialogKey(keyData);
+ }
+
+ protected override bool ProcessKeyPreview(ref Message msg) {
+ if (key_preview) {
+ if (ProcessKeyEventArgs(ref msg)) {
+ return true;
+ }
+ }
+ return base.ProcessKeyPreview (ref msg);
+ }
+
+ protected override bool ProcessTabKey(bool forward) {
+ return SelectNextControl(ActiveControl, forward, true, true, true);
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ protected override void ScaleCore(float dx, float dy) {
+ base.ScaleCore (dx, dy);
+ }
+
+ protected override void Select(bool directed, bool forward) {
+ Form parent;
+
+ if (directed) {
+ base.SelectNextControl(null, forward, true, true, true);
+ }
+
+ parent = this.ParentForm;
+ if (parent != null) {
+ parent.ActiveControl = this;
+ }
+
+ Activate();
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified) {
+ base.SetBoundsCore (x, y, width, height, specified);
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ protected override void SetClientSizeCore(int x, int y) {
+ if ((minimum_size.Width != 0) && (x < minimum_size.Width)) {
+ x = minimum_size.Width;
+ } else if ((maximum_size.Width != 0) && (x > maximum_size.Width)) {
+ x = maximum_size.Width;
+ }
+
+ if ((minimum_size.Height != 0) && (y < minimum_size.Height)) {
+ y = minimum_size.Height;
+ } else if ((maximum_size.Height != 0) && (y > maximum_size.Height)) {
+ y = maximum_size.Height;
+ }
+
+ base.SetClientSizeCore (x, y);
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ protected override void SetVisibleCore(bool value) {
+ base.SetVisibleCore (value);
+ }
+
+ protected override void UpdateDefaultButton() {
+ base.UpdateDefaultButton ();
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ protected override void WndProc(ref Message m) {
+
+ if (IsMdiChild && mdi_child_context.HandleMessage (ref m)) {
+ return;
+ }
+
+ switch((Msg)m.Msg) {
+ case Msg.WM_CLOSE: {
+ CancelEventArgs args = new CancelEventArgs();
+
+ OnClosing(args);
+
+ if (!args.Cancel) {
+ OnClosed(EventArgs.Empty);
+ closing = true;
+ base.WndProc(ref m);
+ break;
+ }
+ break;
+ }
+
+ case Msg.WM_ACTIVATE: {
+ if (m.WParam != (IntPtr)WindowActiveFlags.WA_INACTIVE) {
+ OnActivated(EventArgs.Empty);
+ } else {
+ OnDeactivate(EventArgs.Empty);
+ }
+ return;
+ }
+
+ case Msg.WM_KILLFOCUS: {
+ base.WndProc(ref m);
+ return;
+ }
+
+ case Msg.WM_SETFOCUS: {
+#if not
+ if (this.ActiveControl != null) {
+ ActiveControl.Focus();
+ }
+#endif
+ base.WndProc(ref m);
+ return;
+ }
+
+ // Menu drawing
+ case Msg.WM_NCLBUTTONDOWN: {
+ if (this.menu != null) {
+ int x = LowOrder ((int) m.LParam.ToInt32 ()) ;
+ int y = HighOrder ((int) m.LParam.ToInt32 ());
+ menu.OnMouseDown(this, new MouseEventArgs (FromParamToMouseButtons ((int) m.WParam.ToInt32()), mouse_clicks, x, y, 0));
+ }
+ base.WndProc(ref m);
+ return;
+ }
+
+ case Msg.WM_NCMOUSEMOVE: {
+ if (this.menu != null) {
+ menu.OnMouseMove(this, new MouseEventArgs (FromParamToMouseButtons ((int) m.WParam.ToInt32()),
+ mouse_clicks, LowOrder ((int) m.LParam.ToInt32 ()), HighOrder ((int) m.LParam.ToInt32 ()), 0));
+ }
+ base.WndProc(ref m);
+ return;
+ }
+
+ case Msg.WM_NCPAINT: {
+ if (this.menu != null) {
+ Point pnt = XplatUI.GetMenuOrigin(window.Handle);
+ MenuAPI.DrawMenuBar (menu.Handle, new Rectangle (pnt.X, pnt.Y, ClientSize.Width, 0));
+ }
+
+ base.WndProc(ref m);
+ return;
+ }
+
+ // This message is only received under Win32
+ case Msg.WM_NCCALCSIZE: {
+ XplatUIWin32.NCCALCSIZE_PARAMS ncp;
+
+ if ((menu != null) && (m.WParam == (IntPtr)1)) {
+ ncp = (XplatUIWin32.NCCALCSIZE_PARAMS)Marshal.PtrToStructure(m.LParam, typeof(XplatUIWin32.NCCALCSIZE_PARAMS));
+
+ // Adjust for menu
+ ncp.rgrc1.top += ThemeEngine.Current.CalcMenuBarSize (DeviceContext, menu.menu_handle, ClientSize.Width);
+ Marshal.StructureToPtr(ncp, m.LParam, true);
+ }
+ DefWndProc(ref m);
+ break;
+ }
+
+ case Msg.WM_GETMINMAXINFO: {
+ XplatUIWin32.MINMAXINFO mmi;
+
+ if (m.LParam != IntPtr.Zero) {
+ mmi = (XplatUIWin32.MINMAXINFO)Marshal.PtrToStructure(m.LParam, typeof(XplatUIWin32.MINMAXINFO));
+ default_maximized_bounds = new Rectangle(mmi.ptMaxPosition.x, mmi.ptMaxPosition.y, mmi.ptMaxSize.x, mmi.ptMaxSize.y);
+ if (maximized_bounds != Rectangle.Empty) {
+ mmi.ptMaxSize.x = maximized_bounds.Width;
+ mmi.ptMaxSize.y = maximized_bounds.Height;
+ }
+
+ Marshal.StructureToPtr(mmi, m.LParam, false);
+ }
+ break;
+ }
+
+ default: {
+ base.WndProc (ref m);
+ break;
+ }
+ }
+ }
+ #endregion // Protected Instance Methods
+
+ #region Events