Zitat von Roland Turcan <[EMAIL PROTECTED]>:

> Hello lazarus project!
>
> How to assure, that all nested components will be repainted after
> calling MyPanel.Paint, because actually all components are behind new
> rectangle.

I'm not sure, if you found a bug or if you misunderstood the concept of event
based painting and/or clipping.

In general:
TPanel and TRadioButton are TWinControls and have their own handle. So it is up
to the widgetset (windows, gtk, carbon, qt, fpgui ...) to control the order and
how (double buffered, default background, clipping, overlapping) these widgets
are painted. If they use clipping, then they can paint in any order. They can
even paint only one of them. If they don't use clipping, then they will first
paint TPanel and then TRadioButton.
Some widgetsets use a mixture. That means it depends on the type of widget, what
technique is used.

What widgetset are you using?
What effect do you expect and what do you get?
What lazarus, fpc and OS version are you using?


> procedure TMyPanel.Paint;
> var rect :TRect;
> begin
>   rect := GetClientRect;
>   InflateRect(rect,-50,-50);
>   Canvas.Brush.Color:= clYellow;
>   Canvas.Rectangle(rect);
>
>   inherited Paint;
> end;
>
> procedure TForm1.FormCreate(Sender: TObject);
> var mp:TMyPanel;
> begin
>   mp := TMyPanel.Create (self);
>   with mp do begin
>     Parent := self;
>     Left := 0;
>     Top := 0;
>     Width := 200;
>     Height := 150;
>     Color:= clRed;
>   end;
>
>   with TRadioButton.Create(mp) do begin
>     Left:= 10;
>     Top := mp.Height div 2;
>     Width:=150;
>     Caption:= 'Roland';
>     Parent := mp;
>   end;
> end;
>
> Thanks in advance.

Mattias

_______________________________________________
Lazarus mailing list
[email protected]
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to