[futurebasic] Re: [FB] Getting text from a appearance button _kControlEditTextProc edit field

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

From: Alain Pastor <apastor@...>
Date: Thu, 28 Dec 2006 19:51:35 +0100
Brian Heibert a écrit :
> I am using this
> 
> text _sysfont,12,0
> SetRect( r, 105, 107, 492, 190 )
> appearance button _Speaktxt, _activeBtn,,,,, @r, _kControlEditTextProc
> 
> to create a edit field and a edit field appears in my window just fine
> 
> Now I want to know how to get the text that is in that edit field
> and do something with it
> 
Brian,

a ControlEditTextProc is not similar to a regular FB edit field. Under 
the Appearance Button entry (in the online help), you could find how to 
get the string stored in such a control, which is done by using a 
built-in function, namely ButtonTextString$. So, I think you should have 
written the following:


txt$ = FN ButtonTextString$( _SpeakTxt )

Alternatively, you could extract the string using the routine DEF 
GetButtonData, but it is a bit more cumbersome to program.

Alain

> _cBtn is my push button that is supposed to do something with the text 
> in the edit field
> But it is not doing anything
> 
> I tried
> 
> case _cBtn
> beep
> dim txt$
> txt$ = EDIT$(_SpeakTxt)
> long if fn hasSpeechMgr
> 
> while fn SpeechBusy
> wend
> long if txt$ <> " "
> FN CallAlert
> err = fn SpeakString (txt$)
> 
> 
> xelse
> FN CallAlert1
> 
> -Brian
> 
> -- 
> To unsubscribe, send ANY message to: futurebasic-unsubscribe@...
> 
> 
>