Modify Radio to fill more than one option

Modify Radio to fill more than one option

Postby sambomb » Tue Apr 13, 2010 1:27 pm

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?
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
User avatar
sambomb
 
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Modify Radio to fill more than one option

Postby driessen » Tue Apr 13, 2010 2:41 pm

Why don't you use checkboxes in stead ?
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1399
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Modify Radio to fill more than one option

Postby sambomb » Tue Apr 13, 2010 4:55 pm

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
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
User avatar
sambomb
 
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Modify Radio to fill more than one option

Postby Marcelo Via Giglio » Tue Apr 13, 2010 7:27 pm

Hola,

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

regards

Marcelo
Marcelo Via Giglio
 
Posts: 1051
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Re: Modify Radio to fill more than one option

Postby James Bott » Tue Apr 13, 2010 10:47 pm

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Modify Radio to fill more than one option

Postby sambomb » Wed Apr 14, 2010 11:38 am

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...
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
User avatar
sambomb
 
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Modify Radio to fill more than one option

Postby Marcelo Via Giglio » Wed Apr 14, 2010 12:52 pm

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
Marcelo Via Giglio
 
Posts: 1051
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Re: Modify Radio to fill more than one option

Postby sambomb » Wed Apr 14, 2010 1:44 pm

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 ?
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
User avatar
sambomb
 
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Modify Radio to fill more than one option

Postby ukoenig » Wed Apr 14, 2010 4:21 pm

Another possible Solution using Buttons :
A Buttonclick changes the Colors of the Buttons from Left to selected Position.

Image

Best Regards
Uwe :lol:
Last edited by ukoenig on Wed Apr 14, 2010 11:00 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Modify Radio to fill more than one option

Postby sambomb » Wed Apr 14, 2010 7:12 pm

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....
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
User avatar
sambomb
 
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Modify Radio to fill more than one option

Postby ukoenig » Wed Apr 14, 2010 8:35 pm

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:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Modify Radio to fill more than one option

Postby sambomb » Thu Apr 15, 2010 4:19 am

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...
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
User avatar
sambomb
 
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Modify Radio to fill more than one option

Postby ukoenig » Thu Apr 15, 2010 8:06 am

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:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Modify Radio to fill more than one option

Postby PeterHarmes » Thu Apr 15, 2010 10:14 am

Uwe,

That looks neat - well done!!

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: Modify Radio to fill more than one option

Postby James Bott » Sun Apr 18, 2010 9:21 pm

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: jmartial and 30 guests

cron