public bool HandleInput(MyTreeViewItem treeViewItem)
 {
     bool captured = false;
     if (DraggedItem == null)
     {
         if (MyGUIHelper.Contains(treeViewItem.GetPosition(), treeViewItem.GetSize(), MyGuiManager.MouseCursorPosition.X, MyGuiManager.MouseCursorPosition.Y) &&
             treeViewItem.TreeView.Contains(MyGuiManager.MouseCursorPosition.X, MyGuiManager.MouseCursorPosition.Y))
         {
             if (MyInput.Static.IsNewLeftMousePressed())
             {
                 Dragging = false;
                 DraggedItem = treeViewItem;
                 StartDragPosition = MyGuiManager.MouseCursorPosition;
                 captured = true;
             }
         }
     }
     return captured;
 }
        public bool HandleInput(MyTreeViewItem treeViewItem)
        {
            bool captured = false;

            if (DraggedItem == null)
            {
                if (MyGUIHelper.Contains(treeViewItem.GetPosition(), treeViewItem.GetSize(), MyGuiManager.MouseCursorPosition.X, MyGuiManager.MouseCursorPosition.Y) &&
                    treeViewItem.TreeView.Contains(MyGuiManager.MouseCursorPosition.X, MyGuiManager.MouseCursorPosition.Y))
                {
                    if (MyInput.Static.IsNewLeftMousePressed())
                    {
                        Dragging          = false;
                        DraggedItem       = treeViewItem;
                        StartDragPosition = MyGuiManager.MouseCursorPosition;
                        captured          = true;
                    }
                }
            }
            return(captured);
        }
Example #3
0
        public void FocusItem(MyTreeViewItem item)
        {
            if (item != null)
            {
                Vector2 offset = MyGUIHelper.GetOffset(m_body.GetPosition(), m_body.GetSize(), item.GetPosition(), item.GetSize());

                m_vScrollbar.ChangeValue(-offset.Y);
                m_hScrollbar.ChangeValue(-offset.X);
            }

            FocusedItem = item;
        }
        public void FocusItem(MyTreeViewItem item)
        {
            if (item != null)
            {
                Vector2 offset = MyGUIHelper.GetOffset(m_body.GetPosition(), m_body.GetSize(), item.GetPosition(), item.GetSize());

                m_vScrollbar.ChangeValue(-offset.Y);
                m_hScrollbar.ChangeValue(-offset.X);
            }

            FocusedItem = item;
        }