Ejemplo n.º 1
0
 /// <summary>
 /// Adds the GUI Control nodes to the treeview
 /// </summary>
 /// <param name="ancestor"></param>
 /// <param name="sceneView"></param>
 private void AddControlNodes(Node parentNode, GUIControlCollection controls)
 {
     foreach (GUIControl control in controls)
     {
         AddControlNode(parentNode, control);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Try to locate the list element in a collection of gui controls
 /// </summary>
 /// <param name="collection">The collection where we browse in</param>
 /// <returns>The list if found, null otherwise</returns>
 private GUIListControl GetListControl(GUIControlCollection collection)
 {
     if (collection != null && collection.Count > 0)
     {
         //Get the control that holds all the list items
         foreach (GUIControl c in collection)
         {
             if (c.GetType() == typeof(GUIListControl))
             {
                 GUIListControl list = (GUIListControl)c;
                 return(list);
             }
             else if (c.GetType() == typeof(GUIGroup))
             {
                 GUIGroup group = (GUIGroup)c;
                 //Control type group, can have child elements
                 GUIListControl list = GetListControl(group.Children);
                 if (list != null)
                 {
                     //Found list in group type group, return it
                     return(list);
                 }
             }
         }
     }
     return(null);
 }
Ejemplo n.º 3
0
        private void AddControls(ListBox listBox, GUIControlCollection controls)
        {
            foreach (GUIControl control in controls)
            {
                if (control.GetType() == typeof(GUIMask))
                {
                    listBox.Items.Add(control);
                }

                AddControls(listBox, control.Controls);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Returns a sorted list of channels where children follow parents
        /// </summary>
        /// <param name="controls"></param>
        /// <returns></returns>
        public List <GUIAnimationChannel> GetSortedChannels(GUIControlCollection controls)
        {
            List <GUIAnimationChannel> channels = new List <GUIAnimationChannel>();

            if (controls.Count == 0 || AnimationChannels.Count == 0)
            {
                return(channels);
            }

            BuildSortedAnimations(controls, channels);
            return(channels);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Performs a base init of the window. This includes the following tasks
 /// - Setting the reference to the window in MP
 /// - Setting the reference to the control list of the MP window
 /// </summary>
 protected override void BaseInit()
 {
     _dialogWindow = GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU) as GUIDialogMenu;
       _baseWindow = _dialogWindow;
       if (_dialogWindow != null)
       {
     _controlList = new GUIControlCollection();
     foreach (var baseElement in _dialogWindow.controlList)
     {
       _controlList.Add(baseElement);
     }
       }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Performs a base init of the window. This includes the following tasks
 /// - Setting the reference to the window in MP
 /// - Setting the reference to the control list of the MP window
 /// </summary>
 protected override void BaseInit()
 {
     _dialogWindow = GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU) as GUIDialogMenu;
     _baseWindow   = _dialogWindow;
     if (_dialogWindow != null)
     {
         _controlList = new GUIControlCollection();
         foreach (var baseElement in _dialogWindow.controlList)
         {
             _controlList.Add(baseElement);
         }
     }
 }
Ejemplo n.º 7
0
        private void BuildSortedAnimations(GUIControlCollection controls, List <GUIAnimationChannel> channels)
        {
            foreach (GUIControl control in controls)
            {
                foreach (GUIAnimationChannel channel in AnimationChannels)
                {
                    if (channel.Control == control)
                    {
                        channels.Add(channel);
                        break;
                    }
                }

                BuildSortedAnimations(control.Controls, channels);
            }
        }
Ejemplo n.º 8
0
        private string GetSingleLabel(GUIDialogWindow dialog, int control)
        {
            GUIControlCollection coll = dialog.controlList;

            foreach (GUIControl c in coll)
            {
                if (c.GetType() == typeof(GUIGroup))
                {
                    foreach (GUIControl subControl in ((GUIGroup)c).Children)
                    {
                        if (subControl.GetID == control)
                        {
                            return(GetSingleLabelFromControl(subControl));
                        }
                    }
                }
                else if (c.GetID == control)
                {
                    return(GetSingleLabelFromControl(c));
                }
            }

            return(null);
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Try to locate the list element in a collection of gui controls
 /// </summary>
 /// <param name="collection">The collection where we browse in</param>
 /// <returns>The list if found, null otherwise</returns>
 private GUIListControl GetListControl(GUIControlCollection collection)
 {
     if (collection != null && collection.Count > 0)
     {
         //Get the control that holds all the list items
         foreach (GUIControl c in collection)
         {
             if (c.GetType() == typeof(GUIListControl))
             {
                 GUIListControl list = (GUIListControl)c;
                 return list;
             }
             else if (c.GetType() == typeof(GUIGroup))
             {
                 GUIGroup group = (GUIGroup)c;
                 //Control type group, can have child elements
                 GUIListControl list = GetListControl(group.Children);
                 if (list != null)
                 {
                     //Found list in group type group, return it
                     return list;
                 }
             }
         }
     }
     return null;
 }