aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-08-07 02:40:26 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2016-08-07 02:40:26 +0200
commitd45cf90cb417222aef6e9a7e0de5c2d2f874ac91 (patch)
tree82d65899cbc72e94cb5f902aed8b853a15e8137a /src/GraphicObjects
parentffed25a1ea22392f4fb832b15a91f7d2738ffdfa (diff)
* Label.cs:
no cursor drawn if not selectable * IMLStream.cs: invariant culture loading
Diffstat (limited to 'src/GraphicObjects')
-rw-r--r--src/GraphicObjects/Label.cs52
1 files changed, 25 insertions, 27 deletions
diff --git a/src/GraphicObjects/Label.cs b/src/GraphicObjects/Label.cs
index 95892314..e9568c5d 100644
--- a/src/GraphicObjects/Label.cs
+++ b/src/GraphicObjects/Label.cs
@@ -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;