Example #1
0
        static void OnToolChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            PdfOverlay po = sender as PdfOverlay;

            po.TheModel.ToolList[(int)e.OldValue].OnDeactivate();
            po.TheModel.CurrentTool.OnActivate();
        }
Example #2
0
        static void OnParseTreeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PdfOverlay po = d as PdfOverlay;

            //           if (e.OldValue != null)
            //               (e.OldValue as Tikz_ParseTree).TextChanged -= po._parsetree_TextChanged;
            //           if (po.ParseTree != null)
            //               po.ParseTree.TextChanged += new Tikz_ParseTree.TextChangedHandler(po._parsetree_TextChanged);
            // reset current tool
            po.TheModel.CurrentTool.OnDeactivate();
            po.TheModel.CurrentTool.OnActivate();
            po.TheModel.RedrawObjects();
        }
Example #3
0
        static void OnBBChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PdfOverlay po = d as PdfOverlay;

            po.AdjustSize();
        }
Example #4
0
   /*     private void txtRadialOffset_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (rasterControl1 == null)
                return;
            int i;
            if (Int32.TryParse(txtRadialOffset.Text, out i))
                rasterControl1.RadialOffsetInt = i;

        }

        private void txtRadialSteps_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (rasterControl1 == null)
                return;
            int i;
            if (Int32.TryParse(txtRadialSteps.Text, out i))
                if (i>0 && i< 1000)
                    rasterControl1.RadialSteps = (uint)i;
        }
        */
        private void pdfOverlay1_JumpToSource(object sender, PdfOverlay.JumpToSourceEventArgs e)
        {            
            //string s = txtCode.Text.Substring();
            int spos = e.JumpToPos;
            int sellength = e.SelectionLength;

            // for nodes, try to jump directly to content (so that user can immediately start typing)
            
      /*      if (tpi is Tikz_Node)
            {
                int i = s.LastIndexOf('{');
                if (i >= 0)
                {
                    spos = spos + i;
                    sellength = 0;
                }
            } */

            if (spos > txtCode.Text.Length)
            {
                AddStatusLine("Trying to jump to position " + spos + " but document only has " + txtCode.Text.Length + " characters. Please correct any parser errors or restart TikzEdt.", true);
                return;
            }

            txtCode.SelectionLength = 0; //deselect first
            txtCode.CaretOffset = spos;
            txtCode.SelectionStart = spos;
            txtCode.SelectionLength = sellength;
            txtCode.ScrollToLine(txtCode.Document.GetLineByOffset(spos).LineNumber);
            txtCode.Focus();
                  
        }