void ScreenAnnotateMode() { if (annotationForm == null) { // save owner reference prevOwner = Owner; // hide this toolbar and the mainform Hide(); Application.DoEvents(); System.Threading.Thread.Sleep(250); // create the annotation form (this takes a screen grab) annotationForm = new AnnotationForm(); annotationForm.Dap = tsEngineState.Dap; annotationForm.Show(); // set the owner to the annotation form Owner = annotationForm; // show this toolbar Show(); // show annotation tools tsAnnotate.Visible = true; // show DEngine state tools tsEngineState.Mode = FigureToolStripMode.DEngineState; tsEngineState.De = annotationForm.De; tsPropState.Visible = true; tsPropState.Dap = tsEngineState.Dap; tsPropState.De = annotationForm.De; tsPropState.Dv = annotationForm.Dv; // personal toolbar tsPersonal.Visible = true; System.Diagnostics.Debug.Assert(MainForm is MainForm, "ERROR: mainForm is not of type MainForm"); PtUtils.LoadPersonalToolsFromSource(tsPersonal, PtUtils.CreatePersonalToolsSource(((MainForm)MainForm).PersonalToolStrip)); tsPersonal.De = annotationForm.De; } }
void CloseAnnotationForm() { Show(); if (annotationForm != null) { annotationForm.Close(); annotationForm = null; } }
bool MouseMode() { if (annotationForm != null) { // ask if user wants to cancel if (!HaveImportedAnnotations && annotationForm.De.UndoRedo.CanUndo) { if (MessageBox.Show(WbLocale.NoAnnotationsImportedMsg, WbLocale.NoAnnotationsImported, MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) return false; } HaveImportedAnnotations = false; // set ownwer back to the mainform Owner = prevOwner; // close the annotation form annotationForm.Close(); annotationForm = null; } // hide annotation tools tsAnnotate.Visible = false; // hide state tools tsEngineState.Mode = FigureToolStripMode.FigureClassSelect; tsPropState.Visible = false; // personal toolbar tsPersonal.Visible = false; if (MainForm != null) { System.Diagnostics.Debug.Assert(MainForm is MainForm, "ERROR: mainForm is not of type MainForm"); PtUtils.LoadPersonalToolsFromSource(((MainForm)MainForm).PersonalToolStrip, PtUtils.CreatePersonalToolsSource(tsPersonal)); } return true; }
void ShowAnnotationForm() { // hide this form Hide(); Application.DoEvents(); System.Threading.Thread.Sleep(500); // create the annotation form (this takes a screen grab) annotationForm = new AnnotationForm(); annotationForm.Show(); annotationForm.KeyPreview = true; annotationForm.KeyDown += new KeyEventHandler(annotationForm_KeyDown); }