From e24f59fb9f35d7f789939fbeffdbd4f7b92fc614 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A1roly=20Balogh?= Date: Mon, 5 Jan 2015 05:06:12 +0000 Subject: [PATCH] IDE: enabled AROS' system clipboard code also for Amiga and MorphOS git-svn-id: trunk@29406 - --- ide/fphelp.pas | 5 +++++ ide/fpide.pas | 5 +++++ ide/globdir.inc | 2 ++ ide/winclip.pas | 25 +++++++++++++------------ 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/ide/fphelp.pas b/ide/fphelp.pas index ac3a706dac..3315790e29 100644 --- a/ide/fphelp.pas +++ b/ide/fphelp.pas @@ -115,10 +115,15 @@ const hint_editcut = 'Remove the selected text and put it in the clipboard'; hint_editcopy = 'Copy the selected text in the clipboard'; hint_editpaste = 'Insert selected text from the clipboard at the cursor position'; + {$ifdef HASAMIGA} {$ifdef AROS} hint_editcopywin = 'Copy the selected text in AROS clipboard'; hint_editpastewin = 'Insert selected text from AROS clipboard at the cursor position'; {$else} + hint_editcopywin = 'Copy the selected text to the system clipboard'; + hint_editpastewin = 'Insert selected text from the system clipboard at the cursor position'; + {$endif} + {$else} hint_editcopywin = 'Copy the selected text in windows clipboard'; hint_editpastewin = 'Insert selected text from windows clipboard at the cursor position'; {$endif} diff --git a/ide/fpide.pas b/ide/fpide.pas index 1757540592..2d89e5ec3c 100644 --- a/ide/fpide.pas +++ b/ide/fpide.pas @@ -235,10 +235,15 @@ resourcestring menu_local_gotosource = '~G~oto source'; menu_file_exit = 'E~x~it'; menu_edit = '~E~dit'; + {$ifdef HASAMIGA} {$ifdef AROS} menu_edit_copywin = 'Cop~y~ to AROS'; menu_edit_pastewin = 'Paste from A~R~OS'; {$else} + menu_edit_copywin = 'Cop~y~ to System'; + menu_edit_pastewin = 'Paste from Syste~m~'; + {$endif} + {$else} menu_edit_copywin = 'Cop~y~ to Windows'; menu_edit_pastewin = 'Paste from ~W~indows'; {$endif} diff --git a/ide/globdir.inc b/ide/globdir.inc index 41db0dffd1..520779f3e6 100644 --- a/ide/globdir.inc +++ b/ide/globdir.inc @@ -100,10 +100,12 @@ {$ifdef Amiga} {$define FSCaseInsensitive} + {$define WinClipSupported} {$endif} {$ifdef MorphOS} {$define FSCaseInsensitive} + {$define WinClipSupported} {$endif} {$ifdef AROS} diff --git a/ide/winclip.pas b/ide/winclip.pas index 99268298ef..68cbc6cc8d 100644 --- a/ide/winclip.pas +++ b/ide/winclip.pas @@ -46,11 +46,12 @@ implementation strings,windows; {$endif Windows} -{$ifdef aros} +{$ifdef HASAMIGA} uses - clipboard; + clipboard,cliputils; {$endif} + {$ifdef DOS} function WinClipboardSupported : boolean; var @@ -134,7 +135,7 @@ begin end; {$endif Windows} -{$ifdef Aros} +{$ifdef HASAMIGA} function WinClipboardSupported: Boolean; begin WinClipboardSupported := True; @@ -162,7 +163,7 @@ begin Text := GetTextFromClip(PRIMARY_CLIP); InternGetDataSize := Length(Text); end; -{$endif Aros} +{$endif HASAMIGA} function GetTextWinClipboardSize : longint; @@ -182,10 +183,10 @@ var h : HGlobal; pp : pchar; {$endif Windows} -{$ifdef aros} +{$ifdef HASAMIGA} Text: AnsiString; pp: PChar; -{$endif aros} +{$endif HASAMIGA} begin p:=nil; GetTextWinClipBoardData:=False; @@ -220,14 +221,14 @@ begin end; GetTextWinClipBoardData:=h<>0; {$endif Windows} -{$ifdef aros} +{$ifdef HASAMIGA} Text := GetTextFromClip(0) + #0; PP := @Text[1]; l := Length(Text); GetMem(p,l); Move(pp^,p^,l); GetTextWinClipBoardData := True; -{$endif aros} +{$endif HASAMIGA} CloseWinClipBoard; {$ifdef DOS} M.MoveDataFrom(l,P^); @@ -246,10 +247,10 @@ var pp : pchar; res : boolean; {$endif Windows} -{$ifdef aros} +{$ifdef HASAMIGA} pp: PChar; Test: AnsiString; -{$endif aros} +{$endif HASAMIGA} begin SetTextWinClipBoardData:=False; if (l=0) or (l>65520) then @@ -290,9 +291,9 @@ begin GlobalUnlock(h); SetTextWinClipBoardData:=res; {$endif Windows} -{$ifdef Aros} +{$ifdef HASAMIGA} PutTextToClip(0, AnsiString(p)); -{$endif Aros} +{$endif HASAMIGA} CloseWinClipBoard; end;