Changeset 23 for branches/Xvcl/Xvcl.Kernel.pas
- Timestamp:
- May 8, 2013, 1:52:33 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Xvcl/Xvcl.Kernel.pas
r21 r23 8 8 type 9 9 TKernel = class; 10 TScreen = class; 10 11 11 12 TProcessState = (psReady, psRunning, psWaiting, psFinished); … … 24 25 procedure Initialize; virtual; 25 26 procedure Finalize; virtual; 27 end; 28 29 TScreenCanvas = class(TCanvas) 30 Screen: TScreen; 31 function GetVideoDevice: TVideoDevice; override; 26 32 end; 27 33 … … 45 51 TMouse = class 46 52 Kernel: TKernel; 53 procedure HandleMove(Position: TPoint); 47 54 procedure HandleDown(Position: TPoint); 48 55 procedure HandleUp(Position: TPoint); … … 144 151 inherited; 145 152 Forms := TList<TForm>.Create; 146 Canvas := T Canvas.Create;153 Canvas := TScreenCanvas.Create; 147 154 end; 148 155 … … 158 165 Form: TForm; 159 166 begin 167 Canvas.Brush.Color := clWhite; 168 Canvas.FillRect(TRectangle.Create(0, 0, Size.X, Size.Y)); 160 169 for Form in Forms do Form.Paint; 161 170 end; … … 203 212 var 204 213 Form: TForm; 205 NewMessage: TMessageMouse ;214 NewMessage: TMessageMouseDown; 206 215 begin 207 216 NewMessage := TMessageMouseDown.Create; 208 217 NewMessage.Position := Position; 209 218 try 210 for Form in Kernel.Screen.Forms do begin 219 for Form in Kernel.Screen.Forms do 220 if Form.Bounds.Contains(Position) then begin 211 221 if Form.HandleMessage(NewMessage) then begin 212 222 Break; … … 218 228 end; 219 229 220 procedure TMouse.Handle Up(Position: TPoint);221 var 222 Form: TForm; 223 NewMessage: TMessageMouse ;224 begin 225 NewMessage := TMessageMouse Up.Create;230 procedure TMouse.HandleMove(Position: TPoint); 231 var 232 Form: TForm; 233 NewMessage: TMessageMouseMove; 234 begin 235 NewMessage := TMessageMouseMove.Create; 226 236 NewMessage.Position := Position; 227 237 try 228 for Form in Kernel.Screen.Forms do begin 238 for Form in Kernel.Screen.Forms do 239 if Form.Bounds.Contains(Position) then begin 229 240 if Form.HandleMessage(NewMessage) then begin 230 241 Break; … … 236 247 end; 237 248 249 procedure TMouse.HandleUp(Position: TPoint); 250 var 251 Form: TForm; 252 NewMessage: TMessageMouseUp; 253 begin 254 NewMessage := TMessageMouseUp.Create; 255 NewMessage.Position := Position; 256 try 257 for Form in Kernel.Screen.Forms do 258 if Form.Bounds.Contains(Position) then begin 259 if Form.HandleMessage(NewMessage) then begin 260 Break; 261 end; 262 end; 263 finally 264 NewMessage.Destroy; 265 end; 266 end; 267 268 { TScrenCanvas } 269 270 function TScreenCanvas.GetVideoDevice: TVideoDevice; 271 begin 272 if Assigned(Screen) then Result := Screen.VideoDevice 273 else Result := nil; 274 end; 275 238 276 end.
Note:
See TracChangeset
for help on using the changeset viewer.