private void RedrawSelection() { //clear old selection FRichTextBox.SelectionBackColor = Color.Silver; if (FHoverLine > -1) { //draw current selection FRichTextBox.SelectionStart = FRichTextBox.GetFirstCharIndexFromLine(FHoverLine); FRichTextBox.SelectionLength = CLineLength; FRichTextBox.SelectionBackColor = CHoverColor; } //make sure the selection is also drawn in the NodeTypePanel FRichTextBox.Invalidate(); FNodeTypePanel.Invalidate(); }
void RichTextBoxMouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { if (FHoverLine < 0 || FHoverLine >= FRichTextBox.Lines.Length) { return; } string username = FRichTextBox.Lines[FHoverLine].Trim(); FRichTextBox.SelectionStart = FRichTextBox.GetFirstCharIndexFromLine(FHoverLine) + 1; TagsTextBox.Focus(); //as plugin in its own window if (AllowDragDrop) { var selNode = FSelectionList[FHoverLine + ScrolledLine]; TagsTextBox.DoDragDrop(string.Format("{0}||{1}", selNode.Systemname, selNode.Filename), DragDropEffects.All); return; } //else popped up on doubleclick else if (e.Button == MouseButtons.Left) { CreateNodeFromHoverLine(); } else { try { var selNode = FSelectionList[FHoverLine + ScrolledLine]; if (e.Button == MouseButtons.Middle) { OnShowNodeReference(selNode); } else { TagsTextBox.Text = ""; OnShowHelpPatch(selNode); } } catch //username is a filename..do nothing {} } }