Page 2 of 2

Re: Modify Radio to fill more than one option

PostPosted: Sun Apr 18, 2010 11:26 pm
by ukoenig
Hello James,

my Customers like my Radio-replacement.
I can define any Size and Color, Tooltips, changing Color / Image on < Pressed >.
As well the Textcolor-change is working ( using Radios, it is black )
Changing the Font-Size, You get a Zoom-effect on Focus.
Is there maybe a Reason, not to use it like shown ?

Radio-Replacement :
Image

Best Regards
Uwe :lol:

Re: Modify Radio to fill more than one option

PostPosted: Mon Apr 19, 2010 12:59 am
by James Bott
Uwe,

>Is there maybe a Reason, not to use it like shown ?

There is an issue if you want to use 400 of them on a single dialog. There is limit to how many controls can be used (I can't remember what the limit is).

Is your radio replacement a single control, or are each of the buttons a single control?

James

Re: Modify Radio to fill more than one option

PostPosted: Mon Apr 19, 2010 1:54 pm
by sambomb
James Bott wrote: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



This is exact what I want, but I don't know why

Uwe, thanks for the sample, when I have some free time I'll test it. Just one question, what version of FW I need to run the sample, my license is 9.06.

Re: Modify Radio to fill more than one option

PostPosted: Mon Apr 19, 2010 11:21 pm
by ukoenig
Version FWH 9.06 will be OK, using BtnBMP.
I created a Group of Buttons ( BtnBMP ), to simulate the Radios.
Each Button-Click-Selection assimilates the Status of the other Buttons.

I still added a PopUp-Menu for each Option.
If it is possible, using normal Radios to show a Popup ???, I don't know.
Both : Left MouseClick for Action and Right MouseClick for PopUp changes the Image and Font.

Image

Best Regards
Uwe :lol:

Re: Modify Radio to fill more than one option

PostPosted: Tue Apr 20, 2010 6:06 pm
by sambomb
Do you know how many objects an dialog can hold?

Because just the button will be 400! Beside captions and other objects...

Re: Modify Radio to fill more than one option

PostPosted: Tue May 11, 2010 7:43 pm
by sambomb
I found the solution
Code: Select all  Expand view

oRadio:aItems[1]:Check()
oRadio:aItems[2]:Check()
oRadio:aItems[3]:Check()

In the method bChange I call the MultiFill procedure

Ex.:

   Redefine Radio    oRdBtn;
            Var      nOption;
            ID       141,142,143;
            Update;                
            of       oDlg
   
   oRadio:bChange := {|| MultiFill(oRdBtn,nOption)
/*--------------------------------------------------------------------------------*/
Procedure MultiFill(oRadio,nVal)
Local i := 1

   For i := 1 to Len(oRadio:aItems)
      If i <= nVal
         oRadio:aItems[i]:Check()
      else
         oRadio:aItems[i]:Uncheck()
      end
   end

Return nil