Page 1 of 2

Modify Radio to fill more than one option

PostPosted: Tue Apr 13, 2010 1:27 pm
by sambomb
Hi, I want to change my radio class to work that way

Ex:
Normal radio:
○●○○○
Wanted radio:
●●○○○

Ex2:
Normal radio:
○○●○○
Wanted radio:
●●●○○

Every option at left will be filled.

How can I do it?

Re: Modify Radio to fill more than one option

PostPosted: Tue Apr 13, 2010 2:41 pm
by driessen
Why don't you use checkboxes in stead ?

Re: Modify Radio to fill more than one option

PostPosted: Tue Apr 13, 2010 4:55 pm
by sambomb
Because Radio just need to change the cosmetic...

With checkbox I will have to use +- 400 objects and with radio i will have to use +- 60

I will use about:
19 radios with 10 option's = 190 checkbox
40 radios with 5 option's = 200 checkbox
01 radio with 12 option's = 012 checkbox

Re: Modify Radio to fill more than one option

PostPosted: Tue Apr 13, 2010 7:27 pm
by Marcelo Via Giglio
Hola,

and the modified radios will return? ..... an array? a binary number composition?

regards

Marcelo

Re: Modify Radio to fill more than one option

PostPosted: Tue Apr 13, 2010 10:47 pm
by James Bott
I am curious about what type of applicaton requires 400 checkboxes (or 400 radios)?

I sure wouldn't want to be a user of such an application--that is a lot of work. I think my mouse finger would fall off ;-)

Regards,
James

Re: Modify Radio to fill more than one option

PostPosted: Wed Apr 14, 2010 11:38 am
by sambomb
Marcelo Via Giglio wrote:Hola,

and the modified radios will return? ..... an array? a binary number composition?

regards

Marcelo



Exact like the radio, a number. In the case, the number of the filled options.


Ex:
Normal radio:
○●○○○ = 2
Wanted radio:
●●○○○ =2

James Bott wrote:I am curious about what type of applicaton requires 400 checkboxes (or 400 radios)?

I sure wouldn't want to be a user of such an application--that is a lot of work. I think my mouse finger would fall off ;-)

Regards,
James


It's a opnion poll with notes from 1 to 5 or 1 to 10 in some questions, so the user just only to click in the note wanted.

Like I said, with checkbox I will need 400! with radion will be +- 60...

And the only thing that the user will have to do is choose where to click... It's much easier than choose in a combo...

Re: Modify Radio to fill more than one option

PostPosted: Wed Apr 14, 2010 12:52 pm
by Marcelo Via Giglio
Hello,

Ex:
Normal radio:
○●○○○ = 2
Wanted radio:
●●○○○ =2


this isn't clear for me, but this is not the problem, maybe yo can simulate a option poll with xBrowse, I think, you only use 1 control in this case, and would be more flexible, one row for one question and the columns for the options

Regards

Marcelo

Re: Modify Radio to fill more than one option

PostPosted: Wed Apr 14, 2010 1:44 pm
by sambomb
Marcelo Via Giglio wrote:Hello,

Ex:
Normal radio:
○●○○○ = 2
Wanted radio:
●●○○○ =2


this isn't clear for me, but this is not the problem, maybe yo can simulate a option poll with xBrowse, I think, you only use 1 control in this case, and would be more flexible, one row for one question and the columns for the options

Regards

Marcelo



Redefine Radio oRdImp;
Var nTipImp;
ID 101,102,103; // 101 - By date
Update; // 102 - By client
of oDlgImp // 103 - General

Whe you use the radio the "Var" is numeric, if you choose the second option the number will be 2, the third will be 3, etc...

I don't need to change this, just the cosmetic, if I choose the second option the first and the second will be filled not only the second...

If I can control the state of one individual option of the radio I can do it manually.

Ex.:
//-- Fill the 1st and 2nd option
oRdImp:aOptions[1] := .T.
oRdImp:aOptions[2] := .T.
oRdImp:aOptions[3] := .F.
oRdImp:aOptions[4] := .F.
oRdImp:aOptions[5] := .F.

//-- Fill the 1st to 3rd option
oRdImp:aOptions[1] := .T.
oRdImp:aOptions[2] := .T.
oRdImp:aOptions[3] := .T.
oRdImp:aOptions[4] := .F.
oRdImp:aOptions[5] := .F.

If I don't have how to change this I'll create a class to simulate it with checkbox, but for simulate it, how I can change the checkbox (usally a square) to a circle ?

Re: Modify Radio to fill more than one option

PostPosted: Wed Apr 14, 2010 4:21 pm
by ukoenig
Another possible Solution using Buttons :
A Buttonclick changes the Colors of the Buttons from Left to selected Position.

Image

Best Regards
Uwe :lol:

Re: Modify Radio to fill more than one option

PostPosted: Wed Apr 14, 2010 7:12 pm
by sambomb
ukoenig wrote:Another possible Solution using Buttons :
A Buttonclick changes the Colors of the Buttons from Left to selected Position.

Image

Best Regards
Uwe :lol:


Yes, it can help, but to do this I'll have to create a class....

Re: Modify Radio to fill more than one option

PostPosted: Wed Apr 14, 2010 8:35 pm
by ukoenig
It is easy and no extra Class needed.
I will create a complete sample.
I need to know : how many Rows and how many Actions per Row You need.
Do You want to start all Actions defined from Left to pressed Position ?
Sample : 1 2 3 4 5 => Pressed 4 starts Actions for 1 2 3 4 and colors 1 2 3 4 ???

Image

Best regards
Uwe :lol:

Re: Modify Radio to fill more than one option

PostPosted: Thu Apr 15, 2010 4:19 am
by sambomb
Ex.
If I click on the second
Normal radio:
○●○○○ = 2
Wanted radio:
●●○○○ =2

The options at left will be filled. Dont need to run anything, just change the var with the option selected...

Re: Modify Radio to fill more than one option

PostPosted: Thu Apr 15, 2010 8:06 am
by ukoenig
The complete Source ( prg, resource, buttons, make-file ...)

Image
Image

Download ( 1.6 MB ) :
http://www.pflegeplus.com/fw_downloads/radios.zip

Best Regards
Uwe :lol:

Re: Modify Radio to fill more than one option

PostPosted: Thu Apr 15, 2010 10:14 am
by PeterHarmes
Uwe,

That looks neat - well done!!

Pete

Re: Modify Radio to fill more than one option

PostPosted: Sun Apr 18, 2010 9:21 pm
by James Bott
If you want to use radios like this, then I think your only choice is to create a new subclass of TRadio that works the way you want.

James