Changeset 10 for trunk/Apps
- Timestamp:
- Aug 29, 2016, 5:35:21 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Apps/UClock.pas
r9 r10 13 13 14 14 TAppClock = class(TApp) 15 procedure Run(Task: TTask); override; 16 constructor Create; override; 17 end; 18 19 { TAppClock2 } 20 21 TAppClock2 = class(TApp) 15 22 procedure Run(Task: TTask); override; 16 23 constructor Create; override; … … 36 43 Angle := Frac(Now / (10 * OneSecond)) * 2 * Pi; 37 44 API.DrawLine(Point(120, 120), Point(Trunc(120 + Cos(Angle) * 60), Trunc(120 + Sin(Angle) * 60)), 0); 38 API.Sleep(OneMillisecond * 100);45 API.Sleep(OneMillisecond * 50); 39 46 //API.ReadMessage(Message); 40 47 end; … … 48 55 end; 49 56 57 { TAppClock2 } 58 59 procedure TAppClock2.Run(Task: TTask); 60 var 61 Message: TIPCMessage; 62 WindowId: Integer; 63 Angle: Double; 64 begin 65 Message := TIPCMessage.Create; 66 WindowId := API.WindowCreate; 67 API.WindowSetAttr(300, 200, True); 68 while not Task.Terminated do begin 69 API.WriteText('test2'); 70 API.DrawRect(Rect(260, 160, 380, 280), $ffff80); 71 API.DrawText(Point(210, 110), 'Text', 0); 72 Angle := Frac(Now / (10 * OneSecond)) * 2 * Pi; 73 API.DrawLine(Point(320, 220), Point(Trunc(320 + Cos(Angle) * 60), Trunc(220 + Sin(Angle) * 60)), 0); 74 API.Sleep(OneMillisecond * 300); 75 //API.ReadMessage(Message); 76 end; 77 Message.Free; 78 end; 79 80 constructor TAppClock2.Create; 81 begin 82 inherited Create; 83 Name := 'Clock2'; 84 end; 85 50 86 end. 51 87
Note:
See TracChangeset
for help on using the changeset viewer.