FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour how do I copy get to windows clipboard?
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
how do I copy get to windows clipboard?
Posted: Thu Jun 29, 2017 06: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 (fw): Select all Collapse
#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 2304 / 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)
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: how do I copy get to windows clipboard?
Posted: Thu Jun 29, 2017 07:59 AM
Code (fw): Select all Collapse
ACTION (oGet[1]:SelectAll(), oGet[1]:Copy(), MsgInfo('Copy..'))


EMG
Posts: 85
Joined: Wed Nov 19, 2014 01:04 PM
Re: how do I copy get to windows clipboard?
Posted: Thu Jun 29, 2017 08:02 AM
Dear Mr.Dutch

Please try the sample

Code (fw): Select all Collapse
    #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
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: how do I copy get to windows clipboard?
Posted: Thu Jun 29, 2017 08:03 AM
Dear EMG,

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


EMG
Regards,

Dutch



FWH 2304 / 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)
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: how do I copy get to windows clipboard?
Posted: Thu Jun 29, 2017 08:13 AM
Hi dutch,

I use this procedure.

Code (fw): Select all Collapse
...
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.06
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: how do I copy get to windows clipboard?
Posted: Thu Jun 29, 2017 09:15 AM

Thank you so much, Hakan.

Regards,

Dutch



FWH 2304 / 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)

Continue the discussion