Beispiel #1
0
        private void Editor_UpdateUI(object sender, ScintillaNET.UpdateUIEventArgs e)
        {
            ScintillaNET.Scintilla Editor = sender as ScintillaNET.Scintilla;

            if ((e.Change & ScintillaNET.UpdateChange.Selection) > 0)
            {
                if (editorToolTip != null && editorToolTip.Active)
                {
                    editorToolTip.Hide(Editor);
                    editorToolTip.Dispose();
                }

                if (Editor.SelectionStart == Editor.SelectionEnd)
                {
                    return;
                }

                string selText = Editor.SelectedText;
                selText = selText.Trim();

                if (selText.Length > 0)
                {
                    if (selText.Length > 4 && selText.StartsWith("U", StringComparison.OrdinalIgnoreCase))
                    {
                        editorToolTip           = new ToolTip();
                        editorToolTip.Popup    += new PopupEventHandler(editorToolTip_Popup);
                        editorToolTip.OwnerDraw = true;
                        editorToolTip.Draw     += new DrawToolTipEventHandler(editorToolTip_Draw);

                        string[]      splitted = selText.Split(' ');
                        StringBuilder concated = new StringBuilder();
                        foreach (string split in splitted)
                        {
                            if (split.StartsWith("U", StringComparison.OrdinalIgnoreCase) && split.Length > 4)
                            {
                                string hexString = split.Substring(1, 4);
                                int    hexCode;
                                if (int.TryParse(hexString, System.Globalization.NumberStyles.AllowHexSpecifier, null, out hexCode))
                                {
                                    concated.Append((char)hexCode);
                                }
                            }
                        }

                        Point caretPoint = new Point();
                        if (GetCaretPos(out caretPoint))
                        {
                            caretPoint.X += 5;
                            caretPoint.Y -= 30;
                            toolTipString = concated.ToString();
                            editorToolTip.Show(toolTipString, Editor, caretPoint);
                        }
                    }
                }
            }
        }
Beispiel #2
0
 private void CursorDetector(object sender, ScintillaNET.UpdateUIEventArgs e)
 {
     foreach (edSci item in editorControl.SelectedTab.Controls)
     {
         if (ucfg.Default.language != "EN")
         {
             statusLabel.Text = ParseIt(LanguageFile, "texts", "line") + " : " + item.CurrentLine.ToString() + ParseIt(LanguageFile, "texts", "character") + ", : " + (item.CurrentPosition - item.Lines[item.LineFromPosition(item.CurrentPosition)].Position) + ParseIt(LanguageFile, "texts", "position") + " : " + item.CurrentPosition.ToString();
         }
         else
         {
             statusLabel.Text = "Line : " + item.CurrentLine.ToString() + ", Character : " + (item.CurrentPosition - item.Lines[item.LineFromPosition(item.CurrentPosition)].Position) + ", Position : " + item.CurrentPosition.ToString();
         }
     }
 }
Beispiel #3
0
        private void textBox_UpdateUI(object sender, ScintillaNET.UpdateUIEventArgs e)
        {
            Debug.WriteLine(e.Change.ToString());

            if ((e.Change & ScintillaNET.UpdateChange.Selection) != 0)
            {
                UpdateSelcetion();
            }

            if ((e.Change & ScintillaNET.UpdateChange.VScroll) != 0)
            {
                UpdateText();
            }
        }
Beispiel #4
0
 private void _source_UpdateUI(object sender, ScintillaNET.UpdateUIEventArgs e)
 {
     pb.Trace.WriteLine("_source.SelectionStart {0} _source.SelectionEnd {1}", _source.SelectionStart, _source.SelectionEnd);
 }
Beispiel #5
0
 private void _source_UpdateUI(object sender, ScintillaNET.UpdateUIEventArgs e)
 {
     Trace.WriteLine("UpdateUI : CurrentPosition {0} Line {1} Column {2} Overtype {3}", _source.CurrentPosition, _source.LineFromPosition(_source.CurrentPosition), _source.GetColumn(_source.CurrentPosition), _source.Overtype);
 }
Beispiel #6
0
 private void TxtFileViewer_UpdateUI(object sender, ScintillaNET.UpdateUIEventArgs e)
 {
     UpdateStats();
 }