Ignore:
Timestamp:
May 1, 2024, 12:08:20 PM (3 weeks ago)
Author:
chronos
Message:
  • Modified: Start form changed to use Offscreen bitmap for drawing as Qt5 doesn't support copying from form canvas.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/CevoComponents/DrawDlg.pas

    r554 r565  
    2121    procedure DoDeactivate(Sender: TObject);
    2222  protected
     23    // Defines area to grip the window for moving (from top)
    2324    TitleHeight: Integer;
    24     // defines area to grip the window for moving (from top)
    2525    procedure InitButtons;
    2626    procedure OnEraseBkgnd(var Msg: TMessage); message WM_ERASEBKGND;
     
    237237procedure TDrawDlg.SmartInvalidate;
    238238var
    239   i: Integer;
    240   r0, r1: HRgn;
    241 begin
    242   r0 := CreateRectRgn(0, 0, Width, Height);
    243   for i := 0 to ControlCount - 1 do
    244     if not (Controls[i] is TArea) and Controls[i].Visible then
    245     begin
    246       with Controls[i].BoundsRect do
    247         r1 := CreateRectRgn(Left, Top, Right, Bottom);
    248       CombineRgn(r0, r0, r1, RGN_DIFF);
    249       DeleteObject(r1);
    250     end;
    251   InvalidateRgn(Handle, r0, False);
    252   DeleteObject(r0);
     239  I: Integer;
     240  R0, R1: HRgn;
     241begin
     242  R0 := CreateRectRgn(0, 0, Width, Height);
     243  for I := 0 to ControlCount - 1 do
     244    if not (Controls[I] is TArea) and Controls[I].Visible then begin
     245      with Controls[I].BoundsRect do
     246        R1 := CreateRectRgn(Left, Top, Right, Bottom);
     247      CombineRgn(R0, R0, R1, RGN_DIFF);
     248      DeleteObject(R1);
     249    end;
     250  InvalidateRgn(Handle, R0, False);
     251  DeleteObject(R0);
    253252end;
    254253
     
    272271begin
    273272  if csDesigning in ComponentState then Exit;
    274   PaintBackground(Self, 3 + Border, 3 + Border, Width - (6 + 2 * Border),
    275     Height - (6 + 2 * Border));
     273  PaintBackground(Canvas, 3 + Border, 3 + Border, Width - (6 + 2 * Border),
     274    Height - (6 + 2 * Border), Width, Height);
    276275  for I := 0 to Border do
    277     Frame(Canvas, I, I, Width - 1 - I, Height - 1 - I,
    278       $000000, $000000);
     276    Frame(Canvas, I, I, Width - 1 - I, Height - 1 - I, $000000, $000000);
    279277  Frame(Canvas, Border + 1, Border + 1, Width - (2 + Border),
    280278    Height - (2 + Border), MainTexture.ColorBevelLight,
Note: See TracChangeset for help on using the changeset viewer.