diff --git a/uppsrc/CtrlLib/Text.cpp b/uppsrc/CtrlLib/Text.cpp index d43111441..f55bf296e 100644 --- a/uppsrc/CtrlLib/Text.cpp +++ b/uppsrc/CtrlLib/Text.cpp @@ -1184,6 +1184,7 @@ void TextCtrl::StdBar(Bar& menu) { .Key(K_CTRL_Z); menu.Add(redo.GetCount() && IsEditable(), t_("Redo"), CtrlImg::redo(), THISBACK(Redo)) .Key(K_SHIFT|K_ALT_BACKSPACE) + .Key(K_CTRL_Y) .Key(K_SHIFT_CTRL_Z); menu.Separator(); } diff --git a/uppsrc/RichEdit/DiagramBar.cpp b/uppsrc/RichEdit/DiagramBar.cpp index bdb847740..0dde0b145 100644 --- a/uppsrc/RichEdit/DiagramBar.cpp +++ b/uppsrc/RichEdit/DiagramBar.cpp @@ -7,8 +7,11 @@ void DiagramEditor::TheBar(Bar& bar) bool b = IsCursor(); bar.Add(undoredo.IsUndo(), CtrlImg::undo(), [=] { SetCurrent(undoredo.Undo(GetCurrent())); }) + .Key(K_ALT_BACKSPACE) .Key(K_CTRL_Z); bar.Add(undoredo.IsRedo(), CtrlImg::redo(), [=] { SetCurrent(undoredo.Redo(GetCurrent())); }) + .Key(K_SHIFT|K_ALT_BACKSPACE) + .Key(K_CTRL_Y) .Key(K_SHIFT|K_CTRL_Z); bar.Separator(); bar.Add(b, "Cut", CtrlImg::cut(), [=] { Cut(); }) diff --git a/uppsrc/RichEdit/Kbd.cpp b/uppsrc/RichEdit/Kbd.cpp index 714011ffb..afc69a36e 100644 --- a/uppsrc/RichEdit/Kbd.cpp +++ b/uppsrc/RichEdit/Kbd.cpp @@ -100,9 +100,12 @@ bool RichEdit::Key(dword key, int count) } break; case K_CTRL_Z: + case K_ALT_BACKSPACE: Undo(); return true; case K_SHIFT_CTRL_Z: + case K_SHIFT|K_ALT_BACKSPACE: + case K_CTRL_Y: Redo(); return true; case K_ENTER: { diff --git a/uppsrc/ide/Assist.cpp b/uppsrc/ide/Assist.cpp index 0fe2082eb..057c72a29 100644 --- a/uppsrc/ide/Assist.cpp +++ b/uppsrc/ide/Assist.cpp @@ -1028,6 +1028,16 @@ bool isaid(int c) bool AssistEditor::Key(dword key, int count) { CloseTip(); + dword *k = IdeKeys::AK_DELLINE().key; + if(key == k[0] || key == k[1]) { + DeleteLine(); + return true; + } + k = IdeKeys::AK_CUTLINE().key; + if(key == k[0] || key == k[1]) { + CutLine(); + return true; + } #ifdef _DEBUG if(key == K_F12) { DLOG("=================="); diff --git a/uppsrc/ide/IconDes/Bar.cpp b/uppsrc/ide/IconDes/Bar.cpp index 75d301e38..aa8e83f64 100644 --- a/uppsrc/ide/IconDes/Bar.cpp +++ b/uppsrc/ide/IconDes/Bar.cpp @@ -98,10 +98,13 @@ void IconDes::EditBar(Bar& bar) .Check(paste_mode == PASTE_BACK); bar.Separator(); bar.Add(c && c->undo.GetCount(), "Undo", CtrlImg::undo(), THISBACK(Undo)) + .Key(K_ALT_BACKSPACE) .Key(K_CTRL_Z) .Repeat(); bar.Add(c && c->redo.GetCount(), "Redo", CtrlImg::redo(), THISBACK(Redo)) + .Key(K_CTRL_Y) .Key(K_SHIFT_CTRL_Z) + .Key(K_SHIFT|K_ALT_BACKSPACE) .Repeat(); } diff --git a/uppsrc/ide/LayDes/laywin.cpp b/uppsrc/ide/LayDes/laywin.cpp index 006aafc34..77c8fdf9f 100644 --- a/uppsrc/ide/LayDes/laywin.cpp +++ b/uppsrc/ide/LayDes/laywin.cpp @@ -36,6 +36,7 @@ void LayDes::EditBar(Bar& bar) .Key(K_ALT_BACKSPACE) .Key(K_CTRL_Z); bar.Add(islayout && CurrentLayout().IsRedo(), "Redo", CtrlImg::redo(), THISBACK(Redo)) + .Key(K_CTRL_Y) .Key(K_SHIFT|K_ALT_BACKSPACE) .Key(K_SHIFT_CTRL_Z); bar.MenuSeparator(); diff --git a/uppsrc/ide/ide.cpp b/uppsrc/ide/ide.cpp index d58c428f8..e68b345f6 100644 --- a/uppsrc/ide/ide.cpp +++ b/uppsrc/ide/ide.cpp @@ -404,16 +404,6 @@ void Ide::Activate() bool Ide::Key(dword key, int count) { - dword *k = IdeKeys::AK_DELLINE().key; - if(key == k[0] || key == k[1]) { - editor.DeleteLine(); - return true; - } - k = IdeKeys::AK_CUTLINE().key; - if(key == k[0] || key == k[1]) { - editor.CutLine(); - return true; - } switch(key) { case K_ALT|K_CTRL_UP: case K_ALT|K_CTRL_DOWN: diff --git a/upptst/LineEdit/LineEdit.upp b/upptst/LineEdit/LineEdit.upp new file mode 100644 index 000000000..5872304d3 --- /dev/null +++ b/upptst/LineEdit/LineEdit.upp @@ -0,0 +1,9 @@ +uses + CtrlLib; + +file + main.cpp; + +mainconfig + "" = "GUI"; + diff --git a/upptst/LineEdit/main.cpp b/upptst/LineEdit/main.cpp new file mode 100644 index 000000000..ec05ddb04 --- /dev/null +++ b/upptst/LineEdit/main.cpp @@ -0,0 +1,12 @@ +#include + +using namespace Upp; + +GUI_APP_MAIN +{ + TopWindow win; + LineEdit edit; + edit.NoCutLine(); + win.Add(edit.SizePos()); + win.Run(); +}