On Mon, 09 Jan 2006 02:03:01 +0100
Marc Santhoff <[EMAIL PROTECTED]> wrote:
> Am Dienstag, den 03.01.2006, 00:04 +0100 schrieb Marc Santhoff:
> > Am Montag, den 02.01.2006, 22:58 +0100 schrieb dannym:
> > > Hi,
> > >
> > > Am Montag, den 02.01.2006, 22:18 +0100 schrieb Marc Santhoff:
> > > > Hi,
> > > >
> > > > I'm setting the 'color' property of a TPanel and it is getting
> > > > pretty green. If set back to 'clBtnFace' nothing happens.
> > > >
> > > > procedure TKeyboardForm.rgTestTypeClick(Sender: TObject);
> > > > begin
> > > >
> > > > if (TRadioGroup(Sender).itemindex = 1) then begin
> > > > ...
> > > > lbSignal.Caption := 'Bitte *jede* Taste einmal drücken!';
> > > > pnKeyboard.Color := clGreen;
> > > > pnKeyboard.refresh;
> > > > (* This does work, the panel is getting green. *)
> > > > end;
> > > > end;
> > > > end;
> > > >
> > > > procedure TKeyboardForm.bbStopClick(Sender: TObject);
> > > > begin
> > > > ...
> > > > lbSignal.Caption := 'Abgebrochen.';
> > > > pnKeyboard.Color := clBtnFace;
> > > > pnKeyboard.invalidate;
> > > > pnKeyboard.paint;
> > > > (* Here nothing happens on the panel, it stays green. *)
> > > > ...
> > > > end;
> > > > end;
> > > >
> > > > The caption of the label is set correctly in both cases. Instead of
> > > > 'paint' I tried several combinations of 'refresh', 'redraw' and
> > > > 'invalidate', with no positive result.
> > > >
> > > > I remember something around colors and paint, so it may be a faq ...
> > >
> > > Probably a bug..
> >
> > Seems to be, but maybe WindowMaker or something else is mixing things up
> > here.
> >
> > I tried other components and invalidated the form and they behave
> > different:
> >
> > TButton: gets green, stays green but the highlight color is shown when
> > the mouse is over it
TButton is the gtk button. It is drawn by the theme. That means, if the
theme provides bitmaps for buttons, then it will use bitmaps for TButton.
The LCL gtk interface uses a small hack to override this behaviour when a
custom color is set. But of course a button is more than one color, so don't
use custom colors with buttons, if your application should run on other
peoples desktops.
> >
> > TLabel: is getting green and grey again, works as expected.
TLabel is drawn entirely by the LCL. It uses the nearest font it can find on
the system or the default font.
Because not all fonts supports all styles, like bold or italic, you should
use font styles with care. Especially you should not use font styles as the
only sign to highlight a label from other labels/controls.
> >
> > The label is positioned on the same form as the panel, but the button is
> > sitting on the green panel. If it is not but on the form the behaviour
> > does not change.
> >
> > > Which platform?
> >
> > FreeBSD 4.11, fpc-2.0.2, Lazarus SVN 8285M (0.9.11 beta)
>
> I've poked around in the sources but I found nothing (sure because of
> missing knowledge and understanding of lazarus internals), but:
>
> Redraw problems are subject to controls derived from TWinControl, TLabel
> is a TGraphicControl and has no problem.
Right. see above.
>
> All this holds true for GTK1 and there are at least two bug reports
> related (1134 and 1160, some others deal with similar problems).
>
> Can anyone comment on this, maybe suggest a strategy for hunting this
> bug?
A better hack can improve the situation. But of course it will never be
perfect.
There was a patch proposal some weeks ago, but I was not able to apply it.
Mattias
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives