Don: Radio Button slight correction

new topic     » topic index » view thread      » older message » newer message

Hi Don,

I've found a correction for the Radio buttons in WinClass which make
them work better.

In "Radio.ew" the window style 'line' should be this:

  LLF:OR({Style,BS_AUTORADIOBUTTON,WS_VISIBLE,WS_CHILD}),-- window style

This then allows creation of radio buttons in groups, using
WS_GROUP style at the beginning of each group of radio buttons for
a given window.

Here's an example of four radio buttons where the first two form the
first group and the second two form the second group (ie the first two
work together and the second two work together)...

CODE:

constant
  Radio1=Radio:Create(
  0, --StyleEx,
  WS_GROUP, --Style,
  "RB1", --sequence Caption,
  0, --object font,
  350,150,50,20,--atom xpos,atom ypos,atom width,atom height,
  MainAppWindow,--atom idParent,
  0 )--object events)

constant
  Radio2=Radio:Create(
  0, --StyleEx,
  0, --Style,
  "RB2", --sequence Caption,
  0, --object font,
  350,200,50,20,--atom xpos,atom ypos,atom width,atom height,
  MainAppWindow,--atom idParent,
  0 )--object events)

constant
  Radio3=Radio:Create(
  0, --StyleEx,
  WS_GROUP, --Style,
  "RB3", --sequence Caption,
  0, --object font,
  350,240,50,20,--atom xpos,atom ypos,atom width,atom height,
  MainAppWindow,--atom idParent,
  0 )--object events)

constant
  Radio4=Radio:Create(
  0, --StyleEx,
  0, --Style,
  "RB4", --sequence Caption,
  0, --object font,
  350,270,50,20,--atom xpos,atom ypos,atom width,atom height,
  MainAppWindow,--atom idParent,
  0 )--object events)


Note Radio's 1 and 3 get the WS_GROUP style while the 2 and 4 get zero.
Also note that the order of creation can't be swapped because that's
part of how Windows determines which radios are in which groups.



Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu