Changeset 445
- Timestamp:
- Nov 22, 2012, 1:32:52 PM (12 years ago)
- Location:
- GraphicTest
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GraphicTest/UDrawForm.pas
r443 r445 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs; 8 Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, 9 LCLType; 9 10 10 11 type … … 17 18 { private declarations } 18 19 public 19 { public declarations } 20 EraseBackgroundEnabled: Boolean; 21 procedure EraseBackground(DC: HDC); override; 20 22 end; 21 23 … … 32 34 end; 33 35 36 procedure TDrawForm.EraseBackground(DC: HDC); 37 begin 38 if EraseBackgroundEnabled then 39 inherited EraseBackground(DC); 40 end; 41 34 42 initialization 35 43 {$I UDrawForm.lrs} -
GraphicTest/UMainForm.lfm
r444 r445 1 1 object MainForm: TMainForm 2 Left = 1873 Height = 4404 Top = 1 075 Width = 5 492 Left = 302 3 Height = 308 4 Top = 181 5 Width = 554 6 6 Caption = 'Graphic test' 7 ClientHeight = 4408 ClientWidth = 5 497 ClientHeight = 308 8 ClientWidth = 554 9 9 OnClose = FormClose 10 10 OnCreate = FormCreate … … 14 14 object ListViewMethods: TListView 15 15 Left = 8 16 Height = 36416 Height = 232 17 17 Top = 8 18 Width = 5 3718 Width = 542 19 19 Anchors = [akTop, akLeft, akRight, akBottom] 20 20 Columns = < … … 50 50 Left = 8 51 51 Height = 25 52 Top = 37952 Top = 247 53 53 Width = 115 54 54 Anchors = [akLeft, akBottom] … … 60 60 Left = 136 61 61 Height = 25 62 Top = 37962 Top = 247 63 63 Width = 112 64 64 Anchors = [akLeft, akBottom] … … 70 70 Left = 88 71 71 Height = 21 72 Top = 41172 Top = 279 73 73 Width = 58 74 74 Anchors = [akLeft, akBottom] … … 82 82 Left = 256 83 83 Height = 25 84 Top = 37984 Top = 247 85 85 Width = 75 86 86 Anchors = [akLeft, akBottom] … … 92 92 Left = 8 93 93 Height = 13 94 Top = 41594 Top = 283 95 95 Width = 69 96 96 Anchors = [akLeft, akBottom] … … 101 101 Left = 152 102 102 Height = 13 103 Top = 415103 Top = 283 104 104 Width = 5 105 105 Anchors = [akLeft, akBottom] … … 108 108 end 109 109 object SpinEditWidth: TSpinEdit 110 Left = 363110 Left = 219 111 111 Height = 21 112 Top = 411112 Top = 279 113 113 Width = 58 114 114 Anchors = [akLeft, akBottom] … … 119 119 end 120 120 object SpinEditHeight: TSpinEdit 121 Left = 432121 Left = 288 122 122 Height = 21 123 Top = 411123 Top = 279 124 124 Width = 58 125 125 Anchors = [akLeft, akBottom] … … 130 130 end 131 131 object Label3: TLabel 132 Left = 328132 Left = 184 133 133 Height = 13 134 Top = 416134 Top = 284 135 135 Width = 23 136 136 Anchors = [akLeft, akBottom] … … 139 139 end 140 140 object Label4: TLabel 141 Left = 424141 Left = 280 142 142 Height = 13 143 Top = 415143 Top = 283 144 144 Width = 6 145 145 Anchors = [akLeft, akBottom] 146 146 Caption = 'x' 147 147 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 148 168 end 149 169 object Timer1: TTimer -
GraphicTest/UMainForm.pas
r444 r445 22 22 ButtonBenchmark: TButton; 23 23 ButtonSingleTest: TButton; 24 CheckBoxEraseBackground: TCheckBox; 25 CheckBoxDoubleBuffered: TCheckBox; 24 26 FloatSpinEdit1: TFloatSpinEdit; 25 27 Label1: TLabel; … … 34 36 procedure ButtonSingleTestClick(Sender: TObject); 35 37 procedure ButtonStopClick(Sender: TObject); 38 procedure CheckBoxDoubleBufferedChange(Sender: TObject); 39 procedure CheckBoxEraseBackgroundChange(Sender: TObject); 36 40 procedure FormCreate(Sender: TObject); 37 41 procedure FormDestroy(Sender: TObject); … … 157 161 end; 158 162 163 procedure TMainForm.CheckBoxDoubleBufferedChange(Sender: TObject); 164 begin 165 DrawForm.DoubleBuffered := CheckBoxDoubleBuffered.Checked; 166 end; 167 168 procedure TMainForm.CheckBoxEraseBackgroundChange(Sender: TObject); 169 begin 170 DrawForm.EraseBackgroundEnabled := CheckBoxEraseBackground.Checked; 171 end; 172 159 173 procedure TMainForm.FormClose(Sender: TObject; var CloseAction: TCloseAction); 160 174 begin … … 243 257 SpinEditWidth.MaxValue := Screen.DesktopWidth; 244 258 SpinEditHeight.MaxValue := Screen.DesktopHeight; 259 CheckBoxDoubleBuffered.Checked := DrawForm.DoubleBuffered; 260 CheckBoxEraseBackground.Checked := DrawForm.EraseBackgroundEnabled; 245 261 end; 246 262 247 263 procedure TMainForm.UpdateFrameSize; 248 264 begin 249 DrawForm.SetBounds(DrawForm.Left, DrawForm.Top, FrameSize.X, FrameSize.Y); 265 DrawForm.ClientWidth := FrameSize.X; 266 DrawForm.ClientHeight := FrameSize.Y; 250 267 GenerateSceneFrames; 251 268 end;
Note:
See TracChangeset
for help on using the changeset viewer.