[futurebasic] simple function for hand rolled edit menu

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 1998 : Group Archive : Group : All Groups

From: Bowerbird@...
Date: Thu, 3 Dec 1998 10:44:51 EST
hans said:
>   It took me some time to find out that 
>   you give up all your rights to the clipboard 
>   if you let FB handle it with EDIT MENU 2. 

roll your own edit menu, 
and use this function to handle it...

CLEAR LOCAL FN handrollededitmenu (itemid)
  AUTOCLIP=0     'autoclip must of off for these to work...
  IF itemid=3 THEN CALL TECUT (WINDOW(_efhandle)) : gdirty=1
  IF itemid=4 THEN CALL TECOPY (WINDOW(_efhandle))
  LONG IF itemid=5
    scrapsize%=FN GETSCRAP (_nil,_"TEXT",offset&)
    LONG IF scrapsize%+WINDOW (_eftextlen)<=32000  'do not exceed 32k
      CALL TESTYLPASTE (WINDOW(_efhandle)) : gdirty=1
    XELSE
       BEEP
    END IF
  END IF
  IF itemid=6 THEN CALL TEDELETE (WINDOW(_efhandle)) : gdirty=1
  IF itemid=8 then SETSELECT 0,_maxint
  AUTOCLIP=1     'if desired...
END FN : REM handrollededitmenu