Browse Source

Improvements as suggested by Vasily Volchenko:
* Added mapping for Enter key (= it works now :) )
* Simple clipboard implementation. (although the keys for clipboard
functions don't work yet)

sg 24 years ago
parent
commit
a203b9f012
1 changed files with 24 additions and 3 deletions
  1. 24 3
      fcl/shedit/gtk/gtkshedit.pp

+ 24 - 3
fcl/shedit/gtk/gtkshedit.pp

@@ -104,8 +104,8 @@ type
     procedure SetLineCount(count: Integer); override;
     procedure SetLineCount(count: Integer); override;
 
 
     // Clipboard support
     // Clipboard support
-    //function  GetClipboard: String; override;
-    //procedure SetClipboard(Content: String); override;
+    function  GetClipboard: String; override;
+    procedure SetClipboard(Content: String); override;
 
 
   public
   public
     Widget: PGtkWidget;  // this is the outer editor widget
     Widget: PGtkWidget;  // this is the outer editor widget
@@ -123,6 +123,8 @@ type
 
 
 implementation
 implementation
 
 
+var
+  InternalClipboardContent: String;
 
 
 {*****************************************************************************
 {*****************************************************************************
                               GTK/GDK Callbacks
                               GTK/GDK Callbacks
@@ -160,6 +162,7 @@ begin
   Result := 1;
   Result := 1;
 
 
   case Event^.KeyVal of
   case Event^.KeyVal of
+    GDK_Return       : KeyCode:=13;
     GDK_KP_Insert    : KeyCode:=GDK_Insert;
     GDK_KP_Insert    : KeyCode:=GDK_Insert;
     GDK_KP_Home      : KeyCode:=GDK_Home;
     GDK_KP_Home      : KeyCode:=GDK_Home;
     GDK_KP_Left      : KeyCode:=GDK_Left;
     GDK_KP_Left      : KeyCode:=GDK_Left;
@@ -530,6 +533,18 @@ begin
 end;
 end;
 
 
 
 
+function TGtkSHWidget.GetClipboard: String;
+begin
+  Result := InternalClipboardContent;
+end;
+
+
+procedure TGtkSHWidget.SetClipboard(Content: String);
+begin
+  InternalClipboardContent := Content;
+end;
+
+
 function TGtkSHWidget.GetHorzPos: Integer;
 function TGtkSHWidget.GetHorzPos: Integer;
 begin
 begin
   Result := Trunc(hadj^.value);
   Result := Trunc(hadj^.value);
@@ -573,7 +588,13 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.2  2000-07-13 11:33:02  michael
+  Revision 1.3  2001-02-04 14:32:56  sg
+  Improvements as suggested by Vasily Volchenko:
+  * Added mapping for Enter key (= it works now :) )
+  * Simple clipboard implementation. (although the keys for clipboard
+    functions don't work yet)
+
+  Revision 1.2  2000/07/13 11:33:02  michael
   + removed logs
   + removed logs
  
  
 }
 }