mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-29 01:07:58 +01:00
Fixes the functions of the Edit->Copy-Cut-Paste menu for the TextField that was not working well.
This commit is contained in:
@@ -473,18 +473,17 @@ namespace Terminal.Gui {
|
||||
|
||||
public override bool MouseEvent (MouseEvent ev)
|
||||
{
|
||||
if (!ev.Flags.HasFlag (MouseFlags.Button1Clicked) && !ev.Flags.HasFlag (MouseFlags.Button1Pressed) &&
|
||||
!ev.Flags.HasFlag (MouseFlags.ReportMousePosition))
|
||||
if (!ev.Flags.HasFlag (MouseFlags.Button1Pressed) && !ev.Flags.HasFlag (MouseFlags.ReportMousePosition) &&
|
||||
!ev.Flags.HasFlag (MouseFlags.Button1Released))
|
||||
return false;
|
||||
|
||||
if (ev.Flags == MouseFlags.Button1Clicked) {
|
||||
if (ev.Flags == MouseFlags.Button1Pressed) {
|
||||
if (!HasFocus)
|
||||
SuperView.SetFocus (this);
|
||||
int x = PositionCursor (ev);
|
||||
PositionCursor (ev);
|
||||
if (isButtonReleased)
|
||||
ClearAllSelection ();
|
||||
isButtonReleased = true;
|
||||
Application.UngrabMouse ();
|
||||
} else if (ev.Flags == (MouseFlags.Button1Pressed | MouseFlags.ReportMousePosition)) {
|
||||
int x = PositionCursor (ev);
|
||||
isButtonReleased = false;
|
||||
@@ -496,6 +495,9 @@ namespace Terminal.Gui {
|
||||
int x = PositionCursor (ev);
|
||||
if (SelectedLength != 0)
|
||||
ClearAllSelection ();
|
||||
} else if (ev.Flags == MouseFlags.Button1Released) {
|
||||
isButtonReleased = true;
|
||||
Application.UngrabMouse ();
|
||||
}
|
||||
|
||||
SetNeedsDisplay ();
|
||||
|
||||
Reference in New Issue
Block a user