Esempio n. 1
0
 public void ScrollIntoView(GuiWidget widget)
 {
     if (this.Descendants().Contains(widget))
     {
         if (!widget.ActuallyVisibleOnScreen())
         {
             var widgetScreenBounds = widget.TransformToScreenSpace(widget.LocalBounds);
             var widgetScrollBounds = this.TransformFromScreenSpace(widgetScreenBounds.Center);
             this.ScrollPosition = new Vector2(0, -widgetScrollBounds.Y);
         }
     }
 }
Esempio n. 2
0
        public bool NameExists(string widgetName, SearchRegion searchRegion = null)
        {
            foreach (SystemWindow window in SystemWindow.OpenWindows)
            {
                GuiWidget widgetToClick = window.FindNamedChildRecursive(widgetName);
                if (widgetToClick != null)
                {
                    if (widgetToClick.ActuallyVisibleOnScreen())
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }