1. radio button question
- Posted by gwalters at sc.rr.com Mar 15, 2002
- 376 views
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
2. Re: radio button question
- Posted by Al Gonzalez <alg at nomscon.com> Mar 15, 2002
- 382 views
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 >
3. Re: radio button question
- Posted by gwalters at sc.rr.com Mar 15, 2002
- 366 views
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> 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 >
4. Re: radio button question
- Posted by Derek Parnell <ddparnell at bigpond.com> Mar 16, 2002
- 381 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 > > > > > >
5. Re: radio button question
- Posted by gwalters at sc.rr.com Mar 16, 2002
- 367 views
Thanks, Derek. Your MS doc is the same as I was looking at. The proglem is that I'm understanding about 1/2 of what I'm reading....or misunderstanging most of what i'm reading. I'm not yet up to speed...obviously. Thanks for all you help. george ----- Original Message ----- From: "Derek Parnell" <ddparnell at bigpond.com> To: "EUforum" <EUforum at topica.com> Subject: Re: radio button question > > 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 > > > > > > > >