private void Form_Marks_Load(object sender, EventArgs e) { var xml = new XMLProfileSettings(); numericUpDownStandardNudge.Value = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/StandardNudge", Name), 10); numericUpDownSuperNudge.Value = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/SuperNudge", Name), 20); //xml = null; }
private void RestoreWindowState() { WindowState = FormWindowState.Normal; StartPosition = FormStartPosition.WindowsDefaultBounds; XMLProfileSettings xml = new XMLProfileSettings(); var desktopBounds = new Rectangle( new Point( xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowLocationX", Name), Location.X), xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowLocationY", Name), Location.Y)), new Size( xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowWidth", Name), Size.Width), xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowHeight", Name), Size.Height))); if (desktopBounds.Width < 300) { if (gdiControl.Background != null && gdiControl.Background.Width > 300) { desktopBounds.Width = gdiControl.Background.Width; } else { desktopBounds.Width = 400; } } if (desktopBounds.Height < 200) { if (gdiControl.Background != null && gdiControl.Background.Height > 200) { desktopBounds.Height = gdiControl.Background.Height; } else { desktopBounds.Height = 300; } } if (IsVisibleOnAnyScreen(desktopBounds)) { StartPosition = FormStartPosition.Manual; DesktopBounds = desktopBounds; if (xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowState", Name), "Normal").Equals("Maximized")) { WindowState = FormWindowState.Maximized; } } else { // this resets the upper left corner of the window to windows standards StartPosition = FormStartPosition.WindowsDefaultLocation; // we can still apply the saved size Size = new Size(desktopBounds.Width, desktopBounds.Height); } }
private void Form_Marks_Load(object sender, EventArgs e) { var xml = new XMLProfileSettings(); numericUpDownStandardNudge.Value = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/StandardNudge", Name), 10); numericUpDownSuperNudge.Value = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/SuperNudge", Name), 20); toolStripMenuItemNudgeSettings.Checked = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/NudgeSettings", Name), false); //xml = null; panel1.Visible = toolStripMenuItemNudgeSettings.Checked; ResizeColumnHeaders(); }
private void ExportForm_Load(object sender, EventArgs e) { outputFormatComboBox.Items.Clear(); outputFormatComboBox.Items.AddRange(_exportOps.FormatTypes); outputFormatComboBox.Sorted = true; outputFormatComboBox.SelectedIndex = _profile.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ExportFormat", Name), exportTypeDefault); resolutionComboBox.SelectedIndex = _profile.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ExportResolution", Name), exportResolutionDefault); buttonStop.Enabled = false; UpdateNetworkList(); networkListView.DragDrop += networkListView_DragDrop; networkListView.ItemChecked += NetworkListView_ItemChecked; }
private void CreateCamera() { XMLProfileSettings xml = new XMLProfileSettings(); var name = $"OpenGLPreview_{InstanceId}"; // create our camera _camera = new Camera(new Vector3((_background.HasBackground ? _background.Width:ClientSize.Width) / 2f, (_background.HasBackground ? _background.Height:ClientSize.Height) / 2f, _focalDepth), Quaternion.Identity); _camera.SetDirection(new Vector3(0, 0, -1)); //_camera.Position = new Vector3(_camera.Position.X, _camera.Position.Y, xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/CameraPositionZ", Name),_camera.Position.Z)); _camera.Position = new Vector3( xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/CameraPositionX", name), _camera.Position.X), xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/CameraPositionY", name), _camera.Position.Y), xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/CameraPositionZ", name), _camera.Position.Z)); UpdateStatusDistance(_camera.Position.Z); }
public Form_CurveLibrary(TimelineControl timelineControl) { InitializeComponent(); TimelineControl = timelineControl; Icon = Resources.Icon_Vixen3; ThemeUpdateControls.UpdateControls(this); toolStripCurves.Renderer = new ThemeToolStripRenderer(); int iconSize = (int)(16 * ScalingTools.GetScaleFactor()); toolStripCurves.ImageScalingSize = new Size(iconSize, iconSize); toolStripButtonEditCurve.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonEditCurve.Image = Tools.GetIcon(Resources.configuration, iconSize); toolStripButtonNewCurve.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonNewCurve.Image = Tools.GetIcon(Resources.addItem, iconSize); toolStripButtonDeleteCurve.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonDeleteCurve.Image = Tools.GetIcon(Resources.delete_32, iconSize); toolStripButtonExportCurves.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonExportCurves.Image = Tools.GetIcon(Resources.folder_go, iconSize); toolStripButtonImportCurves.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonImportCurves.Image = Tools.GetIcon(Resources.folder_open, iconSize); listViewCurves.AllowDrop = true; var xml = new XMLProfileSettings(); _curveLibraryImageScale = Convert.ToDouble(xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/CurveLibraryImageScale", Name), "1"), CultureInfo.InvariantCulture); _curveLibraryTextScale = Convert.ToDouble(xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/CurveLibraryTextScale", Name), "1"), CultureInfo.InvariantCulture); if (_curveLibraryImageScale < 0.1) { _curveLibraryImageScale = 0.1; } if (_curveLibraryTextScale < 0.2) { _curveLibraryTextScale = 0.2; } ImageSetup(); ForeColor = ThemeColorTable.ForeColor; BackColor = ThemeColorTable.BackgroundColor; ThemeUpdateControls.UpdateControls(this); //Over-ride the auto theme listview back color listViewCurves.BackColor = ThemeColorTable.BackgroundColor; listViewCurves.Alignment = ListViewAlignment.Top; _curveLibrary = ApplicationServices.Get <IAppModuleInstance>(CurveLibraryDescriptor.ModuleID) as CurveLibrary; }
private void ExportForm_Load(object sender, EventArgs e) { outputFormatComboBox.Items.Clear(); outputFormatComboBox.Items.AddRange(_exportOps.FormatTypes); outputFormatComboBox.Sorted = true; outputFormatComboBox.SelectedIndex = _profile.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ExportFormat", Name), exportTypeDefault); resolutionComboBox.SelectedIndex = _profile.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ExportResolution", Name), exportResolutionDefault); chkGenerateControllerInfo.Checked = _profile.GetSetting(XMLProfileSettings.SettingType.AppSettings, $"{Name}/GenerateUniverse", false); radio2x.Checked = _profile.GetSetting(XMLProfileSettings.SettingType.AppSettings, $"{Name}/Universe2x", true); radio1x.Checked = !radio2x.Checked; chkCompress.Checked = _profile.GetSetting(XMLProfileSettings.SettingType.AppSettings, $"{Name}/Compress", true); chkCompress.Enabled = _exportOps.CanCompress(outputFormatComboBox.SelectedItem.ToString()); buttonStop.Enabled = false; UpdateNetworkList(); networkListView.DragDrop += networkListView_DragDrop; networkListView.ItemChecked += NetworkListView_ItemChecked; }
public Form_ColorLibrary(TimelineControl timelineControl) { InitializeComponent(); TimelineControl = timelineControl; Icon = Resources.Icon_Vixen3; toolStripColors.Renderer = new ThemeToolStripRenderer(); int iconSize = (int)(16 * ScalingTools.GetScaleFactor()); toolStripColors.ImageScalingSize = new Size(iconSize, iconSize); toolStripButtonEditColor.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonEditColor.Image = Tools.GetIcon(Resources.configuration, iconSize); toolStripButtonNewColor.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonNewColor.Image = Tools.GetIcon(Resources.addItem, iconSize); toolStripButtonDeleteColor.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonDeleteColor.Image = Tools.GetIcon(Resources.delete_32, iconSize); toolStripButtonExportColors.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonExportColors.Image = Tools.GetIcon(Resources.folder_go, iconSize); toolStripButtonImportColors.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonImportColors.Image = Tools.GetIcon(Resources.folder_open, iconSize); listViewColors.AllowDrop = true; var xml = new XMLProfileSettings(); _colorLibraryScale = Convert.ToDouble(xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ColorLibraryScale", Name), "1"), CultureInfo.InvariantCulture); ImageSetup(); ThemeUpdateControls.UpdateControls(this); //Over-ride the auto theme listview back color listViewColors.BackColor = ThemeColorTable.BackgroundColor; listViewColors.Alignment = ListViewAlignment.Top; _colorFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Vixen", "ColorPalette.xml"); if (File.Exists(_colorFilePath)) { Load_ColorPaletteFile(); } }
private void RestoreWindowState() { WindowState = FormWindowState.Normal; StartPosition = FormStartPosition.WindowsDefaultBounds; XMLProfileSettings xml = new XMLProfileSettings(); var name = $"Preview_{InstanceId}"; _showStatus = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ShowStatus", name), true); _showBorders = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ShowBorders", name), true); _alwaysOnTop = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/AlwaysOnTop", name), false); _lockPosition = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/LockPosition", name), false); ZoomLevel = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ZoomLevel", name), 1d); IsOnTopWhenPlaying = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/OnTopWhenActive", name), false); ConfigureStatusBar(); ConfigureBorders(); ConfigureAlwaysOnTop(); var desktopBounds = new Rectangle( new Point( xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowLocationX", name), Location.X), xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowLocationY", name), Location.Y)), new Size( xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowWidth", name), 0), xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowHeight", name), 0))); if (desktopBounds.Width < 20) { if (gdiControl.Background != null && gdiControl.Background.Width > 20) { desktopBounds.Width = gdiControl.Background.Width + Width - ClientSize.Width; } else { desktopBounds.Width = 400; } } if (desktopBounds.Height < 10) { if (gdiControl.Background != null && gdiControl.Background.Height > 10) { desktopBounds.Height = gdiControl.Background.Height + Height - ClientSize.Height + (statusStrip.Visible?statusStrip.Height:0); } else { desktopBounds.Height = 300; } } var windowState = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowState", name), "Normal"); if (windowState.Equals("Maximized") && IsVisibleOnAnyScreen(desktopBounds)) { StartPosition = FormStartPosition.Manual; DesktopLocation = desktopBounds.Location; WindowState = FormWindowState.Maximized; } else if (AreCornersVisibleOnAnyScreen(desktopBounds)) { StartPosition = FormStartPosition.Manual; DesktopBounds = desktopBounds; } else { // this resets the upper left corner of the window to windows standards StartPosition = FormStartPosition.WindowsDefaultLocation; // we can still apply the saved size Size = new Size(desktopBounds.Width, desktopBounds.Height); } }
private void RestoreWindowState() { WindowState = FormWindowState.Normal; StartPosition = FormStartPosition.WindowsDefaultBounds; XMLProfileSettings xml = new XMLProfileSettings(); var name = $"OpenGLPreview_{InstanceId}"; _showStatus = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ShowStatus", name), true); _alwaysOnTop = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/AlwaysOnTop", name), false); _enableLightScaling = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/EnableLightScaling", name), true); IsOnTopWhenPlaying = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/OnTopWhenActive", name), false); ConfigureStatusBar(); ConfigureAlwaysOnTop(); var desktopBounds = new Rectangle( new Point( xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowLocationX", name), Location.X), xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowLocationY", name), Location.Y)), new Size(100, 100)); if (IsVisibleOnAnyScreen(desktopBounds)) { StartPosition = FormStartPosition.Manual; DesktopLocation = desktopBounds.Location; //if ( // xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowState", Name), "Normal") // .Equals("Maximized")) //{ // WindowState = FormWindowState.Maximized; //} } else { // this resets the upper left corner of the window to windows standards StartPosition = FormStartPosition.WindowsDefaultLocation; } var cHeight = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ClientHeight", name), _background.HasBackground ? _background.Height : 0); var cWidth = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ClientWidth", name), _background.HasBackground ? _background.Width : 0); if (cHeight == 0 && cWidth == 0) { var size = FindMaxPreviewSize(); if (size.Height > 50 && size.Width > 50) { cHeight = size.Height; cWidth = size.Width; } else { cHeight = _height; cWidth = _width; } } ClientSize = new Size(cWidth, cHeight); _width = cWidth; _height = cHeight; }