Bolding of selected line-numbers
Compacting String functions Removed empty lines (style) Ignore *.aps files git-svn-id: https://lsleditor.svn.sourceforge.net/svnroot/lsleditor@69 3f4676ac-adda-40fd-8265-58d1435b1672
This commit is contained in:
parent
9badf6e430
commit
04f2da6899
4 changed files with 15 additions and 14 deletions
|
@ -82,13 +82,18 @@ namespace LSLEditor.Editor
|
|||
int firstLine = 0;
|
||||
int lastLine = 10;
|
||||
Font font = this.Font;
|
||||
|
||||
int selectedLineStart = -1, selectedLineEnd = -1;
|
||||
if (this.richTextBox1 == null)
|
||||
{
|
||||
LineHeight = 16.0F;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (richTextBox1.SelectionStart != -1)
|
||||
{
|
||||
selectedLineStart = richTextBox1.GetLineFromCharIndex(richTextBox1.SelectionStart);
|
||||
selectedLineEnd = richTextBox1.GetLineFromCharIndex(richTextBox1.SelectionStart + richTextBox1.SelectionLength);
|
||||
}
|
||||
//we get index of first visible char and number of first visible line
|
||||
Point pos = new Point(0, 0);
|
||||
|
||||
|
@ -123,7 +128,7 @@ namespace LSLEditor.Editor
|
|||
g.SetClip(new Rectangle(0, 0, this.Width, this.richTextBox1.ClientRectangle.Height));
|
||||
|
||||
for (int i = firstLine; i < lastLine; i++)
|
||||
g.DrawString(string.Format("{0:0###}", i + 1), font, brush,
|
||||
g.DrawString(string.Format("{0:0###}", i + 1), (i>=selectedLineStart && i<= selectedLineEnd) ? new Font(font,FontStyle.Bold) : font, brush,
|
||||
new PointF(0F, delta + (i - firstLine) * LineHeight) );
|
||||
//g.DrawLine(new Pen(brush), backBuffer.Width - 1, 0, backBuffer.Width - 1, backBuffer.Height);
|
||||
}
|
||||
|
|
|
@ -57,8 +57,14 @@ namespace NumberedTextBox
|
|||
this.numbered1.richTextBox1 = this.syntaxRichTextBox1;
|
||||
this.syntaxRichTextBox1.OnPaintNumbers += new EventHandler(syntaxRichTextBox1_OnPaintNumbers);
|
||||
this.FontChanged += new EventHandler(NumberedTextBoxUC_FontChanged);
|
||||
this.syntaxRichTextBox1.OnCursorPositionChanged += new LSLEditor.SyntaxRichTextBox.CursorPositionChangedHandler(syntaxRichTextBox1_OnCursorPositionChanged);
|
||||
}
|
||||
|
||||
void syntaxRichTextBox1_OnCursorPositionChanged(object sender, LSLEditor.SyntaxRichTextBox.CursorPositionEventArgs e)
|
||||
{
|
||||
this.numbered1.Invalidate();
|
||||
}
|
||||
|
||||
void NumberedTextBoxUC_FontChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.numbered1.LineHeight = 0.0F; // reset!!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue