void sceneViewController_WindowCreated(SceneViewWindow window) { MDISceneViewWindow mdiWindow = window as MDISceneViewWindow; if (mdiWindow != null) { SceneStatsDisplay licenseDisplay = new SceneStatsDisplay(displayStatsTarget); licenseDisplay.Visible = statsVisible; activeSceneStats.Add(licenseDisplay); mdiWindow.addChildContainer(licenseDisplay.LayoutContainer); mdiWindow.Disposed += (win) => { activeSceneStats.Remove(licenseDisplay); licenseDisplay.Dispose(); }; } }
public MDISceneViewWindow createWindow(String name, Vector3 translation, Vector3 lookAt, Vector3 boundMin, Vector3 boundMax, float minOrbitDistance, float maxOrbitDistance, int zIndexStart, MDISceneViewWindow previous = null, WindowAlignment alignment = WindowAlignment.Left) { OrbitCameraController orbitCamera = new OrbitCameraController(translation, lookAt, boundMin, boundMax, minOrbitDistance, maxOrbitDistance); orbitCamera.AllowRotation = AllowRotation; orbitCamera.AllowZoom = AllowZoom; orbitCamera.setUpdateTimer(mainTimer); MDISceneViewWindow window = new MDISceneViewWindow(rendererWindow, this, orbitCamera, name, background, zIndexStart); window.AutoAspectRatio = autoAspectRatio; window.AspectRatio = aspectRatio; window.BackColor = DefaultBackgroundColor; if (WindowCreated != null) { WindowCreated.Invoke(window); } if (camerasCreated) { window.createSceneView(currentScene); } //Count is 0, disable close button on first window if (mdiWindows.Count == 0) { window.AllowClose = false; } //Count is 1, enable the close button on the first window if (mdiWindows.Count == 1) { mdiWindows[0].AllowClose = true; } mdiWindows.Add(window); if (previous != null) { mdiLayout.showWindow(window._getMDIWindow(), previous._getMDIWindow(), alignment); } else { mdiLayout.showWindow(window._getMDIWindow()); } return(window); }
private void mdiLayout_ActiveWindowChanged(object sender, EventArgs e) { //Check to see if the active window is one of the SceneViewWindow's MDIWindow bool foundWindow = false; MDIWindow activeMDIWindow = mdiLayout.ActiveWindow; foreach (SceneViewWindow window in mdiWindows) { MDISceneViewWindow mdiSceneWindow = window as MDISceneViewWindow; if (mdiSceneWindow != null && mdiSceneWindow._getMDIWindow() == activeMDIWindow) { ActiveWindow = window; foundWindow = true; break; } } //If we did not find the window specified and we don't already have an active window, use the first window as the current window if (!foundWindow && activeWindow == null) { ActiveWindow = mdiWindows.FirstOrDefault(); } }
public void setActiveMdiWindow(MDISceneViewWindow mdiWindow) { mdiLayout.ActiveWindow = mdiWindow._getMDIWindow(); }