Ignore:
Timestamp:
Apr 9, 2015, 9:58:36 PM (10 years ago)
Author:
chronos
Message:
  • Fixed: Use csOpaque control style also to Image, PaintBox and OpenGLControl.
  • Modified: Change size of test frame with SpinEdits as delayed using timer.
  • Updated: BRGABitmap package to version 8.1.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GraphicTest/UDrawMethod.pas

    r471 r472  
    2121    FControl: TControl;
    2222    FFPS: Real;
     23    FParent: TWinControl;
    2324  public
    2425    Caption: string;
     
    3940    procedure DrawFrame(FastBitmap: TFastBitmap); virtual;
    4041    procedure DrawFrameTiming(FastBitmap: TFastBitmap);
     42    procedure UpdateSettings; virtual;
    4143    property Control: TControl read FControl;
    4244  end;
     
    4850  TDrawMethodImage = class(TDrawMethod)
    4951    Image: TImage;
     52    procedure UpdateSettings; override;
    5053    procedure Init(Parent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat); override;
    5154    procedure Done; override;
     
    5760    PaintBox: TPaintBox;
    5861    procedure Paint(Sender: TObject); virtual;
     62    procedure UpdateSettings; override;
    5963    procedure Init(Parent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat); override;
    6064    procedure Done; override;
     
    6973    TextureId: GLuint;
    7074    OpenGLBitmap: Pointer;
     75    procedure UpdateSettings; override;
    7176    procedure InitGL;
    7277    procedure OpenGLControlResize(Sender: TObject);
     
    8691begin
    8792
     93end;
     94
     95procedure TDrawMethodPaintBox.UpdateSettings;
     96begin
     97  inherited UpdateSettings;
     98  PaintBox.ControlStyle := FParent.ControlStyle;
    8899end;
    89100
     
    96107  PaintBox.OnPaint := Paint;
    97108  PaintBox.Show;
     109  UpdateSettings;
    98110end;
    99111
     
    105117
    106118{ TDrawMethodImage }
     119
     120procedure TDrawMethodImage.UpdateSettings;
     121begin
     122  inherited;
     123  Image.ControlStyle := FParent.ControlStyle;
     124end;
    107125
    108126procedure TDrawMethodImage.Init(Parent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat);
     
    115133  Image.Picture.Bitmap.SetSize(Size.X, Size.Y);
    116134  Image.Show;
     135  UpdateSettings;
    117136end;
    118137
     
    141160  end;
    142161  GetMem(OpenGLBitmap, OpenGLControl.Width * OpenGLControl.Height * SizeOf(Integer));
     162  UpdateSettings;
    143163end;
    144164
     
    153173begin
    154174  glViewport(0, 0, OpenGLControl.Width, OpenGLControl.Height);
     175end;
     176
     177procedure TDrawMethodOpenGL.UpdateSettings;
     178begin
     179  inherited UpdateSettings;
     180  OpenGLControl.ControlStyle := FParent.ControlStyle;
    155181end;
    156182
     
    195221procedure TDrawMethod.Init(Parent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat);
    196222begin
     223  FParent := Parent;
    197224end;
    198225
     
    227254end;
    228255
     256procedure TDrawMethod.UpdateSettings;
     257begin
     258end;
     259
    229260end.
    230261
Note: See TracChangeset for help on using the changeset viewer.