From 24c0d47fb3c6e160760f915d26b714ff6a201c9d Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Wed, 16 Dec 2009 18:05:42 +0000 Subject: [PATCH] 2009-12-16 19:05 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/tests/gtkeys.prg + added code to test clipboard (CTRL+INS shows clipboard text and CTRL+END set new text in clipboard). --- harbour/ChangeLog | 5 +++++ harbour/tests/gtkeys.prg | 19 +++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b0b9a87956..07e6539b95 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,11 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-12-16 19:05 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/tests/gtkeys.prg + + added code to test clipboard (CTRL+INS shows clipboard text and + CTRL+END set new text in clipboard). + 2009-12-16 18:28 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * harbour-win-spec * harbour-wce-spec diff --git a/harbour/tests/gtkeys.prg b/harbour/tests/gtkeys.prg index c67e4d81f6..f5b5223573 100644 --- a/harbour/tests/gtkeys.prg +++ b/harbour/tests/gtkeys.prg @@ -18,7 +18,7 @@ #endif function main() -local k, i +local k, i, s local aKeys := { ; { "K_UP", 5, "Up arrow, Ctrl-E" }, ; { "K_DOWN", 24, "Down arrow, Ctrl-X" }, ; @@ -235,8 +235,23 @@ while (.t.) ? " key:"+str(k,7) endif // ?? " ("+ltrim(str(maxrow()))+":"+ltrim(str(maxcol()))+")" - if k==64 .and. nextkey()==0 + + if k==asc("@") .and. nextkey()==0 exit +#ifdef __HARBOUR__ + elseif k==K_CTRL_INS + if alert( "Would you like to show clipboard text?", { "YES", "NO" } ) == 1 + s := hb_gtInfo( HB_GTI_CLIPBOARDDATA ) + ? "Clipboard text: [" + s + "]" + endif + elseif k==K_CTRL_END + if alert( "Would you like to set clipboard text?", { "YES", "NO" } ) == 1 + s := hb_tstostr( hb_datetime() ) + hb_osNewLine() + ; + "Harbour " + hb_gtVersion() + " clipboard test" + hb_osNewLine() + ? "New clipboard text: [" + s + "]" + hb_gtInfo( HB_GTI_CLIPBOARDDATA, s ) + endif +#endif endif enddo ?