public static void AssignDockWindowIntoDefaultPosition() { CheckDockWindowClosed(); if (DockViewerController == null) { DockViewerController = new DockViewerController(); } if (DockViewPoint == null) { DockViewPoint = new DockViewPoint(); } if (DockRecorder == null) { DockRecorder = new DockRecorder(); } if (DockNodeTreeView == null) { DockNodeTreeView = new DockNodeTreeView(); } if (DockNodeCommonValues == null) { DockNodeCommonValues = new GUI.DockNodeCommonValues(); } if (DockNodeLocationValues == null) { DockNodeLocationValues = new GUI.DockNodeLocationValues(); } if (DockNodeRotationValues == null) { DockNodeRotationValues = new GUI.DockNodeRotationValues(); } if (DockNodeScalingValues == null) { DockNodeScalingValues = new GUI.DockNodeScaleValues(); } if (DockNodeLocationAbsValues == null) { DockNodeLocationAbsValues = new GUI.DockNodeLocationAbsValues(); } if (DockNodeGenerationLocationValues == null) { DockNodeGenerationLocationValues = new DockNodeGenerationLocationValues(); } if (DockNodeRendererCommonValues == null) { DockNodeRendererCommonValues = new DockNodeRendererCommonValues(); } if (DockNodeDrawingValues == null) { DockNodeDrawingValues = new GUI.DockNodeRendererValues(); } if (DockNodeSoundValues == null) { DockNodeSoundValues = new GUI.DockNodeSoundValues(); } if (DockOption == null) { DockOption = new GUI.DockOption(); } if (DockEffectBehavior == null) { DockEffectBehavior = new DockEffectBehavior(); } if (DockFCurves == null) { DockFCurves = new GUI.DockFCurves(); } if (DockCulling == null) { DockCulling = new DockCulling(); } if (DockNetwork == null) { DockNetwork = new GUI.DockNetwork(); } var rec = Screen.PrimaryScreen.Bounds; int _width = rec.Width; if (_width <= 1024) { MainForm.Panel.SuspendLayout(true); MainForm.Panel.DockRightPortion = 0.5f; MainForm.Panel.DockBottomPortion = 0.2f; DockViewer.Show(MainForm.Panel, DockState.Document); DockViewerController.Show(MainForm.Panel, DockState.DockBottom); DockNodeTreeView.Show(MainForm.Panel, DockState.DockRight); DockNodeLocationValues.Show(DockNodeTreeView.Pane, DockAlignment.Right, 0.65); DockNodeDrawingValues.Show(MainForm.Panel); DockNodeDrawingValues.DockTo(DockNodeLocationValues.Pane, DockStyle.Right, 0); DockNodeRotationValues.Show(MainForm.Panel); DockNodeRotationValues.DockTo(DockNodeLocationValues.Pane, DockStyle.Bottom, 0); DockNodeScalingValues.Show(MainForm.Panel); DockNodeScalingValues.DockTo(DockNodeRotationValues.Pane, DockStyle.Bottom, 0); DockNodeCommonValues.Show(DockNodeTreeView.Pane, DockAlignment.Bottom, 0.75); DockNodeRendererCommonValues.Show(MainForm.Panel); DockNodeRendererCommonValues.DockTo(DockNodeDrawingValues.Pane, DockStyle.Fill, 1); DockNodeSoundValues.Show(MainForm.Panel); DockNodeSoundValues.DockTo(DockNodeDrawingValues.Pane, DockStyle.Fill, 1); MainForm.Panel.ResumeLayout(true, true); } else if (_width <= 1600) { MainForm.Panel.SuspendLayout(true); MainForm.Panel.DockRightPortion = 0.5f; MainForm.Panel.DockBottomPortion = 0.2f; DockViewer.Show(MainForm.Panel, DockState.Document); DockViewerController.Show(MainForm.Panel, DockState.DockBottom); DockNodeTreeView.Show(MainForm.Panel, DockState.DockRight); DockNodeLocationValues.Show(DockNodeTreeView.Pane, DockAlignment.Right, 0.65); DockNodeDrawingValues.Show(MainForm.Panel); DockNodeDrawingValues.DockTo(DockNodeLocationValues.Pane, DockStyle.Right, 0); DockNodeRotationValues.Show(MainForm.Panel); DockNodeRotationValues.DockTo(DockNodeLocationValues.Pane, DockStyle.Bottom, 0); DockNodeScalingValues.Show(MainForm.Panel); DockNodeScalingValues.DockTo(DockNodeRotationValues.Pane, DockStyle.Bottom, 0); DockNodeCommonValues.Show(DockNodeTreeView.Pane, DockAlignment.Bottom, 0.75); DockNodeRendererCommonValues.Show(MainForm.Panel); DockNodeRendererCommonValues.DockTo(DockNodeDrawingValues.Pane, DockStyle.Fill, 1); DockNodeSoundValues.Show(MainForm.Panel); DockNodeSoundValues.DockTo(DockNodeDrawingValues.Pane, DockStyle.Fill, 1); MainForm.Panel.ResumeLayout(true, true); } else { MainForm.Panel.SuspendLayout(true); MainForm.Panel.DockRightPortion = 0.5f; MainForm.Panel.DockBottomPortion = 0.15f; DockViewer.Show(MainForm.Panel, DockState.Document); DockViewerController.Show(MainForm.Panel, DockState.DockBottom); DockNodeTreeView.Show(MainForm.Panel, DockState.DockRight); DockNodeLocationValues.Show(DockNodeTreeView.Pane, DockAlignment.Right, 0.65); DockNodeDrawingValues.Show(MainForm.Panel); DockNodeDrawingValues.DockTo(DockNodeLocationValues.Pane, DockStyle.Right, 0); DockNodeRotationValues.Show(MainForm.Panel); DockNodeRotationValues.DockTo(DockNodeLocationValues.Pane, DockStyle.Bottom, 0); DockNodeScalingValues.Show(MainForm.Panel); DockNodeScalingValues.DockTo(DockNodeRotationValues.Pane, DockStyle.Bottom, 0); DockNodeCommonValues.Show(DockNodeTreeView.Pane, DockAlignment.Bottom, 0.75); DockNodeRendererCommonValues.Show(MainForm.Panel); DockNodeRendererCommonValues.DockTo(DockNodeDrawingValues.Pane, DockStyle.Fill, 1); DockNodeSoundValues.Show(MainForm.Panel); DockNodeSoundValues.DockTo(DockNodeDrawingValues.Pane, DockStyle.Fill, 1); MainForm.Panel.ResumeLayout(true, true); } }
internal static void LoadConfig() { if (System.IO.File.Exists(configGuiPath) && System.IO.File.Exists(configGuiPanelPath)) { // 設定ファイルが存在 { System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.Load(configGuiPath); int x = doc["GUI"].GetTextAsInt("X"); int y = doc["GUI"].GetTextAsInt("Y"); int width = doc["GUI"].GetTextAsInt("Width"); int height = doc["GUI"].GetTextAsInt("Height"); MainForm.Location = new System.Drawing.Point(x, y); MainForm.Width = width; MainForm.Height = height; } { Func <string, WeifenLuo.WinFormsUI.Docking.IDockContent> get_dock = (s) => { if (DockViewer.GetType().FullName == s) { return(DockViewer); } if (DockViewerController.GetType().FullName == s) { return(DockViewerController); } if (DockNodeTreeView.GetType().FullName == s) { return(DockNodeTreeView); } if (DockViewPoint.GetType().FullName == s) { return(DockViewPoint); } if (DockRecorder.GetType().FullName == s) { return(DockRecorder); } if (DockNodeCommonValues.GetType().FullName == s) { return(DockNodeCommonValues); } if (DockNodeLocationValues.GetType().FullName == s) { return(DockNodeLocationValues); } if (DockNodeRotationValues.GetType().FullName == s) { return(DockNodeRotationValues); } if (DockNodeScalingValues.GetType().FullName == s) { return(DockNodeScalingValues); } if (DockNodeLocationAbsValues.GetType().FullName == s) { return(DockNodeLocationAbsValues); } if (DockNodeGenerationLocationValues.GetType().FullName == s) { return(DockNodeGenerationLocationValues); } if (DockNodeRendererCommonValues.GetType().FullName == s) { return(DockNodeRendererCommonValues); } if (DockNodeDrawingValues.GetType().FullName == s) { return(DockNodeDrawingValues); } if (DockNodeSoundValues.GetType().FullName == s) { return(DockNodeSoundValues); } if (DockOption.GetType().FullName == s) { return(DockOption); } if (DockCulling.GetType().FullName == s) { return(DockCulling); } if (DockEffectBehavior.GetType().FullName == s) { return(DockEffectBehavior); } if (DockFCurves.GetType().FullName == s) { return(DockFCurves); } if (DockNetwork.GetType().FullName == s) { return(DockNetwork); } return(null); }; var deserializeDockContent = new WeifenLuo.WinFormsUI.Docking.DeserializeDockContent(get_dock); MainForm.Panel.LoadFromXml(configGuiPanelPath, deserializeDockContent); } } else { // 設定ファイルが存在しない AssignDefaultPosition(); } Network.Load(ConfigNetworkFileName); }
public static void CloseDockWindow() { if (DockViewerController != null) { DockViewerController.Close(); } if (DockViewPoint != null) { DockViewPoint.Close(); } if (DockRecorder != null) { DockRecorder.Close(); } if (DockNodeTreeView != null) { DockNodeTreeView.Close(); } if (DockNodeCommonValues != null) { DockNodeCommonValues.Close(); } if (DockNodeLocationValues != null) { DockNodeLocationValues.Close(); } if (DockNodeRotationValues != null) { DockNodeRotationValues.Close(); } if (DockNodeScalingValues != null) { DockNodeScalingValues.Close(); } if (DockNodeLocationAbsValues != null) { DockNodeLocationAbsValues.Close(); } if (DockNodeGenerationLocationValues != null) { DockNodeGenerationLocationValues.Close(); } if (DockNodeRendererCommonValues != null) { DockNodeRendererCommonValues.Close(); } if (DockNodeDrawingValues != null) { DockNodeDrawingValues.Close(); } if (DockNodeSoundValues != null) { DockNodeSoundValues.Close(); } if (DockOption != null) { DockOption.Close(); } if (DockEffectBehavior != null) { DockEffectBehavior.Close(); } if (DockFCurves != null) { DockFCurves.Close(); } if (DockCulling != null) { DockCulling.Close(); } if (DockNetwork != null) { DockNetwork.Close(); } DockViewerController = null; DockViewPoint = null; DockRecorder = null; DockNodeTreeView = null; DockNodeCommonValues = null; DockNodeLocationValues = null; DockNodeRotationValues = null; DockNodeScalingValues = null; DockNodeLocationAbsValues = null; DockNodeGenerationLocationValues = null; DockNodeRendererCommonValues = null; DockNodeDrawingValues = null; DockNodeSoundValues = null; DockOption = null; DockEffectBehavior = null; DockFCurves = null; DockCulling = null; DockNetwork = null; }