Пример #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="view"></param>
 /// <param name="control"></param>
 public DeleteControlCommand(GUIView view, GUIControl control)
 {
     mView = view;
     Controls.Add(control);
     mParent = Controls[0].Parent;
     mIndex = mView.Controls.IndexOf(Controls[0]);
 }
Пример #2
0
        /// <summary>
        /// Adds a view at the specified index
        /// </summary>
        /// <param name="view"></param>
        /// <param name="atIndex"></param>
        public void AddView(GUIView view, int atIndex)
        {
            if (Views.Contains(view))
            {
                return;
            }

            if (atIndex >= 0)
            {
                Views.Insert(atIndex, view);
            }
            else
            {
                Views.Add(view);
            }

            view.Scene = this;

            NotifyViewAdded(view);
        }
Пример #3
0
 /// <summary>
 /// Called when the selected sceneView has been renamed
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="sceneView"></param>
 void SceneHierarchyView_SelectedViewRenamed(object sender, GUIView view)
 {
 }
Пример #4
0
 /// <summary>
 /// Called when the selected sceneView has changed
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="sceneView"></param>
 void SceneHierarchyView_ViewChanged(object sender, GUIView view)
 {
     SceneView sceneView = mDockPanel.ActiveDocument as SceneView;
     if (sceneView != null && sceneView.Scene == Globals.SceneHierarchyView.Scene)
     {
         sceneView.ActiveView = Globals.SceneHierarchyView.View;
         sceneView.PrimaryControl = Globals.SceneHierarchyView.SelectedControls.Count > 0 ? Globals.SceneHierarchyView.SelectedControls[0] : null;
     }
 }
Пример #5
0
        /// <summary>
        /// Selects a list of controls, and updates all views to reflect that selection
        /// </summary>
        /// <param name="control"></param>
        private void SelectControls(object source, GUIView view, List<GUIControl> controls)
        {
            mIgnoreSelectionChanges = true;
            {
                NotifyingList<GUIControl> selectedControls = new NotifyingList<GUIControl>(controls);

                // Set the current scene's selected control, as well as the properties and
                // the scene hierarchy
                SceneView sceneView = mDockPanel.ActiveDocument as SceneView;
                if (source != sceneView && sceneView != null && sceneView.ActiveView == view)
                {
                    sceneView.SelectedControls = selectedControls;
                }
                
                if (source != Globals.TimelineView)
                    Globals.TimelineView.SelectedControls = selectedControls;

                if (source != Globals.SceneHierarchyView)
                    Globals.SceneHierarchyView.SelectedControls = selectedControls;

                if (source != Globals.PropertiesView)
                    Globals.PropertiesView.PropertyGrid.SelectedObjects = selectedControls.ToArray();
            }
            mIgnoreSelectionChanges = false;
        }
Пример #6
0
 /// <summary>
 /// Selects a single control
 /// </summary>
 /// <param name="source"></param>
 /// <param name="view"></param>
 /// <param name="control"></param>
 private void SelectControl(object source, GUIView view, GUIControl control)
 {
     SelectControls(source, view, (control != null) ? new List<GUIControl>(new GUIControl[] { control }) : new List<GUIControl>());
 }
Пример #7
0
        /// <summary>
        /// Adds a sceneView node to the scene hierarchy at a specific index
        /// </summary>
        /// <param name="sceneView"></param>
        /// <returns></returns>
        private void AddViewNode(GUIView view, int atIndex)
        {
            SceneNode node = new SceneNode(view);

            if (atIndex >= 0)
                mTreeModel.Nodes.Insert(atIndex, node);
            else
                mTreeModel.Nodes.Add(node);

            AddControlNodes(node, view.Controls);
        }
Пример #8
0
 /// <summary>
 /// Adds a sceneView node to the scene hierarchy
 /// </summary>
 /// <param name="sceneView"></param>
 /// <returns></returns>
 private void AddViewNode(GUIView view)
 {
     AddViewNode(view, -1);
 }
Пример #9
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="scene"></param>
 /// <param name="view"></param>
 public AddViewCommand(GUIScene scene, GUIView view)
 {
     mScene = scene;
     mView = view;
 }
Пример #10
0
        /// <summary>
        /// Adds a new sceneView to the scene
        /// </summary>
        public void AddView()
        {
            string name = "New View ";
            int cnt = 1;
            while (mScene.GetView(name + cnt) != null)
                cnt++;

            GUIView view = new GUIView(name + cnt);
            mCommandManager.AddCommand(new AddViewCommand(mScene, view), true);

            View = view;
        }
Пример #11
0
        /// <summary>
        /// Called when a sceneView has been removed from a scene
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="sceneView"></param>
        void mScene_OnViewRemoved(object sender, GUIView view)
        {
            if (view == null)
                return;

            TreeNodeAdv node = FindNodeByTag(view, mSceneTreeView.AllNodes);
            if (node != null)
            {
                Node modelNode = node.Tag as Node;
                modelNode.Parent = null;
            }
        }
Пример #12
0
        /// <summary>
        /// Called when a sceneView has been added to the scene
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="sceneView"></param>
        void mScene_OnViewAdded(object sender, GUIView view)
        {
            if (view == null)
                return;

            GUIScene scene = sender as GUIScene;
            AddViewNode(view, scene.Views.IndexOf(view));
        }
Пример #13
0
 /// <summary>
 /// Adds a view to the scene
 /// </summary>
 /// <param name="view"></param>
 public void AddView(GUIView view)
 {
     AddView(view, -1);
 }
Пример #14
0
 /// <summary>
 /// Notifies that the active sceneView has changed
 /// </summary>
 /// <param name="control"></param>
 private void NotifyActiveViewChanged(GUIView view)
 {
     if (ActiveViewChanged != null)
         ActiveViewChanged(this, view);
 }
Пример #15
0
 /// <summary>
 /// Called when a scene's active sceneView has changed.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="sceneView"></param>
 void SceneView_ActiveViewChanged(object sender, GUIView view)
 {
     Globals.PropertiesView.PropertyGrid.SelectedObject = view;
     Globals.SceneHierarchyView.View = view;
     Globals.TimelineView.View = view;
 }
Пример #16
0
 /// <summary>
 /// Changes to a different view
 /// </summary>
 public void ChangeSelectedView(GUIView view)
 {
     if (view == null)
         mSceneTreeView.SelectedNode = null;
     else
         mSceneTreeView.SelectedNode = FindNodeByTag(view, mSceneTreeView.AllNodes);
 }
Пример #17
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="view"></param>
 /// <param name="control"></param>
 public AddControlCommand(GUIView view, GUIControl parent, GUIControl control)
 {
     mView = view;
     mParent = parent;
     Controls.Add(control);
 }
Пример #18
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="scene"></param>
 /// <param name="view"></param>
 public DeleteViewCommand(GUIScene scene, GUIView view)
 {
     mScene = scene;
     mView = view;
     mIndex = mScene.Views.IndexOf(mView);
 }