OSDN Git Service

これも破綻しそう
authoryamat0jp <yamat0jp@yahoo.co.jp>
Fri, 24 Sep 2021 10:05:08 +0000 (19:05 +0900)
committeryamat0jp <yamat0jp@yahoo.co.jp>
Fri, 24 Sep 2021 10:05:08 +0000 (19:05 +0900)
Undo.pas
Unit1.dfm
Unit1.pas

index d8fec77..b4803f6 100644 (file)
--- a/Undo.pas
+++ b/Undo.pas
@@ -5,8 +5,6 @@ interface
 uses System.Contnrs, System.Classes, Vcl.StdCtrls;
 
 type
-  TUndoMethod = procedure(const str: string; pos: integer) of Object;
-
   TUndoBase = class
   private
     FPos: integer;
index c5cf281..2c1ada2 100644 (file)
--- a/Unit1.dfm
+++ b/Unit1.dfm
@@ -524,6 +524,7 @@ object Form1: TForm1
     object Action4: TAction
       Category = #32232#38598
       Caption = 'Past'
+      ShortCut = 16470
       OnExecute = Action4Execute
     end
   end
index 9f1f36a..46f7502 100644 (file)
--- a/Unit1.pas
+++ b/Unit1.pas
@@ -105,10 +105,10 @@ var
   s: string;
 begin
   s := Clipboard.AsText;
-  Memo1.SelText:=s;
-  Memo1.SelStart:=Memo1.SelStart-Length(s);
-  Memo1.SelLength:=Length(s);
-  Undo.Pasted(Memo1.SelText,Memo1.SelStart);
+  Memo1.SelText := s;
+  Memo1.SelStart := Memo1.SelStart - Length(s);
+  Memo1.SelLength := Length(s);
+  Undo.Pasted(Memo1.SelText, Memo1.SelStart);
 end;
 
 procedure TForm1.arrloop(item: TTreeNode; arr: TJSONArray);
@@ -228,6 +228,8 @@ begin
           delstr := Memo1.Text[Memo1.SelStart]
         else
           delstr := Memo1.SelText;
+    VK_RETURN:
+      ;
   else
     if Memo1.SelLength > 0 then
       Undo.Deleted(Memo1.SelText, Memo1.SelStart, false);