[futurebasic] Re: [FB] Pasting to an Edit field

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 2004 : Group Archive : Group : All Groups

From: michael evans <michael.evans@...>
Date: Mon, 31 May 2004 15:10:24 -0400
on 5/30/04 10:56 PM, Robert Purves at robert.purves@...
wrote:

> 
> michael evans wrote:
> 
>> In fb4 appearnce osx how does one:
>> (1) detect that text has been pasted into the active edit field.
> 
> _preview _efChanged event
> 
>> (2) having detected the paste in (1) above, force all the text in the
>> active
>> edit field to geneva plain 9pt?
> 
> edit text # .....
> 
> Robert P.
> 
> --
> 
> 

Ok, so what am I doing wrong in the following short example?

'--------------------

begin globals
_EditMenuUndoItem     = 1
_EditMenuCutItem      = 3
_EditMenuCopyItem     = 4
_EditMenuPasteItem    = 5
_EditMenuClearItem    = 6
_EditMenuSelectAllItem     = 7
end globals


clear local
local fn buildMainWnd
dim WndRect as rect

SETRECT(WndRect, 0, 0, 762, 684)
APPEARANCE WINDOW 1, "Main", @WndRect,¬
_kDocumentWindowClass,_kWindowStandardFloatingAttributes
DEF SETWINDOWBACKGROUND(_kThemeActiveDialogBackgroundBrush,_zTrue)

text _geneva, 9, 0

EDIT FIELD 1,"this a test",¬
(74, 202)-(561, 262), _framed_noDrawFocus

end fn

clear local
local Fn HandleDialog
'---> Variables
DIM AS INT DlgEV,DlgID
'---> Get Event Info
DlgEV = DIALOG(0)
DlgID = DIALOG(DlgEV)
SELECT DlgEV
CASE _preview
SELECT DlgID
case _efChanged
long if WINDOW(_activeWnd) = 1
long if WINDOW(_efNum) = 1
EDIT TEXT #1,_geneva,9,0
BEEP
end if
end if
end select

end select
end fn

clear local
local Fn HandleMenu



end fn

edit menu 2

on dialog Fn HandleDialog
on menu   fn HandleMenu


MENU 2, 0, _enable
MENU 2, _EditMenuUndoItem, _enable
MENU 2, _EditMenuCutItem, _enable
MENU 2, _EditMenuCopyItem, _enable
MENU 2, _EditMenuPasteItem, _enable
MENU 2, _EditMenuClearItem, _enable
MENU 2, _EditMenuSelectAllItem, _enable, "All/A"

fn buildMainWnd

DO
HANDLEEVENTS
UNTIL gFBQuit
END

'---------------------------------

Cheers,

----------------------------------------------------------------------------
Michael Evans
----------------------------------------------------------------------------