Changeset 445 for GraphicTest


Ignore:
Timestamp:
Nov 22, 2012, 1:32:52 PM (12 years ago)
Author:
chronos
Message:
Location:
GraphicTest
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • GraphicTest/UDrawForm.pas

    r443 r445  
    66
    77uses
    8   Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs;
     8  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
     9  LCLType;
    910
    1011type
     
    1718    { private declarations }
    1819  public
    19     { public declarations }
     20    EraseBackgroundEnabled: Boolean;
     21    procedure EraseBackground(DC: HDC); override;
    2022  end;
    2123
     
    3234end;
    3335
     36procedure TDrawForm.EraseBackground(DC: HDC);
     37begin
     38  if EraseBackgroundEnabled then
     39    inherited EraseBackground(DC);
     40end;
     41
    3442initialization
    3543  {$I UDrawForm.lrs}
  • GraphicTest/UMainForm.lfm

    r444 r445  
    11object MainForm: TMainForm
    2   Left = 187
    3   Height = 440
    4   Top = 107
    5   Width = 549
     2  Left = 302
     3  Height = 308
     4  Top = 181
     5  Width = 554
    66  Caption = 'Graphic test'
    7   ClientHeight = 440
    8   ClientWidth = 549
     7  ClientHeight = 308
     8  ClientWidth = 554
    99  OnClose = FormClose
    1010  OnCreate = FormCreate
     
    1414  object ListViewMethods: TListView
    1515    Left = 8
    16     Height = 364
     16    Height = 232
    1717    Top = 8
    18     Width = 537
     18    Width = 542
    1919    Anchors = [akTop, akLeft, akRight, akBottom]
    2020    Columns = <   
     
    5050    Left = 8
    5151    Height = 25
    52     Top = 379
     52    Top = 247
    5353    Width = 115
    5454    Anchors = [akLeft, akBottom]
     
    6060    Left = 136
    6161    Height = 25
    62     Top = 379
     62    Top = 247
    6363    Width = 112
    6464    Anchors = [akLeft, akBottom]
     
    7070    Left = 88
    7171    Height = 21
    72     Top = 411
     72    Top = 279
    7373    Width = 58
    7474    Anchors = [akLeft, akBottom]
     
    8282    Left = 256
    8383    Height = 25
    84     Top = 379
     84    Top = 247
    8585    Width = 75
    8686    Anchors = [akLeft, akBottom]
     
    9292    Left = 8
    9393    Height = 13
    94     Top = 415
     94    Top = 283
    9595    Width = 69
    9696    Anchors = [akLeft, akBottom]
     
    101101    Left = 152
    102102    Height = 13
    103     Top = 415
     103    Top = 283
    104104    Width = 5
    105105    Anchors = [akLeft, akBottom]
     
    108108  end
    109109  object SpinEditWidth: TSpinEdit
    110     Left = 363
     110    Left = 219
    111111    Height = 21
    112     Top = 411
     112    Top = 279
    113113    Width = 58
    114114    Anchors = [akLeft, akBottom]
     
    119119  end
    120120  object SpinEditHeight: TSpinEdit
    121     Left = 432
     121    Left = 288
    122122    Height = 21
    123     Top = 411
     123    Top = 279
    124124    Width = 58
    125125    Anchors = [akLeft, akBottom]
     
    130130  end
    131131  object Label3: TLabel
    132     Left = 328
     132    Left = 184
    133133    Height = 13
    134     Top = 416
     134    Top = 284
    135135    Width = 23
    136136    Anchors = [akLeft, akBottom]
     
    139139  end
    140140  object Label4: TLabel
    141     Left = 424
     141    Left = 280
    142142    Height = 13
    143     Top = 415
     143    Top = 283
    144144    Width = 6
    145145    Anchors = [akLeft, akBottom]
    146146    Caption = 'x'
    147147    ParentColor = False
     148  end
     149  object CheckBoxDoubleBuffered: TCheckBox
     150    Left = 408
     151    Height = 17
     152    Top = 247
     153    Width = 98
     154    Anchors = [akLeft, akBottom]
     155    Caption = 'Double buffered'
     156    OnChange = CheckBoxDoubleBufferedChange
     157    TabOrder = 7
     158  end
     159  object CheckBoxEraseBackground: TCheckBox
     160    Left = 408
     161    Height = 17
     162    Top = 264
     163    Width = 106
     164    Anchors = [akLeft, akBottom]
     165    Caption = 'Erase background'
     166    OnChange = CheckBoxEraseBackgroundChange
     167    TabOrder = 8
    148168  end
    149169  object Timer1: TTimer
  • GraphicTest/UMainForm.pas

    r444 r445  
    2222    ButtonBenchmark: TButton;
    2323    ButtonSingleTest: TButton;
     24    CheckBoxEraseBackground: TCheckBox;
     25    CheckBoxDoubleBuffered: TCheckBox;
    2426    FloatSpinEdit1: TFloatSpinEdit;
    2527    Label1: TLabel;
     
    3436    procedure ButtonSingleTestClick(Sender: TObject);
    3537    procedure ButtonStopClick(Sender: TObject);
     38    procedure CheckBoxDoubleBufferedChange(Sender: TObject);
     39    procedure CheckBoxEraseBackgroundChange(Sender: TObject);
    3640    procedure FormCreate(Sender: TObject);
    3741    procedure FormDestroy(Sender: TObject);
     
    157161end;
    158162
     163procedure TMainForm.CheckBoxDoubleBufferedChange(Sender: TObject);
     164begin
     165  DrawForm.DoubleBuffered := CheckBoxDoubleBuffered.Checked;
     166end;
     167
     168procedure TMainForm.CheckBoxEraseBackgroundChange(Sender: TObject);
     169begin
     170  DrawForm.EraseBackgroundEnabled := CheckBoxEraseBackground.Checked;
     171end;
     172
    159173procedure TMainForm.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    160174begin
     
    243257  SpinEditWidth.MaxValue := Screen.DesktopWidth;
    244258  SpinEditHeight.MaxValue := Screen.DesktopHeight;
     259  CheckBoxDoubleBuffered.Checked := DrawForm.DoubleBuffered;
     260  CheckBoxEraseBackground.Checked := DrawForm.EraseBackgroundEnabled;
    245261end;
    246262
    247263procedure TMainForm.UpdateFrameSize;
    248264begin
    249   DrawForm.SetBounds(DrawForm.Left, DrawForm.Top, FrameSize.X, FrameSize.Y);
     265  DrawForm.ClientWidth := FrameSize.X;
     266  DrawForm.ClientHeight := FrameSize.Y;
    250267  GenerateSceneFrames;
    251268end;
Note: See TracChangeset for help on using the changeset viewer.