mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-04 23:36:00 +02:00
Minor IDE changes
This commit is contained in:
parent
be3c968e2b
commit
2ea5d31c37
15 changed files with 373 additions and 87 deletions
|
@ -1919,6 +1919,37 @@ namespace Beefy.widgets
|
|||
InsertAtCursor(text);
|
||||
}
|
||||
|
||||
public void CutText()
|
||||
{
|
||||
if (!CheckReadOnly())
|
||||
{
|
||||
String selText = scope String();
|
||||
GetSelectionText(selText);
|
||||
if (!selText.IsWhiteSpace)
|
||||
{
|
||||
BFApp.sApp.SetClipboardText(selText);
|
||||
DeleteSelection();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void CopyText()
|
||||
{
|
||||
String selText = scope String();
|
||||
GetSelectionText(selText);
|
||||
if (!selText.IsWhiteSpace)
|
||||
BFApp.sApp.SetClipboardText(selText);
|
||||
}
|
||||
|
||||
public void PasteText()
|
||||
{
|
||||
String aText = scope String();
|
||||
BFApp.sApp.GetClipboardText(aText);
|
||||
aText.Replace("\r", "");
|
||||
if ((aText != null) && (!CheckReadOnly()))
|
||||
PasteText(aText);
|
||||
}
|
||||
|
||||
public override void KeyDown(KeyCode keyCode, bool isRepeat)
|
||||
{
|
||||
base.KeyDown(keyCode, isRepeat);
|
||||
|
@ -1944,38 +1975,16 @@ namespace Beefy.widgets
|
|||
{
|
||||
case (KeyCode)'A':
|
||||
SelectAll();
|
||||
break;
|
||||
case (KeyCode)'C':
|
||||
String selText = scope String();
|
||||
GetSelectionText(selText);
|
||||
if (!selText.IsWhiteSpace)
|
||||
BFApp.sApp.SetClipboardText(selText);
|
||||
break;
|
||||
CopyText();
|
||||
case (KeyCode)'X':
|
||||
if (!CheckReadOnly())
|
||||
{
|
||||
String selText = scope String();
|
||||
GetSelectionText(selText);
|
||||
if (!selText.IsWhiteSpace)
|
||||
{
|
||||
BFApp.sApp.SetClipboardText(selText);
|
||||
DeleteSelection();
|
||||
}
|
||||
}
|
||||
break;
|
||||
CutText();
|
||||
case (KeyCode)'V':
|
||||
String aText = scope String();
|
||||
BFApp.sApp.GetClipboardText(aText);
|
||||
aText.Replace("\r", "");
|
||||
if ((aText != null) && (!CheckReadOnly()))
|
||||
PasteText(aText);
|
||||
break;
|
||||
PasteText();
|
||||
case (KeyCode)'Z':
|
||||
Undo();
|
||||
break;
|
||||
case (KeyCode)'Y':
|
||||
Redo();
|
||||
break;
|
||||
case .Return:
|
||||
if (mIsMultiline)
|
||||
mEditWidget.Submit();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue