Re: radio button question
- Posted by Derek Parnell <ddparnell at bigpond.com> Mar 16, 2002
- 379 views
George, The MS Docs do not say that at all. I quote: "BS_NOTIFY Enables a button to send BN_KILLFOCUS and BN_SETFOCUS notification messages to its parent window. Note that buttons send the BN_CLICKED notification message regardless of whether it has this style. To get BN_DBLCLK notification messages, the button must have the BS_RADIOBUTTON or BS_OWNERDRAW style. " It talks about focus notification, not click notification. But back to your problem. Can I suggest you use win32lib's create(Radio, ...) instead, and then use the click handler for all your buttons. Something along the lines of : sequence radiobtns, tags radiobtns = {} tags = {} id = create(Radio,EUmenu[i][j][1],subMenuId[i],col,row,lenRow,20,0) if length(tags) < id then tags &= repeat(0,id - length(tags)) end if tags[id] = {i,j} radiobtns &= id . . . procedure ClickRadio(integer self, integer event, sequence parms) -- You can then use tags sequence to quickly get the -- original 'i' and 'j' values. integer oi, oj, win oi = tags[self][1] oj = tags[self][2] -- Get which window was just clicked. win = subMenuId[oi] . . . end procedure setHandler(radiobtns, w32HClick, routine_id("ClickRadio")) --------- Derek. ----- Original Message ----- From: <gwalters at sc.rr.com> To: "EUforum" <EUforum at topica.com> Sent: Saturday, March 16, 2002 1:11 PM Subject: Re: radio button question > > Yes, Al it actually is a radio button. Here's the statement > > id = create(Button,EUmenu[i][j][1],subMenuId[i], > col,row,lenRow,20,BS_AUTORADIOBUTTON) > > The MS doc says that BS_NOTIFY for the button should notify the parent > window if it's clicked. I couldn't seem figure out how to get that to > happen. The reason I wanted the BS_NOTIFY to work is that there are about > 12 windows each having 20 to 30 buttons. > > george > ----- Original Message ----- > From: "Al Gonzalez" <alg at nomscon.com> > To: "EUforum" <EUforum at topica.com> > Sent: Friday, March 15, 2002 3:15 PM > Subject: Re: radio button question > > > I'm assuming you are using Win32lib.ew. > > Wouldn't you just register the onClick event of the button > to call the handler for the window. > > onClick[id]=routine_id("mainWindow_onClick") > > you would then use the getSelf() to determine what id called > mainWindow_onClick. BTW change mainWindow to the name > of your window. > > Also, shouldn't Button in your example be Radio? > > Al > > > > >Does anyone know how to get a click on a radio button to notify the parent > >window? BS_NOTIFY combined in the arguments on create don't seem to do it > > > > id = create(Button,EUmenu[i][j][1],subMenuId[i], > > col,row,lenRow,20,{BS_AUTORADIOBUTTON,BS_NOTIFY}) > > > >If I try this the buttons disappear. > > > >george > > > > > >