public AbstractCompletionWindow() { InitializeComponent(); this.ShowInTaskbar = false; this.TopMost = true; this.FormBorderStyle = FormBorderStyle.None; _parentFormClosingEventHandler = (s, e) => { //when parent form is closing //we close the popup shadow window //and close this abstract completion windows if (_formPopupShadow != null) { _formPopupShadow.Close(); _formPopupShadow = null; } // this.Close(); }; _parentFormSizeChanged = (s, e) => { #if DEBUG this.Hide(); #else this.Hide(); #endif }; }
public void AddChild(RenderElement renderElem, object owner) { if (renderElem is RenderBoxBase) { if (owner is ITopWindowBox) { var topWinBox = owner as ITopWindowBox; if (topWinBox.PlatformWinBox == null) { FormPopupShadow popupShadow1 = new FormPopupShadow(); popupShadow1.Visible = false; IntPtr handle1 = popupShadow1.Handle; //*** //create platform winbox var newForm = new AbstractCompletionWindow(); newForm.LinkedParentForm = this.FindForm(); newForm.LinkedParentControl = this; newForm.PopupShadow = popupShadow1; //TODO: //1. review here=> 300,200 //2. how to choose InnerViewportKind UISurfaceViewportControl newSurfaceViewport = this.CreateNewOne(300, 200, InnerViewportKind.GLES); newSurfaceViewport.Location = new System.Drawing.Point(0, 0); newForm.Controls.Add(newSurfaceViewport); renderElem.ResetRootGraphics(newSurfaceViewport.RootGfx); renderElem.SetLocation(0, 0); newSurfaceViewport.AddChild(renderElem); //----------------------------------------------------- IntPtr tmpHandle = newForm.Handle;//force newform to create window handle //----------------------------------------------------- var platformWinBox = new PlatformWinBoxForm(newForm); topWinBox.PlatformWinBox = platformWinBox; platformWinBox.UseRelativeLocationToParent = true; platformWinBox.PreviewVisibilityChanged += PlatformWinBox_PreviewVisibilityChanged; platformWinBox.PreviewBoundChanged += PlatformWinBox_PreviewBoundChanged; platformWinBox.BoundsChanged += PlatformWinBox_BoundsChanged; platformWinBox.VisibityChanged += PlatformWinBox_VisibityChanged; _subForms.Add(newForm); } } else { _rootgfx.AddChild(renderElem); } } else { _rootgfx.AddChild(renderElem); } }