fe = gr.FontExtents;
#region draw text cursor
- if (mouseLocalPos >= 0)
+ if (HasFocus && Selectable)
{
- computeTextCursor(gr);
-
- if (SelectionInProgress)
+ if (mouseLocalPos >= 0)
{
- if (SelBegin < 0){
- SelBegin = new Point(CurrentColumn, CurrentLine);
- SelStartCursorPos = textCursorPos;
- SelRelease = -1;
- }else{
- SelRelease = new Point(CurrentColumn, CurrentLine);
- if (SelRelease == SelBegin)
- SelRelease = -1;
- else
- SelEndCursorPos = textCursorPos;
- }
- }
- }else
- computeTextCursorPosition(gr);
+ computeTextCursor(gr);
+ if (SelectionInProgress)
+ {
+ if (SelBegin < 0){
+ SelBegin = new Point(CurrentColumn, CurrentLine);
+ SelStartCursorPos = textCursorPos;
+ SelRelease = -1;
+ }else{
+ SelRelease = new Point(CurrentColumn, CurrentLine);
+ if (SelRelease == SelBegin)
+ SelRelease = -1;
+ else
+ SelEndCursorPos = textCursorPos;
+ }
+ }
+ }else
+ computeTextCursorPosition(gr);
+ Foreground.SetAsSource (gr);
+ gr.LineWidth = 1.5;
+ gr.MoveTo(new PointD(textCursorPos + rText.X, rText.Y + CurrentLine * fe.Height));
+ gr.LineTo(new PointD(textCursorPos + rText.X, rText.Y + (CurrentLine + 1) * fe.Height));
+ gr.Stroke();
+ }
#endregion
//****** debug selection *************
// }
//*******************
- if (HasFocus )
- {
- Foreground.SetAsSource (gr);
- gr.LineWidth = 1.5;
- gr.MoveTo(new PointD(textCursorPos + rText.X, rText.Y + CurrentLine * fe.Height));
- gr.LineTo(new PointD(textCursorPos + rText.X, rText.Y + (CurrentLine + 1) * fe.Height));
- gr.Stroke();
- }
-
for (int i = 0; i < lines.Count; i++) {
string l = lines [i].Replace ("\t", new String (' ', Interface.TabSize));
int lineLength = (int)gr.TextExtents (l).XAdvance;
using System.IO;
using System.Reflection;
using System.Reflection.Emit;
+using System.Threading;
namespace Crow
{
/// </summary>
public GraphicObject Instance {
get {
+ System.Globalization.CultureInfo savedCulture = Thread.CurrentThread.CurrentCulture;
+ Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
+
Seek (0, SeekOrigin.Begin);
- return Interface.Load (this, this.RootType);
+ GraphicObject tmp = Interface.Load (this, this.RootType);
+
+ Thread.CurrentThread.CurrentCulture = savedCulture;
+ return tmp;
}
}
/// <summary>