how do I copy get to windows clipboard?

how do I copy get to windows clipboard?

Postby dutch » Thu Jun 29, 2017 6:09 am

Dear All,

I try to copy all text in TGET by oGet:copy() to Windows Clipboard for pasting in another place by put in GET:ACTION, it doesn't work.
Code: Select all  Expand view
#include 'fivewin.ch'

Function Main
local oDlg, oGet[2], oSay, oBtn
local cword1, cword2

cword1 := 'test'+space(16)
cword2 := space(20)

DEFINE DIALOG oDlg FROM 0, 0 TO 120, 450 TITLE 'Support Password' PIXEL
   
   oDlg:lHelpIcon := .F.
   
   @   8,  5 SAY 'Word 1' OF oDlg SIZE 50, 12 PIXEL
   @  23,  5 SAY 'Word 2' OF oDlg SIZE 50, 12 PIXEL

   @   5, 55 GET oGet[1] VAR cword1 OF oDlg SIZE 100, 13 PIXEL ;
         ACTION (oGet[1]:Copy(), MsgInfo('Copy..'))
   @  20, 55 GET oGet[2] VAR cword2 OF oDlg SIZE 100, 13 PIXEL


ACTIVATE DIALOG oDLg CENTER

return nil

I use Ctrl+A, it doesn't work.

I use RClick (Select All) and then copy, it work as I need.

Is it possible, to use oGet:copy()?

Thanks in advance for any help.
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1540
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: how do I copy get to windows clipboard?

Postby Enrico Maria Giordano » Thu Jun 29, 2017 7:59 am

Code: Select all  Expand view
ACTION (oGet[1]:SelectAll(), oGet[1]:Copy(), MsgInfo('Copy..'))


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: how do I copy get to windows clipboard?

Postby dagiayunus » Thu Jun 29, 2017 8:02 am

Dear Mr.Dutch

Please try the sample

Code: Select all  Expand view
   #include 'fivewin.ch'
   
    static oclp
   
    Function Main
    local oDlg, oGet[2], oSay, oBtn
    local cword1, cword2

    cword1 := 'test'+space(16)
    cword2 := space(20)

    DEFINE DIALOG oDlg FROM 0, 0 TO 120, 450 TITLE 'Support Password' PIXEL
       
       oDlg:lHelpIcon := .F.
       
       @   8,  5 SAY 'Word 1' OF oDlg SIZE 50, 12 PIXEL
       @  23,  5 SAY 'Word 2' OF oDlg SIZE 50, 12 PIXEL

       @   5, 55 GET oGet[1] VAR cword1 OF oDlg SIZE 100, 13 PIXEL ;
             ACTION (oClp:SetText( cword1 ), MsgInfo('Copy..'))
       @  20, 55 GET oGet[2] VAR cword2 OF oDlg SIZE 100, 13 PIXEL

    DEFINE CLIPBOARD oClp OF oDlg
    ACTIVATE DIALOG oDLg CENTER
    oClp:End()
    return nil
Regards
Yunus

FWH 21.02
dagiayunus
 
Posts: 85
Joined: Wed Nov 19, 2014 1:04 pm

Re: how do I copy get to windows clipboard?

Postby dutch » Thu Jun 29, 2017 8:03 am

Dear EMG,

Thank you so much for your wonderful idea.
Enrico Maria Giordano wrote:
Code: Select all  Expand view
ACTION (oGet[1]:SelectAll(), oGet[1]:Copy(), MsgInfo('Copy..'))


EMG
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1540
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: how do I copy get to windows clipboard?

Postby Horizon » Thu Jun 29, 2017 8:13 am

Hi dutch,

I use this procedure.

Code: Select all  Expand view
...
Copy_Clipboard(XREF_NO1)
...

PROCEDURE Copy_Clipboard(cText)
LOCAL oClp
DEFAULT cText := ""
    DEFINE CLIPBOARD oClp OF oApp:oDlg   // This is my main window
    cText := ALLTRIM(cText)
    oClp:SetText(cText)
    oClp:End()
RETURN
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: how do I copy get to windows clipboard?

Postby dutch » Thu Jun 29, 2017 9:15 am

Thank you so much, Hakan.
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1540
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 38 guests