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:
thoysg 2012-01-14 23:07:01 +00:00
parent 9badf6e430
commit 04f2da6899
4 changed files with 15 additions and 14 deletions

View file

@ -171,10 +171,6 @@ namespace LSLEditor
}
}
}
}
}
}
}

View file

@ -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);
}

View file

@ -57,6 +57,12 @@ 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)

View file

@ -64,10 +64,7 @@ namespace LSLEditor
// 3 oct 2007
public static explicit operator String(bool a)
{
if (a)
return "1";
else
return "0";
return a ? "1" : "0";
}
// 24 augustus 2007
@ -93,10 +90,7 @@ namespace LSLEditor
public static implicit operator bool(String s)
{
if (s.value == null)
return false;
else
return (s.value.Length != 0);
return (s.value == null) ? false : (s.value.Length != 0);
}
public static bool operator ==(String x, String y)