FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Monitor clipboard and paste into Xbrowse
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM

Monitor clipboard and paste into Xbrowse

Posted: Thu May 14, 2020 01:20 PM

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

Marc Venken

Using: FWH 23.08 with Harbour
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM

Re: Monitor clipboard and paste into Xbrowse

Posted: Thu May 14, 2020 09:14 PM
This is almost ok..

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


Code (fw): Select all Collapse
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
Marc Venken

Using: FWH 23.08 with Harbour

Continue the discussion