Page 1 of 1

Monitor clipboard and paste into Xbrowse

Posted: Thu May 14, 2020 1:20 pm
by Marc Venken
I want to automaticaly paste the content of the clipboard into a next new line in xbrowse.

I have a app that puts a dataline into the clipboard.. FW should be listening (background) if there is a text in the keyboard and paste in into a xbrowse line, and clears the clipboard for next reading.

Any ideas

Marc

Re: Monitor clipboard and paste into Xbrowse

Posted: Thu May 14, 2020 9:14 pm
by Marc Venken
This is almost ok..

Should I look into Xbrowse for 'listening if clipboard is not empty ' or the program itself ?

Code: Select all

function testclip
  local oBrw, oWnd

  DEFINE CLIPBOARD oClp

  aStruct := {}
  AADD(aStruct, { "email"   , "C",  150, 0 })

  DbCreate( "testmail.dbf", aStruct)
  use testmail new

   DEFINE FONT oFont NAME "Courier New" SIZE 8,15

   DEFINE DIALOG oDlg SIZE 640,440 PIXEL ;
      FONT oFont TITLE 'Import email'

   @ 10, 10 XBROWSE oBrwmail OF oDlg ;
      SIZE 300, 200 PIXEL ;
      COLUMNS 'email' ;
      ALIAS 'testmail' NOBORDER

      oBrwmail:bRClicked := { || placemail() }


   WITH OBJECT oBrwmail

      :nColDividerStyle := LINESTYLE_LIGHTGRAY
      :nRowDividerStyle := LINESTYLE_LIGHTGRAY
      :nEditTypes    := EDIT_GET
      :bClrRowFocus     := { || { CLR_BLACK, RGB(185,220,255) } }
      :nMarqueeStyle    := MARQSTYLE_HIGHLROWMS

      :CreateFromCode()
   END
   ACTIVATE DIALOG oDlg CENTERED

   close all

return

function placemail
    cText = oClp:getText()
    testmail->(dbappend())
    testmail->email = cText
    obrwmail:refresh()
return