Board index » delphi » Highlighting a TRadioGroup

Highlighting a TRadioGroup

Hi, all.

I have a very simple problem and not necessarily one for which the world
is waiting for an answer. I'm developing a data input form. Members of a
panel have to rate a given medical treatment on a scale of 1 to 9
(essentially, but grossly oversimplifying, 1 = bad, 9 = good). They have
to do this for a (usually large) number of patients, each with different
characteristics. Up until recently, this has been on paper, with
patients being 'represented' by a string such as '1-2-3-4-5-6-7-8-9'.
Panel members cross the digit of their choice. I want to the same thing
but using a form. After some discussion, my colleagues and I decided
that we would represent the 1-9 scale using a 9-button radio group
rather than, say, an edit box, because it makes visual comparison
between patients easier. However, clicking each radiogroup with the
mouse is a little annoying, so I've programmed the form to preview
keystrokes, set the active radiogroup accordingly and move on to the the
next one. So far, so good. I currently highlight the active radiogroup
by changing its colour. However, the highlighting is rather ugly as the
colour extends above the 'visual border' i.e. the bevel containing the
buttons. So what I would like is an alternative method of highlighting
the radiogroup which is clear but easy on the eye. Any ideas? I'd be
glad to hear them.

Regards

Joseph

 

Re:Highlighting a TRadioGroup


How about putting a simple bevel account the current patient (on a plain
gray background) ?

"Joseph McDonnell" <mcdonn...@bmg.eur.nl> schreef in bericht
news:39B50A8D.BDBED957@bmg.eur.nl...

Quote
> Hi, all.

> I have a very simple problem and not necessarily one for which the world
> is waiting for an answer. I'm developing a data input form. Members of a
> panel have to rate a given medical treatment on a scale of 1 to 9
> (essentially, but grossly oversimplifying, 1 = bad, 9 = good). They have
> to do this for a (usually large) number of patients, each with different
> characteristics. Up until recently, this has been on paper, with
> patients being 'represented' by a string such as '1-2-3-4-5-6-7-8-9'.
> Panel members cross the digit of their choice. I want to the same thing
> but using a form. After some discussion, my colleagues and I decided
> that we would represent the 1-9 scale using a 9-button radio group
> rather than, say, an edit box, because it makes visual comparison
> between patients easier. However, clicking each radiogroup with the
> mouse is a little annoying, so I've programmed the form to preview
> keystrokes, set the active radiogroup accordingly and move on to the the
> next one. So far, so good. I currently highlight the active radiogroup
> by changing its colour. However, the highlighting is rather ugly as the
> colour extends above the 'visual border' i.e. the bevel containing the
> buttons. So what I would like is an alternative method of highlighting
> the radiogroup which is clear but easy on the eye. Any ideas? I'd be
> glad to hear them.

> Regards

> Joseph

Re:Highlighting a TRadioGroup


Quote
"Joseph McDonnell" <mcdonn...@bmg.eur.nl> wrote in message

news:39B50A8D.BDBED957@bmg.eur.nl...

Quote
> Hi, all.

> I have a very simple problem and not necessarily one for which the world
> is waiting for an answer. I'm developing a data input form. Members of a
> panel have to rate a given medical treatment on a scale of 1 to 9
> (essentially, but grossly oversimplifying, 1 = bad, 9 = good). They have
> to do this for a (usually large) number of patients, each with different
> characteristics. Up until recently, this has been on paper, with
> patients being 'represented' by a string such as '1-2-3-4-5-6-7-8-9'.
> Panel members cross the digit of their choice. I want to the same thing
> but using a form. After some discussion, my colleagues and I decided
> that we would represent the 1-9 scale using a 9-button radio group
> rather than, say, an edit box, because it makes visual comparison
> between patients easier. However, clicking each radiogroup with the
> mouse is a little annoying, so I've programmed the form to preview
> keystrokes, set the active radiogroup accordingly and move on to the the
> next one. So far, so good. I currently highlight the active radiogroup
> by changing its colour. However, the highlighting is rather ugly as the
> colour extends above the 'visual border' i.e. the bevel containing the
> buttons. So what I would like is an alternative method of highlighting
> the radiogroup which is clear but easy on the eye. Any ideas? I'd be
> glad to hear them.

Instead of using a radio group you can use individual radio buttons on a
panel.

Re:Highlighting a TRadioGroup


Bruce,

I had actually thought of that, but it seemed a bit like re-inventing the
wheel. M. H. Avegaart's suggestion of using a bevel around the 'active'
patient might be easier.

Thanks to both of you for your suggestions.

Regards

Joseph

Quote
Bruce Roberts wrote:
> "Joseph McDonnell" <mcdonn...@bmg.eur.nl> wrote in message
> news:39B50A8D.BDBED957@bmg.eur.nl...
> > Hi, all.

> > I have a very simple problem and not necessarily one for which the world
> > is waiting for an answer. I'm developing a data input form. Members of a
> > panel have to rate a given medical treatment on a scale of 1 to 9
> > (essentially, but grossly oversimplifying, 1 = bad, 9 = good). They have
> > to do this for a (usually large) number of patients, each with different
> > characteristics. Up until recently, this has been on paper, with
> > patients being 'represented' by a string such as '1-2-3-4-5-6-7-8-9'.
> > Panel members cross the digit of their choice. I want to the same thing
> > but using a form. After some discussion, my colleagues and I decided
> > that we would represent the 1-9 scale using a 9-button radio group
> > rather than, say, an edit box, because it makes visual comparison
> > between patients easier. However, clicking each radiogroup with the
> > mouse is a little annoying, so I've programmed the form to preview
> > keystrokes, set the active radiogroup accordingly and move on to the the
> > next one. So far, so good. I currently highlight the active radiogroup
> > by changing its colour. However, the highlighting is rather ugly as the
> > colour extends above the 'visual border' i.e. the bevel containing the
> > buttons. So what I would like is an alternative method of highlighting
> > the radiogroup which is clear but easy on the eye. Any ideas? I'd be
> > glad to hear them.

> Instead of using a radio group you can use individual radio buttons on a
> panel.

Re:Highlighting a TRadioGroup


"Joseph McDonnell" <mcdonn...@bmg.eur.nl> skrev i melding
news:39B5F038.7B319D29@bmg.eur.nl...

Quote
> Bruce,

> I had actually thought of that, but it seemed a bit like re-inventing
the
> wheel. M. H. Avegaart's suggestion of using a bevel around the
'active'
> patient might be easier.

what about setting bold font when activating ?

procedure TForm1.RadioGroup1Enter(Sender: TObject);
begin
  TRadioGroup(Sender).Font.Style:=[fsBold];
end;

procedure TForm1.RadioGroup1Exit(Sender: TObject);
begin
  TRadioGroup(Sender).Font.Style:=[];
end;

..or changing the entire group's color ?:

procedure TForm1.RadioGroup1Enter(Sender: TObject);
begin
  TRadioGroup(Sender).Color:=clInfoBk;
end;

procedure TForm1.RadioGroup1Exit(Sender: TObject);
begin
  TRadioGroup(Sender).Color:=clBtnFace;
end;

In cose you use this solution, set all the radio group's OnEnter and
OnExit to point to the two handlers.

...BTW, wouldn't a row of TSpeedButtons with GroupIndex set to a unique
number for each group (behaves like a radio group, then) be more
readable ? You would have a row of buttons instead of 9 lines, and if
you place the buttons in a column, it would be extremely easy-to-read.
But I may have misunderstood your form contents...;-)

--
Bjoerge Saether
Consultant / Developer
Asker, Norway
bsaether.removet...@online.no (remove the obvious)

Re:Highlighting a TRadioGroup


In article <39B5F038.7B319...@bmg.eur.nl>, Joseph McDonnell

Quote
<mcdonn...@bmg.eur.nl> writes:
>I had actually thought of that, but it seemed a bit like re-inventing the
>wheel. M. H. Avegaart's suggestion of using a bevel around the 'active'
>patient might be easier.

That's fine if you have separate TRadioButtons, but using a TRadioGroup (a
descendant of TWinControl) the TBevel (being a descendant of TGraphicControl)
will always appear behind the TRadioGroup. Or does this change in Delphi
versions greater than 3.

So to get a bevel you would have to use a TPanel with TRadioButton s. OTOH a
red TShape which you position on the panel against the checked button, looks
OK. Or draw one in the OnPaint event handler

Alan Lloyd
alangll...@aol.com

Other Threads