mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Fixed Time/DateField crash 2
This commit is contained in:
@@ -116,6 +116,11 @@ public class DateField : TextField
|
||||
/// <inheritdoc/>
|
||||
protected override bool OnMouseEvent (MouseEventArgs ev)
|
||||
{
|
||||
if (base.OnMouseEvent (ev) || ev.Handled)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (SelectedLength == 0 && ev.Flags.HasFlag (MouseFlags.Button1Pressed))
|
||||
{
|
||||
AdjCursorPosition (ev.Position.X);
|
||||
@@ -162,7 +167,7 @@ public class DateField : TextField
|
||||
newPoint = 1;
|
||||
}
|
||||
|
||||
//if (newPoint != point)
|
||||
if (newPoint != point)
|
||||
{
|
||||
CursorPosition = newPoint;
|
||||
}
|
||||
|
||||
@@ -165,6 +165,11 @@ public class TimeField : TextField
|
||||
/// <inheritdoc/>
|
||||
protected override bool OnMouseEvent (MouseEventArgs ev)
|
||||
{
|
||||
if (base.OnMouseEvent (ev) || ev.Handled)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (SelectedLength == 0 && ev.Flags.HasFlag (MouseFlags.Button1Pressed))
|
||||
{
|
||||
int point = ev.Position.X;
|
||||
@@ -220,7 +225,7 @@ public class TimeField : TextField
|
||||
newPoint = 1;
|
||||
}
|
||||
|
||||
//if (newPoint != point)
|
||||
if (newPoint != point)
|
||||
{
|
||||
CursorPosition = newPoint;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user