Ejemplo n.º 1
0
        // I put this into a separate function because VS messed it up too often!
        void InitializeMyComponent()
        {
            this.SuspendLayout();

              // Creating Docking Containers
              dockContainer.BringToFront();
              dockContainer.Parent = this;
              EditorManager.ApplicationLayout.DockingArea = dockContainer;

              // Create Engine Panel
              enginePanel1 = new Editor.EnginePanel(EditorManager.ApplicationLayout.DockingArea);
              enginePanel1.ShowDockable();

              // create dockable undo redo history panel
              undoHistoryPanel = new UndoHistoryPanel(EditorManager.ApplicationLayout.DockingArea);
              undoHistoryPanel.ShowDockable();

              // create dockable panel with list of all scripts
              scriptListPanel = new ScriptListPanel(EditorManager.ApplicationLayout.DockingArea);
              scriptListPanel.ShowDockable();

              // Shape Creator Panel
              shapeCreatorPanel = new ShapeCreatorPanel(EditorManager.ApplicationLayout.DockingArea);
              shapeCreatorPanel.ShowDockable();
              shapeCreatorPanel.SelectedCreatorObjectChanged += new EventHandler(shapeCreatorPanel_SelectedCreatorObjectChanged);

              // AssetBrowserPanel
              assetBrowserPanel = new AssetBrowserPanel(EditorManager.ApplicationLayout.DockingArea);
              assetBrowserPanel.ShowDockable();

              // Collection Panel
              collectionPanel = new CollectionPanel(EditorManager.ApplicationLayout.DockingArea);
              collectionPanel.ShowDockable();

              // Grid Panel
              gridPanel = new GridPanel(EditorManager.ApplicationLayout.DockingArea);
              gridPanel.ShowDockable();

              // Create Dockable Property Panel
              propertyPanel1 = new Editor.PropertyPanel(EditorManager.ApplicationLayout.DockingArea);
              propertyPanel1.ShowDockable();

              // Create Dockable ShapeTree Panel
              shapeTreePanel = new ShapeTreePanel(EditorManager.ApplicationLayout.DockingArea);
              shapeTreePanel.ShowDockable();

              // Create Shape Search Panel
              shapeSearchPanel = new ShapeSearchPanel(EditorManager.ApplicationLayout.DockingArea);
              shapeSearchPanel.ShowDockable();

              shapeDuplicatesPanel = new FindDuplicatesPanel(EditorManager.ApplicationLayout.DockingArea);
              shapeDuplicatesPanel.ShowDockable();

              visibilityResultPanel = new VisibilityResultPanel(EditorManager.ApplicationLayout.DockingArea);
              visibilityResultPanel.ShowDockable();

              actionRecorderPanel = new ActionRecorderPanel(EditorManager.ApplicationLayout.DockingArea);
              actionRecorderPanel.ShowDockable();

              // Script Panel
              ScriptPanel scriptPanel = new VisionScriptPanel(EditorManager.ApplicationLayout.DockingArea);
              scriptPanel.ShowDockable();
              ScriptPanel.Instance = scriptPanel;

              // Component Panel
              ConfigureShapeComponentsPanel.PanelInstance.ShowDockable();

              try
              {
            resourceViewerPanel = new ResourceViewerPanel(EditorManager.ApplicationLayout.DockingArea);
            resourceViewerPanel.ShowDockable();
            EditorManager.EngineManager.LogWindow = resourceViewerPanel;
            vResourceViewer.Classes.ResourceInfo.OnSelectedResourceChanged += new EventHandler(ResourceInfo_OnSelectedResourceChanged);
            vResourceViewerBase80.Controls.MasterPanel.OnAutomatedResourcePreview += new EventHandler(ResourceInfo_OnAutomatedResourcePreview);
            resourceViewerPanel.VisibleChanged += new EventHandler(resourceViewerPanel_VisibleChanged);
              }
              catch (Exception ex)
              {
            EditorManager.DumpException(ex);
              }

              this.ResumeLayout(true);

              // set the references in the EditorManager
              EditorManager.GUI.MainMenu = this.mainMenu;
              EditorManager.GUI.MainToolBar = this.mainToolBar;
              EditorManager.GUI.EnginePanelToolBar = this.enginePanel1.Toolbar;

              // Create the MRU lists
              mruList_RecentProjects = new MRUList(RecentProjects);
              mruList_RecentProjects.MRUEvent += new MRUListEventHandler(this.Menu_File_Recent_Project_Click);
              mruList_RecentProjects.LoadFromRegistry(@"Software\Havok\VisionSDK\vEngineEditor\RecentProjects");

              mruList_RecentScenes = new MRUList(RecentScenes);
              mruList_RecentScenes.MRUEvent += new MRUListEventHandler(this.Menu_File_Recent_Scene_Click);
              mruList_RecentScenes.LoadFromRegistry(@"Software\Havok\VisionSDK\vEngineEditor\RecentScenes");

              // Check for a tablet
              CSharpFramework.Contexts.WintabTabletContext tablet = new CSharpFramework.Contexts.WintabTabletContext();
              if (tablet.IsAvailable && tablet.IsActive)
            EditorManager.Tablet = tablet;
              else
            EditorManager.Tablet = new NullTabletContext();

              // default lighting tool
              VLux.VLuxLightingTool vLuxTool = new VLux.VLuxLightingTool();
              EditorManager.SupportedLightingTools.Add(vLuxTool);
        }