Alaska Software Inc. - Copy and past in TEXT mode
Username: Password:
AuthorTopic: Copy and past in TEXT mode
Jack DuijfCopy and past in TEXT mode
on Mon, 21 Aug 2017 09:53:37 +0200
Hello,

Is it possible to enable copy and paste in TEXT mode?

Procedure Main()
LOCAL  cNaam         := Space(30)
LOCAL  cAdres        := Space(30)
LOCAL  cWoonplaats   := Space(30)
LOCAL nLine          := 1
LOCAL GetList        := {}
SET CURSOR ON
@ nLine++, 1 SAY "Naam        : "  GET cNaam
@ nLine++, 1 SAY "Adres       : "  GET cAdres
@ nLine++, 1 SAY "Woonplaats  : "  GET cWoonplaats
READ
Return

Regards
Jack Duijf

-------------------------------------------------------------
Also a member off the XXP (http://www.xxp.nl)

---
Deze e-mail is gecontroleerd op virussen door AVG.
http://www.avg.com
Jim LeeRe: Copy and past in TEXT mode
on Mon, 21 Aug 2017 17:37:54 +0200
hi,

have not test it with c:\ALASKA\XPPW32\SOURCE\SYS\GetSys.prg while using
SetMouse(.T.) with c:\ALASKA\XPPW32\SOURCE\SYS\GetSysX.prg

PROCEDURE GetHandleEvent( oGet, nEvent, mp1, mp2, obj )
...
      CASE nEvent == xbeK_CTRL_C                             Copy to 
Clipboard
         oClipBoard := XbpClipBoard():new():create()
         oClipBoard:open()
         cText := oGet:buffer
         oClipBoard:setBuffer(cText, XBPCLPBRD_TEXT)
         oClipBoard:close()
         oClipBoard:destroy()

      CASE nEvent == xbeK_CTRL_V                             Copy from 
Clipboard
         oClipBoard := XbpClipBoard() :new() :create()
         oClipBoard:open()
         aFormats := OClipBoard:queryFormats()

         IF ASCAN( aFormats, XBPCLPBRD_TEXT ) > 0
            cText := oClipBoard:getBuffer( XBPCLPBRD_TEXT )
            n := LEN( cText )
            FOR i := 1 TO n
               cChar := cText[ i ]

               /* Transfer character to edit buffer */
               IF SET( _SET_INSERT )
                  oGet:insert( cChar )
               ELSE
                  oGet:overstrike( cChar )
               ENDIF

               /* No room left to type to the right of the cursor */
               IF oGet:typeOut
                  IF SET( _SET_BELL )
                     QQOUT( CHR( 7 ) )
                  ENDIF

                  IF !SET( _SET_CONFIRM )
                     oGet:exitState := GE_ENTER
                  ENDIF

                  EXIT
               ENDIF
            NEXT i
         ENDIF
         oClipBoard:close()
         oClipBoard:destroy()
Jack DuijfRe: Copy and past in TEXT mode
on Sat, 16 Sep 2017 16:57:40 +0200
Hello,

Unfortunaly, the GetHandleEvent is not called.
Sourcecode is actualy old clipper code, so no eventloop.

@ 1,1, DCSAY "Data" GET cData
READ

What is m y error?





On Mon, 21 Aug 2017 17:37:54 +0200, Jim Lee wrote:

>hi,
>
>have not test it with c:\ALASKA\XPPW32\SOURCE\SYS\GetSys.prg while using
>SetMouse(.T.) with c:\ALASKA\XPPW32\SOURCE\SYS\GetSysX.prg
>
>PROCEDURE GetHandleEvent( oGet, nEvent, mp1, mp2, obj )
>...
>      CASE nEvent == xbeK_CTRL_C                             Copy to 
>Clipboard
>         oClipBoard := XbpClipBoard():new():create()
>         oClipBoard:open()
>         cText := oGet:buffer
>         oClipBoard:setBuffer(cText, XBPCLPBRD_TEXT)
>         oClipBoard:close()
>         oClipBoard:destroy()
>
>      CASE nEvent == xbeK_CTRL_V                             Copy from 
>Clipboard
>         oClipBoard := XbpClipBoard() :new() :create()
>         oClipBoard:open()
>         aFormats := OClipBoard:queryFormats()
>
>         IF ASCAN( aFormats, XBPCLPBRD_TEXT ) > 0
>            cText := oClipBoard:getBuffer( XBPCLPBRD_TEXT )
>            n := LEN( cText )
>            FOR i := 1 TO n
>               cChar := cText[ i ]
>
>               /* Transfer character to edit buffer */
>               IF SET( _SET_INSERT )
>                  oGet:insert( cChar )
>               ELSE
>                  oGet:overstrike( cChar )
>               ENDIF
>
>               /* No room left to type to the right of the cursor */
>               IF oGet:typeOut
>                  IF SET( _SET_BELL )
>                     QQOUT( CHR( 7 ) )
>                  ENDIF
>
>                  IF !SET( _SET_CONFIRM )
>                     oGet:exitState := GE_ENTER
>                  ENDIF
>
>                  EXIT
>               ENDIF
>            NEXT i
>         ENDIF
>         oClipBoard:close()
>         oClipBoard:destroy()
>
Regards
Jack Duijf

-------------------------------------------------------------
Also a member off the XXP (http://www.xxp.nl)

---
Deze e-mail is gecontroleerd op virussen door AVG.
http://www.avg.com
Damir HodakRe: Copy and past in TEXT mode
on Mon, 18 Sep 2017 14:47:34 +0200
On Sat, 16 Sep 2017 16:57:40 +0200, Jack Duijf wrote:

> Hello,
> 
> Unfortunaly, the GetHandleEvent is not called.
> Sourcecode is actualy old clipper code, so no eventloop.
> 
> @ 1,1, DCSAY "Data" GET cData
> READ
> 
> What is m y error?
> 
> 
> 
> 
> 
> On Mon, 21 Aug 2017 17:37:54 +0200, Jim Lee wrote:
> 
>>hi,
>>
>>have not test it with c:\ALASKA\XPPW32\SOURCE\SYS\GetSys.prg while using
>>SetMouse(.T.) with c:\ALASKA\XPPW32\SOURCE\SYS\GetSysX.prg
>>
>>PROCEDURE GetHandleEvent( oGet, nEvent, mp1, mp2, obj )
>>...
>>      CASE nEvent == xbeK_CTRL_C                             Copy to 
>>Clipboard
>>         oClipBoard := XbpClipBoard():new():create()
>>         oClipBoard:open()
>>         cText := oGet:buffer
>>         oClipBoard:setBuffer(cText, XBPCLPBRD_TEXT)
>>         oClipBoard:close()
>>         oClipBoard:destroy()
>>
>>      CASE nEvent == xbeK_CTRL_V                             Copy from 
>>Clipboard
>>         oClipBoard := XbpClipBoard() :new() :create()
>>         oClipBoard:open()
>>         aFormats := OClipBoard:queryFormats()
>>
>>         IF ASCAN( aFormats, XBPCLPBRD_TEXT ) > 0
>>            cText := oClipBoard:getBuffer( XBPCLPBRD_TEXT )
>>            n := LEN( cText )
>>            FOR i := 1 TO n
>>               cChar := cText[ i ]
>>
>>               /* Transfer character to edit buffer */
>>               IF SET( _SET_INSERT )
>>                  oGet:insert( cChar )
>>               ELSE
>>                  oGet:overstrike( cChar )
>>               ENDIF
>>
>>               /* No room left to type to the right of the cursor */
>>               IF oGet:typeOut
>>                  IF SET( _SET_BELL )
>>                     QQOUT( CHR( 7 ) )
>>                  ENDIF
>>
>>                  IF !SET( _SET_CONFIRM )
>>                     oGet:exitState := GE_ENTER
>>                  ENDIF
>>
>>                  EXIT
>>               ENDIF
>>            NEXT i
>>         ENDIF
>>         oClipBoard:close()
>>         oClipBoard:destroy()
>>
> Regards
> Jack Duijf
> 
> -------------------------------------------------------------
> Also a member off the XXP (http://www.xxp.nl)
> 
> ---
> Deze e-mail is gecontroleerd op virussen door AVG.
> http://www.avg.com

Hi!

If you are creating text mode application using Alaska Xbase, you have to 
change procedure GetApplyKey in \XPPW32\source\SYS\GetSys.prg and 
compile/link it with your project.
Also you have to differentiate K_CTRL_C from K_PGDN, and K_CTRL_V from 
K_INS because they have same InKey values. I use function KbdStat from 
XbToolsIII to check if Ctrl is pressed or not.

Regards
Damir
Jack DuijfRe: Copy and past in TEXT mode
on Tue, 19 Sep 2017 09:03:23 +0200
Hello,

Thank you.
Now i understand.



On Mon, 18 Sep 2017 14:47:34 +0200, Damir Hodak wrote:

>On Sat, 16 Sep 2017 16:57:40 +0200, Jack Duijf wrote:
>
>> Hello,
>> 
>> Unfortunaly, the GetHandleEvent is not called.
>> Sourcecode is actualy old clipper code, so no eventloop.
>> 
>> @ 1,1, DCSAY "Data" GET cData
>> READ
>> 
>> What is m y error?
>> 
>> 
>> 
>> 
>> 
>> On Mon, 21 Aug 2017 17:37:54 +0200, Jim Lee wrote:
>> 
>>>hi,
>>>
>>>have not test it with c:\ALASKA\XPPW32\SOURCE\SYS\GetSys.prg while using
>>>SetMouse(.T.) with c:\ALASKA\XPPW32\SOURCE\SYS\GetSysX.prg
>>>
>>>PROCEDURE GetHandleEvent( oGet, nEvent, mp1, mp2, obj )
>>>...
>>>      CASE nEvent == xbeK_CTRL_C                             Copy to 
>>>Clipboard
>>>         oClipBoard := XbpClipBoard():new():create()
>>>         oClipBoard:open()
>>>         cText := oGet:buffer
>>>         oClipBoard:setBuffer(cText, XBPCLPBRD_TEXT)
>>>         oClipBoard:close()
>>>         oClipBoard:destroy()
>>>
>>>      CASE nEvent == xbeK_CTRL_V                             Copy from 
>>>Clipboard
>>>         oClipBoard := XbpClipBoard() :new() :create()
>>>         oClipBoard:open()
>>>         aFormats := OClipBoard:queryFormats()
>>>
>>>         IF ASCAN( aFormats, XBPCLPBRD_TEXT ) > 0
>>>            cText := oClipBoard:getBuffer( XBPCLPBRD_TEXT )
>>>            n := LEN( cText )
>>>            FOR i := 1 TO n
>>>               cChar := cText[ i ]
>>>
>>>               /* Transfer character to edit buffer */
>>>               IF SET( _SET_INSERT )
>>>                  oGet:insert( cChar )
>>>               ELSE
>>>                  oGet:overstrike( cChar )
>>>               ENDIF
>>>
>>>               /* No room left to type to the right of the cursor */
>>>               IF oGet:typeOut
>>>                  IF SET( _SET_BELL )
>>>                     QQOUT( CHR( 7 ) )
>>>                  ENDIF
>>>
>>>                  IF !SET( _SET_CONFIRM )
>>>                     oGet:exitState := GE_ENTER
>>>                  ENDIF
>>>
>>>                  EXIT
>>>               ENDIF
>>>            NEXT i
>>>         ENDIF
>>>         oClipBoard:close()
>>>         oClipBoard:destroy()
>>>
>> Regards
>> Jack Duijf
>> 
>> -------------------------------------------------------------
>> Also a member off the XXP (http://www.xxp.nl)
>> 
>> ---
>> Deze e-mail is gecontroleerd op virussen door AVG.
>> http://www.avg.com
>
>Hi!
>
>If you are creating text mode application using Alaska Xbase, you have to 
>change procedure GetApplyKey in \XPPW32\source\SYS\GetSys.prg and 
>compile/link it with your project.
>Also you have to differentiate K_CTRL_C from K_PGDN, and K_CTRL_V from 
>K_INS because they have same InKey values. I use function KbdStat from 
>XbToolsIII to check if Ctrl is pressed or not.
>
>Regards
>Damir
Regards
Jack Duijf

-------------------------------------------------------------
Also a member off the XXP (http://www.xxp.nl)