From 7f87c847ba8ec976c6ad345942f9867658a89ab2 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Fri, 10 Feb 2023 17:13:20 +0100 Subject: Unlimited undo/redo for Fl_Input_ and Fl_Text_Buffer (#558) (#676) --- src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx | 3 ++- src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H | 4 +--- src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx | 11 +++++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'src/drivers') diff --git a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx index 76eee9e12..012261b2c 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx +++ b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx @@ -1,7 +1,7 @@ // // Definition of Apple Cocoa Screen interface. // -// Copyright 1998-2022 by Bill Spitzak and others. +// Copyright 1998-2023 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -79,6 +79,7 @@ Fl_Screen_Driver::Keyname darwin_key_table[] = { static Fl_Text_Editor::Key_Binding extra_bindings[] = { // Define CMD+key accelerators... { 'z', FL_COMMAND, Fl_Text_Editor::kf_undo ,0}, + { 'z', FL_COMMAND|FL_SHIFT, Fl_Text_Editor::kf_redo ,0}, { 'x', FL_COMMAND, Fl_Text_Editor::kf_cut ,0}, { 'c', FL_COMMAND, Fl_Text_Editor::kf_copy ,0}, { 'v', FL_COMMAND, Fl_Text_Editor::kf_paste ,0}, diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H index 3bb5e11a6..3bbd51d59 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H +++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H @@ -41,9 +41,7 @@ protected: public: float dpi[MAX_SCREENS][2]; - Fl_WinAPI_Screen_Driver() : Fl_Screen_Driver() { - for (int i = 0; i < MAX_SCREENS; i++) scale_of_screen[i] = 1; - } + Fl_WinAPI_Screen_Driver(); // --- display management int visual(int flags) FL_OVERRIDE; // --- screen configuration diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx index 1f9ed3249..452815afb 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx @@ -38,6 +38,17 @@ extern const char *fl_bg2; # include #endif // !HMONITOR_DECLARED && _WIN32_WINNT < 0x0500 +static Fl_Text_Editor::Key_Binding extra_bindings[] = { + // Define MS Windows specific accelerators... + { 'y', FL_CTRL, Fl_Text_Editor::kf_redo ,0}, + { 0, 0, 0 ,0} +}; + + +Fl_WinAPI_Screen_Driver::Fl_WinAPI_Screen_Driver() : Fl_Screen_Driver() { + text_editor_extra_key_bindings = extra_bindings; + for (int i = 0; i < MAX_SCREENS; i++) scale_of_screen[i] = 1; +} int Fl_WinAPI_Screen_Driver::visual(int flags) { -- cgit v1.2.3