private void VixenPreviewSetup3_Load(object sender, EventArgs e) { previewForm = new VixenPreviewSetupDocument(); if (!DesignMode && previewForm != null) { previewForm.Preview.Data = _data; } previewForm.Preview.OnSelectDisplayItem += OnSelectDisplayItem; previewForm.Preview.OnDeSelectDisplayItem += OnDeSelectDisplayItem; previewForm.Preview.OnSelectionChanged += Preview_OnSelectionChanged; previewForm.Preview.OnChangeZoomLevel += VixenPreviewSetup3_ChangeZoomLevel; PreviewItemsAlignNew += vixenpreviewControl_PreviewItemsAlignNew; elementsForm = new VixenPreviewSetupElementsDocument(previewForm.Preview); propertiesForm = new VixenPreviewSetupPropertiesDocument(previewForm.Preview); previewForm.Show(dockPanel, WeifenLuo.WinFormsUI.Docking.DockState.Document); elementsForm.Show(dockPanel, WeifenLuo.WinFormsUI.Docking.DockState.DockLeft); propertiesForm.Show(elementsForm.Pane, WeifenLuo.WinFormsUI.Docking.DockAlignment.Bottom, 0.5); previewForm.Preview.elementsForm = elementsForm; previewForm.Preview.propertiesForm = propertiesForm; previewForm.Preview.LoadBackground(); trackBarBackgroundAlpha.Value = Data.BackgroundAlpha; previewForm.Preview.Reload(); Setup(); useOpenGLPreviewToolStripMenuItem.Checked = Data.UseOpenGL; useOpenGLPreviewToolStripMenuItem.Enabled = VixenPreviewModuleInstance.SupportsOpenGLPreview(); saveLocationsToolStripMenuItem.Checked = Data.SaveLocations; // Choose the select tool to start toolbarButton_Click(buttonSelect, new EventArgs()); SetZoomTextAndTracker(previewForm.Preview.ZoomLevel); InitUndo(); VerifyPreviewShapeLocations(); }
private void useOpenGLPreviewToolStripMenuItem_Click(object sender, EventArgs e) { if (useOpenGLPreviewToolStripMenuItem.Checked) { if (VixenPreviewModuleInstance.SupportsOpenGLPreview()) { Data.UseOpenGL = true; } else { Data.UseOpenGL = false; useOpenGLPreviewToolStripMenuItem.Checked = false; var messageBox = new MessageBoxForm("Open GL Preview is not supported on your hardware. Reverting to the GDI preview.", "Change Preview Viewer", MessageBoxButtons.OK, SystemIcons.Error); messageBox.ShowDialog(); } } else { Data.UseOpenGL = false; } }