Exemplo n.º 1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="entry"></param>
 public ProjectEntryActionEventArgs(GUIProjectEntry entry)
 {
     mEntry = entry;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Opens an existing entry
 /// </summary>
 /// <param name="entry"></param>
 public void OpenEntry(GUIProjectEntry entry)
 {
     if (entry != null)
     {
         if (entry.Open())
         {
             NotifyOpenEntry(entry);
         }
         else
         {
             MessageBox.Show("Failed to load " + entry.Filename + ".", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Closes the entry
        /// </summary>
        /// <param name="entry"></param>
        private bool CloseEntry(GUIProjectEntry entry)
        {
            if (entry == null || NotifyClosingEntry(entry))
                return false;

            if (entry.Close())
                NotifyCloseEntry(entry);

            return true;
        }
Exemplo n.º 4
0
 /// <summary>
 /// Notifies when an entry has been opened
 /// </summary>
 /// <param name="entry"></param>
 private void NotifyCloseEntry(GUIProjectEntry entry)
 {
     if (OnCloseEntry != null)
         OnCloseEntry(this, entry);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Notifies when the user has chosen to export an entry
 /// </summary>
 /// <param name="entry"></param>
 private void NotifyExportEntry(GUIProjectEntry entry)
 {
     if (OnExportEntry != null)
         OnExportEntry(this, entry);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Notifies when an entry has been opened
 /// </summary>
 /// <param name="entry"></param>
 private void NotifyOpenEntry(GUIProjectEntry entry)
 {
     if (OnOpenEntry != null)
         OnOpenEntry(this, entry);
 }
Exemplo n.º 7
0
        /// <summary>
        /// Notifies that we are about to close an entry
        /// </summary>
        /// <param name="entry"></param>
        private bool NotifyClosingEntry(GUIProjectEntry entry)
        {
            if (OnClosingEntry != null)
            {
                ProjectEntryActionEventArgs args = new ProjectEntryActionEventArgs(entry);
                OnClosingEntry(this, args);

                return args.CancelAction;
            }

            return false;
        }
Exemplo n.º 8
0
 /// <summary>
 /// Notifies when an entry has been renamed
 /// </summary>
 /// <param name="entry"></param>
 private void NotifyRenameEntry(GUIProjectEntry entry)
 {
     if (OnRenameEntry != null)
         OnRenameEntry(this, entry);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Notifies when an entry has been opened
 /// </summary>
 /// <param name="entry"></param>
 private void NotifySelectEntry(GUIProjectEntry entry)
 {
     if (OnSelectEntry != null)
         OnSelectEntry(this, entry);
 }
Exemplo n.º 10
0
 /// <summary>
 /// Called when an entry has been closed
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="entry"></param>
 void ProjectView_OnCloseEntry(object sender, GUIProjectEntry entry)
 {
 }
Exemplo n.º 11
0
 /// <summary>
 /// Exports an entry
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="entry"></param>
 void ProjectView_OnExportEntry(object sender, GUIProjectEntry entry)
 {
     GUIProjectScene projectScene = entry as GUIProjectScene;
     if (projectScene != null)
     {
         if(projectScene.Open())
             ExportScene(projectScene);
     }
 }
Exemplo n.º 12
0
 /// <summary>
 /// Opens a scene for editing.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="scene"></param>
 void ProjectView_OnOpenEntry(object sender, GUIProjectEntry entry)
 {
     OpenEntry(entry);
 }
Exemplo n.º 13
0
        /// <summary>
        /// Called when an entry has been renamed
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="entry"></param>
        void ProjectView_OnRenameEntry(object sender, GUIProjectEntry entry)
        {
            GUIProjectScene sceneEntry = entry as GUIProjectScene;
            if(sceneEntry == null)
                return;

            foreach (SceneView view in mDockPanel.Documents)
            {
                if (view.Scene == sceneEntry.Scene)
                {
                    view.TabText = sceneEntry.Name;
                }
            }
        }
Exemplo n.º 14
0
 /// <summary>
 /// Called when an entry has been deleted
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="entry"></param>
 void ProjectView_OnDeleteEntry(object sender, GUIProjectEntry entry)
 {
 }
Exemplo n.º 15
0
        /// <summary>
        /// Called when an entry has been created
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="entry"></param>
        void ProjectView_OnCreateEntry(object sender, GUIProjectEntry entry)
        {
            GUIProjectScene sceneEntry = entry as GUIProjectScene;
            if (sceneEntry == null)
                return;

            if (sceneEntry.Open())
            {
                sceneEntry.Scene.AddView(new GUIView("Default View"));
            }
        }
Exemplo n.º 16
0
        /// <summary>
        /// Opens a scene for editing
        /// </summary>
        /// <param name="scene"></param>
        private void OpenEntry(GUIProjectEntry entry)
        {
            GUIProjectScene projectScene = entry as GUIProjectScene;
            SceneView sceneView = null;

            // Check to see if the document is already open, and focus
            // on it if so.
            foreach (DockContent doc in mDockPanel.Documents)
            {
                SceneView view = doc as SceneView;
                if (view != null && view.Scene == projectScene.Scene)
                {
                    doc.Show();
                    return;
                }
            }

            // We don't have a sceneview for this scene, create and 
            // add it now.
            if (sceneView == null)
            {
                LoadResources(projectScene);

                sceneView = new SceneView(projectScene.Scene);
                sceneView.TabText = projectScene.Name;

                sceneView.SelectedControlsChanged += new SceneView.ControlsEventHandler(SceneView_ControlsSelectionChanged);
                sceneView.ActiveViewChanged += new SceneView.ViewEventHandler(SceneView_ActiveViewChanged);
                sceneView.GUIControlUpdated += new SceneView.ControlEventHandler(SceneView_ControlUpdated);
                sceneView.Enter += new EventHandler(SceneView_Enter);
                sceneView.FormClosing += new FormClosingEventHandler(SceneView_FormClosing);
                sceneView.FormClosed += new FormClosedEventHandler(SceneView_FormClosed);
                
                sceneView.Show(mDockPanel, DockState.Document);
            }
        }