Form.OnPaint called too late – overwrites other content

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #35272
    ralfiii
    Participant

    Let's say I use a forms OnPaint event to draw a special form background.

    When I now place a paintbox on this form, then the content of the paintbox is never visible if the form is skinned.

    The problem seems to be that Form.OnPaint is called AFTER Paintbox.Paint.

    (when you switch of skinning then the event order is correct again).

    Here a tiny code snippet to verify that:

    Code:
    procedure TForm1.FormPaint(Sender: TObject);
    begin
    Canvas.Brush.Color:=clYellow;
    Canvas.FillRect(Canvas.ClipRect);
    OutputDebugString('Main Background');
    end;

    procedure TForm1.PaintBox1Paint(Sender: TObject);
    begin
    with PaintBox1.Canvas do
    begin
    moveto(0,0);
    lineto(100,100);
    end;
    OutputDebugString('Main Paintbox');
    end;

    In the debug output you'll see first “Background” then “Paintbox” if the app is “normal”, and the other way round when the app is skinned. 🙁

    #48635
    Support
    Keymaster

    Hello

    I'll try to solve this issue.

    #48673
    ralfiii
    Participant

    Any news on that?

    *push*

    #48695
    Support
    Keymaster

    Hello

    Please wait a new release, the problem will be solved there, I think.

    #48777
    ralfiii
    Participant

    Version 7.68 solves this problem.

    Thanks a lot Serge!!!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.