PDA

View Full Version : Radio buttons not working in certain locations


junioreq
07-19-2010, 07:59 PM
I have a set of radio buttons and when I have the horizontal location above 130 it works fine, if i drop it down to say 170, nothing works they wont move or anything.. and theres no other image, slider near it!

//ratio
int nButtons1 = 4; // Number of radio buttons
pGraphics->AttachControl(new IRadioButtonsControl(this, &IRECT(60, 120, 257 ,60+ nButtons1 * 0.5*25), kratio, nButtons1, &bandSelect, kHorizontal));

Works just fine because the Horizontal is at 120, if i change it to 170, in its proper location, it doesnt work...

Any ideas?

::they work in the top position here, but not the bottom one ?? edit, radios are not lined up on bottom one, just for testing purposes..

http://stash.reaper.fm/oldsb/957729/radios.PNG

~Rob.

Tale
07-20-2010, 03:17 AM
The coordinates within your IRECT() probably aren't correct for a kHorizontal set of radio buttons. The following two examples work at my end, regardless of the position:

Horizontal:
bitmap = pGraphics->LoadIBitmap(RADIO_ID, RADIO_PNG, 2);
int x = 400, y = 300, nButtons = 6, spacing = 5;
pGraphics->AttachControl(new IRadioButtonsControl(this, &IRECT(x, y, x + nButtons * bitmap.W + (nButtons - 1) * spacing, y + bitmap.H / 2), kMyParam, nButtons, &bitmap, kHorizontal));

Vertical:
bitmap = pGraphics->LoadIBitmap(RADIO_ID, RADIO_PNG, 2);
int x = 400, y = 300, nButtons = 6, spacing = 5;
pGraphics->AttachControl(new IRadioButtonsControl(this, &IRECT(x, y, x + nButtons * bitmap.W + (nButtons - 1) * spacing, y + bitmap.H / 2), kMyParam, nButtons, &bitmap, kHorizontal));

junioreq
07-20-2010, 09:56 AM
Thanks tale, will try in a few. Not sure where I came up with the way that I was doing radio buttons lol.

Your very good at Iplug!

~Rob.

junioreq
07-20-2010, 10:08 AM
That worked tale :)

~Rob.