]> O.S.I.I.S - jp/crow.git/commitdiff
* Label.cs:
authorjpbruyere <jp.bruyere@hotmail.com>
Sun, 7 Aug 2016 00:40:26 +0000 (02:40 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Sun, 7 Aug 2016 00:40:26 +0000 (02:40 +0200)
  no cursor drawn if not selectable

* IMLStream.cs:
  invariant culture loading

src/GraphicObjects/Label.cs
src/IMLStream.cs

index 95892314b36cf579062d639af4810ea8490c4c06..e9568c5d6f503e5dddd55e60858d1536c87eb75c 100644 (file)
@@ -489,28 +489,35 @@ namespace Crow
                        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 *************
@@ -536,15 +543,6 @@ namespace Crow
 //                     }
                        //*******************
 
-                       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;
index d4dc6496084c0c91e915a68a3bf702986bf7ed63..542797a13ef978cdbcbd80dc9aa50885e765260d 100644 (file)
@@ -22,6 +22,7 @@ using System;
 using System.IO;
 using System.Reflection;
 using System.Reflection.Emit;
+using System.Threading;
 
 namespace Crow
 {
@@ -42,8 +43,14 @@ 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>