Board index » cppbuilder » TRadioGroup Problem

TRadioGroup Problem

To Whom it May Concern,

I have a tabbed form.  On the tab named View I have on the left a
Group Box.  Contained within the goup box is a TRadioGroup with 15
items. Immediately to the left of the Radio Group but inside the group
box are 15 labels placed opposite each item in the radio group.

On the right side of the tab form I have a similar setup that contains
items for 16 colors.

I have onclick events set up for each radio group.

Upon instantiation, I have the left RG enabled and the right disabled.
Upon clicking and item in the left RG, the left rg is disabled and the
right enabled.  Upon clicking an item in the right side, its itemindex
goes to case statement and assigns a color.  It then call the left
onclick function case statement and assigns the color to the label
opposite the left RG itemindex.  This works for the assignment of the
first color, but after that, additional colors are not assigned to their
labels.

Is there some synergism between the properties of the two RG or group
boxes that prevent the proper assignment of the colors.

I have excerpted a stripped down version of only 3 items on a form that
shows the problem if someone wants to look at the code.

Thanks for any help.

David Hooper

 

Re:TRadioGroup Problem


Hi David,

Quote
> Is there some synergism between the properties of the two RG or group
> boxes that prevent the proper assignment of the colors.
> I have excerpted a stripped down version of only 3 items on a form that
> shows the problem if someone wants to look at the code.

It's really hard to tell what's going on without actually examining the code --
perhaps you should go ahead and post your code snippet, and if it's too large, I
believe there is a new .attachements group.

Good luck!

--------------------------------------
Damon Chandler

http://bcbcaq.freeservers.com
Answers to <Commonly Asked Questions>
52064929

Re:TRadioGroup Problem


Hi Damon,
As you suggested I am posting my code as an attachment.  I have also
attached a printout of a run, file called junk.

As you will see in junk, I first pick a data group, item index 0 assign
a color, then pick another datatype, itemindex = 2, then pick a color
and no assignment is made.  It does not make any difference in what
order I assigned the data types or colors.  Data type with item index
set at 2  will not assign a color.

The itemindex of the datatype when ck is odd is used to make the color
assignment when ck is even and then is assigned a -1 waiting for the
next user pick.

Any help you may wish to give would be greatly apprecaiated.
Incidentally, I use BCB 1 standard.  I could zip up the cpp, dfm , h and
mak and send it, if it would be of any help to you??? It is small, about
4k.

Thank you for your continuing interest.

David Hooper

Quote
Damon Chandler wrote:

> Hi David,
> > Is there some synergism between the properties of the two RG or group
> > boxes that prevent the proper assignment of the colors.
> > I have excerpted a stripped down version of only 3 items on a form that
> > shows the problem if someone wants to look at the code.

> It's really hard to tell what's going on without actually examining the code --
> perhaps you should go ahead and post your code snippet, and if it's too large, I
> believe there is a new .attachements group.

> Good luck!

> --------------------------------------
> Damon Chandler

> http://bcbcaq.freeservers.com
> Answers to <Commonly Asked Questions>
> 52064929

[ testing.cpp < 1K ]
//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#pragma hdrstop
//---------------------------------------------------------------------------
USEFORM("test.cpp", Form1);
USERES("testing.res");
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
        try
        {
                Application->Initialize();
                Application->CreateForm(__classid(TForm1), &Form1);
                Application->Run();
        }
        catch (Exception &exception)
        {
                Application->ShowException(&exception);
        }
        return 0;

Quote
}

//---------------------------------------------------------------------------

[ junk < 1K ]
Ck = 1  Data Type RG   enabled = 0 ItemIndex = 0
    DataType Prog  Color_num = -1 Color = ffffffff8000000f
    DataType Itn   Color_num = -1 Color = ffffffff8000000f
    DataType Names Color_num = -1 Color = ffffffff8000000f

Ck = 1  Color RG  Picked Color
    color_num = 1  color = 80

Ck = 2  Data Type RG   enabled = 1 ItemIndex = -1
    DataType Prog  Color_num = 1 Color = 80
    DataType Itn   Color_num = -1 Color = ffffffff8000000f
    DataType Names Color_num = -1 Color = ffffffff8000000f

Ck = 3  Data Type RG   enabled = 0 ItemIndex = 2
    DataType Prog  Color_num = 1 Color = 80
    DataType Itn   Color_num = -1 Color = ffffffff8000000f
    DataType Names Color_num = -1 Color = ffffffff8000000f

Ck = 3  Color RG  Picked Color
    color_num = 2  color = 8000

Ck = 4  Data Type RG   enabled = 1 ItemIndex = -1
    DataType Prog  Color_num = 1 Color = 80
    DataType Itn   Color_num = -1 Color = ffffffff8000000f
    DataType Names Color_num = 2 Color = ffffffff8000000f

Re:TRadioGroup Problem


Quote
On Fri, 17 Dec 1999 07:35:01 -0800, David Hooper <v...@jps.net> wrote:
>Content-Type: text/plain; charset=us-ascii; name="testing.cpp"
>Content-Transfer-Encoding: 7bit
>Content-Disposition: inline; filename="testing.cpp"

Please refrain from posting attachments in these groups...  There is only
one group where attachments are allowed,  and that is
borland.public.attachments...

Jerry Bloomfield (TeamB)
--
Jerry Bloomfield                                     JersW...@wwa.com
Proud Member of Borland's TeamB
"We'll do anything if you don't pay us."

Other Threads