[futurebasic] RE: [FB] NewControl question

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 1999 : Group Archive : Group : All Groups

From: Chris.Young@...
Date: Tue, 8 Jun 1999 08:47:56 -0500
Larry,

I assume you are using either the system popup menu CDEF, or another 
CDEF. FB stuffs the button number in the upper word of the control 
refcon. If you have the FB Reference manual, look at page 341 under the 
WNDBLK statement for details (not sure why control records are detailed 
here, but....). At any rate, you can make up your own button numbers 
for your popups, and do something like:

refCon& = myBtnNo << 16
CALL SETCREFCON(ControlHandle&, refCon&)

Your button will now show up during _btnClick events, and you can do 
whatever processing you need to do. Also, if you use FB's BUTTON 
statement to get the popup value, it will be off by one (1st menu 
selection will return 2, etc.), so you will need to do
myCtlVal = BUTTON(ControlHandle&) - 1

hth

Chris Young

On Monday, June 07, 1999 11:16 PM, BMichael [SMTP:BMichael@...] 
wrote:
> Forwarded For: larry1008@... (Larry T.)
> 
> I created a control using FN NEWCONTROL(blah). It's a popup menu, 
that's 
> why I used newcontrol. How can I use the event loop to determine 
which 
> button was clicked? Buttons created this way don't have an ID, do 
they? 
> In this case, dlgID% is zero, and I can't use that, because there is 
more 
> than one of these newcontrols, and dlgID% is zero for all of them.
> 
>     CASE _btnClick
>       SELECT dlgID%
>        CASE ????
> 
> Larry
> 
> --
> To unsubscribe, send ANY message to 
<futurebasic-unsubscribe@...>
>  << File: [FB] NewControl question.TXT >>