/** * @brief Tries to add a sulphur.editor.controls.TabWindow content to this control. * @param[in] window (TabWindow) Window whose content has to be copied over to this control. * @return True if window was added, false otherwise. * @see sulphur.editor.controls.TabWindow. * @remark If succesfull the window added will be closed. */ public bool AddWindow(TabWindow window) { Point top_left = tab_panel_.TranslatePoint(new Point(0, 0), this); top_left = this.PointToScreen(top_left); Point bottom_right = new Point(top_left.X + tab_panel_.ActualWidth, top_left.Y + tab_panel_.ActualHeight); Point mouse = native.Win32.GetMousePosition(); bool result = mouse.X > top_left.X && mouse.X <bottom_right.X && mouse.Y> top_left.Y && mouse.Y < bottom_right.Y; if (result == false) { return(result); } List <object> collection = window.GetTabs(); window.UnparentTabs(); foreach (object item in collection) { Items.Add(item); SelectedItem = item; } window.Close(); return(true); }