protected bool ContinueWithBigImage(Point p) { bool contin = true; if (p.X < -100 || p.X > 100 || p.Y < -100 || p.Y > 100) { if (MessageBoxResult.Cancel == GlobalUI.ShowMessageBox("Warning! Image seems to be very big. TikzEdt might not be able to handle this.", "Image very big", MessageBoxButton.OKCancel, MessageBoxImage.Warning)) { contin = false; } } return(contin); }
protected bool EnsureParseTreeExists() { // Try to create a new ParseTree if (overlay.ParseTree == null) { // TODO return(false); //TryCreateNew(this, out lret); if (overlay.AllowEditing) { // create a new parsetree Tikz_ParseTree t = new Tikz_ParseTree(); Tikz_Picture tp = new Tikz_Picture(); tp.starttag = "\\begin{tikzpicture}"; tp.AddChild(new Tikz_Something("\r\n")); tp.endtag = "\\end{tikzpicture}"; overlay.BeginUpdate(); // overlay.ParseTree = t; t.AddChild(tp); tp.UpdateText(); overlay.EndUpdate(); return(true); } else { GlobalUI.ShowMessageBox("Parse tree could not be created. Please correct all parser errors in the code and try again.", "Function not available", MessageBoxButton.OK, MessageBoxImage.Exclamation); return(false); } } else { return(true); } }